bash 终端无法运行 apktool
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21656721/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Terminal can't run apktool
提问by user3289129
I am using macOSX, and trying to extract all the files in a APK file, I've extracted it with zip and unzip. Used dex2jar to extract classes.dex to jar file and decompiled it.
我正在使用 macOSX,并尝试提取 APK 文件中的所有文件,我已使用 zip 和解压缩将其解压缩。使用 dex2jar 将 classes.dex 提取到 jar 文件并反编译它。
Now when I am in my last step, using APKtool to decode the apk file, however, it shows "-bash: apktool: command not found " eventhough I put all 3 files(aapt, apktool and apktool.jar) into one folder.
现在,当我进行最后一步时,使用 APKtool 解码 apk 文件,但它显示“-bash:apktool:未找到命令”,即使我将所有 3 个文件(aapt、apktool 和 apktool.jar)放入一个文件夹中。
How can I decompile with my apktool now?
我现在如何用我的 apktool 反编译?
回答by flagoworld
If you are using relative paths to execute apktool, and you are cd
d to the directory they are in, you have to prefix the command with ./
如果您使用相对路径来执行 apktool,并且您是cd
d 到它们所在的目录,则必须在命令前加上./
So if apktool is at /path/to/apktool
所以如果 apktool 在 /path/to/apktool
And you cd /path/to
和你 cd /path/to
Then type ./apktool
然后输入 ./apktool
Instead of apktool
代替 apktool
If you want to add this folder to your PATH, you can do that too...
如果您想将此文件夹添加到您的 PATH,您也可以这样做...
Open ~/.bashrc
in a text editor of choice and add this to the bottom of it:
~/.bashrc
在选择的文本编辑器中打开并将其添加到它的底部:
PATH=$PATH:/path/to
PATH=$PATH:/path/to
Where, once again, /path/to
is the folder that contains apktool
.
再一次,/path/to
包含apktool
.
Now you can just type apktool
from anywhere.
现在您可以apktool
从任何地方输入。