我希望能从apk文件中提取源代码。为此,我参考了网上给出的链接。但是,当我在命令提示符上运行dex2jar classes.dex时,我遇到了以下错误:
"初始化VM时发生错误
无法为对象堆保留足够的空间
无法创建JVM"
请指导我如何解决这个错误。
请在您的文件夹中编辑dex2jar.bat文件。将其修改为:
java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.v3.Main" %*
内存设置应该更小。
对于源代码,您需要两个工具
i) dex2jar
ii) jd-gui
使用这个工具需要一个 .apk 文件,然后
step 1 : Right click on that .apk file and convert it into .zip
step 2: unZip that file then take classes.dex from this unzip folder
step 3: Go to cmd then go to the path of dex2jar folder like D:\dex2jar tools\dex2jar-0.0.9.8\dex2jar-0.0.9.8
step 4: write dex2jar classes.dex
step 5: press Enter
step 6: then see in path D:\dex2jar tools\dex2jar-0.0.9.8\dex2jar-0.0.9.8 you can see a .zip file of classes then unzip and
step 7 : import that files in jd-gui software