feat(android): replace QUERY_ALL_PACKAGES with build-time <queries> manifest#13
Open
m-awadi wants to merge 1 commit into
Open
feat(android): replace QUERY_ALL_PACKAGES with build-time <queries> manifest#13m-awadi wants to merge 1 commit into
m-awadi wants to merge 1 commit into
Conversation
…anifest
Drops QUERY_ALL_PACKAGES (Play Store policy compliance) in favor of a
<queries> block generated at build time from ALL.json. Adds the schema
plumbing and runtime matching needed to keep detection working under the
new package-visibility model.
Schema / scrapper
- Add `android_curated_app_ids` to FinalDBFile schema (Zod + JSON schema).
- Scrapper expands developer prefixes into concrete package IDs at build
time and writes them to the curated field.
- Manual override updates for Microsoft BDS hints.
- gen_static.ts: emit android-targeting fields (`hint_android_id`,
`android_dev_id`, `android_app_ids`, `android_curated_app_ids`) on the
first/canonical entry per company only. Previously every social-media
split entry duplicated the curated array, e.g. Microsoft's 22-item
list was stamped 76 times across its hint entries. The runtime resolves
apps via .find() against ALL.json so a single matching entry is
sufficient. Reclaims ~63KB per ALL.json copy (4 copies = ~250KB).
- Regenerate ALL.json across addon, android, scrapper, telegram-bot.
Android build
- Generate `<queries>` AndroidManifest from ALL.json at compile time
(GenerateQueriesManifestTask), wired in via androidComponents.onVariants.
- Hard-fail the build on orphaned `android_dev_id` entries (declared but
with no concrete app IDs) — these would silently disappear under
<queries>. Documents the curation-completeness limitation that the
orphan check cannot detect (incomplete curated lists need periodic
Play Store audits).
- Drop QUERY_ALL_PACKAGES + tools:ignore from the manifest.
Android runtime
- AppScanner / ScanWorker now consult `androidCuratedAppIds` alongside
`androidAppIds` and the `androidDevId` prefix branch. The prefix
branch is kept as a defensive catch in case a curated package shares
the dev_id namespace.
- Hint scanner also consults the curated list (it previously only saw
exact app_ids).
Debug ADB trigger
- Add ScanTriggerReceiver behind a debug-only manifest entry.
- Add scripts/trigger-worker.{sh,md} for manual verification on device.
UI
- Remove the now-unused PermissionRequestScreen and its strings (we no
longer ask for QUERY_ALL_PACKAGES at runtime).
Tests
- AppScannerTest: 5 new tests covering curated matching, curated-only
entries, unrelated package non-match, hint+curated, and blacklist
priority.
- ScanWorkerTest: 4 new tests covering the equivalent scenarios on the
worker path including the hint+curated regression case.
- EndToEndDetectionTest: new install-and-detect E2E using real
AssetDatabaseProvider + real SystemPackageScanner against Robolectric's
shadow PackageManager + real PackageInstallReceiver + real WorkManager
+ real NotificationPreferences.
Total: 191 unit tests, 0 failures, lint clean.
Version bump: 1.5.0 (21) -> 1.6.1 (23). Snapshot screenshots updated.
f2cf969 to
fb0fe26
Compare
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.
Summary
Drops
QUERY_ALL_PACKAGES(Play Store policy compliance) in favour of a<queries>block generated at build time fromALL.json. Adds the schemaplumbing and runtime matching needed to keep boycott detection working under
Android's exact-package-match visibility model.
Also adds:
ScanWorkeron a device.What changed
Schema + scrapper (
packages/common,packages/scrapper)android_curated_app_idsonFinalDBFileentries (Zod + JSON schema).ALL.jsonacrossaddon/,android/,scrapper/,telegram-bot/.Android build (
app/build.gradle.kts)GenerateQueriesManifestTaskproducesAndroidManifest.xmlwith a<queries>block fromALL.json. Wired in viaandroidComponents.onVariantsso the merged manifest contains the explicit package list at install time.android_dev_identries (declared with no concrete app IDs) — under<queries>those companies' apps would silently disappear from the scanner.QUERY_ALL_PACKAGES(and itstools:ignore) from the main manifest.Android runtime
AppScannerandScanWorkernow consultandroidCuratedAppIdsalongsideandroidAppIdsand theandroidDevIdprefix branch. The prefix branch is kept as a defensive catch when a curated package shares the dev_id namespace.androidAppIds).Debug ADB trigger
ScanTriggerReceiver(debug-only manifest) lets devs/QA fire a scan viaadb shell am broadcast.scripts/trigger-worker.sh+ accompanying.mddoc.UI cleanup
PermissionRequestScreenand its strings — we no longer prompt forQUERY_ALL_PACKAGESat runtime.Tests
AppScannerTest— 5 new cases for curated matching, curated-only entries, unrelated-package non-match, hint+curated, and blacklist priority over hint.ScanWorkerTest— 4 new cases on the worker path including the hint+curated regression.EndToEndDetectionTest— new install-and-detect E2E using realAssetDatabaseProvider+ realSystemPackageScanneragainst Robolectric's shadowPackageManager, realPackageInstallReceiver, real WorkManager test harness, realNotificationPreferences.Final state: 191 unit tests, 0 failures, 0 errors, 0 skipped. Android lint clean.
Test plan
./gradlew :app:testDebugUnitTest— 191 tests pass./gradlew :app:lintDebug— cleanpnpm build— full monorepo build green<queries>block lands in the merged manifest (./gradlew :app:processDebugMainManifestartifact)adb installof a known boycotted packagescripts/trigger-worker.sh) works on-device