Repository navigation
Conversation
…ToEdge Google Play flags 1.3.4: "DEX code optimisation is below our threshold: Obfuscation (0%)", to fix by Feb 2027. The release build now runs R8 with proguard-android-optimize.txt. proguard-rules.pro keeps all com.shimmerresearch code as it is (driver, library, app, biophysical processing jar): it relies on Java serialization (devices are configured through serialized clones, private readObject/writeObject) and reflection (ExGConfigBytesDetails and UartPacketDetails collect static fields reflectively). androidplot and AndroidBluetoothLibrary work by reflection and are kept too, as are the two AppCompat names MainActivity reaches by name to align the toolbar (Toolbar.mTitleTextView, ActionMenuView), which R8 would rename silently. -dontwarn covers what the driver refers to that the app never had: protobuf, Netty and JNA (excluded in the build), desktop UI, and optional gRPC/Netty/Guava dependencies. 79.8% of classes are obfuscated (Play's threshold is 25%); the APK goes from 25.8 to 11.8 MB. The workflow keeps R8's mapping.txt as its own artifact and the play job uploads it, so Play's crash reports show real names; the release job never publishes it. MainActivity goes edge to edge with EdgeToEdge.enable() instead of WindowCompat.setDecorFitsSystemWindows(), as Play recommends, with light status bar icons over the always-dark toolbar. RELEASING.md explains R8, what it breaks (at runtime only) and that the dry run's APK, not the debug build, is what to test on hardware. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Google Play's dashboard for ShimmerCapture 1.3.4 flagged one issue to fix by Feb 2027 and recommended two actions. This addresses the issue and the first recommendation, explains the second, and raises the app to 1.3.5 / versionCode 38.
1. "DEX code optimisation is below our threshold: Obfuscation (0%)": fixed
The release build now runs R8 (
minifyEnabled true,proguard-android-optimize.txt). R8 breaks code that's found by name at runtime only, never at build time. Soproguard-rules.prokeeps everything R8 can't see being used, each rule with its reason:All Shimmer code,
com.shimmerresearch.**: the driver, this library, the app, and the closed-source biophysical processing jar. It relies on:readObject/writeObject.ExGConfigBytesDetails.getExGConfigOptionFields()andUartPacketDetails.getUartPropertyParsed()collect static fields reflectively, so R8 would drop those fields as unused and the ExG option lists would come out short.Keeping it whole makes this safe without auditing every class. Optimising it can come later, one hardware-tested step at a time.
androidplot (its
Configuratorreflects on getter and setter names) and AndroidBluetoothLibrary (built on reflection).Two AppCompat names
MainActivityuses:Toolbar.mTitleTextView, read by reflection, andActionMenuView, matched by class name, to align the toolbar. R8 would rename both, and the code'scatch (Exception ignore)would hide the failure: the toolbar would just look slightly off.-dontwarnfor classes the driver refers to that were never in the app:build.gradle;java.awt,javax.swing);The code referring to them is Shimmer code, kept as-is, so the app behaves exactly as before.
Result: 5,332 of 6,680 classes are obfuscated, 79.8%; Play's threshold is 25%. The APK goes from 25.8 MB to 11.8 MB. I searched the app, the library and the driver at
0.11.12_betafor reflection and class-name checks into non-Shimmer code. The two AppCompat sites above are the only ones; the driver's one check is against a Shimmer class, which is kept.Crash reports: the workflow keeps R8's
mapping.txtas its own artifact,shimmercapture-mapping, and the play job uploads it with the APK, so Play's crash reports show real names. The release job publishes onlyshimmercapture-apk, so the mapping never reaches the public GitHub release.2. "Edge-to-edge may not display for all users": fixed
MainActivitynow usesEdgeToEdge.enable()(androidx.activity 1.8.0, already a dependency) instead ofWindowCompat.setDecorFitsSystemWindows(…, false). It setsSystemBarStyle.dark(…)for the status bar, so the icons stay light over the toolbar, which is dark in both light and dark mode. The default would give dark icons in light mode. The existing inset listeners are unchanged.3. "Your app uses deprecated APIs or parameters for edge-to-edge": not fixed here
Neither the app nor the library calls the deprecated APIs (
setStatusBarColor,setNavigationBarColor, …). The likely sources are AppCompat/Material 1.12.0 and androidx.activity 1.8.0, which still call them internally. The versions that stop doing so need compileSdk 35+, which this repo's AGP 8.2.2 doesn't support, so the fix is a toolchain upgrade for the whole repo, every example and CI. Play Console lists the exact call sites under that recommendation: if they're all inside libraries, that upgrade is the fix and needs its own ticket.Tested
On the Android 16 emulator (Pixel 7 and Pixel Tablet profiles), using the shrunk release APK itself, signed with a throwaway key:
Bluetooth Manager created; Connect opensWindowLeaked, layout as beforeClassNotFoundException,NoSuchField/Method,InvalidClassException,NoClassDefFoundErrorassembleReleaseandassembleDebugpass.Not yet tested: real hardware. Nothing above connects to a Shimmer, and that's where serialization (configuring through clones), the ExG options and streaming are exercised. Before release:
shimmercapture-apkartifact, signed with the real key) on a phone, after uninstalling the Play version.RELEASING.mdnow says this: the debug build is never shrunk, so it can't show what R8 breaks.Also
RELEASING.md: a new R8 section covering what's kept and why, what breaks and where, how to add a rule, and the mapping file. The failure table covers Missing classes detected while running R8 and a release-only crash.AGENTS.md: a short note on R8.ShimmerServiceand the fragments, not these files, so the two merge in either order.🤖 Generated with Claude Code