我正在尝试使用 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