-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Audit][Implementation] - Use shrinkMode strict to reduce the APK size #39592
[Audit][Implementation] - Use shrinkMode strict to reduce the APK size #39592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a very low-priority performance task, but I see no reason to not merge it 👍
@Julesssss Can you please add |
Yep done. Only Android needs to be tested here |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it's even worth finishing this. We'll need further exceptions to fix the resources getting stripped out which may further reduce the APK filesize reduction gains.
@Julesssss I will try adding these to exceptions and see if it's affecting the APK size. If it's then we will close this PR and if it's not then we may continue with this PR. |
@Julesssss I applied the changes and it turns out that the gains are not that much now as compared to the baseline. Baseline:
Before fixes:
After fixes:
Comparing After fixes to the Baseline gives us only 0.8 MB of reduction in APK size and Download size. This is not much of a gain as it was before. For the context, below is the fix I have applied. Let me know if we want to move forward with this PR or otherwise 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks for confirming. I think we should close the PR and move on.
Closing this as the gains are not that high after fixing the reported regressions. |
Details
This PR is part of Audit by callstack and is concerned with reducing the APK size. Since it's regarding APK size, it only affects android.
By default, Android Build Tools uses default shrinking mode when
shrinkResources
is enabled inapp/build.gradle
file. Which covers the most cases and we already have this covered as part of enabling ProGuard here.Building on top of this, we can further reduce the APK size by ~2 MB if we use
shrinkMode=strict
, however this requires to add keep rules for not removing the images we require. This is also fixed in this PR by addingassets_animations_
andassets_images_
to thekeep.xml
file.Before:
After:
Fixed Issues
$ #39700
PROPOSAL: #39700
Tests
Testing Steps:
General usage of the app should not result in missing images
Verify that no errors appear in the JS console
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-04-04.at.4.22.07.PM.mov
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A
MacOS: Desktop
N/A