Added supporting apk patches via docker #636
Closed
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.
This makes a few changes which allow for users to patch APK files via Docker.
Suggested in: #528
Notable Changes
Dockerfile was added
Make command was added to build docker. --platform linux/amd64 was added to ensure it also works on Mac silicon
Set objection to use aapt2 by default
The step that runs empty-framework-dir was removed. This was causing a lot of issues and preventing apktool from rebuilding the apk. This should only be required if the user is using a v1 version of apktool and never ran this command after updating to v2. If there's another use case for this that im not aware of, I can add it back.
While there is ways to use adb from within the container to query the device for architecture, I felt like it could possibly introduce a bunch of other issues and add to the complexity. For this reason, the architecture type must be passed in along with the docker run command. Adb is still on the final image to make it easier to add that feature later on.
Other changes are just overall formatting, variable names, and other small fixes. (I have auto format enabled, can disable it and change formatting back if you want)
Patching APK
Once the container is pulled/built, patching the APK should be straight forward.
Example:
Note: The container could take a while to patch the apk (~5-20 min). One way to check to see if its not stuck somewhere is to use the
docker stats
command and see if the containers cpu usage is fluctuating.You should then see the patched apk in the same folder as the original APK.