我正在尝试使用apktool修改Android应用。
我已经下载了apktool,现在我有3个文件apktool,aapt和apktool.jar
我正在尝试修改Gallery_3D.apk的背景
我正在使用这些命令进行反编译,然后重新编译
./apktool if Gallery 3D.apk
./apktool d Gallery 3D.apk gallery
对于上述2个步骤,但使用命令
重新编译时,它可以正常工作./apktool b gallery Gallery 3D New.apk
但是我在最后一步收到了这个错误。
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL4811911322257021960.tmp, -I, /home/seat2/apktool/framework/1.apk, -S, /home/seat2/Desktop/apktool/gallery/res, -M, /home/seat2/Desktop/apktool/gallery/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL4811911322257021960.tmp, -I, /home/seat2/apktool/framework/1.apk, -S, /home/seat2/Desktop/apktool/gallery/res, -M, /home/seat2/Desktop/apktool/gallery/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at java.lang.Runtime.exec(Runtime.java:610)
at java.lang.Runtime.exec(Runtime.java:483)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 10 more
答案 0 :(得分:0)
我知道这是一个很老的答案,但我会发布解决方案以防有人仍然需要帮助。
RC指出了第一个问题:你需要在你的路径上添加一个问题。您可以使用以下命令执行此操作:
PATH=$PATH:/location/of/aapt
要修复第二个问题( INSTALL_PARSE_FAILED_NO_CERTIFICATES ),您需要在apk上签名。您可以使用testsign.jar执行此操作:
java -jar testsign.jar unsigned.apk signed.apk