feat(apk): APK Inspector — analyze APKs without installing + auto assetlinks check#36
Open
manjees wants to merge 1 commit into
Open
feat(apk): APK Inspector — analyze APKs without installing + auto assetlinks check#36manjees wants to merge 1 commit into
manjees wants to merge 1 commit into
Conversation
…etlinks check Adds a new sidebar screen that takes a local .apk, parses the manifest and signing certificates in-process, and (the headline value) cross-references every autoVerify https domain against the live assetlinks.json — answering "would this build verify on a real device?" without needing a device at all. Domain - ApkAnalysisResult / ApkInfo / ApkSignature / ApkIntentFilter / ApkLinkDomain / ApkPathPattern / ApkDomainVerification / ApkFingerprintMatch (sealed) - collapseLinkDomains merges per-filter declarations into one entry per host so the user sees the same domain list Android's verifier would consider Infrastructure - net.dongliu:apk-parser 2.6.10 wraps APK + manifest binary XML decoding + signing block parsing. Uses getAllCertificateMetas() to union v1/v2/v3 schemes. - Fingerprints are SHA-256-hashed locally from raw cert bytes (apk-parser doesn't expose them directly), then formatted as XX:XX:XX:... uppercase to match the canonical form assetlinks.json uses - Manifest XML is walked via DOM (DocumentBuilder) — explicitly handles all 5 component tags (activity, activity-alias, service, receiver, provider) and every <data> attribute variant (path/pathPrefix/pathSuffix/pathPattern/ pathAdvancedPattern + scheme + host + mimeType) - Filters with no link-relevant data (boot completed, sync, push) are dropped rather than cluttering the result panel UseCase - AnalyzeApkAndValidateLinksUseCase fans out to assetlinks for every autoVerify https domain in parallel, then per-domain matches the APK's SHA-256 fingerprints against the JSON's. Result: FullMatch / PartialMatch / NoMatch / PackageNotDeclared / AssetLinksUnavailable UI - New sidebar item "APK" (Android icon) routes to ApkInspectorScreen - AWT FileDialog for native picker on macOS / Windows / Linux - Result cards: Package metadata, Signing certs, App Links verification (the headline section), All declared link domains, Intent filters (collapsible — large APKs can have 50+) - AAB rejected up-front with a clear "use the universal/split APK" hint — silently failing on .aab would mislead users Test plan documented in PR body. Closes #32.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32.
Summary
New sidebar screen that takes a local
.apk, parses the manifest and signing certificates in-process, and (the headline value) cross-references everyautoVerify httpsdomain against the liveassetlinks.json— answering "would this build verify on a real device?" without needing a device at all.Why this matters: today the only way to know whether an APK will pass App Links verification is to install it and run `pm get-app-links` on a device. That breaks the CI / release-review workflow. This PR puts that check in front of you before the artifact even reaches a tester.
What's in
Dependency
Domain
Infrastructure
UseCase
UI
Test plan
Out of scope (follow-up)