Skip to content
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

feat: support aapt optimization #3558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zjns
Copy link

@zjns zjns commented Mar 30, 2024

These options help reduce the apk size when using aapt2, and --collapse-resource-names may have side effects.

@iBotPeaches
Copy link
Owner

At the moment, I don't really see a need for this. Apktool challenge is reading and understanding these sparse/collapsed applications. I don't understand a use-case where users would be disassembling and reassembling an application with intention to sparse/chunk/collapse.

I'd be interested in hearing what is leading you to this need.

@zjns
Copy link
Author

zjns commented Mar 31, 2024

Basically, most apps now perform the --shorten-resources-names optimization when they are compiled. It's default behavior when shrinkResouces flag enabled. When the app is large, shortening the resource path name can indeed reduce the size of the apk. As for the other two flags, there is really no need for them.

@iBotPeaches
Copy link
Owner

I'm more worried about the flag in general when used with Apktool. This optimize feature works very well at stripping things that Apktool has to piece back together. Its a challenge in of itself to just disassemble and reassemble after an optimize command.

For this to go into the core - we'd need a few tests and samples to ensure a few things

  • basic build -> optimize
  • optimized build -> optimize

Copy link
Owner

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

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

At moment - going to hold on this for reasons mentioned.

@HassanMirza01
Copy link

HassanMirza01 commented Jul 16, 2024

@iBotPeaches seems out of context question but can the build time be reduced for recompile? one Settings app take around 25min to compile on my Ryzen 7 4700U laptop with 40GB ram,

its due to languages addition done in app but is there a way can this be reduced? without those additional languages, it repack same apk in less than 4mins

@iBotPeaches
Copy link
Owner

@iBotPeaches seems out of context question but can the build time be reduced for recompile? one Settings app take around 25min to compile on my Ryzen 7 4700U laptop with 40GB ram,

2.10.x has performance improvements to add parallelization.

@HassanMirza01
Copy link

@iBotPeaches seems out of context question but can the build time be reduced for recompile? one Settings app take around 25min to compile on my Ryzen 7 4700U laptop with 40GB ram,

2.10.x has performance improvements to add parallelization.

i am always using latest compile binary with latest commits

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.

None yet

3 participants