Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix(android): enable resource shrinking in release builds

Amruth Pillai5cc3677a44a8
diff --git a/.agents/docs/mobile-ci.md b/.agents/docs/mobile-ci.md
index 93350d603..0050781a3 100644
--- a/.agents/docs/mobile-ci.md
+++ b/.agents/docs/mobile-ci.md
@@ -103,7 +103,8 @@ Merely naming an environment does not configure these protection rules.
A separate `-evidence` artifact retains `release.json`, `fingerprint.json`, available
JavaScript source maps, iOS dSYMs, Android obfuscation mappings and native debug
symbols for 90 days. Mapping/symbol files are included when produced by the
- toolchain; this workflow does not enable obfuscation or manufacture missing symbols.
+ toolchain; the Android build lane enables R8 and resource shrinking, while the
+ workflow preserves the resulting mappings and available native symbols.
Raw build logs are not uploaded because toolchains can include environment values.
Actions retention is capped at 90 days for this public repository and deleting a run
still deletes its artifacts: export evidence to your permanent release records
@@ -129,6 +130,35 @@ certificate into a temporary keychain, and removes the profile, keychain and tem
files after the build. It never invokes capability synchronization or provisions new
Apple resources. Renew certificates/profiles before expiry and update Actions secrets.
+## Android Play Console optimization warnings
+
+The Android build lane in `tooling/mobile/fastlane/Fastfile` passes
+`android.enableMinifyInReleaseBuilds=true` and
+`android.enableShrinkResourcesInReleaseBuilds=true` to Gradle after Expo Prebuild. Both store
+AABs and manual release APKs use these settings. Resource shrinking requires R8;
+do not disable minification independently. Verify a release build, then test photo
+selection/cropping, navigation, notifications, and PDF previews before submitting a
+new binary. This cannot ship through OTA. These build-only optimization flags do
+not change the app's native interfaces or shared Expo configuration/fingerprints;
+no iOS rebuild is needed for this Android fix.
+
+The 1.0.0 Play Console recommendations also report deprecated window APIs and manual
+network bitmap decoding in bundled libraries. Current `expo-image-picker` 58.0.10
+uses `WindowCompat.enableEdgeToEdge` and window insets in `ExpoCropImageActivity`.
+React Native 0.88.0 still contains deprecated status/navigation color setters and
+legacy cutout modes in `WindowUtil.kt`. App screens do not set those colors or modes;
+keep safe-area handling and cropping intact rather than removing framework
+compatibility code to silence a static warning.
+
+App image views already use `expo-image` (Glide on Android). Manual download paths
+remain in dependencies, including `expo-notifications`'s notification image helper
+and `react-native-enriched-html`'s inline-image drawable. The PDF renderer separately
+needs original image bytes; its download enforces a byte limit and timeout. Do not
+replace that with a downsampled display image. Match Play's obfuscated class names
+against the **same release's** archived `mapping.txt` before attributing each report;
+current source alone cannot identify them. Recheck remaining recommendations after
+uploading the new AAB; configuration/source checks do not prove Play cleared them.
+
## Manual Android APKs
Dispatch **Mobile release** on `main` with `platform=android`, `format=apk`,
diff --git a/tooling/mobile/build_test.rb b/tooling/mobile/build_test.rb
index 5cabd373f..d818ebfcd 100644
--- a/tooling/mobile/build_test.rb
+++ b/tooling/mobile/build_test.rb
@@ -74,6 +74,8 @@ Dir.mktmpdir do |directory|
options = contract.gradle_options
raise "Wrong Gradle task" unless options[:task] == (abi ? "assemble" : "bundle")
raise "Wrong ABI filter" unless options[:properties]["reactNativeArchitectures"] == abi
+ raise "R8 disabled" unless options[:properties]["android.enableMinifyInReleaseBuilds"] == "true"
+ raise "Resource shrinking disabled" unless options[:properties]["android.enableShrinkResourcesInReleaseBuilds"] == "true"
raise "Signing command exposed" unless options[:print_command] == false
raise "Keystore leaked" if File.exist?(contract.keystore_path)
name = abi ? "reactive-resume-#{abi}.apk" : "ReactiveResume.aab"
diff --git a/tooling/mobile/fastlane/Fastfile b/tooling/mobile/fastlane/Fastfile
index 0825bacc4..0dafa4ec2 100644
--- a/tooling/mobile/fastlane/Fastfile
+++ b/tooling/mobile/fastlane/Fastfile
@@ -26,6 +26,8 @@ platform :android do
task: abi ? "assemble" : "bundle", build_type: "Release", flags: "--no-daemon",
print_command: false,
properties: {
+ "android.enableMinifyInReleaseBuilds" => "true",
+ "android.enableShrinkResourcesInReleaseBuilds" => "true",
"android.injected.signing.store.file" => keystore,
"android.injected.signing.store.password" => ENV.fetch("ANDROID_KEYSTORE_PASSWORD"),
"android.injected.signing.key.alias" => ENV.fetch("ANDROID_KEY_ALIAS"),