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] aapt binaries for arm #2811

Closed
oSumAtrIX opened this issue May 5, 2022 · 11 comments
Closed

[FEAT] aapt binaries for arm #2811

oSumAtrIX opened this issue May 5, 2022 · 11 comments

Comments

@oSumAtrIX
Copy link

Problem

Currently apktool-lib has no prebuild binaries for thr arm architecture. This means, that resources can not be compiled on mobile phones.

Solution

Add pre-built binaries for the arm architecture. Termux currently provides these pre-build binaries and build scripts here.

@iBotPeaches
Copy link
Owner

The problem is more so signing up to support alternative architectures. I don't plan on moving on this until native AOSP supports it.

Lodged into Roadmap - https://github.com/iBotPeaches/Apktool/blob/master/ROADMAP.md#android-support

@Anonymous2716
Copy link

Termuxs aapt doesn't work well yet with apps that was targeted recent android versions (11, 12) .I did a little tweak that allows me to use x86 binaries run on termux.

@oSumAtrIX
Copy link
Author

@Anonymous2716 would this not require emulation?

@Anonymous2716
Copy link

@oSumAtrIX yes I did it with qemu-i386. A little slower than native use but not that noticeable.

@oSumAtrIX
Copy link
Author

Termuxs aapt doesn't work well yet with apps that was targeted recent android versions (11, 12)

Can you elaborate on that

@Anonymous2716
Copy link

Anonymous2716 commented May 14, 2022

@oSumAtrIX termux uses its aapt as default with apktool. And every time I use apktool on recent SDK targeted (not entirely sure if its the issue) apps it gives me XML build errors . which app doesn't have a lots of XML in res works just fine . e.g. helloworld apks.

❯ apktool b base -o b.apk
I: Using Apktool 2.6.1-dirty
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: res/drawable/$avd_hide_password__0.xml: Invalid file name: must contain only [a-z0-9_.]
W: res/drawable/$avd_hide_password__1.xml: Invalid file name: must contain only [a-z0-9_.]
W: res/drawable/$avd_hide_password__2.xml: Invalid file name: must contain only [a-z0-9_.]
W: res/drawable/$avd_show_password__0.xml: Invalid file name: must contain only [a-z0-9_.]
W: res/drawable/$avd_show_password__1.xml: Invalid file name: must contain only [a-z0-9_.]
W: res/drawable/$avd_show_password__2.xml: Invalid file name: must contain only [a-z0-9_.]
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/data/com.termux/files/usr/tmp/brut_util_Jar_106390223823776650034599575935767187581.tmp, p, --min-sdk-version, 16, --target-sdk-version, 30, --version-code, 16150060, --version-name, v4.8.1, --no-version-vectors, -F, /data/data/com.termux/files/usr/tmp/APKTOOL2337288095946542186.tmp, -0, resources.arsc, -0, png, -0, arsc, -I, /data/data/com.termux/files/home/.local/share/apktool/framework/1.apk, -S, /data/data/com.termux/files/home/a/base/res, -M, /data/data/com.termux/files/home/a/base/AndroidManifest.xml]

@Anonymous2716
Copy link

Anonymous2716 commented May 14, 2022

@oSumAtrIX as this https://github.com/termux/termux-packages/blob/master/packages/apktool/aapt-wrapper.patch I call qemu-i386 aapt (I gave absolute paths) instead of termux provided aapt. or 64bit your choice . since apktool provides standalone one binary it works. And I compiled apktool from source (v2.6.2) as the instructions given in termuxs repository. I tried v 2.6.1 gives me errors . I don't recall whice ones. The framework apk apktool provides doesn't seem to resolve all the XML references . a recent update termuxes aapt (android.jar) updated to SDK 31. So I copied android.jar to the path of apktools framework 1.apk. Now I can reverse engineer apps on my phone . and a real device to test on without needing to transfer and adb.

@oSumAtrIX
Copy link
Author

Would modifying the aapt build scripts to use the latest sdk not work?

@Anonymous2716
Copy link

Anonymous2716 commented May 15, 2022

I dont know whats difference between apktools binary termuxs and this one below. There are arm binaries that works but couldn't find the source or how to build. Check https://github.com/Hax4us/Apkmod release page . it works in proot.

@oSumAtrIX
Copy link
Author

The problem is more so signing up to support alternative architectures

@iBotPeaches We have successfully built aapt2 (and aapt) for several architectures and tested it on android with Apktool and from an Android app:
https://github.com/revanced/aapt2/actions/runs/2373859817

@Anonymous2716
Copy link

Anonymous2716 commented Oct 5, 2022

@eladkarako your aapt2 binary just prints the help message . not doing anything else. Takes no arguments.

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

No branches or pull requests

3 participants