Avoid common App Store and Google Play rejections. Open playbook and pre-submission guard with 117 documented rejection patterns and fixes, privacy manifest and Data safety checks, 95 tracked deadlines (EU AI Act, DSA, COPPA, age laws), and a skill for AI coding agents.
Shell accessibilityai-agentsandroidapp-review-guidelinesapp-storeapp-store-connectapp-store-rejectionapp-store-reviewclaude-codecoppadata-safetyeu-ai-actgdprgoogle-playgoogle-play-policyiosmobile-complianceplay-consolepre-submission-checklistprivacy-manifest
fix: findings first, monitors write nothing unasked, four frameworks (#844)
Mirza Iqbal5201f1bd4069
diff --git a/README.md b/README.mdindex c3cfcdd..f629263 100644--- a/README.md+++ b/README.md@@ -14,12 +14,10 @@ Stop getting your iOS and Android apps rejected. The enterprise reference and au[](.github/CONTRIBUTING.md)[](https://github.com/mjmirza/app-store-compliance/stargazers)-[](https://github.com/mjmirza/app-store-compliance/fork)-[](https://github.com/mjmirza)-**If this saves you even one rejection, leave a star, fork it, and follow along. That is the whole ask.**+**If this saves you even one rejection, leave a star. That is the whole ask.**-[Star this repo](https://github.com/mjmirza/app-store-compliance) | [Fork it](https://github.com/mjmirza/app-store-compliance/fork) | [Follow on GitHub](https://github.com/mjmirza) | [Follow on X](https://twitter.com/MirzaJhanzaib) | [next8n.com](https://next8n.com)+[Star this repo](https://github.com/mjmirza/app-store-compliance)</div>@@ -41,7 +39,7 @@ git clone https://github.com/mjmirza/app-store-compliance ~/repositories/app-stobash ~/repositories/app-store-compliance/agent-os/hooks/app-store-compliance-guard.sh /path/to/your/app```-Replace only `/path/to/your/app`, with the folder that holds your Xcode project or your Android app. A small project scans in about a second, a large one can take up to a minute, and the guard prints the time it took. The last lines tell you where you stand.+Replace only `/path/to/your/app`, with the folder that holds your Xcode project or your Android app. A small project scans in about a second, a large one can take up to a minute, and the guard prints the time it took. Findings print first, critical ones on top, each with the file and line that triggered it when there is one. The last lines tell you where you stand.| Last line starts with | It means | Do next ||---|---|---|@@ -289,13 +287,14 @@ What to expect, measured on 30 September 2026.| Command | Output and time | Writes a file ||---|---|---|| `monitor.py` | A count per track and the first 10 items. `--full` prints every item | No |-| `monitor-android.py`, `monitor-ai-policy.py` | About 200 and 95 lines | Each rewrites its migration doc under `docs/` in the folder you run it from |-| `monitor-privacy.py`, `monitor-security.py` | About 27 lines each | A PR draft under `docs/` in the folder you run them from |+| `monitor-regulatory.py` | About 95 lines | No |+| `monitor-android.py`, `monitor-ai-policy.py` | About 205 and 95 lines | Only with `--output-docs <path>` or `--pr-output <path>` |+| `monitor-privacy.py`, `monitor-security.py` | About 27 lines each | Only with `--output-docs <path>` or `--pr-output <path>` || `release-audit.py` | About two minutes. It checks the playbook itself first, then your app | `RELEASE-READINESS-REPORT.md` in your app folder || `generate-timeline.py` | The open deadlines, then one completion line | Rewrites `docs/REGULATORY-TIMELINE.md` in the playbook folder || `deadline-checker.py` | About 175 lines of detail. Add `--brief` for one line per open deadline | No |-The monitors other than `monitor.py` read built-in sample announcements by default. Treat their output as a worked example of the migration tasks, not as news.+Every monitor prints one `Data.` line that says whether its items are live or sample. The monitors other than `monitor.py` read built-in sample announcements unless you pass `--live`, so treat that output as a worked example of the migration tasks, not as news. `monitor-regulatory.py` and `monitor-security.py` have no live feed.### Citation integrity@@ -349,7 +348,7 @@ python3 scripts/deadline-checker.py| `docs/EU-REGULATORY-2026.md` | The EU legal hard rules with dated sources. the EU AI Act (Article 50 transparency by 2 August 2026, Article 4 literacy, Article 5 prohibitions, penalties), the Digital Markets Act and the Core Technology Fee, DSA trader status, the European Accessibility Act and EN 301 549, and the Apple 2025 and 2026 platform changes || `docs/GLOBAL-REGULATORY-2026.md` | The USA and other-global legal hard rules with dated sources. US COPPA and the state app-store age laws, the external-link rules, plus the UK, Australia, Brazil, and other jurisdictions, and what Apple tells developers to do per region || `docs/PLATFORM-MECHANICS-2026.md` | The platform-mechanics and newer-policy hard rules with dated sources. macOS notarization, Guideline 4.2 and 4.3 with the June 2026 saturation tightening, reader-app entitlement, France ANSSI encryption, visionOS and watchOS and tvOS specifics, plus Android developer verification, Foreground Service types, Play Integrity, Play Billing v8, target API, Health Connect, and the cross-cutting CSAM, UGC, accessibility, sanctions, and PCI items |-| `docs/CROSS-PLATFORM-FRAMEWORKS.md` | What the guard covers for Flutter, React Native, Expo, Capacitor, Ionic, and Cordova apps, and why it scans the built artifact surface rather than framework source |+| `docs/CROSS-PLATFORM-FRAMEWORKS.md` | What the guard covers for Flutter, React Native, Expo, Capacitor, Ionic, Cordova, Unity, .NET MAUI, Tauri mobile, and Kotlin Multiplatform apps, and why it scans the built artifact surface rather than framework source || `docs/BY-APP-TYPE.md` | The rejection map routed by app type. Universal, subscriptions, social, kids, health, games, macOS, AI, crypto and finance, VPN || `docs/COMPETITIVE-GAP-ANALYSIS.md` | A survey of the other open source compliance repositories, what each publishes and why, the gaps they surfaced, and what was folded in here || `docs/REGULATORY-GAP-REPORT-2026.md` | Global and regional regulatory compliance gap analysis prepared by the Senior Compliance Officer, evaluating modern and upcoming frameworks |diff --git a/agent-os/hooks/app-store-compliance-guard-test.sh b/agent-os/hooks/app-store-compliance-guard-test.shindex d2c79e1..2b1cde4 100755--- a/agent-os/hooks/app-store-compliance-guard-test.sh+++ b/agent-os/hooks/app-store-compliance-guard-test.sh@@ -1210,7 +1210,7 @@ NCRIT="$(echo "$OUT" | grep -c '^ \[CRITICAL\] ')"echo "$OUT" | grep -q "^Project\. $D$" && [ "$(echo "$OUT" | grep -c '^App\. ')" -eq 2 ] && ok "612-2 monorepo report keeps the root Project line and adds one App section per root" || bad "612-2 monorepo report keeps the root Project line and adds one App section per root"# the findings sit under the app they belong to, never under the clean siblingAPP_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/app$/{p=1;next} /^App\. /{p=0} p')"-KIOSK_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/kiosk$/{p=1;next} /^App\. |^Summary\./{p=0} p')"+KIOSK_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/kiosk$/{p=1;next} /^App\. |^Summary\.|^== Regulatory/{p=0} p')"echo "$APP_SECTION" | grep -q '\[CRITICAL\]' && ! echo "$KIOSK_SECTION" | grep -q '\[CRITICAL\]' && ok "612-3 findings sit under their own app section" || bad "612-3 findings sit under their own app section"rm -rf "$D"@@ -1242,7 +1242,7 @@ rm -rf "$D"D="$(mk_two_native)"OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?[ "$(echo "$OUT" | grep -c '^App\. ')" -eq 2 ] && echo "$OUT" | grep -q 'GOOGLE-PERM-BACKGROUND-LOCATION' && echo "$OUT" | grep -q 'MISSING-USAGE-DESCRIPTION' && [ "$RC" -eq 2 ] && ok "612-8 side by side native projects are scanned separately" || bad "612-8 side by side native projects are scanned separately (rc=$RC)"-IOS_SECTION="$(echo "$OUT" | awk '/^App\. .*\/ios-app$/{p=1;next} /^App\. |^Summary\./{p=0} p')"+IOS_SECTION="$(echo "$OUT" | awk '/^App\. .*\/ios-app$/{p=1;next} /^App\. |^Summary\.|^== Regulatory/{p=0} p')"echo "$IOS_SECTION" | grep -q 'Platforms\. iOS=1 Android=0' && ok "612-9 each section reports its own platforms" || bad "612-9 each section reports its own platforms"rm -rf "$D"@@ -1331,7 +1331,7 @@ mk_bare_ios_android() {D="$(mk_root_app_plus_child)"OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?ROOT_SECTION="$(echo "$OUT" | awk -v r="App. $D" '$0==r{p=1;next} /^App\. /{p=0} p')"-CHILD_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/child$/{p=1;next} /^App\. |^Summary\./{p=0} p')"+CHILD_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/child$/{p=1;next} /^App\. |^Summary\.|^== Regulatory/{p=0} p')"[ "$RC" -eq 2 ] && [ "$(echo "$OUT" | grep -c '^App\. ')" -eq 2 ] && echo "$ROOT_SECTION" | grep -q 'MISSING-USAGE-DESCRIPTION' && ! echo "$CHILD_SECTION" | grep -q '\[CRITICAL\]' && ok "612-13 root app plus nested app are scanned apart" || bad "612-13 root app plus nested app are scanned apart (rc=$RC)"rm -rf "$D"@@ -1493,7 +1493,7 @@ printf "plugins { id 'com.android.application' }\nandroid { buildTypes { releaseprintf '<manifest xmlns:android="http://schemas.android.com/apk/res/android"></manifest>' > "$D/apps/a/app/src/main/AndroidManifest.xml"printf '<manifest xmlns:android="http://schemas.android.com/apk/res/android"></manifest>' > "$D/apps/b/app/src/main/AndroidManifest.xml"OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?-A_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/a\/app$/{p=1;next} /^App\. |^Summary\./{p=0} p')"+A_SECTION="$(echo "$OUT" | awk '/^App\. .*\/apps\/a\/app$/{p=1;next} /^App\. |^Summary\.|^== Regulatory/{p=0} p')"[ "$(echo "$OUT" | grep -c '^App\. ')" -eq 2 ] && echo "$A_SECTION" | grep -q 'ANDROID-R8-OPTIMIZATION-MISSING' && ok "612-33 Android app modules without a settings file are two apps" || bad "612-33 Android app modules without a settings file are two apps (rc=$RC sections=$(echo "$OUT" | grep -c '^App\. '))"rm -rf "$D"@@ -1618,6 +1618,172 @@ D="$(mk_ios_bad)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?[ "$RC" -eq 2 ] && echo "$OUT" | grep -q 'run the same command again' && ok "verdict-5 a block says what to do next" || bad "verdict-5 a block says what to do next (rc=$RC)"rm -rf "$D"+# ===== Third review round. Each case failed before its fix. =====+r3_hook() { python3 -c 'import json,sys; print(json.dumps({"tool_input":{"command":sys.argv[1]}}))' "$1" | CLAUDE_PROJECT_DIR="$2" bash "$GUARD" >/dev/null 2>"${3:-/dev/null}"; }+D="$(mk_ios_bad)"+r3_hook 'npm install "$(fastlane deliver)"' "$D"; RC=$?+[ "$RC" -eq 2 ] && ok "r3-1 a submit inside a command substitution in an install line still blocks" || bad "r3-1 a submit inside a command substitution in an install line still blocks (rc=$RC)"+r3_hook 'npm install `fastlane deliver`' "$D"; RC=$?+[ "$RC" -eq 2 ] && ok "r3-2 a submit inside backticks in an install line still blocks" || bad "r3-2 a submit inside backticks in an install line still blocks (rc=$RC)"+r3_hook 'npm install bundletool fastlane' "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "r3-3 a plain install of a package named like a submit tool stays silent" || bad "r3-3 a plain install of a package named like a submit tool stays silent (rc=$RC)"+OUT="$(env -u HOME bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 2 ] && ! echo "$OUT" | grep -q "unbound variable" && ok "r3-4 an unset HOME does not crash the guard" || bad "r3-4 an unset HOME does not crash the guard (rc=$RC)"+rm -rf "$D"+# A monorepo with one scannable app and one Expo app with no native folders is never CLEAR.+D="$(mktemp -d)"; mkdir -p "$D/apps/native/App.xcodeproj" "$D/apps/expo"+N="$(mk_ios_clean)"; cp -R "$N/App" "$D/apps/native/"; rm -rf "$N"+printf '{"expo":{"name":"x","slug":"x"}}' > "$D/apps/expo/app.json"; printf '{"dependencies":{"expo":"~52.0.0","react-native":"0.76.0"}}' > "$D/apps/expo/package.json"+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+echo "$OUT" | grep -q "^Apps. 2 app roots" && ! echo "$OUT" | grep -q '^CLEAR' && echo "$OUT" | grep '^NOT CHECKED' | grep -q 'apps/expo' && [ "$RC" -eq 1 ] && ok "r3-5 an unscanned sibling app stops CLEAR and is named" || bad "r3-5 an unscanned sibling app stops CLEAR and is named (rc=$RC)"+r3_hook 'fastlane deliver' "$D" "$D/err.txt"; RC=$?+[ "$RC" -eq 0 ] && grep -q 'NOT CHECKED' "$D/err.txt" && ok "r3-6 as a hook the unscanned sibling is reported and never blocks" || bad "r3-6 as a hook the unscanned sibling is reported and never blocks (rc=$RC)"+rm -rf "$D"++# ===== Issue 842. Findings lead the report, critical first, each with the file that triggered it. =====+D="$(mk_ios_bad)"+OUT="$(bash "$GUARD" "$D" 2>&1)"+echo "$OUT" | awk '/^ \[CRITICAL\]/{ if (lower) bad=1; c++ } /^ \[(HIGH|MEDIUM)\]/{ lower=1 } END { exit (bad || c == 0) }' && ok "842-1 every critical finding prints above the first high or medium one" || bad "842-1 every critical finding prints above the first high or medium one"+FIRST_F="$(echo "$OUT" | grep -n '^ \[' | head -1 | cut -d: -f1)"; DL="$(echo "$OUT" | grep -n 'Regulatory Compliance Deadline Status' | head -1 | cut -d: -f1)"+[ -n "$FIRST_F" ] && [ -n "$DL" ] && [ "$FIRST_F" -lt "$DL" ] && ok "842-2 findings print above the deadline list" || bad "842-2 findings print above the deadline list (finding=$FIRST_F deadlines=$DL)"+echo "$OUT" | grep -A1 'APPLE-2.1-STAGING-BACKEND' | grep -q '^ file\. App/X\.swift:4$' && ok "842-3 a finding names the file and line that triggered it" || bad "842-3 a finding names the file and line that triggered it"+echo "$OUT" | grep -A2 'APPLE-2.1-STAGING-BACKEND' | grep -q '^ fix\. ' && ok "842-4 the fix line still follows the finding" || bad "842-4 the fix line still follows the finding"+rm -rf "$D"+# Deadlines follow the stores the project ships to. Laws that bind every app stay.+DLF="$(mktemp)"+python3 - "$DLF" <<'PYT'+import datetime, json, sys+day = (datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=10)).strftime("%Y-%m-%d")+rows = [("A", "Apple App Store (Global)", "Apple rule"), ("G", "Google Play (Global)", "Play rule"), ("R", "Android (Brazil)", "Android rule"), ("E", "European Union", "EU law")]+out = [{"id": i, "jurisdiction": j, "law": law, "requirement": "r", "effective_date": "2026-01-01", "grace_period": "none", "mandatory_date": day, "enforcement_date": day, "affected_repository_sections": "docs/X.md", "priority": "high"} for i, j, law in rows]+with open(sys.argv[1], "w", encoding="utf-8") as f:+ json.dump({"deadlines": out}, f)+PYT+D="$(mk_android_bad)"; OUT="$(DEADLINES_FILE="$DLF" bash "$GUARD" "$D" 2>&1)"+echo "$OUT" | grep -q 'Play rule' && echo "$OUT" | grep -q 'Android rule' && echo "$OUT" | grep -q 'EU law' && ! echo "$OUT" | grep -q 'Apple rule' && echo "$OUT" | grep -q '^1 deadline(s) for a store this project does not ship to' && ok "842-5 an Android-only project sees no Apple store deadline and is told one was left out" || bad "842-5 an Android-only project sees no Apple store deadline and is told one was left out"+rm -rf "$D"+D="$(mk_ios_bad)"; OUT="$(DEADLINES_FILE="$DLF" bash "$GUARD" "$D" 2>&1)"+echo "$OUT" | grep -q 'Apple rule' && echo "$OUT" | grep -q 'EU law' && ! echo "$OUT" | grep -q 'Play rule' && ! echo "$OUT" | grep -q 'Android rule' && ok "842-6 an iOS-only project sees no Google Play or Android deadline" || bad "842-6 an iOS-only project sees no Google Play or Android deadline"+rm -rf "$D" "$DLF"++# ===== Issue 837. Unity, .NET MAUI, Tauri mobile and Kotlin Multiplatform. One bad and one clean project each. =====+BAD_SRC='"https://staging.example.com/api"'+GOOD_SRC='"https://api.realbackend.io" "https://realbackend.io/privacy-policy"'+mk_unity() { # $1 is the string the source file carries+ local d; d="$(mktemp -d)"; mkdir -p "$d/ProjectSettings" "$d/Assets/Scripts"+ printf 'm_EditorVersion: 6000.0.30f1\n' > "$d/ProjectSettings/ProjectVersion.txt"+ printf 'public class Api { string[] u = { %s }; }\n' "$1" > "$d/Assets/Scripts/Api.cs"+ echo "$d"+}+mk_maui() {+ local d; d="$(mktemp -d)"; mkdir -p "$d/Platforms/iOS" "$d/Platforms/Android" "$d/Services"+ printf '<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFrameworks>net8.0-ios;net8.0-android</TargetFrameworks><UseMaui>true</UseMaui></PropertyGroup></Project>\n' > "$d/App.csproj"+ printf '<plist><dict><key>ITSAppUsesNonExemptEncryption</key><false/></dict></plist>' > "$d/Platforms/iOS/Info.plist"+ printf '<manifest></manifest>' > "$d/Platforms/Android/AndroidManifest.xml"+ printf 'public class Api { string[] u = { %s }; }\n' "$1" > "$d/Services/Api.cs"+ echo "$d"+}+mk_tauri() {+ local d; d="$(mktemp -d)"; mkdir -p "$d/src-tauri/src" "$d/src-tauri/gen/apple/app.xcodeproj" "$d/src-tauri/gen/apple/app_iOS"+ printf '{"productName":"x","identifier":"io.realbackend.x"}' > "$d/src-tauri/tauri.conf.json"+ printf '<plist><dict><key>ITSAppUsesNonExemptEncryption</key><false/></dict></plist>' > "$d/src-tauri/gen/apple/app_iOS/Info.plist"+ printf 'pub fn urls() -> Vec<&'"'"'static str> { vec![%s] }\n' "$(printf '%s' "$1" | sed 's/" "/", "/')" > "$d/src-tauri/src/lib.rs"+ echo "$d"+}+mk_kmp() {+ local d; d="$(mktemp -d)"; mkdir -p "$d/shared/src/commonMain/kotlin" "$d/iosApp/iosApp.xcodeproj" "$d/iosApp/iosApp"+ printf 'include(":shared")\n' > "$d/settings.gradle.kts"+ printf 'plugins { kotlin("multiplatform") }\n' > "$d/shared/build.gradle.kts"+ printf '<plist><dict><key>ITSAppUsesNonExemptEncryption</key><false/></dict></plist>' > "$d/iosApp/iosApp/Info.plist"+ printf 'val urls = listOf(%s)\n' "$(printf '%s' "$1" | sed 's/" "/", "/')" > "$d/shared/src/commonMain/kotlin/Api.kt"+ echo "$d"+}+f837() { # name, builder, framework label, source path, submit command+ local D OUT RC+ D="$("$2" "$BAD_SRC")"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+ [ "$RC" -eq 2 ] && echo "$OUT" | grep -q "^Frameworks\. .*$3=1" && echo "$OUT" | grep -A1 'APPLE-2.1-STAGING-BACKEND' | grep -q "file\. $4:1" \+ && ok "837 $1 bad project is recognised, blocked, and the finding names $4" || bad "837 $1 bad project is recognised, blocked, and the finding names $4 (rc=$RC)"+ r3_hook "$5" "$D"; RC=$?+ [ "$RC" -eq 2 ] && ok "837 $1 submit command runs the scan" || bad "837 $1 submit command runs the scan (rc=$RC)"+ rm -rf "$D"+ D="$("$2" "$GOOD_SRC")"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+ [ "$RC" -eq 0 ] && echo "$OUT" | grep -q '^CLEAR\. ' && ! echo "$OUT" | grep -q '^Apps\. ' \+ && ok "837 $1 clean project is CLEAR and scanned as one app" || bad "837 $1 clean project is CLEAR and scanned as one app (rc=$RC)"+ r3_hook "$5" "$D"; RC=$?+ [ "$RC" -eq 0 ] && ok "837 $1 submit command passes on the clean project" || bad "837 $1 submit command passes on the clean project (rc=$RC)"+ rm -rf "$D"+}+f837 "Unity" mk_unity "Unity" "Assets/Scripts/Api.cs" "/Applications/Unity/Unity -batchmode -quit -buildTarget iOS -executeMethod Build.Run"+f837 "MAUI" mk_maui "MAUI" "Services/Api.cs" "dotnet publish -f net8.0-ios -c Release"+f837 "Tauri" mk_tauri "Tauri" "src-tauri/src/lib.rs" "cargo tauri ios build"+f837 "KMP" mk_kmp "KotlinMultiplatform" "shared/src/commonMain/kotlin/Api.kt" "xcodebuild -scheme iosApp archive"+# A Unity project has no Info.plist or Gradle file until it is exported, so the two checks that read them stay silent.+D="$(mk_unity "$GOOD_SRC")"; OUT="$(bash "$GUARD" "$D" 2>&1)"+! echo "$OUT" | grep -qE 'APPLE-EXPORT-COMPLIANCE-MISSING|ANDROID-R8-OPTIMIZATION-MISSING' && echo "$OUT" | grep -q '^Unity\. ' && ok "837 Unity is not blamed for files that exist only after export, and is told so" || bad "837 Unity is not blamed for files that exist only after export, and is told so"+r3_hook "Unity -batchmode -buildTarget StandaloneOSX -executeMethod Build.Run" "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "837 a Unity desktop build is not a store submit" || bad "837 a Unity desktop build is not a store submit (rc=$RC)"+rm -rf "$D"+D="$(mk_maui "$BAD_SRC")"+r3_hook "dotnet build" "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "837 a plain dotnet build is not a store submit" || bad "837 a plain dotnet build is not a store submit (rc=$RC)"+r3_hook "cargo tauri dev" "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "837 tauri dev is not a store submit" || bad "837 tauri dev is not a store submit (rc=$RC)"+rm -rf "$D"++# ===== Second attack pass on this change. Each case failed before its fix. =====+# A finding with two conditions names the file that holds the more specific one.+D="$(mk_ios_clean)"+printf 'let plan = "monthly subscription"\n' > "$D/App/Aaa.swift"+printf 'let help = "call support to cancel"\n' > "$D/App/Zzz.swift"+OUT="$(bash "$GUARD" "$D" 2>&1)"+echo "$OUT" | grep -A1 'BOTH-SUBSCRIPTION-HARD-CANCEL' | grep -q 'file\. App/Zzz\.swift:1' && ok "c2-1 a two-condition finding names the file of the specific condition" || bad "c2-1 a two-condition finding names the file of the specific condition"+# A broken privacy manifest is still reported now that findings are buffered.+printf '<plist><dict><key>NSPrivacyTracking</key><true/></dict></plist>' > "$D/App/PrivacyInfo.xcprivacy"+OUT="$(bash "$GUARD" "$D" 2>&1)"+echo "$OUT" | grep -qE '^ \[(CRITICAL|HIGH|MEDIUM)\] APPLE-[A-Z0-9.-]*(MANIFEST|TRACKING)' && ok "c2-2 privacy manifest validator findings survive the buffering" || bad "c2-2 privacy manifest validator findings survive the buffering"+rm -rf "$D"+D="$(mk_maui "$BAD_SRC")"+r3_hook "dotnet publish --framework net8.0-maccatalyst --configuration Debug" "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "c2-3 a Mac Catalyst publish is not an iOS or Android submit" || bad "c2-3 a Mac Catalyst publish is not an iOS or Android submit (rc=$RC)"+rm -rf "$D"++# ===== Third attack pass. Each case failed before its fix. =====+D="$(mk_maui "$BAD_SRC")"+r3_hook "dotnet publish --framework net8.0-ios --configuration Debug" "$D"; RC=$?+[ "$RC" -eq 0 ] && ok "c3-1 a Debug dotnet publish is not a store submit" || bad "c3-1 a Debug dotnet publish is not a store submit (rc=$RC)"+r3_hook "dotnet publish -c Debug -f net8.0-android && dotnet publish -f net8.0-ios -c Release" "$D"; RC=$?+[ "$RC" -eq 2 ] && ok "c3-2 a Release publish after a Debug one still runs the scan" || bad "c3-2 a Release publish after a Debug one still runs the scan (rc=$RC)"+rm -rf "$D"+# A cross-platform app with no native folder has had no store check, so it is never CLEAR.+D="$(mktemp -d)"+printf '{"dependencies":{"@capacitor/core":"^6.0.0"}}' > "$D/package.json"; printf 'export default {};' > "$D/capacitor.config.ts"; printf '<html></html>' > "$D/index.html"+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q '^NOT CHECKED' && echo "$OUT" | grep -q 'npx cap add' && ! echo "$OUT" | grep -q '^CLEAR' && ok "c3-3 a Capacitor app with no native folders is NOT CHECKED and told to add one" || bad "c3-3 a Capacitor app with no native folders is NOT CHECKED and told to add one (rc=$RC)"+r3_hook "npx cap build ios" "$D" "$D/err.txt"; RC=$?+[ "$RC" -eq 0 ] && grep -q 'NOT CHECKED' "$D/err.txt" && ok "c3-4 as a hook the Capacitor app is reported and not blocked" || bad "c3-4 as a hook the Capacitor app is reported and not blocked (rc=$RC)"+rm -rf "$D"+D="$(mktemp -d)"; mkdir -p "$D/lib"+printf 'name: x\ndependencies:\n flutter:\n sdk: flutter\n' > "$D/pubspec.yaml"; printf 'void main() {}\n' > "$D/lib/main.dart"+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q '^NOT CHECKED' && echo "$OUT" | grep -q 'flutter create' && ok "c3-5 a Flutter app with no platform folders is NOT CHECKED and told to create them" || bad "c3-5 a Flutter app with no platform folders is NOT CHECKED and told to create them (rc=$RC)"+rm -rf "$D"+D="$(mk_web_clean)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 0 ] && echo "$OUT" | grep -q '^CLEAR' && ok "c3-6 a plain web project still ends CLEAR" || bad "c3-6 a plain web project still ends CLEAR (rc=$RC)"+rm -rf "$D"++# ===== Fourth attack pass. Each case failed before its fix. =====+# A Flutter app with no platform folders next to a native app is its own root, so it cannot hide behind the sibling.+D="$(mktemp -d)"; mkdir -p "$D/apps/native/App.xcodeproj" "$D/apps/fl/lib" "$D/packages/util/lib"+N="$(mk_ios_clean)"; cp -R "$N/App" "$D/apps/native/"; rm -rf "$N"+printf 'name: fl\ndependencies:\n flutter:\n sdk: flutter\n' > "$D/apps/fl/pubspec.yaml"; printf 'void main() {}\n' > "$D/apps/fl/lib/main.dart"+printf 'name: util\n' > "$D/packages/util/pubspec.yaml"; printf 'int one() => 1;\n' > "$D/packages/util/lib/util.dart"+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 1 ] && echo "$OUT" | grep '^NOT CHECKED' | grep -q 'apps/fl' && ! echo "$OUT" | grep '^NOT CHECKED' | grep -q 'packages/util' && ! echo "$OUT" | grep -q '^CLEAR' && ok "c4-1 a Flutter app with no platform folders beside a native app stops CLEAR" || bad "c4-1 a Flutter app with no platform folders beside a native app stops CLEAR (rc=$RC)"+rm -rf "$D/apps/fl"+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?+[ "$RC" -eq 0 ] && echo "$OUT" | grep -q '^CLEAR' && ok "c4-2 a plain Dart package beside a native app does not stop CLEAR" || bad "c4-2 a plain Dart package beside a native app does not stop CLEAR (rc=$RC)"+rm -rf "$D"+echo ""echo "app-store-compliance-guard-test: $PASS passed, $FAIL failed"[ "$FAIL" -eq 0 ]diff --git a/agent-os/hooks/app-store-compliance-guard.sh b/agent-os/hooks/app-store-compliance-guard.shindex 8e3c2b2..8bc39c0 100755--- a/agent-os/hooks/app-store-compliance-guard.sh+++ b/agent-os/hooks/app-store-compliance-guard.sh@@ -5,12 +5,12 @@# @matcher: Bashset -uo pipefail-HOOK_LOG="$HOME/.claude/hooks/hook-log.sh"+HOOK_LOG="${HOME:-}/.claude/hooks/hook-log.sh"# shellcheck disable=SC1090[ -f "$HOOK_LOG" ] && source "$HOOK_LOG" 2>/dev/null || truelog_err() { if type hlog_error >/dev/null 2>&1; then hlog_error "app-store-compliance-guard" "$@"; else echo "app-store-compliance-guard: $*" >&2; fi; }-CRIT=0; HIGH=0; MED=0; DEADLINE_DONE=0; ANY_NATIVE=0; ANY_RN=0; ANY_WEB=0+CRIT=0; HIGH=0; MED=0; ANY_IOS=0; ANY_AND=0; ANY_NATIVE=0; ANY_RN=0; ANY_WEB=0; ANY_NEEDS_NATIVE=0; NATIVE_HINT=""; UNCHECKED=""FILELIST=""REPORT=""; REPORT_DEGRADED=0cleanup() { [ -n "$FILELIST" ] && rm -f "$FILELIST" "$FILELIST.blob" "$FILELIST.manifest" 2>/dev/null; [ -n "$REPORT" ] && rm -f "$REPORT" 2>/dev/null; true; }@@ -109,8 +109,10 @@ if [ -n "$STDIN_JSON" ]; thenprint l }' 2>/dev/null | sed -E 's/\\([A-Za-z0-9])/\1/g')"# Only act on submission style commands. Otherwise stay silent.# Installing a package named like a submit tool (npm install bundletool) is not a submit.- CMD_MATCH="$(printf '%s' "$CMD_MATCH" | sed -E 's/(npm|pnpm|yarn|bun|brew|pip3?|gem|cargo)[[:space:]]+(install|add|i|uninstall|remove)([[:space:]][^;&|]*)?//g')"- SUBMIT_RE='fastlane[[:space:]]+(run[[:space:]]+)?(deliver|pilot|supply|submit|appstore|testflight|upload_to_app_store|upload_to_testflight|upload_to_play_store)([^A-Za-z0-9_]|$)|eas([[:space:]]+--?[A-Za-z][A-Za-z0-9-]*([=[:space:]][^-[:space:]][^[:space:]]*)?)*[[:space:]]+(submit|build)|xcrun[[:space:]]+(altool|notarytool)|transporter|gradlew?[^&|;]*(bundleRelease|assembleRelease|publish[A-Za-z]*(Bundle|Apk|Apps)|promote[A-Za-z]*Artifact)|bundletool|xcodebuild[^&|;]*archive|flutter[[:space:]]+build[[:space:]]+(ipa|appbundle|apk|ios)|(npx[[:space:]]+)?(expo[[:space:]]+(prebuild|run:ios|run:android|submit|upload:(ios|android)|build:(ios|android))|cap[[:space:]]+(sync|build|run|copy|open)|react-native[[:space:]]+run-(ios|android))|ionic[[:space:]]+capacitor[[:space:]]+(build|run)|cordova[[:space:]]+build([[:space:]]+--release)?'+ CMD_MATCH="$(printf '%s' "$CMD_MATCH" | sed -E 's/(npm|pnpm|yarn|bun|brew|pip3?|gem|cargo)[[:space:]]+(install|add|i|uninstall|remove)([[:space:]][^;&|$`]*)?//g')"+ # A Debug publish is a local build, never a store upload.+ CMD_MATCH="$(printf '%s' "$CMD_MATCH" | sed -E 's/dotnet[[:space:]]+publish[^;&|]*(-c|--configuration)[[:space:]=]+[Dd]ebug[^;&|]*//g')"+ SUBMIT_RE='fastlane[[:space:]]+(run[[:space:]]+)?(deliver|pilot|supply|submit|appstore|testflight|upload_to_app_store|upload_to_testflight|upload_to_play_store)([^A-Za-z0-9_]|$)|eas([[:space:]]+--?[A-Za-z][A-Za-z0-9-]*([=[:space:]][^-[:space:]][^[:space:]]*)?)*[[:space:]]+(submit|build)|xcrun[[:space:]]+(altool|notarytool)|transporter|gradlew?[^&|;]*(bundleRelease|assembleRelease|publish[A-Za-z]*(Bundle|Apk|Apps)|promote[A-Za-z]*Artifact)|bundletool|xcodebuild[^&|;]*archive|flutter[[:space:]]+build[[:space:]]+(ipa|appbundle|apk|ios)|(npx[[:space:]]+)?(expo[[:space:]]+(prebuild|run:ios|run:android|submit|upload:(ios|android)|build:(ios|android))|cap[[:space:]]+(sync|build|run|copy|open)|react-native[[:space:]]+run-(ios|android))|ionic[[:space:]]+capacitor[[:space:]]+(build|run)|cordova[[:space:]]+build([[:space:]]+--release)?|(^|[^A-Za-z0-9_])unity(-editor|\.exe)?[[:space:]][^;&|]*-buildtarget[[:space:]]+(ios|android)|dotnet[[:space:]]+publish[^;&|]*(-f|--framework)[[:space:]=]+net[0-9.]+-(ios|android)|tauri[[:space:]]+(ios|android)[[:space:]]+build'UPLOAD_ACTION_RE='(^|[^A-Za-z0-9_])(upload_to_app_store|upload_to_testflight|upload_to_play_store|deliver|pilot|supply|appstore|testflight)([^A-Za-z0-9_]|$)'# A custom fastlane lane submits when a word in its name says so, when its Fastfile block calls an# upload action, or when the lane is a variable the guard cannot read (scanned, never assumed safe).@@ -176,7 +178,7 @@ FASTFILESif [ "$CD_COUNT" -eq 1 ] && printf '%s' "$FIRST" | grep -qE '^[[:space:]]*cd[[:space:]]+[^&|;]+(&&|;)'; thenTARGET="$(printf '%s' "$FIRST" | sed -E 's/^[[:space:]]*cd[[:space:]]+//; s/[[:space:]]*(&&|;).*$//; s/^"(.*)"$/\1/; s/^'"'"'(.*)'"'"'$/\1/')"TARGET="${TARGET//\$\{CLAUDE_PROJECT_DIR\}/$DIR}"; TARGET="${TARGET//\$CLAUDE_PROJECT_DIR/$DIR}"- case "$TARGET" in /*) ;; '~'*) TARGET="$HOME${TARGET#\~}" ;; *) TARGET="$DIR/$TARGET" ;; esac+ case "$TARGET" in /*) ;; '~'*) TARGET="${HOME:-}${TARGET#\~}" ;; *) TARGET="$DIR/$TARGET" ;; esacif [ -d "$TARGET" ]; thenREAL_T="$(cd "$TARGET" 2>/dev/null && pwd -P)"; REAL_R="$(cd "$DIR" 2>/dev/null && pwd -P)"case "$REAL_T/" in "$REAL_R"/*) DIR="$REAL_T" ;; esac@@ -192,7 +194,7 @@ fi# folder for the Apple-only checks below (standalone mode has no CMD, unaffected).CMD_TARGET_ANDROID_ONLY=0if [ -n "$CMD" ] \- && printf '%s' "$CMD" | grep -qiE 'build[[:space:]]+(apk|appbundle)\b|assembleRelease|bundleRelease|run-android|run:android|--platform[[:space:]]+android\b|capacitor[[:space:]]+android\b' \+ && printf '%s' "$CMD" | grep -qiE 'build[[:space:]]+(apk|appbundle)\b|assembleRelease|bundleRelease|run-android|run:android|--platform[[:space:]]+android\b|capacitor[[:space:]]+android\b|-buildtarget[[:space:]]+android|net[0-9.]+-android|tauri[[:space:]]+android\b' \&& ! printf '%s' "$CMD" | grep -qiE '\bios\b|\bipa\b|xcodebuild|altool|notarytool'; thenCMD_TARGET_ANDROID_ONLY=1fi@@ -256,18 +258,43 @@ release_string_has() {# machine. Draining all input with plain grep and returning its status is deterministic.}-finding() { # severity id title fix+# Prints the first file and line that match, relative to the scanned folder. $1 is src or manifest.+hit_file() {+ [ -s "$FILELIST" ] || return 0+ local f n+ if [ "$1" = "manifest" ]; then+ f="$(grep '/AndroidManifest[.]xml$' "$FILELIST" | tr '\n' '\0' | xargs -0 grep -EIls -e "$2" 2>/dev/null | head -1)"+ else+ f="$(tr '\n' '\0' < "$FILELIST" | xargs -0 grep -EIls -e "$2" 2>/dev/null | head -1)"+ fi+ [ -n "$f" ] || return 0+ n="$(grep -En -m1 -e "$2" "$f" 2>/dev/null | cut -d: -f1)"+ printf '%s%s' "${f#"${DIR%/}"/}" "${n:+:$n}"+}++# Findings are held and printed by flush_findings, critical first (issue #842).+F_CRIT=(); F_HIGH=(); F_MED=()+finding() { # severity id title fix [src|manifest regex]. The optional pair names the file that triggered it.+ local t w=""+ [ -n "${5:-}" ] && w="$(hit_file "$5" "${6:-}")"case "$1" in- critical) CRIT=$((CRIT+1)); printf ' [CRITICAL] %s %s\n' "$2" "$3" ;;- high) HIGH=$((HIGH+1)); printf ' [HIGH] %s %s\n' "$2" "$3" ;;- *) MED=$((MED+1)); printf ' [MEDIUM] %s %s\n' "$2" "$3" ;;+ critical) CRIT=$((CRIT+1)); t=" [CRITICAL] $2 $3" ;;+ high) HIGH=$((HIGH+1)); t=" [HIGH] $2 $3" ;;+ *) MED=$((MED+1)); t=" [MEDIUM] $2 $3" ;;esac- printf ' fix. %s\n' "$4"+ [ -n "$w" ] && t="$t"$'\n'" file. $w"+ t="$t"$'\n'" fix. $4"+ case "$1" in critical) F_CRIT+=("$t") ;; high) F_HIGH+=("$t") ;; *) F_MED+=("$t") ;; esac+}+flush_findings() {+ local t+ for t in ${F_CRIT[@]+"${F_CRIT[@]}"} ${F_HIGH[@]+"${F_HIGH[@]}"} ${F_MED[@]+"${F_MED[@]}"}; do printf '%s\n' "$t"; done+ F_CRIT=(); F_HIGH=(); F_MED=()}# Cross-platform apps reach StoreKit and Play Billing through a plugin, so the native symbols never# appear in their source. These are the plugins' own package names.-XPLAT_IAP='in_app_purchase|purchases_flutter|flutter_inapp_purchase|react-native-iap|react-native-purchases|expo-iap|cordova-plugin-purchase|@revenuecat/purchases-capacitor'+XPLAT_IAP='in_app_purchase|purchases_flutter|flutter_inapp_purchase|react-native-iap|react-native-purchases|expo-iap|cordova-plugin-purchase|@revenuecat/purchases-capacitor|UnityEngine\.Purchasing|com\.unity\.purchasing|Plugin\.InAppBilling|tauri-plugin-iap'# Vendored trees never decide the platform, and the prune applies only below the project root, so a project# that itself sits under a folder named build or test is still detected. Same SIGPIPE-safe grep as the source scan.@@ -307,6 +334,7 @@ find "$DIR" -mindepth 1 \-o -name '*.json' -o -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' \-o -name '*.dart' -o -name '*.xcconfig' -o -name '*.yaml' -o -name '*.yml' \-o -name '*.pbxproj' -o -name '*.entitlements' -o -name '*.html' -o -name '*.xcprivacy' \+ -o -name '*.cs' -o -name '*.rs' -o -name '*.csproj' -o -name '*.xaml' -o -name '*.toml' \\) -print 2>/dev/null \> "$FILELIST"build_blob@@ -337,6 +365,26 @@ while IFS= read -r cfg; dogrep -qE '<widget|xmlns:cdv' "$cfg" 2>/dev/null && IS_IONIC=1done < <(find_app 12 -name 'config.xml')+# ----- Unity, .NET MAUI, Tauri mobile, Kotlin Multiplatform (issue #837) -----+IS_UNITY=0; IS_MAUI=0; IS_TAURI=0; IS_KMP=0+find_app 6 -name 'ProjectVersion.txt' -path '*/ProjectSettings/*' | grep . >/dev/null && IS_UNITY=1+while IFS= read -r cs; do+ grep -qE '<UseMaui>[[:space:]]*true|net[0-9.]+-(ios|android|maccatalyst)' "$cs" 2>/dev/null || continue+ IS_MAUI=1+ grep -qE 'net[0-9.]+-ios' "$cs" 2>/dev/null && IS_IOS=1+ grep -qE 'net[0-9.]+-android' "$cs" 2>/dev/null && IS_AND=1+done < <(find_app 6 -name '*.csproj')+find_app 6 -name 'tauri.conf.json' -o -name 'tauri.conf.json5' -o -name 'Tauri.toml' | grep . >/dev/null && IS_TAURI=1+while IFS= read -r g; do+ grep -qE 'kotlin\("multiplatform"\)|org\.jetbrains\.kotlin\.multiplatform|kotlinMultiplatform' "$g" 2>/dev/null && { IS_KMP=1; break; }+done < <(find_app 6 -name 'build.gradle.kts' -o -name 'build.gradle' -o -name 'libs.versions.toml')+# Unity holds no Xcode or Gradle project until export. The build target names the store, with none named both are scanned.+if [ "$IS_UNITY" -eq 1 ]; then+ case "$(printf '%s' "${CMD:-}" | grep -oiE -e '-buildtarget[[:space:]]+(ios|android)' | head -1 | tr '[:upper:]' '[:lower:]')" in+ *ios) IS_IOS=1 ;; *android) IS_AND=1 ;; *) IS_IOS=1; IS_AND=1 ;;+ esac+fi+# The actual gate the framework checks below use: a committed ios/ folder AND the# invoking command (when known) does not explicitly target Android-only.IOS_TARGET_ACTIVE=0@@ -344,56 +392,51 @@ IOS_TARGET_ACTIVE=0echo "Platforms. iOS=$IS_IOS Android=$IS_AND Web=$IS_WEB"{ [ "$IS_IOS" -eq 1 ] || [ "$IS_AND" -eq 1 ]; } && ANY_NATIVE=1+[ "$IS_IOS" -eq 1 ] && ANY_IOS=1+[ "$IS_AND" -eq 1 ] && ANY_AND=1[ "$IS_RN" -eq 1 ] && ANY_RN=1+# A framework app builds its native project later. Until that exists the store checks have nothing to read.+NEEDS_NATIVE=0+if [ "$IS_IOS" -eq 0 ] && [ "$IS_AND" -eq 0 ]; then+ [ "$IS_RN" -eq 1 ] && { NEEDS_NATIVE=1; NATIVE_HINT="npx expo prebuild"; }+ [ "$IS_IONIC" -eq 1 ] && { NEEDS_NATIVE=1; NATIVE_HINT="npx cap add ios or npx cap add android"; }+ [ "$IS_FLUTTER" -eq 1 ] && { NEEDS_NATIVE=1; NATIVE_HINT="flutter create --platforms ios,android ."; }+ [ "$IS_TAURI" -eq 1 ] && { NEEDS_NATIVE=1; NATIVE_HINT="cargo tauri ios init or cargo tauri android init"; }+fi+[ "$NEEDS_NATIVE" -eq 1 ] && ANY_NEEDS_NATIVE=1[ "$IS_WEB" -eq 1 ] && ANY_WEB=1-echo "Frameworks. Flutter=$IS_FLUTTER ReactNative/Expo=$IS_RN Ionic/Capacitor/Cordova=$IS_IONIC"+echo "Frameworks. Flutter=$IS_FLUTTER ReactNative/Expo=$IS_RN Ionic/Capacitor/Cordova=$IS_IONIC Unity=$IS_UNITY MAUI=$IS_MAUI Tauri=$IS_TAURI KotlinMultiplatform=$IS_KMP"+[ "$IS_UNITY" -eq 1 ] && echo "Unity. No Xcode or Gradle project exists before export, so Info.plist and the Gradle settings were not read. Scan the exported project too."+[ "$IS_TAURI" -eq 1 ] && [ "$IS_IOS" -eq 0 ] && [ "$IS_AND" -eq 0 ] && echo "Tauri. No src-tauri/gen/apple or gen/android folder. Run cargo tauri ios init or cargo tauri android init before a mobile submit, then scan again."[ "$CMD_TARGET_ANDROID_ONLY" -eq 1 ] && echo "Command targets Android only. Apple-only framework checks suppressed for this run."echo ""-# ----- run regulatory deadlines check ------# Tries both ship shapes. nested repo (agent-os/hooks/) and flat ~/.claude.-HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"-DEADLINE_PY=""-for candidate in \- "$HOOK_DIR/../../scripts/deadline-checker.py" \- "$HOOK_DIR/../skills/app-store-compliance/scripts/deadline-checker.py"; do- if [ -f "$candidate" ]; then DEADLINE_PY="$candidate"; break; fi-done-if [ -n "$DEADLINE_PY" ] && [ "${DEADLINE_DONE:-0}" -eq 0 ] && ! tool_ok python3 -c pass; then- echo "Regulatory deadline list skipped. python3 not found."- echo ""-elif [ -n "$DEADLINE_PY" ] && [ "${DEADLINE_DONE:-0}" -eq 0 ]; then- python3 "$DEADLINE_PY" --brief- echo ""-fi-DEADLINE_DONE=1-# ===== shared checks =====# App Store Connect API 4.3 and 4.4 removed the old age-rating declaration endpoints. a pipeline that still calls them stops the release.if grep_has 'appStoreVersions/[^ "]*/ageRatingDeclaration|relationships/ageRatingDeclaration'; then- finding critical "APPLE-ASCAPI-AGERATING-ENDPOINT-REMOVED" "Pipeline calls a removed App Store Connect API age-rating endpoint" "Switch to the current age-rating declaration read and update endpoints (ASC API 4.4 release notes)."+ finding critical "APPLE-ASCAPI-AGERATING-ENDPOINT-REMOVED" "Pipeline calls a removed App Store Connect API age-rating endpoint" "Switch to the current age-rating declaration read and update endpoints (ASC API 4.4 release notes)." src 'appStoreVersions/[^ "]*/ageRatingDeclaration|relationships/ageRatingDeclaration'fi# Genuine placeholder CONTENT only. the bare word "placeholder" matches every SwiftUI# `placeholder:` parameter and a "TODO"/"FIXME" matches normal dev comments, neither of which is a# rejection cause, so match real placeholder markers a reviewer would actually see.if grep_has 'lorem ipsum|example\.(com|org)|YOUR_[A-Z_]+_(KEY|HERE)|INSERT_[A-Z_]+_HERE|dummy (text|content|data)|(john|jane)@example|"Acme( Inc| Corp)?"'; then- finding high "BOTH-PLACEHOLDER" "Placeholder content (lorem ipsum, example.com, dummy text) found in sources" "Replace placeholder text and assets with real content."+ finding high "BOTH-PLACEHOLDER" "Placeholder content (lorem ipsum, example.com, dummy text) found in sources" "Replace placeholder text and assets with real content." src 'lorem ipsum|example\.(com|org)|YOUR_[A-Z_]+_(KEY|HERE)|INSERT_[A-Z_]+_HERE|dummy (text|content|data)|(john|jane)@example|"Acme( Inc| Corp)?"'fi# ROSCA and CA/NY/MA negative-option laws bind regardless of the vacated federal rule.# "call" and "write" match as whole words only, or "renews automatically until cancelled" and# "overwrite ... cancel" read as an instruction to call or write in.if grep_has 'subscri(be|ption)|auto.renew|membership' && grep_has '(^|[^A-Za-z])[Cc]all[^A-Za-z].{0,24}[Cc]ancel|[Cc]ancel.{0,25}[^A-Za-z][Cc]all([^A-Za-z]|$)|[Mm]ail.{0,25}[Cc]ancel|(^|[^A-Za-z])[Ww]rite[^A-Za-z].{0,24}[Cc]ancel|[Cc]ancel.{0,15}(in.person|by.phone|by.mail)'; then- finding high "BOTH-SUBSCRIPTION-HARD-CANCEL" "Subscription cancellation appears to require a phone call, mail, or an in-person visit" "Provide a self-service cancellation path at least as easy as sign-up (FTC Section 5, ROSCA, and CA/NY/MA negative-option laws)."+ finding high "BOTH-SUBSCRIPTION-HARD-CANCEL" "Subscription cancellation appears to require a phone call, mail, or an in-person visit" "Provide a self-service cancellation path at least as easy as sign-up (FTC Section 5, ROSCA, and CA/NY/MA negative-option laws)." src '(^|[^A-Za-z])[Cc]all[^A-Za-z].{0,24}[Cc]ancel|[Cc]ancel.{0,25}[^A-Za-z][Cc]all([^A-Za-z]|$)|[Mm]ail.{0,25}[Cc]ancel|(^|[^A-Za-z])[Ww]rite[^A-Za-z].{0,24}[Cc]ancel|[Cc]ancel.{0,15}(in.person|by.phone|by.mail)'fi# fastlane precheck derived metadata checksif grep_has 'coming soon|coming-soon|will be available|in a future update|stay tuned'; then- finding medium "APPLE-2.3-FUTURE-FUNCTIONALITY" "Future functionality language found (coming soon, beta)" "Describe only what the build does today (fastlane precheck future_functionality, Apple 2.3.1)."+ finding medium "APPLE-2.3-FUTURE-FUNCTIONALITY" "Future functionality language found (coming soon, beta)" "Describe only what the build does today (fastlane precheck future_functionality, Apple 2.3.1)." src 'coming soon|coming-soon|will be available|in a future update|stay tuned'fiif grep_has 'iOS bug|apple bug|broken on iOS'; then- finding medium "APPLE-2.3-NEGATIVE-APPLE-SENTIMENT" "Negative Apple or iOS bug reference in copy" "Remove negative references to Apple and iOS bugs (fastlane precheck negative_apple_sentiment)."+ finding medium "APPLE-2.3-NEGATIVE-APPLE-SENTIMENT" "Negative Apple or iOS bug reference in copy" "Remove negative references to Apple and iOS bugs (fastlane precheck negative_apple_sentiment)." src 'iOS bug|apple bug|broken on iOS'fiif grep_has 'loot ?box|gacha|mystery box|random reward'; then- finding high "BOTH-LOOTBOX-ODDS" "Random reward mechanic present" "Disclose the odds for every random reward before purchase (Apple 3.1.1, Google gambling)."+ finding high "BOTH-LOOTBOX-ODDS" "Random reward mechanic present" "Disclose the odds for every random reward before purchase (Apple 3.1.1, Google gambling)." src 'loot ?box|gacha|mystery box|random reward'fi# ===== Flutter checks =====@@ -414,12 +457,12 @@ fiif [ "$IS_RN" -eq 1 ] && [ "$IOS_TARGET_ACTIVE" -eq 1 ]; thenif grep_has 'react-native-code-push|CodePush\.|expo-updates|Updates\.checkForUpdate|react-native-ota-hot-update|@stallion-js|Stallion\.'; thenif ! grep_has 'reviewNotes|App Review|bug.fix.only|bugfix.only'; then- finding high "RN-OTA-UNDECLARED" "An over-the-air JS bundle updater (CodePush, Expo Updates, or similar) is present" "Disclose the OTA mechanism by name in App Review notes, restrict its use to bug fixes that do not change the app's purpose, UI, or add features beyond what was reviewed (Apple 3.3.2, 2.5.2)."+ finding high "RN-OTA-UNDECLARED" "An over-the-air JS bundle updater (CodePush, Expo Updates, or similar) is present" "Disclose the OTA mechanism by name in App Review notes, restrict its use to bug fixes that do not change the app's purpose, UI, or add features beyond what was reviewed (Apple 3.3.2, 2.5.2)." src 'react-native-code-push|CodePush\.|expo-updates|Updates\.checkForUpdate|react-native-ota-hot-update|@stallion-js|Stallion\.'fifiif grep_has 'Firebase|@react-native-firebase|expo-file-system|expo-application|AsyncStorage|@react-native-async-storage'; thenif ! find_tree -name 'PrivacyInfo.xcprivacy' -print | grep . >/dev/null; then- finding critical "RN-PRIVACY-MANIFEST-MISSING" "React Native native modules that touch required-reason APIs but no PrivacyInfo.xcprivacy anywhere" "Add an app-level PrivacyInfo.xcprivacy. Native modules bundled transitively via JS deps (analytics, storage, device-info libraries) each need their own manifest aggregated in the final IPA; this is easy to miss because the dependency is JS-side."+ finding critical "RN-PRIVACY-MANIFEST-MISSING" "React Native native modules that touch required-reason APIs but no PrivacyInfo.xcprivacy anywhere" "Add an app-level PrivacyInfo.xcprivacy. Native modules bundled transitively via JS deps (analytics, storage, device-info libraries) each need their own manifest aggregated in the final IPA; this is easy to miss because the dependency is JS-side." src 'Firebase|@react-native-firebase|expo-file-system|expo-application|AsyncStorage|@react-native-async-storage'fififi@@ -433,11 +476,11 @@ if [ "$IS_IONIC" -eq 1 ] && [ "$IOS_TARGET_ACTIVE" -eq 1 ]; thenfinding high "IONIC-4.2-THIN-WRAPPER" "WebView/Capacitor/Cordova present with fewer than 2 recognized native-feel plugins (status bar, splash screen, push, haptics)" "This is a heuristic proxy, not the actual Apple 4.2 test (features/content/UI beyond a repackaged website); review manually before treating it as a hard blocker. Add native Capacitor/Cordova plugins for status bar, splash transition, push, and haptics, or ship as an installable PWA to skip App Review entirely."fiif grep_has 'UIWebView'; then- finding critical "IONIC-UIWEBVIEW-DEPRECATED" "Deprecated UIWebView symbol referenced (directly or via a stale plugin)" "Apple auto-rejects (ITMS-90809) any binary statically linking UIWebView. Update every Capacitor/Cordova plugin to a version using WKWebView; a stale plugin can pull this in even when app code never references it."+ finding critical "IONIC-UIWEBVIEW-DEPRECATED" "Deprecated UIWebView symbol referenced (directly or via a stale plugin)" "Apple auto-rejects (ITMS-90809) any binary statically linking UIWebView. Update every Capacitor/Cordova plugin to a version using WKWebView; a stale plugin can pull this in even when app code never references it." src 'UIWebView'fiif grep_has '@capacitor/|Capacitor\.'; thenif ! find_tree -name 'PrivacyInfo.xcprivacy' -print | grep . >/dev/null; then- finding high "IONIC-PRIVACY-MANIFEST-MISSING" "Capacitor/Cordova plugins present but no PrivacyInfo.xcprivacy" "Capacitor plugin manifest support is less standardized than Flutter's; verify each plugin wrapping a native SDK (camera, geolocation, ads) ships PrivacyInfo.xcprivacy, and add the app-level one."+ finding high "IONIC-PRIVACY-MANIFEST-MISSING" "Capacitor/Cordova plugins present but no PrivacyInfo.xcprivacy" "Capacitor plugin manifest support is less standardized than Flutter's; verify each plugin wrapping a native SDK (camera, geolocation, ads) ships PrivacyInfo.xcprivacy, and add the app-level one." src '@capacitor/|Capacitor\.'fififi@@ -445,77 +488,77 @@ fi# ===== iOS checks =====if [ "$IS_IOS" -eq 1 ]; thenif release_string_has 'localhost|127\.0\.0\.1|staging\.[a-z]|ngrok\.io'; then- finding critical "APPLE-2.1-STAGING-BACKEND" "A release-build string points at localhost or a staging host" "Point the release build at the live production backend. A localhost/staging URL inside #if DEBUG or a comment is fine. this only flags strings the release build actually compiles."+ finding critical "APPLE-2.1-STAGING-BACKEND" "A release-build string points at localhost or a staging host" "Point the release build at the live production backend. A localhost/staging URL inside #if DEBUG or a comment is fine. this only flags strings the release build actually compiles." src 'localhost|127\.0\.0\.1|staging\.[a-z]|ngrok\.io'fiif grep_has 'signIn|logIn|LoginView|OAuth|FirebaseAuth|createAccount|signUp'; thenif ! grep_has 'deleteAccount|delete_account|account deletion|deleteUser'; then- finding critical "APPLE-5.1.1-NO-ACCOUNT-DELETION" "Account creation found but no in app account deletion" "Add an in app account deletion flow (Apple 5.1.1(v))."+ finding critical "APPLE-5.1.1-NO-ACCOUNT-DELETION" "Account creation found but no in app account deletion" "Add an in app account deletion flow (Apple 5.1.1(v))." src 'signIn|logIn|LoginView|OAuth|FirebaseAuth|createAccount|signUp'fifiif grep_has 'AVCaptureDevice|UIImagePickerController'; then- grep_has 'NSCameraUsageDescription' || finding critical "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Camera used without NSCameraUsageDescription" "Add NSCameraUsageDescription with a specific reason."+ grep_has 'NSCameraUsageDescription' || finding critical "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Camera used without NSCameraUsageDescription" "Add NSCameraUsageDescription with a specific reason." src 'AVCaptureDevice|UIImagePickerController'fiif grep_has 'CLLocationManager'; then- grep_has 'NSLocation.*UsageDescription' || finding critical "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Location used without a location usage description" "Add the matching NSLocation usage description with a specific reason."+ grep_has 'NSLocation.*UsageDescription' || finding critical "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Location used without a location usage description" "Add the matching NSLocation usage description with a specific reason." src 'CLLocationManager'fiif grep_has 'PHPhotoLibrary|PHPicker'; then- grep_has 'NSPhotoLibrary.*UsageDescription' || finding high "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Photos used without a photo library usage description" "Add NSPhotoLibraryUsageDescription with a specific reason."+ grep_has 'NSPhotoLibrary.*UsageDescription' || finding high "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Photos used without a photo library usage description" "Add NSPhotoLibraryUsageDescription with a specific reason." src 'PHPhotoLibrary|PHPicker'fiif grep_has 'CNContactStore'; then- grep_has 'NSContactsUsageDescription' || finding high "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Contacts used without NSContactsUsageDescription" "Add NSContactsUsageDescription with a specific reason."+ grep_has 'NSContactsUsageDescription' || finding high "APPLE-5.1.1-MISSING-USAGE-DESCRIPTION" "Contacts used without NSContactsUsageDescription" "Add NSContactsUsageDescription with a specific reason." src 'CNContactStore'fiif grep_has 'FacebookLogin|GoogleSignIn|GIDSignIn|LoginWithFacebook'; then- grep_has 'SignInWithApple|ASAuthorizationAppleIDProvider' || finding high "APPLE-4.8-SOCIAL-LOGIN-ONLY" "Third party social login without Sign in with Apple" "Add Sign in with Apple or an equal privacy preserving login (Apple 4.8)."+ grep_has 'SignInWithApple|ASAuthorizationAppleIDProvider' || finding high "APPLE-4.8-SOCIAL-LOGIN-ONLY" "Third party social login without Sign in with Apple" "Add Sign in with Apple or an equal privacy preserving login (Apple 4.8)." src 'FacebookLogin|GoogleSignIn|GIDSignIn|LoginWithFacebook'fi# Hide My Email relay addresses now also come from private.icloud.com (Apple news 1ptvdtcm, corrected 24 Aug 2026).if grep_has 'privaterelay\.appleid\.com' && ! grep_has 'private\.icloud\.com'; then- finding critical "APPLE-4.0-SIWA-RELAY-DOMAIN" "Sign in with Apple relay allowlist accepts only privaterelay.appleid.com" "Accept private.icloud.com as well, everywhere relay addresses are validated or allowlisted."+ finding critical "APPLE-4.0-SIWA-RELAY-DOMAIN" "Sign in with Apple relay allowlist accepts only privaterelay.appleid.com" "Accept private.icloud.com as well, everywhere relay addresses are validated or allowlisted." src 'privaterelay\.appleid\.com'fi# Age assurance. a parent can withdraw consent, Apple then blocks launch. the app must handle RESCIND_CONSENT.if grep_has 'DeclaredAgeRange|AgeRangeService' && ! grep_has 'RESCIND_CONSENT|rescindConsent'; then- finding high "APPLE-5.1.1-RESCIND-CONSENT-UNHANDLED" "Declared Age Range used without RESCIND_CONSENT handling" "Handle the RESCIND_CONSENT server notification, revoke the minor session and consent-scoped data, and build with the iOS 26.2 SDK or later."+ finding high "APPLE-5.1.1-RESCIND-CONSENT-UNHANDLED" "Declared Age Range used without RESCIND_CONSENT handling" "Handle the RESCIND_CONSENT server notification, revoke the minor session and consent-scoped data, and build with the iOS 26.2 SDK or later." src 'DeclaredAgeRange|AgeRangeService'fi# The no-entitlement external purchase link is a US-storefront carve-out only. everywhere else it is still 3.1.1.if grep_has 'ExternalPurchaseLink|external-purchase-link|openExternalPurchaseLink' && ! grep_has 'Storefront|storefront|countryCode'; then- finding high "APPLE-3.1.1-EXTERNAL-LINK-REGION-GATING" "External purchase link is not gated on the storefront" "Show the link only on the US storefront (or where you hold the entitlement). gate on Storefront.current or countryCode."+ finding high "APPLE-3.1.1-EXTERNAL-LINK-REGION-GATING" "External purchase link is not gated on the storefront" "Show the link only on the US storefront (or where you hold the entitlement). gate on Storefront.current or countryCode." src 'ExternalPurchaseLink|external-purchase-link|openExternalPurchaseLink'fi# On-Demand Resources are deprecated from the 27 OS family (WWDC26).if grep_has 'NSBundleResourceRequest|OnDemandResources|on-demand-resource'; then- finding high "APPLE-ODR-DEPRECATED-27" "On-Demand Resources in use, deprecated starting iOS 27" "Migrate tagged resources to the Background Assets framework."+ finding high "APPLE-ODR-DEPRECATED-27" "On-Demand Resources in use, deprecated starting iOS 27" "Migrate tagged resources to the Background Assets framework." src 'NSBundleResourceRequest|OnDemandResources|on-demand-resource'fi# Since September 2026 the social media capability question gates every submission (Apple news 0d2gpmml).if grep_has 'newsFeed|NewsFeed|followers|chatRoom|ChatRoom|DirectMessage|liveStream|LiveStream'; then- finding medium "APPLE-2.3.6-SOCIAL-MEDIA-DECLARATION" "Social features detected, confirm the social media capability declaration in App Store Connect" "Answer the social media question before submitting. it sets a 13+ minimum and requires Declared Age Range for under-13 users."+ finding medium "APPLE-2.3.6-SOCIAL-MEDIA-DECLARATION" "Social features detected, confirm the social media capability declaration in App Store Connect" "Answer the social media question before submitting. it sets a 13+ minimum and requires Declared Age Range for under-13 users." src 'newsFeed|NewsFeed|followers|chatRoom|ChatRoom|DirectMessage|liveStream|LiveStream'fi# Match the tracking SDKs by their own type names / imports, never the bare words "Adjust" or# "Branch", which collide with ordinary English ("Adjust times", a git branch) and false-flag a# tracking SDK that is not present.if grep_has 'AppsFlyerLib|import AppsFlyer|AdjustConfig|AdjustEvent|import Adjust[^A-Za-z]|BranchEvent|BranchUniversalObject|import Branch[^A-Za-z]|FBSDKCoreKit|FBSDKLogin|ASIdentifierManager|advertisingIdentifier'; then- grep_has 'ATTrackingManager|NSUserTrackingUsageDescription' || finding high "APPLE-5.1.2-MISSING-ATT" "Tracking SDK without App Tracking Transparency" "Call the ATT prompt and add NSUserTrackingUsageDescription (Apple 5.1.2)."+ grep_has 'ATTrackingManager|NSUserTrackingUsageDescription' || finding high "APPLE-5.1.2-MISSING-ATT" "Tracking SDK without App Tracking Transparency" "Call the ATT prompt and add NSUserTrackingUsageDescription (Apple 5.1.2)." src 'AppsFlyerLib|import AppsFlyer|AdjustConfig|AdjustEvent|import Adjust[^A-Za-z]|BranchEvent|BranchUniversalObject|import Branch[^A-Za-z]|FBSDKCoreKit|FBSDKLogin|ASIdentifierManager|advertisingIdentifier'fiif grep_has 'Stripe|PayPalCheckout|braintree|razorpay'; then- grep_has "StoreKit|SKProduct|Product\.purchase|$XPLAT_IAP" || finding critical "APPLE-3.1.1-EXTERNAL-PAYMENT" "External payment SDK without StoreKit" "Route digital goods through in app purchase unless the app is a documented exempt category (Apple 3.1.1)."+ grep_has "StoreKit|SKProduct|Product\.purchase|$XPLAT_IAP" || finding critical "APPLE-3.1.1-EXTERNAL-PAYMENT" "External payment SDK without StoreKit" "Route digital goods through in app purchase unless the app is a documented exempt category (Apple 3.1.1)." src 'Stripe|PayPalCheckout|braintree|razorpay'fiif grep_has 'api\.openai\.com|anthropic|generativelanguage|chat/completions'; then- finding medium "APPLE-5.1.2-AI-NO-CONSENT-MODAL" "Third party AI integration detected" "If personal data is sent, show a consent modal naming the AI provider and data types (Apple 5.1.2)."+ finding medium "APPLE-5.1.2-AI-NO-CONSENT-MODAL" "Third party AI integration detected" "If personal data is sent, show a consent modal naming the AI provider and data types (Apple 5.1.2)." src 'api\.openai\.com|anthropic|generativelanguage|chat/completions'fiif ! grep_has 'privacyPolicy|privacy-policy|PrivacyPolicy'; thenfinding high "APPLE-5.1.1-MISSING-PRIVACY-POLICY" "No privacy policy reference found in sources" "Publish a privacy policy, link it in App Store Connect, and reach it from inside the app."fiif grep_has 'UserDefaults\.standard'; thenif grep_has 'token|password|credential|secret|jwt' && ! grep_has 'Keychain|SecItemAdd|SecItemUpdate'; then- finding high "BOTH-SECURE-STORAGE" "Plain UserDefaults storage is used for sensitive credentials" "Store access tokens and sensitive credentials in iOS Keychain instead."+ finding high "BOTH-SECURE-STORAGE" "Plain UserDefaults storage is used for sensitive credentials" "Store access tokens and sensitive credentials in iOS Keychain instead." src 'token|password|credential|secret|jwt'fifiif grep_has 'CFBundleURLSchemes'; thenif ! grep_has 'apple-app-site-association'; then- finding high "BOTH-UNSAFE-DEEPLINK" "Custom URL deep link schemes declared without Universal Links configuration" "Configure Universal Links (iOS) using apple-app-site-association verification to prevent URL hijacking."+ finding high "BOTH-UNSAFE-DEEPLINK" "Custom URL deep link schemes declared without Universal Links configuration" "Configure Universal Links (iOS) using apple-app-site-association verification to prevent URL hijacking." src 'CFBundleURLSchemes'fifi# Privacy manifest, the top modern Apple upload rejection since 2024if grep_has 'Firebase|Alamofire|UserDefaults|systemUptime|FileManager\.default|ProcessInfo'; thenif ! find_tree -name 'PrivacyInfo.xcprivacy' -print | grep . >/dev/null; then- finding critical "APPLE-PRIVACY-MANIFEST-MISSING" "Required reason APIs or SDKs present but no PrivacyInfo.xcprivacy" "Add a privacy manifest with approved reason codes and tracking domains, and confirm each SDK ships its signed manifest."+ finding critical "APPLE-PRIVACY-MANIFEST-MISSING" "Required reason APIs or SDKs present but no PrivacyInfo.xcprivacy" "Add a privacy manifest with approved reason codes and tracking domains, and confirm each SDK ships its signed manifest." src 'Firebase|Alamofire|UserDefaults|systemUptime|FileManager\.default|ProcessInfo'fifi@@ -525,7 +568,7 @@ if [ "$IS_IOS" -eq 1 ]; thenMANIFEST_VALIDATOR=""for candidate in \"$(dirname "$0")/../../scripts/validate-privacy-manifest.py" \- "$HOME/.claude/skills/app-store-compliance/scripts/validate-privacy-manifest.py"; do+ "${HOME:-}/.claude/skills/app-store-compliance/scripts/validate-privacy-manifest.py"; do[ -f "$candidate" ] && { MANIFEST_VALIDATOR="$candidate"; break; }doneif [ -n "$MANIFEST_VALIDATOR" ] && command -v python3 >/dev/null 2>&1; then@@ -550,48 +593,48 @@ if [ "$IS_IOS" -eq 1 ]; thenelif find_app 12 -name 'PrivacyInfo.xcprivacy' | grep . >/dev/null; thenfinding medium "APPLE-MANIFEST-VALIDATOR-UNAVAILABLE" "Privacy manifests present but python3 or scripts/validate-privacy-manifest.py is missing, so their internals were not validated" "Install python3 and keep scripts/validate-privacy-manifest.py next to the guard, or run plutil -lint on each manifest by hand."fi- grep_has 'ITSAppUsesNonExemptEncryption' || finding high "APPLE-EXPORT-COMPLIANCE-MISSING" "ITSAppUsesNonExemptEncryption not set" "Set it in Info.plist or the build stalls in Missing Compliance and never reaches review."+ [ "$IS_UNITY" -eq 1 ] || grep_has 'ITSAppUsesNonExemptEncryption' || finding high "APPLE-EXPORT-COMPLIANCE-MISSING" "ITSAppUsesNonExemptEncryption not set" "Set it in Info.plist or the build stalls in Missing Compliance and never reaches review."if grep_has 'SKProduct|Product\.purchase|StoreKit'; then- grep_has 'restorePurchases|restoreCompletedTransactions|AppStore\.sync|Restore Purchases' || finding high "APPLE-RESTORE-PURCHASES-MISSING" "StoreKit purchases without a Restore Purchases control" "Add a visible Restore Purchases control. Required for non consumables."+ grep_has 'restorePurchases|restoreCompletedTransactions|AppStore\.sync|Restore Purchases' || finding high "APPLE-RESTORE-PURCHASES-MISSING" "StoreKit purchases without a Restore Purchases control" "Add a visible Restore Purchases control. Required for non consumables." src 'SKProduct|Product\.purchase|StoreKit'fiif grep_has 'deleteAccount|delete account'; then- grep_has 'mailto:|deactivate' && finding high "APPLE-ACCOUNT-DELETION-WEAK" "Account removal may be deactivate or mailto only" "Provide genuine in app deletion of the account and its data, not a deactivate or external form."+ grep_has 'mailto:|deactivate' && finding high "APPLE-ACCOUNT-DELETION-WEAK" "Account removal may be deactivate or mailto only" "Provide genuine in app deletion of the account and its data, not a deactivate or external form." src 'mailto:|deactivate'fiif grep_has 'fixed-odds|betting'; then- finding critical "APPLE-GAMBLING-BRAZIL-LICENSE" "Fixed-odds or betting keyword detected in sources" "Provide a valid fixed-odds betting license from the Secretariat of Prizes and Bets (SPA) in App Review Info, set age rating to A18, and submit a new version to trigger verification (Apple policy May 8, 2026)."+ finding critical "APPLE-GAMBLING-BRAZIL-LICENSE" "Fixed-odds or betting keyword detected in sources" "Provide a valid fixed-odds betting license from the Secretariat of Prizes and Bets (SPA) in App Review Info, set age rating to A18, and submit a new version to trigger verification (Apple policy May 8, 2026)." src 'fixed-odds|betting'fiif grep_has 'Image\('; thenif ! grep_has 'accessibilityLabel|accessibilityIdentifier|accessibilityHidden|accessibilityElement'; then- finding medium "APPLE-ACCESSIBILITY-VOICEOVER" "SwiftUI Image or UIKit component without VoiceOver accessibility attribute" "Provide an accessibilityLabel or use decorative initializers (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-VOICEOVER" "SwiftUI Image or UIKit component without VoiceOver accessibility attribute" "Provide an accessibilityLabel or use decorative initializers (Apple Design - Accessibility)." src 'Image\('fifiif grep_has '\.system\(size:'; then- finding medium "APPLE-ACCESSIBILITY-DYNAMICTYPE" "Hardcoded system font size detected" "Use relative SwiftUI font styles or preferredFont APIs to support Dynamic Type (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-DYNAMICTYPE" "Hardcoded system font size detected" "Use relative SwiftUI font styles or preferredFont APIs to support Dynamic Type (Apple Design - Accessibility)." src '\.system\(size:'fiif grep_has 'withAnimation|UIView\.animate'; thenif ! grep_has 'isReduceMotionEnabled|accessibilityReduceMotion'; then- finding medium "APPLE-ACCESSIBILITY-REDUCEMOTION" "Animations implemented without checking Reduce Motion" "Respect the Reduce Motion accessibility setting before executing complex custom animations (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-REDUCEMOTION" "Animations implemented without checking Reduce Motion" "Respect the Reduce Motion accessibility setting before executing complex custom animations (Apple Design - Accessibility)." src 'withAnimation|UIView\.animate'fifiif grep_has 'UIColor\(\s*red:'; thenif ! grep_has 'isDarkerSystemColorsEnabled|darkerSystemColors'; then- finding medium "APPLE-ACCESSIBILITY-COLORCONTRAST" "Raw RGB UIColor without system dynamic color or high contrast checks" "Utilize dynamic named asset colors or check isDarkerSystemColorsEnabled (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-COLORCONTRAST" "Raw RGB UIColor without system dynamic color or high contrast checks" "Utilize dynamic named asset colors or check isDarkerSystemColorsEnabled (Apple Design - Accessibility)." src 'UIColor\(\s*red:'fifiif grep_has 'onTapGesture|Button'; thenif ! grep_has 'FeedbackGenerator|CoreHaptics'; then- finding medium "APPLE-ACCESSIBILITY-HAPTICS" "Taps or button interactions without tactile feedback" "Integrate haptic feedback generators to improve interaction accessibility (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-HAPTICS" "Taps or button interactions without tactile feedback" "Integrate haptic feedback generators to improve interaction accessibility (Apple Design - Accessibility)." src 'onTapGesture|Button'fifiif grep_has 'focusable'; thenif ! grep_has 'FocusState|focused'; then- finding medium "APPLE-ACCESSIBILITY-KEYBOARD" "Focusable controls declared without focus state tracking" "Support physical keyboards with FocusState tracking (Apple Design - Accessibility)."+ finding medium "APPLE-ACCESSIBILITY-KEYBOARD" "Focusable controls declared without focus state tracking" "Support physical keyboards with FocusState tracking (Apple Design - Accessibility)." src 'focusable'fififinding medium "APPLE-2.3-AGE-RATING-2026" "Verify the 2026 age rating questionnaire" "Answer the updated age rating questions (13 plus, 16 plus, 18 plus) in App Store Connect."if grep_has 'email|phoneNumber|userName|location|coordinates'; thenif ! grep_has 'NSPrivacyCollectedDataTypes|privacyNutritionLabels|privacy-nutrition-labels'; then- finding high "APPLE-PRIVACY-NUTRITION-LABELS" "Missing Privacy Nutrition Labels data type declarations" "Update the app privacy manifest (PrivacyInfo.xcprivacy) with NSPrivacyCollectedDataTypes and complete corresponding Nutrition Labels in App Store Connect."+ finding high "APPLE-PRIVACY-NUTRITION-LABELS" "Missing Privacy Nutrition Labels data type declarations" "Update the app privacy manifest (PrivacyInfo.xcprivacy) with NSPrivacyCollectedDataTypes and complete corresponding Nutrition Labels in App Store Connect." src 'email|phoneNumber|userName|location|coordinates'fififi@@ -599,65 +642,65 @@ fi# ===== Android checks =====if [ "$IS_AND" -eq 1 ]; thenif grep_has 'ACCESS_BACKGROUND_LOCATION'; then- finding critical "GOOGLE-PERM-BACKGROUND-LOCATION" "Background location permission declared" "Justify with a core feature and prominent disclosure, or use foreground location."+ finding critical "GOOGLE-PERM-BACKGROUND-LOCATION" "Background location permission declared" "Justify with a core feature and prominent disclosure, or use foreground location." src 'ACCESS_BACKGROUND_LOCATION'fiif grep_has 'MANAGE_EXTERNAL_STORAGE'; then- finding critical "GOOGLE-PERM-ALL-FILES" "All files access declared" "Use scoped storage. Request all files access only for a qualifying use case."+ finding critical "GOOGLE-PERM-ALL-FILES" "All files access declared" "Use scoped storage. Request all files access only for a qualifying use case." src 'MANAGE_EXTERNAL_STORAGE'fiif grep_has 'android\.permission\.(READ_SMS|SEND_SMS|RECEIVE_SMS|READ_CALL_LOG|WRITE_CALL_LOG)'; then- finding critical "GOOGLE-PERM-SMS-CALLLOG" "SMS or Call Log permission declared" "Use the permissions declaration for an approved core use case, or drop it."+ finding critical "GOOGLE-PERM-SMS-CALLLOG" "SMS or Call Log permission declared" "Use the permissions declaration for an approved core use case, or drop it." src 'android\.permission\.(READ_SMS|SEND_SMS|RECEIVE_SMS|READ_CALL_LOG|WRITE_CALL_LOG)'fiif grep_has 'BIND_ACCESSIBILITY_SERVICE|AccessibilityService'; then- finding critical "GOOGLE-PERM-ACCESSIBILITY-MISUSE" "AccessibilityService present" "Use it only for genuine accessibility and declare the use, or remove it."+ finding critical "GOOGLE-PERM-ACCESSIBILITY-MISUSE" "AccessibilityService present" "Use it only for genuine accessibility and declare the use, or remove it." src 'BIND_ACCESSIBILITY_SERVICE|AccessibilityService'fiif grep_has 'Stripe|PayPal|braintree|razorpay'; then- grep_has "BillingClient|com\.android\.billingclient|$XPLAT_IAP" || finding critical "GOOGLE-PLAY-BILLING" "External payment without Play Billing" "Use Play Billing for in app digital goods."+ grep_has "BillingClient|com\.android\.billingclient|$XPLAT_IAP" || finding critical "GOOGLE-PLAY-BILLING" "External payment without Play Billing" "Use Play Billing for in app digital goods." src 'Stripe|PayPal|braintree|razorpay'fi# Payments policy exception is literal. only a tax-exempt charity may take donations outside Play# billing (AnkiDroid, August 2026). A donate link to a funding platform is a Payments violation.if grep_has 'opencollective\.com|ko-fi\.com|patreon\.com|buymeacoffee\.com|github\.com/sponsors|liberapay\.com|paypal\.com/donate'; then- finding high "GOOGLE-PAYMENTS-DONATION-LINK" "In-app donation link to a payment page outside Play billing" "Remove the donation entry point from the Play build or sell it through Play billing. Only a tax-exempt charity (501(c)(3)-class) may bypass Play billing, Google rejects 501(c)(6) and unincorporated projects (Payments policy)."+ finding high "GOOGLE-PAYMENTS-DONATION-LINK" "In-app donation link to a payment page outside Play billing" "Remove the donation entry point from the Play build or sell it through Play billing. Only a tax-exempt charity (501(c)(3)-class) may bypass Play billing, Google rejects 501(c)(6) and unincorporated projects (Payments policy)." src 'opencollective\.com|ko-fi\.com|patreon\.com|buymeacoffee\.com|github\.com/sponsors|liberapay\.com|paypal\.com/donate'fi# Since 3 August 2026 the developer bears chargeback costs. An app on Play billing that never# handles the refund-review notification loses every fraudulent dispute by default.# New apps and updates need Play Billing Library 8 or later since 31 August 2026 (deprecation ladder, extension to 1 November 2026).BILLING_MAJOR="$(grep -E '/build\.gradle(\.kts)?$' "$FILELIST" | tr '\n' '\0' | xargs -0 grep -hoE 'com\.android\.billingclient:billing(-ktx)?:[0-9]+' 2>/dev/null | grep -oE '[0-9]+$' | sort -n | tail -1)"if [ -n "$BILLING_MAJOR" ] && [ "$BILLING_MAJOR" -lt 8 ]; then- finding critical "GOOGLE-PLAY-BILLING-V8-REQUIRED" "Play Billing Library $BILLING_MAJOR.x, new apps and updates need version 8 or later since 31 August 2026" "Upgrade com.android.billingclient:billing to 8.x, or request the Play Console extension available until 1 November 2026."+ finding critical "GOOGLE-PLAY-BILLING-V8-REQUIRED" "Play Billing Library $BILLING_MAJOR.x, new apps and updates need version 8 or later since 31 August 2026" "Upgrade com.android.billingclient:billing to 8.x, or request the Play Console extension available until 1 November 2026." src 'billingclient'fiif grep_has 'BillingClient|com\.android\.billingclient'; then- grep_has 'PendingRefundReviewNotification|[Rr]eview[Rr]efund' || finding medium "GOOGLE-PLAY-CHARGEBACK-LIABILITY" "Play billing without chargeback dispute handling" "Handle PendingRefundReviewNotification and call the Review Refund API within 24 hours with the refund preference and usage evidence (Play Console Help answer 17068375)."+ grep_has 'PendingRefundReviewNotification|[Rr]eview[Rr]efund' || finding medium "GOOGLE-PLAY-CHARGEBACK-LIABILITY" "Play billing without chargeback dispute handling" "Handle PendingRefundReviewNotification and call the Review Refund API within 24 hours with the refund preference and usage evidence (Play Console Help answer 17068375)." src 'BillingClient|com\.android\.billingclient'fi# From 30 September 2026 regulated categories must publish from an organization account with a D-U-N-S number.if grep_has 'VpnService|HealthConnect|health\.connect|BankAccount|cryptocurrency'; then- finding high "GOOGLE-ORG-REGISTRATION-REQUIRED" "Regulated-category signals (VPN, health, finance), organization account required from 30 Sep 2026" "Publish from an organization account with a D-U-N-S number matching the Dun and Bradstreet profile (Play Console Help 10788890)."+ finding high "GOOGLE-ORG-REGISTRATION-REQUIRED" "Regulated-category signals (VPN, health, finance), organization account required from 30 Sep 2026" "Publish from an organization account with a D-U-N-S number matching the Dun and Bradstreet profile (Play Console Help 10788890)." src 'VpnService|HealthConnect|health\.connect|BankAccount|cryptocurrency'fi# Geofencing is no longer an approved foreground-service use case for API 37 targets (Play Console Help 16965181).if grep_has 'FOREGROUND_SERVICE_LOCATION' && grep_has '[Gg]eofenc'; then- finding high "GOOGLE-FGS-GEOFENCE-REMOVED" "Foreground service used for geofencing" "Move to the Geofence API (GeofencingClient) and drop FOREGROUND_SERVICE_LOCATION if geofencing was its only use."+ finding high "GOOGLE-FGS-GEOFENCE-REMOVED" "Foreground service used for geofencing" "Move to the Geofence API (GeofencingClient) and drop FOREGROUND_SERVICE_LOCATION if geofencing was its only use." src '[Gg]eofenc'fi# Random or anonymous chat is now in scope of Age-Restricted, Families, and Child Safety Standards (26 Aug 2026).if grep_has '[Rr]andom chat|[Aa]nonymous chat|chat with strangers|Omegle' && ! grep_has 'ageGate|minorBlock|csae'; then- finding critical "GOOGLE-ANON-CHAT-MINOR-BLOCK" "Random or anonymous chat without minor blocking and child-safety standards" "Enable Play Console minor blocking, exclude children from the target audience, publish CSAE standards, add in-app reporting and a child-safety contact."+ finding critical "GOOGLE-ANON-CHAT-MINOR-BLOCK" "Random or anonymous chat without minor blocking and child-safety standards" "Enable Play Console minor blocking, exclude children from the target audience, publish CSAE standards, add in-app reporting and a child-safety contact." src '[Rr]andom chat|[Aa]nonymous chat|chat with strangers|Omegle'fi# Generative image or video apps need NCII controls and a full-access test account (Android Developers Blog, 25 Aug 2026).if grep_has 'generateImage|imageGeneration|text-to-image|faceSwap|stable-diffusion' && ! grep_has '[Mm]oderation|safetyClassifier|contentFilter'; then- finding high "GOOGLE-GENAI-NCII-CONTROLS" "Generative image or video feature without moderation controls" "Add input and output moderation for intimate and deepfake content, document tested safety prompts, and give the reviewer a full-access test account."+ finding high "GOOGLE-GENAI-NCII-CONTROLS" "Generative image or video feature without moderation controls" "Add input and output moderation for intimate and deepfake content, document tested safety prompts, and give the reviewer a full-access test account." src 'generateImage|imageGeneration|text-to-image|faceSwap|stable-diffusion'fi# From February 2027 release builds must be R8-optimized (25 percent minimum coverage, Play Console Help 17492799).R8_ON=0while IFS= read -r g; dogrep -qE '(isMinifyEnabled|minifyEnabled)[[:space:]=]+true' "$g" 2>/dev/null && { R8_ON=1; break; }done < <(find_tree -type f \( -name '*.gradle' -o -name '*.kts' \) -print)- if [ "$R8_ON" -eq 0 ]; then+ if [ "$R8_ON" -eq 0 ] && [ "$IS_UNITY" -eq 0 ] && [ "$IS_MAUI" -eq 0 ]; thenfinding high "ANDROID-R8-OPTIMIZATION-MISSING" "No release build type with minifyEnabled true" "Enable R8 (isMinifyEnabled = true, isShrinkResources = true) in the release build type before February 2027."fi# From April 2027 sign-in apps must restore sign-in state on a new device (Restore Credentials API).if grep_has 'signInWith|CredentialManager|FirebaseAuth|LoginActivity' && ! grep_has 'RestoreCredential'; then- finding medium "ANDROID-RESTORE-CREDENTIALS-REQUIRED" "Sign-in present without Restore Credentials integration" "Create a restore credential on sign-in and restore it after device transfer (Play technical quality requirement, April 2027)."+ finding medium "ANDROID-RESTORE-CREDENTIALS-REQUIRED" "Sign-in present without Restore Credentials integration" "Create a restore credential on sign-in and restore it after device transfer (Play technical quality requirement, April 2027)." src 'signInWith|CredentialManager|FirebaseAuth|LoginActivity'fiif grep_has 'firebase-analytics|com\.google\.android\.gms\.ads|appsflyer|com\.adjust|com\.facebook'; then- finding high "GOOGLE-DATASAFETY-MISMATCH" "Analytics or ad SDK present. Verify the Data Safety form" "Declare every collection and sharing accurately. Data Safety mismatch is the top Google rejection."+ finding high "GOOGLE-DATASAFETY-MISMATCH" "Analytics or ad SDK present. Verify the Data Safety form" "Declare every collection and sharing accurately. Data Safety mismatch is the top Google rejection." src 'firebase-analytics|com\.google\.android\.gms\.ads|appsflyer|com\.adjust|com\.facebook'fiif ! grep_has 'privacyPolicy|privacy-policy'; thenfinding high "GOOGLE-MISSING-PRIVACY-POLICY" "No privacy policy reference found" "Publish a privacy policy and set its URL in the Play Console store listing."@@ -666,61 +709,61 @@ if [ "$IS_AND" -eq 1 ]; then# android/app/build.gradle was never read. Play rejects new apps and updates below API 36 since 31 August 2026.TSDK="$(grep -E '/build\.gradle(\.kts)?$' "$FILELIST" | tr '\n' '\0' | xargs -0 grep -hoE 'targetSdk(Version)?[[:space:]=]+[0-9]+' 2>/dev/null | grep -oE '[0-9]+' | sort -n | tail -1)"if [ -n "$TSDK" ] && [ "$TSDK" -lt 36 ]; then- finding critical "GOOGLE-TARGET-API" "targetSdk is $TSDK, below the API 36 floor Play enforces for new apps and updates since 31 August 2026" "Target API 36 or higher (Wear OS and Automotive 35, TV and XR 34), or request the Play Console extension available until 1 November 2026."+ finding critical "GOOGLE-TARGET-API" "targetSdk is $TSDK, below the API 36 floor Play enforces for new apps and updates since 31 August 2026" "Target API 36 or higher (Wear OS and Automotive 35, TV and XR 34), or request the Play Console extension available until 1 November 2026." src 'targetSdk'fi# Android 17 (API 37) targets. contacts picker, location button scope, and local network permission (27 Jan 2027).if [ -n "$TSDK" ] && [ "$TSDK" -ge 37 ] 2>/dev/null; thenif grep_has 'READ_CONTACTS' && ! grep_has 'ACTION_PICK|ContactPicker'; then- finding high "GOOGLE-CONTACTS-PICKER-REQUIRED" "READ_CONTACTS on an API 37 target where the Contact Picker may suffice" "Use the Android Contact Picker for one-off selection and keep READ_CONTACTS only for a declared core use (Play Console Help 16909972)."+ finding high "GOOGLE-CONTACTS-PICKER-REQUIRED" "READ_CONTACTS on an API 37 target where the Contact Picker may suffice" "Use the Android Contact Picker for one-off selection and keep READ_CONTACTS only for a declared core use (Play Console Help 16909972)." src 'READ_CONTACTS'fiif grep_has 'ACCESS_FINE_LOCATION|ACCESS_COARSE_LOCATION' && ! grep_has 'onlyForLocationButton'; then- finding high "GOOGLE-LOCATION-BUTTON-SCOPE" "Location requested on an API 37 target without the location button scope" "Scope one-shot location to the Android location button with the onlyForLocationButton manifest flag (Play Console Help 16909972)."+ finding high "GOOGLE-LOCATION-BUTTON-SCOPE" "Location requested on an API 37 target without the location button scope" "Scope one-shot location to the Android location button with the onlyForLocationButton manifest flag (Play Console Help 16909972)." src 'ACCESS_FINE_LOCATION|ACCESS_COARSE_LOCATION'fiif grep_has 'NsdManager|MulticastSocket|_tcp\.local|mDNS' && ! grep_has 'ACCESS_LOCAL_NETWORK'; then- finding high "ANDROID-LOCAL-NETWORK-PERMISSION" "Local network discovery on an API 37 target without ACCESS_LOCAL_NETWORK" "Declare and request android.permission.ACCESS_LOCAL_NETWORK before any LAN discovery or connection (Android 17 behavior changes)."+ finding high "ANDROID-LOCAL-NETWORK-PERMISSION" "Local network discovery on an API 37 target without ACCESS_LOCAL_NETWORK" "Declare and request android.permission.ACCESS_LOCAL_NETWORK before any LAN discovery or connection (Android 17 behavior changes)." src 'NsdManager|MulticastSocket|_tcp\.local|mDNS'fifiif grep_has 'DexClassLoader|PathClassLoader|loadDex'; then- finding high "ANDROID-DYNAMIC-CODE-LOADING" "Dynamic code loading at runtime" "Ship all code in the package. Server changes are data, not executable code."+ finding high "ANDROID-DYNAMIC-CODE-LOADING" "Dynamic code loading at runtime" "Ship all code in the package. Server changes are data, not executable code." src 'DexClassLoader|PathClassLoader|loadDex'fiif grep_has 'getSharedPreferences'; thenif grep_has 'token|password|credential|secret|jwt' && ! grep_has 'EncryptedSharedPreferences|KeyStore|SQLCipher'; then- finding high "BOTH-SECURE-STORAGE" "Plain SharedPreferences storage is used for sensitive credentials" "Store access tokens and sensitive credentials in Android EncryptedSharedPreferences / Keystore instead."+ finding high "BOTH-SECURE-STORAGE" "Plain SharedPreferences storage is used for sensitive credentials" "Store access tokens and sensitive credentials in Android EncryptedSharedPreferences / Keystore instead." src 'token|password|credential|secret|jwt'fifiif grep_has 'allowBackup="true"'; thenif ! grep_has 'dataExtractionRules|fullBackupContent|allowBackup="false"'; then- finding high "ANDROID-INSECURE-BACKUP" "Android allowBackup is enabled without strict filters" "Disable backups using android:allowBackup=\"false\", or restrict backup folders using dataExtractionRules."+ finding high "ANDROID-INSECURE-BACKUP" "Android allowBackup is enabled without strict filters" "Disable backups using android:allowBackup=\"false\", or restrict backup folders using dataExtractionRules." src 'allowBackup="true"'fifiif grep_has 'android:scheme'; thenif ! grep_has 'assetlinks.json'; then- finding high "BOTH-UNSAFE-DEEPLINK" "Custom URL deep link schemes declared without App Links configuration" "Configure App Links (Android) using assetlinks.json verification to prevent URL hijacking."+ finding high "BOTH-UNSAFE-DEEPLINK" "Custom URL deep link schemes declared without App Links configuration" "Configure App Links (Android) using assetlinks.json verification to prevent URL hijacking." src 'android:scheme'fifiif grep_has 'QUERY_ALL_PACKAGES'; then- finding high "ANDROID-QUERY-ALL-PACKAGES" "QUERY_ALL_PACKAGES without a permitted use case" "Declare specific packages with a queries element, or qualify for a permitted use case."+ finding high "ANDROID-QUERY-ALL-PACKAGES" "QUERY_ALL_PACKAGES without a permitted use case" "Declare specific packages with a queries element, or qualify for a permitted use case." src 'QUERY_ALL_PACKAGES'fiif grep_has 'SYSTEM_ALERT_WINDOW|TYPE_APPLICATION_OVERLAY'; then- finding high "ANDROID-OVERLAY-TAPJACKING" "System overlay permission present" "Remove overlay abuse. The overlay plus accessibility combination is a strong malware signal."+ finding high "ANDROID-OVERLAY-TAPJACKING" "System overlay permission present" "Remove overlay abuse. The overlay plus accessibility combination is a strong malware signal." src 'SYSTEM_ALERT_WINDOW|TYPE_APPLICATION_OVERLAY'fiif grep_has 'com\.google\.android\.play:age-signals|AgeSignalsManager|AgeSignalsRequest'; then- finding critical "GOOGLE-PLAY-AGE-SIGNALS-MISUSE" "Play Age Signals API dependency found" "Ensure age signals are ONLY used to provide age-appropriate experiences. Using them for advertising, marketing, user profiling, or analytics is a direct ToS violation that can result in immediate app suspension or takedown."+ finding critical "GOOGLE-PLAY-AGE-SIGNALS-MISUSE" "Play Age Signals API dependency found" "Ensure age signals are ONLY used to provide age-appropriate experiences. Using them for advertising, marketing, user profiling, or analytics is a direct ToS violation that can result in immediate app suspension or takedown." src 'com\.google\.android\.play:age-signals|AgeSignalsManager|AgeSignalsRequest'fiif grep_has '<ImageView|<ImageButton'; thenif ! grep_has 'contentDescription'; then- finding medium "ANDROID-ACCESSIBILITY-TALKBACK" "XML ImageView or ImageButton missing contentDescription" "Add an android:contentDescription attribute (Google User Experience - Accessibility)."+ finding medium "ANDROID-ACCESSIBILITY-TALKBACK" "XML ImageView or ImageButton missing contentDescription" "Add an android:contentDescription attribute (Google User Experience - Accessibility)." src '<ImageView|<ImageButton'fifiif grep_has 'android:textSize=.*dp'; then- finding medium "ANDROID-ACCESSIBILITY-FONTSCALING" "Text size defined in dp instead of sp" "Always define text size in sp to allow system font scaling to work correctly (Google User Experience - Accessibility)."+ finding medium "ANDROID-ACCESSIBILITY-FONTSCALING" "Text size defined in dp instead of sp" "Always define text size in sp to allow system font scaling to work correctly (Google User Experience - Accessibility)." src 'android:textSize=.*dp'fiif grep_has 'android:(textColor|background)=.*#'; then- finding medium "ANDROID-ACCESSIBILITY-HIGHCONTRAST" "Hardcoded hex colors ignoring high contrast settings" "Use semantic theme references or color resources instead of hardcoded hex values (Google User Experience - Accessibility)."+ finding medium "ANDROID-ACCESSIBILITY-HIGHCONTRAST" "Hardcoded hex colors ignoring high contrast settings" "Use semantic theme references or color resources instead of hardcoded hex values (Google User Experience - Accessibility)." src 'android:(textColor|background)=.*#'fiif grep_has 'android:(layout_width|layout_height|minWidth|minHeight)=.*dp'; thenif grep_has 'clickable|onClick'; then- finding medium "ANDROID-ACCESSIBILITY-SCANNER" "Interactive controls with hardcoded dimensions" "Verify touch target sizes are at least 48dp (Google User Experience - Accessibility)."+ finding medium "ANDROID-ACCESSIBILITY-SCANNER" "Interactive controls with hardcoded dimensions" "Verify touch target sizes are at least 48dp (Google User Experience - Accessibility)." src 'clickable|onClick'fififinding medium "GOOGLE-12-TESTER-RULE" "Verify the closed testing requirement" "A new personal account needs 12 testers over 14 consecutive days before production."@@ -728,29 +771,29 @@ if [ "$IS_AND" -eq 1 ]; then# feature, and a Play Console declaration is required either way (Photo and Video Permissions policy).if manifest_has 'android\.permission\.READ_MEDIA_(IMAGES|VIDEO)'; thenif ! grep_has 'PickVisualMedia|ACTION_PICK_IMAGES|PhotoPicker|photo_picker'; then- finding high "GOOGLE-PHOTO-VIDEO-PERMISSIONS-DECLARATION" "READ_MEDIA_IMAGES or READ_MEDIA_VIDEO declared without the Android photo picker" "Use the Android photo picker for one-off selection. Keep broad access only for a core gallery-style feature and complete the Photo and Video Permissions declaration in Play Console."+ finding high "GOOGLE-PHOTO-VIDEO-PERMISSIONS-DECLARATION" "READ_MEDIA_IMAGES or READ_MEDIA_VIDEO declared without the Android photo picker" "Use the Android photo picker for one-off selection. Keep broad access only for a core gallery-style feature and complete the Photo and Video Permissions declaration in Play Console." manifest 'android\.permission\.READ_MEDIA_(IMAGES|VIDEO)'fifi# Declared permissions in AndroidManifest.xml, the surface Play enforces on (#542). English words matched prose,# and bare API symbols match imports, comments and vendored SDKs. READ_MEDIA_* has its own check below.if manifest_has 'android\.permission\.(READ_CONTACTS|WRITE_CONTACTS|READ_SMS|SEND_SMS|RECEIVE_SMS|READ_CALL_LOG|WRITE_CALL_LOG|GET_ACCOUNTS|MANAGE_EXTERNAL_STORAGE)'; thenif ! grep_has 'prominent disclosure|user consent|privacy consent|accept policy|[Pp]rominentDisclosure|[Dd]isclosureDialog|[Cc]onsentDialog|showDisclosure|requestConsent'; then- finding critical "ANDROID-USER-DATA-DISCLOSURE" "Missing prominent disclosure for sensitive user data" "Provide a prominent in-app disclosure before collecting sensitive personal data, and obtain explicit user consent."+ finding critical "ANDROID-USER-DATA-DISCLOSURE" "Missing prominent disclosure for sensitive user data" "Provide a prominent in-app disclosure before collecting sensitive personal data, and obtain explicit user consent." manifest 'android\.permission\.(READ_CONTACTS|WRITE_CONTACTS|READ_SMS|SEND_SMS|RECEIVE_SMS|READ_CALL_LOG|WRITE_CALL_LOG|GET_ACCOUNTS|MANAGE_EXTERNAL_STORAGE)'fifiif grep_has 'com\.google\.android\.gms\.permission\.AD_ID|AD_ID|getAdvertisingIdInfo'; thenif ! grep_has 'opt-out|reset AD_ID|advertisingIdConsent|delete AD_ID'; then- finding high "ANDROID-ADVERTISING-ID" "Google Play Advertising ID usage without disclosure or opt-out" "Declare the AD_ID permission in AndroidManifest.xml and handle user opt-out or deletion requests in full compliance with Google Play policy."+ finding high "ANDROID-ADVERTISING-ID" "Google Play Advertising ID usage without disclosure or opt-out" "Declare the AD_ID permission in AndroidManifest.xml and handle user opt-out or deletion requests in full compliance with Google Play policy." src 'com\.google\.android\.gms\.permission\.AD_ID|AD_ID|getAdvertisingIdInfo'fifiif grep_has 'requestPermissions|checkSelfPermission|shouldShowRequestPermissionRationale'; thenif ! grep_has 'permission explanation|showPermissionRationale|explainPermission'; then- finding high "ANDROID-RUNTIME-PERMISSIONS" "Sensitive runtime permissions requested without validation" "Check permissions dynamically at runtime, show a clear rationale if denied, and handle denials gracefully."+ finding high "ANDROID-RUNTIME-PERMISSIONS" "Sensitive runtime permissions requested without validation" "Check permissions dynamically at runtime, show a clear rationale if denied, and handle denials gracefully." src 'requestPermissions|checkSelfPermission|shouldShowRequestPermissionRationale'fifiif grep_has 'HealthConnectClient|com\.google\.android\.gms\.permission\.HealthConnect|READ_STEPS|READ_HEART_RATE'; thenif ! grep_has 'healthConnectConsent|healthPrivacyPolicy|Health Connect'; then- finding critical "ANDROID-HEALTH-PERMISSIONS" "Health or fitness data access without Health Connect declaration" "Declare Health Connect permissions, complete the console Health Connect form, and maintain a dedicated health privacy policy."+ finding critical "ANDROID-HEALTH-PERMISSIONS" "Health or fitness data access without Health Connect declaration" "Declare Health Connect permissions, complete the console Health Connect form, and maintain a dedicated health privacy policy." src 'HealthConnectClient|com\.google\.android\.gms\.permission\.HealthConnect|READ_STEPS|READ_HEART_RATE'fififi@@ -759,32 +802,32 @@ fiif [ "$IS_WEB" -eq 1 ]; thenif grep_has 'processData|personalData|submitForm|registerWeb|webForm'; thenif ! grep_has 'GDPR|opt-in|privacyConsent|deletePersonalData|exportData'; then- finding critical "WEB-GDPR-COMPLIANCE" "Processing web personal data without GDPR compliance controls" "Integrate standard GDPR compliance gates including explicit opt-in for data processing and a mechanism for data deletion."+ finding critical "WEB-GDPR-COMPLIANCE" "Processing web personal data without GDPR compliance controls" "Integrate standard GDPR compliance gates including explicit opt-in for data processing and a mechanism for data deletion." src 'processData|personalData|submitForm|registerWeb|webForm'fifiif grep_has 'document\.cookie|setCookie|cookieStore|js-cookie|cookieConsent'; thenif ! grep_has 'cookieBanner|cookieConsentBanner|acceptCookies|cookiePreferences'; then- finding critical "WEB-COOKIE-CONSENT" "Setting non-essential cookies without prior cookie consent" "Implement a compliant Cookie Consent banner that blocks non-essential cookies until the user gives explicit consent."+ finding critical "WEB-COOKIE-CONSENT" "Setting non-essential cookies without prior cookie consent" "Implement a compliant Cookie Consent banner that blocks non-essential cookies until the user gives explicit consent." src 'document\.cookie|setCookie|cookieStore|js-cookie|cookieConsent'fifiif grep_has 'localStorage\.setItem|localStorage'; thenif ! grep_has 'encryptedStorage|encryptToken|consentLocalStorage|clearLocalStorage'; then- finding high "WEB-LOCAL-STORAGE" "Unencrypted sensitive personal data stored in localStorage" "Avoid storing plain sensitive personal info in localStorage, encrypt any stored tokens, and respect storage preferences."+ finding high "WEB-LOCAL-STORAGE" "Unencrypted sensitive personal data stored in localStorage" "Avoid storing plain sensitive personal info in localStorage, encrypt any stored tokens, and respect storage preferences." src 'localStorage\.setItem|localStorage'fifiif grep_has 'sessionStorage\.setItem|sessionStorage'; thenif ! grep_has 'encryptedSession|clearSessionStorage'; then- finding high "WEB-SESSION-STORAGE" "Sensitive session details stored in sessionStorage without protection" "Limit and secure the data written to sessionStorage, apply encryption, and ensure data is deleted at session end."+ finding high "WEB-SESSION-STORAGE" "Sensitive session details stored in sessionStorage without protection" "Limit and secure the data written to sessionStorage, apply encryption, and ensure data is deleted at session end." src 'sessionStorage\.setItem|sessionStorage'fifiif grep_has 'indexedDB\.open|indexedDB|createObjectStore'; thenif ! grep_has 'encryptDatabase|deleteDatabase|consentIndexedDB'; then- finding high "WEB-INDEXEDDB" "Structured personal data stored in IndexedDB without security controls" "Use encrypted IndexedDB wrappers for structured sensitive records, check user consent, and clear databases upon logout."+ finding high "WEB-INDEXEDDB" "Structured personal data stored in IndexedDB without security controls" "Use encrypted IndexedDB wrappers for structured sensitive records, check user consent, and clear databases upon logout." src 'indexedDB\.open|indexedDB|createObjectStore'fifiif grep_has 'gtag|fbq|google-analytics|trackingPixel|analytics\.js|hotjar'; thenif ! grep_has 'consentTracking|disableTracking|optOutTracking|trackingPreferences'; then- finding high "WEB-TRACKING-TECHNOLOGIES" "Third-party tracking technologies loaded without consent" "Load third-party tracking scripts and pixels conditionally only after receiving explicit user cookie consent."+ finding high "WEB-TRACKING-TECHNOLOGIES" "Third-party tracking technologies loaded without consent" "Load third-party tracking scripts and pixels conditionally only after receiving explicit user cookie consent." src 'gtag|fbq|google-analytics|trackingPixel|analytics\.js|hotjar'fififi@@ -825,7 +868,7 @@ app_roots() { # prints the roots, one per line, only when two or more distinctd="$(dirname "$m")"case "$m" in*/app.json) grep -qE '"(expo|displayName)"' "$m" 2>/dev/null || continue ;;- */pubspec.yaml) { [ -d "$d/ios" ] || [ -d "$d/android" ]; } && ! is_library "$d" || continue ;;+ */pubspec.yaml) { [ -d "$d/ios" ] || [ -d "$d/android" ] || [ -f "$d/lib/main.dart" ]; } && ! is_library "$d" || continue ;;*/build.gradle|*/build.gradle.kts) grep -qE 'com\.android\.application|android\.application' "$m" 2>/dev/null || continue ;;esacprintf '%s\n' "$d"@@ -869,6 +912,21 @@ if [ -n "$STDIN_JSON" ]; thenif [ -n "$REPORT" ] && : >"$REPORT" 2>/dev/null; then exec 3>&1; exec >"$REPORT"; else REPORT=""; REPORT_DEGRADED=1; fifi+# The deadline list prints after the findings, and only for the stores this project ships to (issue #842).+print_deadlines() {+ local hd py="" c plats=""+ hd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+ for c in "$hd/../../scripts/deadline-checker.py" "$hd/../skills/app-store-compliance/scripts/deadline-checker.py"; do+ if [ -f "$c" ]; then py="$c"; break; fi+ done+ [ -n "$py" ] || return 0+ echo ""+ if ! tool_ok python3 -c pass; then echo "Regulatory deadline list skipped. python3 not found."; return 0; fi+ [ "$ANY_IOS" -eq 1 ] && plats="ios"+ [ "$ANY_AND" -eq 1 ] && plats="${plats:+$plats,}android"+ if [ -n "$plats" ]; then python3 "$py" --brief --platforms "$plats"; else python3 "$py" --brief; fi+}+echo "== App Store Compliance Guard =="echo "Project. $DIR"ROOTS="$(app_roots)"@@ -886,12 +944,19 @@ EOF2DIR="$ROOT"echo "App. $ROOT"scan_tree+ flush_findings+ # One scannable sibling must not speak for a root the store checks never ran on.+ if [ "$IS_IOS" -eq 0 ] && [ "$IS_AND" -eq 0 ] && { [ "$IS_WEB" -eq 0 ] || [ "$NEEDS_NATIVE" -eq 1 ]; }; then+ UNCHECKED="${UNCHECKED:+$UNCHECKED, }${ROOT#"$PROJECT_ROOT"/}"+ fidone <<EOF$ROOTSEOFelsescan_tree+ flush_findingsfi+print_deadlines# ===== summary and exit =====echo ""@@ -916,9 +981,13 @@ if [ "$CRIT" -gt 0 ]; thenemit_report 2; exit 2fi# A verdict line every time. Exit 0 with nothing scanned reads as a pass, so it is named and, run by hand, exits 1.-if [ "$ANY_NATIVE" -eq 0 ] && { [ "$ANY_WEB" -eq 0 ] || [ "$ANY_RN" -eq 1 ]; }; then+if [ -n "$UNCHECKED" ] || { [ "$ANY_NATIVE" -eq 0 ] && { [ "$ANY_WEB" -eq 0 ] || [ "$ANY_NEEDS_NATIVE" -eq 1 ]; }; }; thenNOTE="NOT CHECKED. No iOS or Android project was found in $DIR, so the store checks did not run."- if [ "$ANY_RN" -eq 1 ]; then NEXT="Next. This looks like an Expo or React Native app with no ios or android folder. Run npx expo prebuild, then run the guard again."+ if [ -n "$UNCHECKED" ]; then+ NOTE="NOT CHECKED. No ios or android folder in $UNCHECKED, so the store checks did not run there. The other app roots had 0 critical risks."+ NEXT="Next. Create the native project in each folder named above (npx expo prebuild, npx cap add, flutter create, or cargo tauri ios init), then run the guard again."+ elif [ "$ANY_RN" -eq 1 ]; then NEXT="Next. This looks like an Expo or React Native app with no ios or android folder. Run npx expo prebuild, then run the guard again."+ elif [ "$ANY_NEEDS_NATIVE" -eq 1 ]; then NEXT="Next. This app has no ios or android folder yet. Run $NATIVE_HINT, then run the guard again."else NEXT="Next. Point the guard at the folder that holds your Xcode project or your Android app folder."; fiecho ""; echo "$NOTE"; echo "$NEXT"if [ -n "$STDIN_JSON" ]; then emit_report 0; echo "$NOTE $NEXT" >&2; exit 0; fidiff --git a/docs/CROSS-PLATFORM-FRAMEWORKS.md b/docs/CROSS-PLATFORM-FRAMEWORKS.mdindex d588187..d4b8f05 100644--- a/docs/CROSS-PLATFORM-FRAMEWORKS.md+++ b/docs/CROSS-PLATFORM-FRAMEWORKS.md@@ -37,7 +37,8 @@ file-tree detection.`xcrun notarytool`, `transporter`, `gradlew bundleRelease/assembleRelease`,`bundletool`, `xcodebuild archive`, `flutter build ipa/appbundle/apk`,`cap sync/build/run` (with or without `npx`), `ionic capacitor build/run`,-`cordova build` (with or without `--release`).+`cordova build` (with or without `--release`), `Unity ... -buildTarget iOS/Android`,+`dotnet publish -f net8.0-ios/android`, `tauri ios/android build`.## Flutter checks@@ -87,6 +88,38 @@ before submitting.support is less standardized than Flutter's. Verify each plugin wrapping anative SDK ships its own `PrivacyInfo.xcprivacy`.+## Unity, .NET MAUI, Tauri mobile, and Kotlin Multiplatform++Added for issue 837. Each one is detected, named on the `Frameworks.` line, and has a bad and a clean project in the test suite.++| Framework | Detected by | Source now read | Submit command that runs the scan |+|---|---|---|---|+| Unity | `ProjectSettings/ProjectVersion.txt` | `.cs` | `Unity -batchmode ... -buildTarget iOS` or `Android` |+| .NET MAUI | a `.csproj` with `UseMaui` or a `net8.0-ios` style target | `.cs`, `.xaml`, `.csproj` | `dotnet publish -f net8.0-ios` or `net8.0-android` |+| Tauri mobile | `tauri.conf.json`, `tauri.conf.json5` or `Tauri.toml` | `.rs`, `.toml` | `tauri ios build`, `tauri android build`, with or without `cargo` or `npx` |+| Kotlin Multiplatform | the multiplatform plugin in a Gradle file | `commonMain` Kotlin, as before | the Gradle and `xcodebuild archive` commands already covered |++Three behaviours to know.++- A Unity project is scanned for both stores when it is run by hand. As a hook the `-buildTarget` value picks the store.+- A Unity project holds no Xcode or Gradle project until it is exported, so the export compliance check and the R8 check stay silent and the report says so. Scan the exported project too.+- A Kotlin Multiplatform project is scanned as one app, so shared code in `commonMain` counts for both the iOS and the Android checks.++## What stays out of reach++These are limits, not bugs waiting for a fix. Plan around them.++- **Anything that runs on a CI server.** `gh workflow run`, a release started from a CI dashboard, and a fastlane lane run by a runner are never seen by a hook on your machine.+- **Uploads from an app window.** Xcode Organizer, the Transporter app, the Unity Editor build window and Android Studio's Generate Signed Bundle do not run a shell command.+- **A Unity build whose target is chosen in code.** `-executeMethod` with no `-buildTarget iOS` or `Android` on the command line is not treated as a submit.+- **Unity and .NET MAUI build settings.** Info.plist keys and Gradle settings that the tool generates at build time are not read. For .NET MAUI the linker and target API settings in the `.csproj` are not checked, and `dotnet build -t:Publish` is not matched. A Mac Catalyst publish is not treated as a submit.+- **Tauri before init.** With no `src-tauri/gen/apple` or `src-tauri/gen/android` folder there is nothing native to scan. The report names the command to run.+- **A Tauri app beside a native app.** In a monorepo a Tauri folder with no `gen/apple` or `gen/android` is treated as a desktop app, so it does not stop a `CLEAR` for the native app next to it.+- **Rust naming.** The sign-in and account-deletion patterns look for camelCase names such as `signIn`. A Rust function named `sign_in` does not trigger them.+- **Frameworks not detected.** NativeScript and legacy Xamarin.Forms projects.+- **More than one Xcode target.** Targets are read as one body of source, so an app extension can satisfy, or trigger, a finding for the main app. A watchOS-only or visionOS-only workspace is treated as iOS.+- **Store console state.** The guard cannot see App Store Connect or Play Console, so the age rating, social media declaration, and closed testing items are reminders, not proof of a problem.+## Known gaps (found by Codex and Qwen adversarial review, not yet fixed)- **Newline-containing file paths.** The `package.json`/`config.xml` scan loops@@ -111,9 +144,9 @@ before submitting.- **Expo Continuous Native Generation (CNG) is not modeled.** A managed Expoproject legitimately has no committed `ios/`/`android/` folder; treating thatas "no iOS target" is not always correct.-- **Other cross-platform frameworks have no coverage.** NativeScript,- Xamarin/.NET MAUI, Kotlin Multiplatform, Unity (mobile export), and Tauri- Mobile are not detected at all.+- **Two frameworks have no coverage.** NativeScript and legacy Xamarin.Forms+ are not detected. Unity, .NET MAUI, Tauri mobile, and Kotlin Multiplatform+ are, see the section above for what each one still cannot see.- **The submission regex still misses a few real commands**(`eas build` with no platform flag, ambiguous local `cap run` without arelease intent) and can overfire on non-release local dev commands.@@ -124,7 +157,7 @@ improvement over native-only, not a finished answer.## The honest limit-The guard reads Swift, Kotlin, XML, Gradle, Plist, Dart, JS, and TS source text.+The guard reads Swift, Kotlin, XML, Gradle, Plist, Dart, JS, TS, C#, and Rust source text.It does not execute the app, does not parse the Dart or JS AST, and cannot seeruntime behavior (whether an OTA update actually changes the UI, for example).Treat every finding as a lead to verify, not a guaranteed defect, and treat adiff --git a/scripts/check-docs-test.sh b/scripts/check-docs-test.shindex d37107b..b7b12e2 100644--- a/scripts/check-docs-test.sh+++ b/scripts/check-docs-test.sh@@ -34,6 +34,11 @@ printf '# T\n\nSee https://example.org/docs/NOPE.md and `~/other/docs/x.md`.\n'OUT="$(run)"; RC=$?[ "$RC" -eq 0 ] && ok "a web URL and a path outside the repo are left alone" || bad "a web URL and a path outside the repo are left alone (rc=$RC)"+printf '# T\n\n[x](<docs/GUIDE.md#first-step>) and [y][g].\n\n[g]: docs/GUIDE.md\n' > "$T/README.md"+OUT="$(run)"; RC=$?+[ "$RC" -eq 0 ] && ok "an angle-bracket link and a reference link to real files pass" || bad "an angle-bracket link and a reference link to real files pass (rc=$RC)"+expect_fail "a reference link to a missing file fails" "$(printf '[y][g]\n\n[g]: other/NOPE.md\n')" "other/NOPE.md"+OUT="$(python3 "$CHECK" 2>&1)"; RC=$?[ "$RC" -eq 0 ] && ok "the real repository passes" || bad "the real repository passes (rc=$RC)"diff --git a/scripts/check-docs.py b/scripts/check-docs.pyindex 266453c..bd51bb2 100644--- a/scripts/check-docs.py+++ b/scripts/check-docs.py@@ -26,6 +26,7 @@ PATH_RE = re.compile(% "|".join(re.escape(t) for t in TOP))LINK_RE = re.compile(r"(!?)\[[^\]]*\]\(([^)\s]+)(?:\s+\"[^\"]*\")?\)")+REF_RE = re.compile(r"\s{0,3}\[([^\]^][^\]]*)\]:\s*(\S+)")HTML_SRC_RE = re.compile(r"<img[^>]+src=\"([^\"]+)\"")CMD_RE = re.compile(r"(?:python3|bash)\s+((?:~/[\w./-]*/)?(scripts/[\w.-]+\.(?:py|sh)))((?:\s+[^\s|;&<>`]+)*)"@@ -86,6 +87,10 @@ def check_file(path):targets = [m.group(2) for m in LINK_RE.finditer(line)] + HTML_SRC_RE.findall(line)+ ref = REF_RE.match(line)+ if ref:+ targets.append(ref.group(2))+ targets = [t.strip("<>") for t in targets]for target in targets:if re.match(r"[a-z][a-z0-9+.-]*:", target) or target.startswith("//"):continuediff --git a/scripts/deadline-checker-test.sh b/scripts/deadline-checker-test.shindex 222dd54..23048bb 100755--- a/scripts/deadline-checker-test.sh+++ b/scripts/deadline-checker-test.sh@@ -51,5 +51,23 @@ check "brief counts what it left out" "1 passed deadline" "$T/brief.txt"ncheck "brief has no multi-line blocks" "Affected repository sections" "$T/brief.txt"[ "$(wc -l < "$T/brief.txt")" -le 8 ] && echo "PASS brief output stays short" || { echo "FAIL brief output stays short ($(wc -l < "$T/brief.txt") lines)"; fails=$((fails+1)); }+cat > "$T/stores.json" <<'JSON'+{"deadlines":[+ {"id":"A","jurisdiction":"Apple App Store (Global)","law":"Apple rule","requirement":"r","effective_date":"2024-01-01","grace_period":"none","mandatory_date":"2025-06-01","enforcement_date":"2025-06-01","affected_repository_sections":"docs/Y.md","priority":"high"},+ {"id":"G","jurisdiction":"Google Play (Global)","law":"Play rule","requirement":"r","effective_date":"2024-01-01","grace_period":"none","mandatory_date":"2025-06-01","enforcement_date":"2025-06-01","affected_repository_sections":"docs/Y.md","priority":"high"},+ {"id":"E","jurisdiction":"European Union","law":"EU law","requirement":"r","effective_date":"2024-01-01","grace_period":"none","mandatory_date":"2025-06-01","enforcement_date":"2025-06-01","affected_repository_sections":"docs/Y.md","priority":"high"}+]}+JSON+DEADLINES_FILE="$T/stores.json" python3 scripts/deadline-checker.py --brief --platforms android > "$T/and.txt" 2>&1+check "platforms android keeps the Play deadline" "Play rule" "$T/and.txt"+check "platforms android keeps a law that binds every app" "EU law" "$T/and.txt"+ncheck "platforms android drops the Apple store deadline" "Apple rule" "$T/and.txt"+check "the dropped deadline is counted" "^1 deadline\(s\) for a store this project does not ship to" "$T/and.txt"+DEADLINES_FILE="$T/stores.json" python3 scripts/deadline-checker.py --brief --platforms ios,android > "$T/both.txt" 2>&1+check "both platforms keep the Apple deadline" "Apple rule" "$T/both.txt"+ncheck "both platforms leave nothing out" "does not ship to" "$T/both.txt"+DEADLINES_FILE="$T/stores.json" python3 scripts/deadline-checker.py --brief > "$T/none.txt" 2>&1+check "no platforms flag lists every store" "Apple rule" "$T/none.txt"+echo "----"if [ "$fails" -eq 0 ]; then echo "deadline-checker-test: ALL PASS"; else echo "deadline-checker-test: $fails FAIL"; exit 1; fidiff --git a/scripts/deadline-checker.py b/scripts/deadline-checker.pyindex 2818582..9b44b98 100755--- a/scripts/deadline-checker.py+++ b/scripts/deadline-checker.py@@ -29,7 +29,18 @@ def load_deadlines():return []-def print_brief(passed, upcoming, absorbed):+STORE_OF = (("Apple", "ios"), ("App Store", "ios"), ("Google Play", "android"), ("Android", "android"))+++def other_store(item, platforms):+ """True when the deadline binds one store only and the project does not ship there."""+ for prefix, platform in STORE_OF:+ if item["jurisdiction"].startswith(prefix):+ return platform not in platforms+ return False+++def print_brief(passed, upcoming, absorbed, skipped=0):"""One line per deadline, for the guard report. The full blocks stay the default."""print("== Regulatory Compliance Deadline Status ==")for item in passed:@@ -48,6 +59,8 @@ def print_brief(passed, upcoming, absorbed):print("No deadline is overdue or due within 90 days.")if absorbed:print(f"{len(absorbed)} passed deadline(s) already carried by the playbook, not listed.")+ if skipped:+ print(f"{skipped} deadline(s) for a store this project does not ship to, not listed.")print(f"Full detail. python3 {os.path.abspath(__file__)}")return 0@@ -116,8 +129,16 @@ def main():elif remaining_days <= 90:upcoming_deadlines.append(item)+ skipped = 0+ if "--platforms" in sys.argv[1:-1]:+ platforms = set(sys.argv[sys.argv.index("--platforms") + 1].lower().split(","))+ before = len(passed_deadlines) + len(upcoming_deadlines)+ passed_deadlines = [d for d in passed_deadlines if not other_store(d, platforms)]+ upcoming_deadlines = [d for d in upcoming_deadlines if not other_store(d, platforms)]+ skipped = before - len(passed_deadlines) - len(upcoming_deadlines)+if "--brief" in sys.argv[1:]:- return print_brief(passed_deadlines, upcoming_deadlines, absorbed_deadlines)+ return print_brief(passed_deadlines, upcoming_deadlines, absorbed_deadlines, skipped)if passed_deadlines or upcoming_deadlines:print("== Regulatory Compliance Deadline Status ==\n")diff --git a/scripts/install-test.sh b/scripts/install-test.shindex 9fd82f6..3edcf4b 100755--- a/scripts/install-test.sh+++ b/scripts/install-test.sh@@ -140,6 +140,59 @@ if command -v jq >/dev/null 2>&1; thenrm -rf "$SHIM"fi+# 18 a hook for a guard of the same file name in another folder is somebody else's. It is not trusted and not removed.+fresh+python3 -c 'import json,sys; json.dump({"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"bash /opt/other/app-store-compliance-guard.sh"}]}]}}, sys.stdout)' > "$C/settings.json"+run >/dev/null; RC=$?+[ "$RC" -eq 0 ] && [ "$(hooks "$C/settings.json")" = "2" ] && ok "a same-named guard in another folder does not count as installed" || bad "a same-named guard in another folder does not count as installed (rc=$RC entries=$(hooks "$C/settings.json"))"+run uninstall >/dev/null+[ "$(hooks "$C/settings.json")" = "1" ] && grep -q "/opt/other/app-store-compliance-guard.sh" "$C/settings.json" && ok "uninstall leaves the other folder's hook in place" || bad "uninstall leaves the other folder's hook in place (entries=$(hooks "$C/settings.json"))"++# 19 no HOME and no CLAUDE_CONFIG_DIR is a clear message, never a crash. HOME alone missing still works.+OUT="$(env -u HOME -u CLAUDE_CONFIG_DIR bash "$INSTALL" --dry-run 2>&1)"; RC=$?+[ "$RC" -ne 0 ] && echo "$OUT" | grep -q 'HOME is not set' && ! echo "$OUT" | grep -q 'unbound variable' && ok "an unset HOME is reported, not a crash" || bad "an unset HOME is reported, not a crash (rc=$RC)"+fresh+OUT="$(env -u HOME CLAUDE_CONFIG_DIR="$C" bash "$INSTALL" --dry-run 2>&1)"; RC=$?+[ "$RC" -eq 0 ] && ! echo "$OUT" | grep -q 'unbound variable' && ok "a custom folder works with HOME unset" || bad "a custom folder works with HOME unset (rc=$RC)"+# 20 the default folder written with a braced HOME is still this folder's hook, so no second entry is added.+H="$WORK/home$RANDOM"; mkdir -p "$H/.claude"+C="$H/.claude"+python3 -c 'import json,sys; json.dump({"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"bash \"${HOME}/.claude/hooks/app-store-compliance-guard.sh\"","timeout":120}]}]}}, sys.stdout)' > "$H/.claude/settings.json"+env -u CLAUDE_CONFIG_DIR HOME="$H" bash "$INSTALL" >/dev/null 2>&1; RC=$?+[ "$RC" -eq 0 ] && [ "$(hooks)" = "1" ] && ok "a hook written with a braced HOME counts as installed" || bad "a hook written with a braced HOME counts as installed (rc=$RC entries=$(hooks))"++# 21 a hook that runs some other script and only passes this guard's path as an argument is not ours.+fresh+python3 - "$C" > "$C/settings.json" <<'PYT'+import json, sys+cmd = "bash %s/hooks/audit-wrapper.sh --guard %s/hooks/app-store-compliance-guard.sh" % (sys.argv[1], sys.argv[1])+json.dump({"hooks": {"PreToolUse": [{"matcher": "Bash", "hooks": [{"type": "command", "command": cmd}]}]}}, sys.stdout)+PYT+run >/dev/null; RC=$?+[ "$RC" -eq 0 ] && [ "$(hooks)" = "2" ] && ok "a wrapper that only names the guard as an argument does not count as installed" || bad "a wrapper that only names the guard as an argument does not count as installed (rc=$RC entries=$(hooks))"+run uninstall >/dev/null+[ "$(hooks)" = "1" ] && grep -q "audit-wrapper.sh" "$C/settings.json" && ok "uninstall leaves the wrapper hook in place" || bad "uninstall leaves the wrapper hook in place (entries=$(hooks))"++# 22 only the exact command counts. A longer file name, or the path run without bash, is somebody else's hook.+for OTHER in "bash $WORK/x/hooks/app-store-compliance-guard.sh.backdoor" "$WORK/x/hooks/app-store-compliance-guard.sh"; do+ C="$WORK/x"; rm -rf "$C"; mkdir -p "$C"+ python3 -c 'import json,sys; json.dump({"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":sys.argv[1]}]}]}}, sys.stdout)' "$OTHER" > "$C/settings.json"+ run >/dev/null; RC=$?+ [ "$RC" -eq 0 ] && [ "$(hooks)" = "2" ] && ok "a look-alike command is not taken for this guard (${OTHER##*/})" || bad "a look-alike command is not taken for this guard (${OTHER##*/}) (rc=$RC entries=$(hooks))"+ run uninstall >/dev/null+ [ "$(hooks)" = "1" ] && grep -qF "$OTHER" "$C/settings.json" && ok "uninstall leaves the look-alike in place (${OTHER##*/})" || bad "uninstall leaves the look-alike in place (${OTHER##*/}) (entries=$(hooks))"+done++# 23 a config folder with an apostrophe in its name installs once, verifies, and uninstalls.+C="$WORK/O'Reilly cfg"; mkdir -p "$C"+OUT="$(run)"; RC=$?+run >/dev/null+[ "$RC" -eq 0 ] && [ "$(hooks)" = "1" ] && ok "a folder with an apostrophe installs once and verifies" || bad "a folder with an apostrophe installs once and verifies (rc=$RC entries=$(hooks))"+run doctor >/dev/null; RC=$?+[ "$RC" -eq 0 ] && ok "doctor passes for a folder with an apostrophe" || bad "doctor passes for a folder with an apostrophe (rc=$RC)"+run uninstall >/dev/null+[ "$(hooks)" = "0" ] && ok "uninstall removes the hook for a folder with an apostrophe" || bad "uninstall removes the hook for a folder with an apostrophe (entries=$(hooks))"+echo ""echo "install-test: $PASS passed, $FAIL failed"[ "$FAIL" -eq 0 ]diff --git a/scripts/install.sh b/scripts/install.shindex 2599078..738b7da 100755--- a/scripts/install.sh+++ b/scripts/install.sh@@ -4,7 +4,11 @@set -uo pipefailREPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"-CONF="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"+if [ -z "${CLAUDE_CONFIG_DIR:-}" ] && [ -z "${HOME:-}" ]; then+ echo "HOME is not set, so there is no folder to install into. Set HOME or CLAUDE_CONFIG_DIR, then run this again." >&2+ exit 1+fi+CONF="${CLAUDE_CONFIG_DIR:-${HOME:-}/.claude}"GUARD_NAME="app-store-compliance-guard.sh"GUARD_SRC="$REPO/agent-os/hooks/$GUARD_NAME"GUARD="$CONF/hooks/$GUARD_NAME"@@ -14,9 +18,9 @@ SETTINGS="$CONF/settings.json"PAYLOAD_DIRS="docs data references templates scripts"# shellcheck disable=SC2088-if [ "$CONF" = "$HOME/.claude" ]; then SHOWN='~/.claude'; else SHOWN="$CONF"; fi+if [ "$CONF" = "${HOME:-}/.claude" ]; then SHOWN='~/.claude'; else SHOWN="$CONF"; fi# The hook command is run by a shell, so a custom folder is single-quoted. The default keeps an unquoted tilde.-if [ "$CONF" = "$HOME/.claude" ]; then+if [ "$CONF" = "${HOME:-}/.claude" ]; thenHOOK_CMD="bash $SHOWN/hooks/$GUARD_NAME"elseHOOK_CMD="bash '$(printf '%s' "$GUARD" | sed "s/'/'\\\\''/g")'"@@ -64,10 +68,12 @@ BLOCKsettings_edit() {local action="$1"if have python3 -c pass; then- python3 - "$SETTINGS" "$HOOK_CMD" "$GUARD_NAME" "$action" <<'PY'+ python3 - "$SETTINGS" "$HOOK_CMD" "$GUARD_NAME" "$action" "$GUARD" "$SHOWN/hooks/$GUARD_NAME" <<'PY'import json, os, re, shutil, sys, tempfile, timepath, cmd, name, action = sys.argv[1:5]+spots = list(sys.argv[5:7])+spots += [h + s[2:] for s in list(spots) if s.startswith("~/") for h in ("$HOME/", "${HOME}/")]real = os.path.realpath(path)exists = os.path.exists(real)data = {}@@ -100,7 +106,10 @@ for e in pre:def ours(h):- return isinstance(h, dict) and name in str(h.get("command", ""))+ # Ours means this folder's guard. A guard of the same file name somewhere else belongs to someone else.+ c = str(h.get("command", "")) if isinstance(h, dict) else ""+ c = c.strip()+ return c == cmd or any(c in ("bash " + s, "bash '" + s + "'", 'bash "' + s + '"') for s in spots)def fires(e, h):@@ -172,7 +181,7 @@ PY[ -w "$cur" ] || return 6filocal present=1- [ -n "$cur" ] && jq -e --arg n "$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and contains($n) and (contains("#") | not))] | length > 0' "$cur" >/dev/null 2>&1 && present=0+ [ -n "$cur" ] && jq -e --arg hc "$HOOK_CMD" --arg g "$GUARD" --arg t "$SHOWN/hooks/$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and (. as $c | $c == $hc or ([$g, $t] | any(. as $s | $c == "bash " + $s or $c == "bash \u0027" + $s + "\u0027" or $c == "bash \"" + $s + "\""))) and (contains("#") | not))] | length > 0' "$cur" >/dev/null 2>&1 && present=0if [ "$action" = "add" ]; then[ "$present" -eq 0 ] && return 3mkdir -p "$CONF"; tmp="$(mktemp "$CONF/.settings-XXXXXX")" || return 4@@ -184,7 +193,7 @@ PY[ "$present" -ne 0 ] && return 3tmp="$(mktemp "$CONF/.settings-XXXXXX")" || return 4cp -p "$cur" "$SETTINGS.bak-$(date +%Y%m%d-%H%M%S)"- jq --arg n "$GUARD_NAME" '.hooks.PreToolUse |= (map(.hooks |= map(select((.command? // "" | tostring | contains($n)) | not))) | map(select((.hooks | length) > 0)))' "$cur" > "$tmp" || { rm -f "$tmp"; return 4; }+ jq --arg hc "$HOOK_CMD" --arg g "$GUARD" --arg t "$SHOWN/hooks/$GUARD_NAME" '.hooks.PreToolUse |= (map(.hooks |= map(select((.command? // "" | tostring | (. as $c | $c == $hc or ([$g, $t] | any(. as $s | $c == "bash " + $s or $c == "bash \u0027" + $s + "\u0027" or $c == "bash \"" + $s + "\"")))) | not))) | map(select((.hooks | length) > 0)))' "$cur" > "$tmp" || { rm -f "$tmp"; return 4; }mv "$tmp" "$SETTINGS"; return 0fireturn 5@@ -197,7 +206,9 @@ registered_cmd() {python3 -c 'import json,re,systry: d=json.load(open(sys.argv[1]))except Exception: sys.exit(0)-n=sys.argv[2]+hc=sys.argv[2]+n=sys.argv[3:]+n+=[h+s[2:] for s in list(n) if s.startswith("~/") for h in ("$HOME/","${HOME}/")]for e in d.get("hooks",{}).get("PreToolUse",[]):if not isinstance(e,dict): continuem=e.get("matcher","")@@ -206,15 +217,15 @@ for e in d.get("hooks",{}).get("PreToolUse",[]):if not ok: continuefor h in e.get("hooks",[]):c=str(h.get("command","")) if isinstance(h,dict) else ""- if n in c and "#" not in c and c.strip().startswith("bash "):- print(c); sys.exit(0)' "$SETTINGS" "$GUARD_NAME" 2>/dev/null+ if (c.strip()==hc or any(c.strip() in ("bash " + s, "bash \"" + s + "\"", "bash \u0027" + s + "\u0027") for s in n)) and "#" not in c and c.strip().startswith("bash "):+ print(c); sys.exit(0)' "$SETTINGS" "$HOOK_CMD" "$GUARD" "$SHOWN/hooks/$GUARD_NAME" 2>/dev/nullreturn 0fiif have jq -n true; then- jq -r --arg n "$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and contains($n) and (contains("#") | not))] | first // empty' "$SETTINGS" 2>/dev/null+ jq -r --arg hc "$HOOK_CMD" --arg g "$GUARD" --arg t "$SHOWN/hooks/$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and (. as $c | $c == $hc or ([$g, $t] | any(. as $s | $c == "bash " + $s or $c == "bash \u0027" + $s + "\u0027" or $c == "bash \"" + $s + "\""))) and (contains("#") | not))] | first // empty' "$SETTINGS" 2>/dev/nullreturn 0fi- grep -q "$GUARD_NAME" "$SETTINGS" 2>/dev/null && printf '%s\n' "$HOOK_CMD"+ grep -qF "$SHOWN/hooks/$GUARD_NAME" "$SETTINGS" 2>/dev/null && printf '%s\n' "$HOOK_CMD"return 0}diff --git a/scripts/monitor-ai-policy.py b/scripts/monitor-ai-policy.pyindex 3afe56a..01717c0 100755--- a/scripts/monitor-ai-policy.py+++ b/scripts/monitor-ai-policy.py@@ -501,7 +501,7 @@ def main():parser.add_argument("--output-docs",type=str,- default="docs/AI-POLICY-MIGRATION.md",+ default=None,help="Filepath to write migration tasks / docs updates",)parser.add_argument(@@ -525,6 +525,7 @@ def main():used_mock = Falseif args.mock or (not args.live and not args.mock):used_mock = True+ print("Data. sample announcements built into this script, not live news.")# Default or explicit inline mock modeprint("Using mock policy update data for analysis...")if args.mock and args.mock != "inline" and os.path.exists(args.mock):@@ -539,6 +540,8 @@ def main():announcements.extend(MOCK_ANNOUNCEMENTS)else:announcements.extend(MOCK_ANNOUNCEMENTS)+ else:+ print("Data. live feeds, fetched just now.")# 2. Analyze policy announcements against keywordsmatched_policies = analyze_announcements(announcements, keywords_list)@@ -558,8 +561,11 @@ def main():print(f"Found {len(affected_features)} matching source lines.")# 4. Generate documentation updates and migration tasks- os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)- update_documentation(matched_policies, args.output_docs, is_simulated=used_mock)+ if args.output_docs:+ os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)+ update_documentation(matched_policies, args.output_docs, is_simulated=used_mock)+ else:+ print("No file written. Pass --output-docs <path> to save this report.")# 5. Draft the Pull Request with exactly 15 sectionspr_draft = generate_pull_request_draft(matched_policies, affected_features)diff --git a/scripts/monitor-android.py b/scripts/monitor-android.pyindex f495d83..9e34912 100644--- a/scripts/monitor-android.py+++ b/scripts/monitor-android.py@@ -1187,7 +1187,7 @@ def main():parser.add_argument("--output-docs",type=str,- default="docs/ANDROID-POLICY-MIGRATION.md",+ default=None,help="Filepath to write migration tasks and logs",)parser.add_argument(@@ -1216,6 +1216,7 @@ def main():used_mock = Falseif args.mock or (not args.live and not args.mock) or not announcements:used_mock = True+ print("Data. sample announcements built into this script, not live news.")print("Using comprehensive mock Android policy updates for compliance scanning...")@@ -1231,6 +1232,8 @@ def main():announcements.extend(MOCK_ANNOUNCEMENTS)else:announcements.extend(MOCK_ANNOUNCEMENTS)+ else:+ print("Data. live feeds, fetched just now.")# 2. Classify updates into the 19 required categorieskeywords_filter = (@@ -1256,8 +1259,11 @@ def main():print(f"Found {total_matches} signal matches in code.")# 4. Write/Update documentation- os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)- update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ if args.output_docs:+ os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)+ update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ else:+ print("No file written. Pass --output-docs <path> to save this report.")# 5. Generate Pull Request draftpr_draft = generate_pull_request_draft(classified_updates, scan_results)diff --git a/scripts/monitor-no-write-test.sh b/scripts/monitor-no-write-test.shnew file mode 100644index 0000000..0075730--- /dev/null+++ b/scripts/monitor-no-write-test.sh@@ -0,0 +1,36 @@+#!/usr/bin/env bash+# Issue 843. Every monitor says whether its items are live or sample, and writes no file unless asked.+set -uo pipefail+REPO="$(cd "$(dirname "$0")/.." && pwd)"+PASS=0; FAIL=0+ok() { PASS=$((PASS+1)); printf 'PASS %s\n' "$1"; }+bad() { FAIL=$((FAIL+1)); printf 'FAIL %s\n' "$1"; }+T="$(mktemp -d)"; trap 'rm -rf "$T"' EXIT++for m in regulatory android ai-policy privacy security; do+ W="$T/$m"; mkdir -p "$W/app"; cd "$W" || exit 1+ flag="--dir"; [ "$m" = "regulatory" ] && flag="--project"+ OUT="$(python3 "$REPO/scripts/monitor-$m.py" "$flag" app 2>&1)"; RC=$?+ N="$(printf '%s\n' "$OUT" | grep -cE '^Data\. (sample|live) ')"+ [ "$RC" -eq 0 ] && [ "$N" -eq 1 ] && ok "$m says once whether its items are live or sample" || bad "$m says once whether its items are live or sample (rc=$RC lines=$N)"+ printf '%s\n' "$OUT" | grep -qE '^Data\. sample ' && ok "$m run with no feed flag is labelled sample" || bad "$m run with no feed flag is labelled sample"+ FILES="$(find "$W" -type f | wc -l | tr -d ' ')"+ [ "$FILES" -eq 0 ] && ok "$m writes no file when no output flag is passed" || bad "$m writes no file when no output flag is passed (files=$FILES)"+ [ "$m" = "regulatory" ] && continue+ printf '%s\n' "$OUT" | grep -q '^No file written\. ' && ok "$m says how to save the report" || bad "$m says how to save the report"+ python3 "$REPO/scripts/monitor-$m.py" --dir app --output-docs "$W/out/report.md" >/dev/null 2>&1+ [ -s "$W/out/report.md" ] && ok "$m writes the report when the output flag is passed" || bad "$m writes the report when the output flag is passed"+done++cd "$T/regulatory" || exit 1+python3 "$REPO/scripts/monitor-regulatory.py" --project app --json 2>"$T/err.txt" | python3 -c 'import json,sys; json.load(sys.stdin)' \+ && grep -qE '^Data\. sample ' "$T/err.txt" && ok "regulatory json stays parseable and the data line goes to stderr" || bad "regulatory json stays parseable and the data line goes to stderr"+for m in privacy security; do+ cd "$T/$m" || exit 1+ python3 "$REPO/scripts/monitor-$m.py" --dir app --pr-output "$T/$m/pr/draft.md" >/dev/null 2>&1+ [ -s "$T/$m/pr/draft.md" ] && ok "$m writes the PR draft when its flag is passed" || bad "$m writes the PR draft when its flag is passed"+done++echo ""+echo "monitor-no-write-test: $PASS passed, $FAIL failed"+[ "$FAIL" -eq 0 ]diff --git a/scripts/monitor-privacy.py b/scripts/monitor-privacy.pyindex d40afcb..1a22fbf 100755--- a/scripts/monitor-privacy.py+++ b/scripts/monitor-privacy.py@@ -871,13 +871,13 @@ def main():parser.add_argument("--output-docs",type=str,- default="docs/PRIVACY-POLICY-MIGRATION.md",+ default=None,help="Filepath to write migration tasks and logs",)parser.add_argument("--pr-output",type=str,- default="docs/PRIVACY_COMPLIANCE_PR_DRAFT.md",+ default=None,help="Filepath to save the drafted PR",)parser.add_argument(@@ -899,6 +899,7 @@ def main():used_mock = Falseif args.mock or (not args.live and not args.mock) or not announcements:used_mock = True+ print("Data. sample announcements built into this script, not live news.")if args.mock and args.mock != "inline" and os.path.exists(args.mock):try:with open(args.mock, "r") as f:@@ -911,6 +912,8 @@ def main():announcements.extend(MOCK_ANNOUNCEMENTS)else:announcements.extend(MOCK_ANNOUNCEMENTS)+ else:+ print("Data. live feeds, fetched just now.")# 2. Classify updates into the 16 required categorieskeywords_filter = (@@ -949,22 +952,28 @@ def main():print(f"Found {total_matches} signal matches in code.")# 4. Write/Update documentation- os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)- update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ if args.output_docs:+ os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)+ update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ else:+ print("No file written. Pass --output-docs <path> to save this report.")# 5. Generate Pull Request draft using verified updatespr_draft = generate_pull_request_draft(verified_updates, scan_results)if used_mock:pr_draft = "\n".join(SIMULATED_NOTICE[1:]) + "\n" + pr_draft- # Save drafted PR- os.makedirs(os.path.dirname(args.pr_output) or ".", exist_ok=True)- try:- with open(args.pr_output, "w", encoding="utf-8") as f:- f.write(pr_draft)- print(f"PR draft written successfully to: {args.pr_output}")- except Exception as e:- print(f"Failed to write PR draft to {args.pr_output}: {e}", file=sys.stderr)+ # Save the drafted PR only when a path was passed+ if args.pr_output:+ try:+ os.makedirs(os.path.dirname(args.pr_output) or ".", exist_ok=True)+ with open(args.pr_output, "w", encoding="utf-8") as f:+ f.write(pr_draft)+ print(f"PR draft written successfully to: {args.pr_output}")+ except Exception as e:+ print(f"Failed to write PR draft to {args.pr_output}: {e}", file=sys.stderr)+ else:+ print("No PR draft written. Pass --pr-output <path> to save it.")# 6. JSON output format verification if requestedif args.json:diff --git a/scripts/monitor-regulatory.py b/scripts/monitor-regulatory.pyindex 8302e8c..54d6489 100755--- a/scripts/monitor-regulatory.py+++ b/scripts/monitor-regulatory.py@@ -3,6 +3,7 @@(EU/UK/US/CA/AU/SG/intl) against a source trust hierarchy. See README.md."""import os+import sysimport reimport jsonimport argparse@@ -1114,6 +1115,11 @@ def main():args = parser.parse_args()+ # The line goes to stderr with --json so the JSON on stdout stays parseable.+ print(+ "Data. sample developments built into this script, not live news.",+ file=sys.stderr if args.json else sys.stdout,+ )report_items, processed = run_monitor(project_path=args.project, simulate_track=args.simulate, verbose=args.verbose)diff --git a/scripts/monitor-security.py b/scripts/monitor-security.pyindex 4f0048f..ac01f4e 100755--- a/scripts/monitor-security.py+++ b/scripts/monitor-security.py@@ -940,13 +940,13 @@ def main():parser.add_argument("--output-docs",type=str,- default="docs/SECURITY-POLICY-MIGRATION.md",+ default=None,help="Filepath to write migration tasks and logs",)parser.add_argument("--pr-output",type=str,- default="docs/SECURITY_COMPLIANCE_PR_DRAFT.md",+ default=None,help="Filepath to save the drafted PR",)@@ -964,6 +964,7 @@ def main():used_mock = Falseif args.mock or (not args.live and not args.mock) or not announcements:used_mock = True+ print("Data. sample announcements built into this script, not live news.")print("Using comprehensive mock Security policy updates for compliance scanning...")@@ -979,6 +980,8 @@ def main():announcements.extend(MOCK_ANNOUNCEMENTS)else:announcements.extend(MOCK_ANNOUNCEMENTS)+ else:+ print("Data. live feeds, fetched just now.")# 2. Classify updates into the 17 required categorieskeywords_filter = (@@ -1004,8 +1007,11 @@ def main():print(f"Found {total_matches} signal matches in code.")# 4. Write/Update documentation- os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)- update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ if args.output_docs:+ os.makedirs(os.path.dirname(args.output_docs) or ".", exist_ok=True)+ update_documentation_report(classified_updates, args.output_docs, is_simulated=used_mock)+ else:+ print("No file written. Pass --output-docs <path> to save this report.")# 5. Generate Pull Request draftpr_draft = generate_pull_request_draft(classified_updates, scan_results)@@ -1021,9 +1027,7 @@ def main():except Exception as e:print(f"Failed to write PR draft to {args.pr_output}: {e}", file=sys.stderr)else:- print("\n=== GENERATED 15-SECTION COMPLIANCE PULL REQUEST DRAFT ===")- print(pr_draft)- print("==========================================================")+ print("No PR draft written. Pass --pr-output <path> to save it.")if __name__ == "__main__":diff --git a/scripts/release-audit-test.sh b/scripts/release-audit-test.shindex 67825c3..f045183 100755--- a/scripts/release-audit-test.sh+++ b/scripts/release-audit-test.sh@@ -41,5 +41,22 @@ OUT="$(python3 scripts/release-audit.py "$FX/no-such-app" 2>&1)"; RC=$?FIRST="$(python3 scripts/release-audit.py "$FX/no-such-app" 2>&1; sed -n '/Starting Release Readiness/,/Scanning your app/p' scripts/release-audit.py)"echo "$FIRST" | grep -q "about two minutes" && ok "the slow self-check step says how long it takes" || bad "the slow self-check step says how long it takes"+# A finding whose title contains "(mandatory " is a finding. Only deadline lines, which carry a date there, are skipped.+python3 - <<'PYT' && ok "only deadline lines are dropped from the finding list" || bad "only deadline lines are dropped from the finding list"+import importlib.util, sys+spec = importlib.util.spec_from_file_location("ra", "scripts/release-audit.py")+ra = importlib.util.module_from_spec(spec)+spec.loader.exec_module(ra)+keep = " [HIGH] BOTH-PLACEHOLDER Placeholder text (mandatory disclosure) found"+keep2 = " [HIGH] BOTH-SOME-RULE A title that quotes a date (mandatory 2026-10-15)"+drop = [+ "[CRITICAL] OVERDUE 12 days. EU. Some Act (mandatory 2026-09-18)",+ "[HIGH] in 3 days. Apple. Thing (mandatory 2026-10-03)",+ "[HIGH] EU AI Act (mandatory 2025-02-02) absorbed into docs/EU.md",+]+fn = getattr(ra, "is_deadline_line", None)+sys.exit(0 if fn and not fn(keep) and not fn(keep2) and all(fn(d) for d in drop) else 1)+PYT+echo "release-audit-test: $PASS passed, $FAIL failed"[ "$FAIL" -eq 0 ]diff --git a/scripts/release-audit.py b/scripts/release-audit.pyindex e79c2d5..ede299a 100755--- a/scripts/release-audit.py+++ b/scripts/release-audit.py@@ -114,6 +114,18 @@ def run_command(args, cwd=ROOT):return -1, "", str(e)+DEADLINE_LINE_RE = re.compile(r"\(mandatory \d{4}-\d{2}-\d{2}\)")++FINDING_SHAPE_RE = re.compile(r"^\s*\[\w+\]\s+[A-Z0-9]+(-[A-Z0-9.]+)+\s")+++def is_deadline_line(line):+ """A deadline-checker line carries a date after the word mandatory. A finding does not."""+ if FINDING_SHAPE_RE.match(line):+ return False+ return bool(DEADLINE_LINE_RE.search(line))++def load_patterns():path = os.path.join(ROOT, "data", "rejection-patterns.json")if os.path.exists(path):@@ -356,8 +368,7 @@ def main():i = 0while i < len(lines):line = lines[i]- # deadline-checker lines ("[HIGH] EU AI Act ... (mandatory ...) absorbed into ...") are not findings- if "(mandatory " in line:+ if is_deadline_line(line):i += 1continuematch = re.match(@@ -376,6 +387,8 @@ def main():title = re.sub(r"\s*\([^)]+\)$", "", title)fix = ""+ if i + 1 < len(lines) and re.match(r"^\s*file\.\s", lines[i + 1]):+ i += 1if i + 1 < len(lines):next_line = lines[i + 1]fix_match = re.match(r"^\s*fix\.\s+(.+)$", next_line, re.IGNORECASE)diff --git a/scripts/run-monitor-tests.sh b/scripts/run-monitor-tests.shindex 15aed8c..5cd23da 100755--- a/scripts/run-monitor-tests.sh+++ b/scripts/run-monitor-tests.sh@@ -5,7 +5,7 @@ set -uo pipefailcd "$(dirname "$0")/.." || exit 1status=0-for t in monitor monitor-regulatory monitor-ai-policy monitor-android monitor-security monitor-privacy monitor-simulated-notice; do+for t in monitor monitor-regulatory monitor-ai-policy monitor-android monitor-security monitor-privacy monitor-simulated-notice monitor-no-write; doif bash "scripts/${t}-test.sh"; thenecho "OK ${t}"else