-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Prebuilt aapt not found if apktool jar is built into a spring boot app #1543
Comments
Why is that? You can also do a Pull Request to propose changes to this functionality in that is easier to describe an enhancement or tweak. |
Class.class.getResourceAsStream tries to load resource from root directory. This fails when apktool is built into a fat jar like Spring boot executable becasue the classloader of Class tries to load the resource from the root directory of the Spring boot jar instead of that of the bundled appktool jar. The loading of android-framework.jar works because it's the classloader of AndrolibResources loading the jar. I created a pull request to show the fix that works for my app. |
This is the classloader for AndrolibResources: org.springframework.boot.loader.LaunchedURLClassLoader. |
Thanks for the report and quick pull request. This has been merged into master. |
- Android O Final Dev Preview support (iBotPeaches/Apktool#1520) - SnakeYAML 1.1.8 Android Support (iBotPeaches/Apktool#591) - Fix issue with APKs taking longer than usual to parse resources (iBotPeaches/Apktool#1489) - Fix issue with internal binaries not accessible in a Spring boot environment. (iBotPeaches/Apktool#1543) - Fix issues with rebuilding applications originally built with aapt2. (iBotPeaches/Apktool#1520) - Patch aapt to support the $ character in resource filenames. (iBotPeaches/Apktool#1532) - Fix issue where apktool was holding locks onto files during execution. (iBotPeaches/Apktool#1561) - Fix issue with APKs that last resource in pool is INVALID_TYPE_CONFIG. (iBotPeaches/Apktool#1534) - Fix issue with APKs that are including malformed characters to break parser. (iBotPeaches/Apktool#1564) - Only exit with 0 error code during version commands. - Enforce license header on all source files. - [Security] Prevent malicous directory traversal with unknown files. - [Security] Prevent XXE vulnerability when given a malicious AndroidManifest.xml - Upgrade to gradle 4.0.
- Android O Final Dev Preview support (iBotPeaches/Apktool#1520) - SnakeYAML 1.1.8 Android Support (iBotPeaches/Apktool#591) - Fix issue with APKs taking longer than usual to parse resources (iBotPeaches/Apktool#1489) - Fix issue with internal binaries not accessible in a Spring boot environment. (iBotPeaches/Apktool#1543) - Fix issues with rebuilding applications originally built with aapt2. (iBotPeaches/Apktool#1520) - Patch aapt to support the $ character in resource filenames. (iBotPeaches/Apktool#1532) - Fix issue where apktool was holding locks onto files during execution. (iBotPeaches/Apktool#1561) - Fix issue with APKs that last resource in pool is INVALID_TYPE_CONFIG. (iBotPeaches/Apktool#1534) - Fix issue with APKs that are including malformed characters to break parser. (iBotPeaches/Apktool#1564) - Only exit with 0 error code during version commands. - Enforce license header on all source files. - [Security] Prevent malicous directory traversal with unknown files. - [Security] Prevent XXE vulnerability when given a malicious AndroidManifest.xml - Upgrade to gradle 4.0.
- Android O Final Dev Preview support (iBotPeaches/Apktool#1520) - SnakeYAML 1.1.8 Android Support (iBotPeaches/Apktool#591) - Fix issue with APKs taking longer than usual to parse resources (iBotPeaches/Apktool#1489) - Fix issue with internal binaries not accessible in a Spring boot environment. (iBotPeaches/Apktool#1543) - Fix issues with rebuilding applications originally built with aapt2. (iBotPeaches/Apktool#1520) - Patch aapt to support the $ character in resource filenames. (iBotPeaches/Apktool#1532) - Fix issue where apktool was holding locks onto files during execution. (iBotPeaches/Apktool#1561) - Fix issue with APKs that last resource in pool is INVALID_TYPE_CONFIG. (iBotPeaches/Apktool#1534) - Fix issue with APKs that are including malformed characters to break parser. (iBotPeaches/Apktool#1564) - Only exit with 0 error code during version commands. - Enforce license header on all source files. - [Security] Prevent malicous directory traversal with unknown files. - [Security] Prevent XXE vulnerability when given a malicious AndroidManifest.xml - Upgrade to gradle 4.0.
I'm trying to use apktool jar in a Spring boot project and found that prebuilt aapt binaries are not accessible in the Spring boot executable jar while android-framework.jar is.
The cause of this is that Jar#extractToTmp calls getResourceAsStream on Class.class instead of AndrolibResources.class. And in the context of Spring boot, this call fails because the prebuilt aapt binaries are not packaged in the root directory.
Any chance to change this method and those calling it to something like this?
The text was updated successfully, but these errors were encountered: