addpkg(main/apktool): 3.0.1#28991
Conversation
dcd081a to
35dbc09
Compare
robertkirkman
left a comment
There was a problem hiding this comment.
please use rm -rf disabled-packages/apktool, then git add . , then git commit --amend, then git push -f origin apktool
|
Why was the original apktool disabled? |
|
The commit message said it's because it's "not working" |
|
Okay, I understand. I'll give it a try and see |
958e77b to
ba63b9f
Compare
ba63b9f to
939c8aa
Compare
|
@robertkirkman I think I fixed it. |
There was a problem hiding this comment.
Unfortunately, for me, the original problem is still reproducible.
To reproduce the error, a precompiled Android APK (any) is required as test data
These commands produce it:
apktool d app.apk -o test
apktool b -o out.apk testhere is the error:
I: Using Apktool 3.0.1-dirty on soh.apk with 6 threads
I: Smaling smali folder into classes.dex...
I: Smaling smali_classes3 folder into classes3.dex...
I: Smaling smali_classes4 folder into classes4.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Building resources with aapt2...
Exception in thread "main" brut.androlib.exceptions.AndrolibException: brut.common.BrutException: Execution failed (exit code = 2): [/data/data/com.termux/files/usr/tmp/aapt2_24006682307500161125675915606835355288.tmp, compile, --dir, test/res, --legacy, -o, test/build/resources.zip]
at brut.androlib.res.AaptInvoker.invoke(SourceFile:90)
at brut.androlib.ApkBuilder.buildResources(SourceFile:357)
at brut.apktool.Main.main(SourceFile:92)
Caused by: brut.common.BrutException: Execution failed (exit code = 2): [/data/data/com.termux/files/usr/tmp/aapt2_24006682307500161125675915606835355288.tmp, compile, --dir, test/res, --legacy, -o, test/build/resources.zip]
at brut.util.OS.exec(SourceFile:147)
at brut.androlib.res.AaptInvoker.invoke(SourceFile:87)
... 2 more
W: /data/data/com.termux/files/usr/tmp/aapt2_24006682307500161125675915606835355288.tmp: 2: Syntax error: "(" unexpected
I could outline some of what I know about this issue so far:
apktoolrequires a specialaapt2with patches- The one that comes with it by default is for x86 GNU/Linux, so that is why that one has this error
- The one that comes from
pkg install aapt2seems to not have the necessary version and/or patches needed byapktool - Source code of the required special
aapt2might be unavailable, and you might need to invent a new one from scratch to fix this
|
Okay. |
|
@robertkirkman Okay, I seem to have found a method. Can we achieve this by replacing the aapt2 binary file? |
|
Or rather, Should we update the aapt2 package? |
It may depend on this: I have left other reviews in that PR. I think that if you copy and paste that PR and try to update it to make your own version, that would be ok. The original creator seems to be afk. |
what aapt2 did you replace it with? |
|
It's from here https://github.com/ReVanced/aapt2 |
|
Good. If you can find a way to build that version in the Termux |
|
I created a new pr. #28994 |
|
Is there a way to directly download the deb packages present in the official repository and extract the binary files? |
Yes, here is an example curl -O https://packages-cf.termux.dev/apt/termux-x11/pool/main/d/dia/dia_0.97.2-p20260216-0_aarch64.deb
ar x dia_0.97.2-p20260216-0_aarch64.deb
tar xvf data.tar.xz
ls data/data/com.termux/files/usr/bin |
|
Okay, I think we should handle aapt's PR first before dealing with this, after all, it requires aapt. |



Apktool is a tool for reverse engineering Android apps (decoding, rebuilding, and smali debugging).