version: 1.0.0
updated: 2026-07-29
owner: Android platform
description: >
  Google Play policy + platform requirements, as a machine-readable registry. IDs
  are the source-of-truth IDs the underlying scanner uses and are stable across
  versions  -  a finding cites the ID so the author can look it up and disagree.

# What these rules may be applied to. Every rule here is measured against a BUILT
# bundle or APK, not against source, so path scoping names the release-relevant
# inputs a diff can touch. A consumer resolves this before selecting rules and
# records what it dropped rather than applying a bundle rule to a source-only diff.
scope:
  languages: [kotlin, java]
  paths:
    - "**/AndroidManifest.xml"
    - "**/build.gradle"
    - "**/build.gradle.kts"
    - "**/proguard-rules.pro"
    - "**/network_security_config.xml"
    - "**/gradle.properties"
  notCovered:
    ios: App Store policy is a separate registry  -  see apple-archive-compliance
    source-quality: Kotlin naming, Compose and MVVM live in the android stack skills

severity_levels: [blocking, important, suggestion]
enforcement_kinds:
  scan: a tool measures it against the built artefact
  judgement: requires a person or an audit run

# No rule here carries a regex mechanism. These are measured by the bundle scanner
# against a built artefact, so a consumer either runs that scanner and maps its
# output onto these IDs, or reports the rule as unverified. Grepping source for
# them produces confident wrong answers: minifyEnabled can read true in one build
# type and false in the one that ships.

rules:
  - id: target-api-level
    title: >
      `android:targetSdkVersion` ≥ 34 for new apps (Aug 2024+), ≥ 34 for updates (Nov 2024+). Lower → rejected.
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  Target API
    rationale: play-store-compliance
  - id: native-64bit
    title: >
      Every native `.so` has an `arm64-v8a` counterpart. `armeabi-v7a`-only rejected since Aug 2019.
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  64-bit
    rationale: play-store-compliance
  - id: app-bundle-format
    title: >
      New apps must ship `.aab`. `.apk` uploads rejected on new apps since Aug 2021.
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  AAB
    rationale: play-store-compliance
  - id: base-module-size
    title: >
      Base APK from bundle ≤ 150 MB (bundletool `--mode=universal` size). Beyond → rejected.
    severity: blocking
    enforcement: scan
    policy_ref: Platform limit
    rationale: play-store-compliance
  - id: package-visibility
    title: >
      If `targetSdkVersion ≥ 30` and code queries other packages, `<queries>` must be declared in manifest.
    severity: important
    enforcement: scan
    policy_ref: Android 11+
    rationale: play-store-compliance
  - id: foreground-service-types
    title: >
      Every `<service android:foregroundServiceType="..."/>` type must match runtime usage. Missing = policy violation.
    severity: blocking
    enforcement: scan
    policy_ref: Android 14
    rationale: play-store-compliance
  - id: app-signing
    title: >
      Signed with at least v2 scheme (apksigner verify --min-sdk-version). Enrollment in Play App Signing recommended.
    severity: blocking
    enforcement: scan
    policy_ref: Play App Signing
    rationale: play-store-compliance
  - id: cleartext-traffic
    title: >
      `android:usesCleartextTraffic="false"` OR Network Security Config explicitly lists cleartext domains.
    severity: important
    enforcement: scan
    policy_ref: Policy  -  Security
    rationale: play-store-compliance
  - id: exported-components
    title: >
      Every `<activity>` / `<service>` / `<receiver>` with `<intent-filter>` must explicitly declare `android:exported="true"`. Missing → build fail on API 31+.
    severity: blocking
    enforcement: scan
    policy_ref: Android 12+
    rationale: play-store-compliance
  - id: proguard-mapping
    title: >
      Release build has `mapping.txt` (upload to Play Console for deobfuscation). `minifyEnabled = false` on release = warning.
    severity: important
    enforcement: scan
    policy_ref: none
    rationale: play-store-compliance
  - id: dangerous-permissions
    title: >
      Every dangerous permission (`MANAGE_EXTERNAL_STORAGE`, `SYSTEM_ALERT_WINDOW`, `REQUEST_INSTALL_PACKAGES`, `PACKAGE_USAGE_STATS`, `QUERY_ALL_PACKAGES`) has justification in Play Console.
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  Permissions
    rationale: play-store-compliance
  - id: advertising-id
    title: >
      If AdMob / advertising ID used (manifest `com.google.android.gms.permission.AD_ID`), must be declared in Data Safety form. Targeting API 33+ requires `AD_ID` permission.
    severity: important
    enforcement: scan
    policy_ref: Policy  -  Ad ID
    rationale: play-store-compliance
  - id: background-location
    title: >
      `ACCESS_BACKGROUND_LOCATION` declared → Play Console background location justification required (policy revoke risk).
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  Location
    rationale: play-store-compliance
  - id: data-safety-consistency
    title: >
      Manifest-declared permissions match Data Safety form (drift audit  -  manual; this rule flags permissions likely to trigger form updates).
    severity: important
    enforcement: scan
    policy_ref: Policy  -  Data safety
    rationale: play-store-compliance
  - id: sensitive-permission-special-access
    title: >
      `READ_SMS`, `RECEIVE_SMS`, `READ_CALL_LOG`, `WRITE_CALL_LOG`, `READ_CONTACTS`, `PROCESS_OUTGOING_CALLS` require special access from Play Console (Default handler use case).
    severity: blocking
    enforcement: scan
    policy_ref: Policy  -  Sensitive
    rationale: play-store-compliance
  - id: debug-tool-leak
    title: >
      Release APK contains `com.squareup.leakcanary`, `com.facebook.stetho`, `com.github.chuckerteam.chucker`, `com.jakewharton.pidcat`, `com.github.anrwatchdog` (and variants) in DEX/META-INF.
    severity: blocking
    enforcement: scan
    policy_ref: none
    rationale: play-store-compliance
  - id: log-statements
    title: >
      Release APK has `Log.d` / `Log.v` / `Timber.d` call sites in bytecode. Should be stripped via ProGuard rules or build-type conditional.
    severity: important
    enforcement: scan
    policy_ref: none
    rationale: play-store-compliance
  - id: mock-endpoints
    title: >
      Release APK manifest / resources contain dev/staging URL literals or test API key patterns (`dev.`, `staging.`, `test-api-key`, `Bearer test_`).
    severity: important
    enforcement: scan
    policy_ref: none
    rationale: play-store-compliance
  - id: minify-enabled
    title: >
      Release build-type has `minifyEnabled = true` and `shrinkResources = true`. Both off = warning (size + deobfuscation impact).
    severity: important
    enforcement: scan
    policy_ref: Build config
    rationale: play-store-compliance
  - id: version-code-progression
    title: >
      `versionCode` in this bundle > last published versionCode on Play (requires Play Console API lookup or user-provided last version).
    severity: important
    enforcement: scan
    policy_ref: Platform req
    rationale: play-store-compliance
  - id: app-links-verification
    title: >
      `<intent-filter android:autoVerify="true">` domains have reachable `/.well-known/assetlinks.json`.
    severity: suggestion
    enforcement: scan
    policy_ref: Digital Asset Links
    rationale: play-store-compliance
