Skip to content

Expose the aapt --no-crunch option #1849

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

Closed
wants to merge 2 commits into from

Conversation

Novex
Copy link
Contributor

@Novex Novex commented Jul 24, 2018

Adds a --no-crunch/-nc flag to apktool which gets passed through to aapt. This allows apktool to make a byte-for-byte copy of resource files which lowers the amount of changes when generating patches.

Happy to add tests if you can point me in the right direction - I'm not super familiar with the java ecosystem and I couldn't find any existing ones that included aaptPackage.

Also there was a feature request for this in #1232, which is already closed anyway.

- Add a --no-crunch/-nc flag to apktool which gets passed through to aapt
- This allows apktool to make a byte-for-byte copy of resource files
- refs: iBotPeaches#1232
@iBotPeaches
Copy link
Owner

Thanks for the pull-request. I'm not sure of a way to test this efficiently. I might run a little test locally with an image to detect modifications, otherwise I'll get this merged.

@iBotPeaches iBotPeaches self-assigned this Jul 24, 2018
@iBotPeaches iBotPeaches added this to the 2.3.4 milestone Jul 24, 2018
@iBotPeaches
Copy link
Owner

iBotPeaches commented Aug 1, 2018

Going to need to dig into this more. no-crunch is destroying 9patch images.

Original

testapp-orig/res/drawable-xxhdpi/ic_notification_overlay.9.png

Rebuilt w/ --no-crunch

testapp-new/res/drawable-xxhdpi/ic_notification_overlay.png

It wiped the .9. portion of filename, thus tests failed.

@Novex
Copy link
Contributor Author

Novex commented Aug 2, 2018

I've only tested with one apk, but my 9patch images seem to be rebuilt ok. I think it's not using aapt2 if that helps narrow it down.

@iBotPeaches iBotPeaches modified the milestones: 2.3.4, 2.4.0 Aug 31, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@iBotPeaches
Copy link
Owner

Sorry for the massive delay on this. So this was a bug in aapt2 that I think was related to this - https://issuetracker.google.com/issues/73456168

As this request is nearly 6 months old (Apologies for that). I pulled this change down again and all my tests locally (mac) are passing, so I just updated this project with the latest codebase.

Going to let the CI run with latest code and dive in again. I think we just had to wait on AOSP for this.

@iBotPeaches
Copy link
Owner

This has been merged in.

@iBotPeaches iBotPeaches closed this Jan 4, 2019
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

2 participants