Repository navigation
fix(android): enable R8 for release builds - #712
Merged
Merged
Conversation
Play Console flags the release DEX as almost unobfuscated (1 %). R8 was off because Rust calls our Kotlin by name over JNI; proguard-rules.pro now keeps com.voltius.app whole, Tauri's library ships rules for its own classes, and Tink's compile-only javax.annotation references are silenced. Libraries (AndroidX, Kotlin, Jackson...) are shrunk and obfuscated; AGP puts the mapping file into the AAB for Play crash deobfuscation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Ly4RP96nLUnj4FWtWthpE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Play Console warns that the release DEX is below its optimization threshold (obfuscation 1 %). R8 was disabled on purpose because Rust calls app Kotlin classes by name over JNI.
Change
isMinifyEnabled = trueforrelease, withproguard-android-optimize.txt,proguard-rules.proandproguard-tauri.pro.proguard-rules.prokeepscom.voltius.app.**whole (JNI from Rust:VoltiusKeychain,VoltiusBiometric,VoltiusTunnelService,VoltiusDownloads,SystemBars… and@JavascriptInterfacebridges). Tauri's own classes are covered by the consumer rules its library ships.-dontwarnfor Tink's compile-onlyjavax.annotation.Nullable/GuardedBy(pulled in bysecurity-crypto), which otherwise fails the R8 task.androidx.activity.Api34Impl -> a.a); AGP bundles the mapping file into the AAB, so Play crash reports stay readable.Tested on the emulator with an x86_64 release APK (R8 on, signed with the repo test keystore), installed over existing data:
VoltiusTunnelServiceruns in the foreground and the port listensVoltiusDownloads.launchPicker), file written to Documents with the right contentClassNotFoundException/NoSuchMethodErrorin logcat🤖 Generated with Claude Code
https://claude.ai/code/session_015Ly4RP96nLUnj4FWtWthpE