id: webview-file-access-java

info:
  name: Android File Access - Detect in Java sources
  author: 7h3b4dger
  severity: info
  description: Android WebView File Access enabling was detected - Java source version.
  tags: android,file,webview

file:
  - extensions:
      - java

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "setAllowFileAccess(true)"

      - type: regex
        part: body
        regex:
          - package\s+(?:.*)

    extractors:
      - type: regex
        part: body
        name: package
        group: 1
        regex:
          - (?m)^\s*package\s+([A-Za-z_][A-Za-z0-9_\.]*)\s*;
# digest: 4a0a00473045022028b71ccf953d918f4232cb0c9e4cd8774b3f37f0ed64e7b0c69333893236ea21022100854a654d966c122e26ea8c2220c8d62d2259e173fd6b3a87e80b04b157c9c2ec:922c64590222798bb761d5b6d8e72950