Skip to content

Conversation

al-rosenthal
Copy link
Contributor

@al-rosenthal al-rosenthal commented Sep 2, 2025

Summary of Changes

On some android devices, the bundled js was large enough to cause start up problems, steps taken to reduce bundled js size

  • updated app/bundle.gradle to include proguard, which helps minify android code during builds
  • updated metro.config to build with metro-minify-terser to minify the bundled js
  • added clean up to console.logs in production for additional package size reduction
  • added default values for keystore for local builds

Screenshots, videos, or gifs

android-start-up-fix

this gif was captured with the an apk generated locally with the changes and installed directly onto the phone.

Related Issues

BC-Wallet: 2609

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • Related issues are included under the Related Issues section above
  • If applicable, screenshots, gifs, or video are included for UI changes

Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
@al-rosenthal al-rosenthal marked this pull request as ready for review September 2, 2025 20:08
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def enableProguardInReleaseBuilds = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Able to confirm Person credential flow still works with this turned on?

Copy link
Member

@jleach jleach Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryce-mcmath Proguard does optimization and shrinking for a bundle in Android so I don't think it will impact app functionality. It should be on where possible IMHO.

EDIT: I doubt it will shrinking or optimize our JS code. Just Android native. We have it turned on in BCSC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked this cause a lot of the Android React Native dependency docs required adding certain proguard exclusions to make things work if you had proguard turned on, and our attestation package uses some Android dependencies. Should be fine, just might be worth a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleach After testing the person credential flow with pro guard enabled it fails at a strange step. The app still initializes and the camera/ QR code scanning seems to work but that person workflow stops at the Connecting to agent... which is the very first step. Disabling progaurd fixes that issue and does not affect start up time.

Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Signed-off-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Copy link

sonarqubecloud bot commented Sep 4, 2025

@bryce-mcmath bryce-mcmath merged commit da09105 into main Sep 5, 2025
19 checks passed
@bryce-mcmath bryce-mcmath deleted the fix/android-start-up-time branch September 5, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants