class
Analyzer::Mobile::Android
- Analyzer::Mobile::Android
- Analyzer
- Reference
- Object
Overview
Parses AndroidManifest.xml to surface mobile app entry points:
- custom URL scheme deep links (intent-filter > data android:scheme)
- verified App Links (autoVerify intent-filter on http/https)
- exported components with a data-less action filter (IPC surface)
- exported components with no intent-filter (explicit-intent surface)
- exported ContentProviders (content://authority IPC surface)
- Jetpack Navigation deep links (res/navigation/*.xml
)
One endpoint is emitted per deep-link URI; the handling component lives
in metadata["via"], not a separate entry. A bare intent://component
endpoint models the Android IPC surface: it is emitted for an exported
component whose filter declares an action but no URI (and isn't
the launcher), and for an exported component with no intent-filter at all
— the latter is still reachable by an explicit intent naming the component
(tagged explicit in metadata).
All endpoints keep method = "GET"; the mobile semantics live in
protocol (mobile-scheme / universal-link / android-intent). @string/
values are resolved against res/values/strings.xml when present, and
gradle manifest placeholders (${applicationId}, custom
manifestPlaceholders) against the nearest build.gradle(.kts).
Defined in:
analyzer/analyzers/mobile/android.crConstant Summary
-
ANDROID_NS =
"http://schemas.android.com/apk/res/android" -
APPLICATION_ID_CONST_RE =
/\bapplicationId(?![A-Za-z0-9_])\s*(?:=\s*)?([A-Z][A-Z0-9_]+)\b/ -
Unquoted value: a gradle constant reference, e.g.
applicationId APP_ID(groovy) orapplicationId = NEWPIPE_APPLICATION_ID_OLD(kts). The(?![A-Za-z0-9_])after the key keepsapplicationIdSuffixout, and the UPPER_SNAKE value requirement keeps prose in a// applicationId is ...comment from matching (gradle constants are upper-case by convention; a camelCase val is intentionally not followed). -
APPLICATION_ID_RE =
/\bapplicationId\s*(?:=\s*)?["']([^"']+)["']/ -
applicationId "com.x"(groovy) /applicationId = "com.x"(kts); the quote requirement keepsapplicationIdSuffixfrom matching. -
BUILDSRC_SEARCH_DEPTH =
4 -
How far up from the module script to look for a
buildSrc/source tree holding shared gradle constants. -
GENERIC_SCHEMES =
Set {"http", "https", "file", "content"} -
Generic/standard schemes carry no app-specific meaning on their own. A host-less
http:///https:///file:///content://is a content-source qualifier — typically paired with a<data mimeType>so the component can open a file type from a browser / file manager — not a deep-link entry point. Custom schemes (myapp://) stay even host-less, since that's how a runtime-routed custom scheme is declared. -
LAUNCHER_ACTION =
"android.intent.action.MAIN" -
LOCAL_SCHEMES =
Set {"file", "content"} -
Local-content schemes.
file:///content://URIs always point at on-device content (a file picked from a file manager, a ContentProvider row), never a remotely reachable deep link — so they are suppressed regardless of host (including a bare*wildcard host). -
MAX_FILTER_COMBOS =
64 -
Upper bound on endpoints emitted from a single intent-filter. A media router / browser filter can declare dozens of hosts × paths; the full cross product would flood the inventory with near-duplicates, so past the cap the path dimension is dropped (scheme × host) and, if still over, the result is truncated.
-
NAMESPACE_CONST_RE =
/\bnamespace(?![A-Za-z0-9_])\s*(?:=\s*)?([A-Z][A-Z0-9_]+)\b/ -
NAMESPACE_RE =
/\bnamespace\s*(?:=\s*)?["']([^"']+)["']/ -
NAV_DEFAULT_SCHEME =
"https" -
Scheme emitted for scheme-less Navigation URIs. Navigation matches both http and https for them; one canonical https endpoint keeps the inventory free of http/https twins.
-
NAV_VIEW_ACTION =
"android.intent.action.VIEW" -
OPAQUE_SCHEMES =
Set {"mailto", "tel", "sms", "smsto", "geo"} -
Opaque (authority-less) schemes:
mailto:foo@bar,tel:123,geo:…. They take no//hostpart, so the URL is rendered asscheme:rather thanscheme://. Deliberately conservative:market://details?id=…(Play Store) andmms://host(media streaming, e.g. VLC) DO use an authority, so they are NOT listed here. -
PLACEHOLDER_INDEX_RE =
/manifestPlaceholders\s*\[\s*["'](\w+)["']\s*\]\s*=\s*["']([^"']*)["']/ -
manifestPlaceholders["key"] = "value"/manifestPlaceholders.put("key", "value")(kts). -
PLACEHOLDER_MAP_RE =
/manifestPlaceholders[^\[(\n]*[\[(]([^\])]*)/ -
The bracketed segment after
manifestPlaceholders— a groovy map literal (= [k: "v"]), a kts+= mapOf("k" to "v"), or aputAll(mapOf(...))— captured up to the first closing bracket. -
PLACEHOLDER_PAIR_RE =
/["']?([A-Za-z_]\w*)["']?\s*(?::|\bto\b)\s*["']([^"']*)["']/ -
key: "value","key": "value"(groovy) and"key" to "value"(kts). -
PLACEHOLDER_PROPERTY_RE =
/manifestPlaceholders\s*\.\s*(?!put\b)([A-Za-z_]\w*)\s*=\s*["']([^"']*)["']/ -
manifestPlaceholders.key = "value"— groovy property-access form on the placeholder map. Termux declares its whole package name this way (manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux"), and without it every${TERMUX_PACKAGE_NAME}authority stayed unresolved in the emittedcontent://URL.\.putis excluded so the call form above can't be read as a property namedput. -
PLACEHOLDER_PUT_RE =
/manifestPlaceholders\s*\.\s*put\s*\(\s*["'](\w+)["']\s*,\s*["']([^"']*)["']\s*\)/ -
SYSTEM_BROADCAST_SCHEMES =
Set {"package"} -
Schemes that only ever appear as the data qualifier of a protected system broadcast, never as an addressable URI.
package:is the canonical one:<data android:scheme="package"/>pairs withACTION_PACKAGE_ADDED/PACKAGE_FULLY_REMOVED/ … so the receiver can read the affected package name out ofintent.data. Those actions can only be broadcast by the system, andpackage:is opaque anyway, so rendering it produced a bare, meaninglesspackage://endpoint (WordPress-Android'sJetpackAppUninstallReceiver). The receiver's own IPC surface is still reported through theintent://path when it is exported with a non-system action. -
UNRESOLVED_URL_RE =
Regex.union("@string/", "@{", "${") -
Per-endpoint gate, evaluated for every emitted deep-link/provider URL.
String#matches?(PCRE2 JIT) replaces three OR-edString#includes?scans with a single pass;Regex.unionauto-escapes each literal, so it is provably equivalent to the OR-of-substrings it replaces.
Class Method Summary
Instance Method Summary
- #analyze
-
#tech : String
Instance-side view of the same declaration.
Instance methods inherited from class Analyzer
analyze
analyze,
base_path : String
base_path,
base_paths : Array(String)
base_paths,
base_relative_path(path : String) : String
base_relative_path,
callees_needed? : Bool
callees_needed?,
content_matches?(content : String, markers : Regex) : Bool
content_matches?,
http_header_name(name : String) : String | Nil
http_header_name,
line_number_for_index(content : String, char_index : Int32) : Int32
line_number_for_index,
logger : NoirLogger
logger,
parallel_analyze(files : Array(String), &block : String -> Nil)
parallel_analyze,
read_file_content(path : String) : String
read_file_content,
result : Array(Endpoint)
result,
tech : String
tech,
unique_params(params : Array(Param)) : Array(Param)
unique_params,
url : String
url,
web_root_path(path : String, markers : Array(String)) : String
web_root_path
Constructor methods inherited from class Analyzer
new(options : Hash(String, YAML::Any))
new
Macros inherited from class Analyzer
analyzer_for(tech)
analyzer_for
Instance methods inherited from module FileHelper
all_files : Array(String)
all_files,
get_files_by_basename(basename : String) : Array(String)
get_files_by_basename,
get_files_by_extension(extension : String) : Array(String)
get_files_by_extension,
get_files_by_extensions(extensions : Array(String)) : Array(String)
get_files_by_extensions,
get_files_by_prefix(prefix : String) : Array(String)
get_files_by_prefix,
get_files_by_prefix_and_extension(prefix : String, extension : String) : Array(String)
get_files_by_prefix_and_extension,
get_files_by_relative_path(relative_path : String, root : String = "") : Array(String)
get_files_by_relative_path,
get_public_dir_files(base_path : String, folder : String) : Array(String)
get_public_dir_files,
get_public_files(base_path : String, anchors : Array(String) = ["shard.yml", "Gemfile"]) : Array(String)
get_public_files,
walked_path(expanded : String) : String
walked_path
Class Method Detail
Instance Method Detail
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.