Android app (Java, minSdk 31, targetSdk 37) that removes metadata from photos and videos, converts formats and censors parts of photos, all on the phone. Its job is that private data never leaves a file or the phone, so a change that drops a check is a regression, never a simplification.
- Never weaken a check that a cleaned file is clean (
CleanVerifier:verifyMetadataRemoval,requireSameContent,requireVideoMetadataClean,VideoStreamMetadata.scan, the container scans), even where it repeats work. Code that fails closed (returns null, throws or re-encodes when it cannot vouch for a file) stays that way. - Never loosen
.github/scripts/check_release_manifest.py, which fails CI when the release manifest grants a permission, exported component or application flag thatapp/release-manifest.txtdoes not list. Add a line there only for a change that is meant to ship, after./gradlew bundleRelease exportReleaseManifestand--update. - Keep
SecureDeleteon anything that may hold original media, the inbound URI checks inMainActivityandShareHandlerActivity,SentryPrivacyScrubberand thebefore*callbacks inSentryInitializer. - Sentry may collect every technical detail it offers (sessions, breadcrumbs, threads, view hierarchy, traces, profiles, logs, metrics), with two hard limits: nothing that can tie reports to one phone or person (install ID, distinct ID, user, boot time, time zone, kernel version, IP address), and nothing about a file (URI, path, name, contents, metadata value) or typed text. Never screenshots or session replay. Section 6 of
legal/redact.htmland the consent strings must describe what is sent. - Everything the app reports itself goes through
SentryManager. Its names follow one scheme, written aboveSentryManager's key lists and enforced bySentryNamingTest: lower-case area breadcrumb categories,area.event[.measure]metrics, andgroup.fieldtag keys beside the bareoutcome,reasonanderror_type. What the SDK collects on its own goes through thebefore*callbacks andSentryPrivacyScrubber. - The "What Send Crash Reports captures" tables in
README.mdandsite/index.html(idcrash-reports) say exactly what Sentry receives and what it never does, and their Names in Sentry tables (idsentry-names) list every tag, metric and breadcrumb category;SentryNamingTestfails on a name missing there. Any change to what is sent (a Sentry option, a scrubber rule, a tag key, anAppMetricsmetric, an SDK upgrade that collects something new) updates both tables, Section 6 oflegal/redact.htmland, when it changes what someone agrees to, the consent strings in all 13strings.xmlfiles, in the same commit.
MetadataStripperis the entry point for cleaning and holds the shared state (context, progress, cancellation); the work is inImageCleaner,VideoCleanerandCleanVerifier, each created by it.- Reuse the helpers before writing new ones:
MediaSizeLimits.copyStream,SecureDelete,MediaFileNames,MediaUriResolver,MediaStoreWrites,OutputDestination,InboundSnapshots(copies of shared-in files),BatchRun(the loop Clean, Convert and Share run a batch through),SentryManager, andAppMetricsfor every metric. - The release build leaves out Sentry's session-replay module (
excludeinapp/build.gradle), library translations the app doesn't have (localeFilters) and logging (proguard-rules.prostrips everyLogcall and treatsLog.isLoggableas false). Keep them out when upgrading. ImageCleaner,CleanVerifier,MetadataDisplayer,CleanStatsandAlreadyCleanCheckfind EXIF tags by reflection overExifInterface.TAG_*, so grep alone does not show every use;proguard-rules.prokeeps those names.- Every user-visible string goes into
values/and all 12 locales (ar de es fr hi it ja ko pt ru zh-rCN zh-rTW);StringTranslationsTestchecks it. The Play listing text infastlane/metadata/android/<locale>/follows the English too. - A setting that is removed leaves its saved value in place; do not add code to clear it.
./gradlew :app:testDebugUnitTest(Robolectric),:app:jacocoTestCoverageVerificationfor the 90% line gate CI enforces,:app:lintRelease, and:app:bundleReleaseto catch R8 problems the debug tests miss. From PowerShell usegradlew.bat.- Never run two Gradle builds of this project at once: they fight over the same build locks. The daemon is on locally; CI turns it off.
- Python scripts that need Pillow (
.claude/scripts/make_test_media.py,check_media.py) run withpython3; plainpythonhas no Pillow.check_media.pyalso needspillow-heifto read HEIC; without it a HEIC fails as not checked.
- Test emulator: the
Pixel_10_ProAVD (Play Store image, API 37.2)./testand/verifycleanboot it headless;/generatescreenshotsuses its window. Never use a physical device. - Profile emulator:
Pixel_10_Pro_Profiles, Gradle-managed (Google APIs API 37.0, defined inbaselineprofile/build.gradle). Gradle starts and stops it for:app:generateBaselineProfile. Its journeys are inProfiles(startupfeeds the startup profile,generatethe baseline profile). - Clean test emulator:
Pixel_10_Pro_Clean, Gradle-managed (Google APIs API 37.0, defined inapp/build.gradle)../gradlew :app:Pixel_10_Pro_CleanDebugAndroidTestrunsCleanOnDeviceTest, which cleans the fixtures inapp/src/androidTest/assets/media(made by.claude/scripts/make_instrumented_media.py) with real codecs and checks them likecheck_media.py. CI does not run it: on a headless managed emulator the goldfish video decoders fail to configure, so its two video tests fail there. Run it locally before a release. - Benchmark emulator:
Pixel_10_Pro_Benchmark, Gradle-managed (Automated Test Device image, API 37.0, stripped of most system apps), used only byStartupBenchmarkthrough/benchmark. - The managed emulators stay on 37.0: AGP 9.5's managed devices take only whole API levels, and no stripped-down image exists for 37.2. While running,
adbshows them under a generated AVD name such asdev37_google_apis_x86_64_Pixel_10_Pro, so pick the test emulator by its exact AVD name,Pixel_10_Pro. - Keep the profile generator class name (
Profiles) and the managed device names short: they go into the paths of the profile files copied back from the emulator, andadbon Windows fails on paths over 260 characters. When every copy fails, the run finds no rules and deletes the committed profiles; restore them withgit checkout.
/prerelease runs the whole release check and calls the others: /translate, /dependencies, /sentry, /sentrycoverage, /cleanup, /lint, /bump, /releasenotes, /test, /coverage, /generateprofiles, /generatescreenshots. Also /verifyclean (quick emulator check after touching cleaning code), /benchmark (startup with and without the profile), /generateall and /release. Each one's file in .claude/commands/ is the source of truth for how it works.
Work on dev; main is what ships, through /release. Commit to the current branch when a command says to, and never push unless asked. Leave .idea/ files alone.