Simple way: use online tool http://www.javadecompilers.com/apk , upload apk and get source code.
(简单方法:使用在线工具http://www.javadecompilers.com/apk ,上传apk并获取源代码。)
Procedure for decoding .apk files, step-by-step method:
(.apk文件解码过程,分步方法:)
Step 1: (第1步:)
Make a new folder and copy over the .apk file that you want to decode.
(新建一个文件夹,然后复制要解码的.apk文件。)
Now rename the extension of this .apk file to .zip (eg rename from filename.apk to filename.zip) and save it.
(现在,将此.apk文件的扩展名重命名为.zip(例如,从filename.apk重命名为filename.zip)并保存。)
Now you can access the classes.dex files, etc. At this stage you are able to see drawables but not xml and java files, so continue. (现在,您可以访问classes.dex文件等。在此阶段,您可以看到可绘制对象,但看不到xml和java文件,因此继续。)
Step 2: (第2步:)
Now extract this .zip file in the same folder (or NEW FOLDER).
(现在,将此.zip文件解压缩到同一文件夹(或NEW FOLDER)中。)
Download dex2jar and extract it to the same folder (or NEW FOLDER).
(下载dex2jar并将其解压缩到同一文件夹(或NEW FOLDER)。)
Move the classes.dex file into the dex2jar folder.
(将classes.dex文件移动到dex2jar文件夹中。)
Now open command prompt and change directory to that folder (or NEW FOLDER).
(现在打开命令提示符,并将目录更改为该文件夹(或NEW FOLDER)。)
Then write d2j-dex2jar classes.dex
(for mac terminal or ubuntu write ./d2j-dex2jar.sh classes.dex
) and press enter. (然后编写d2j-dex2jar classes.dex
(对于Mac终端或ubuntu,请编写./d2j-dex2jar.sh classes.dex
)并按Enter。)
You now have the classes.dex.dex2jar file in the same folder. (现在,您在同一文件夹中有classes.dex.dex2jar文件。)
Download java decompiler , double click on jd-gui, click on open file, and open classes.dex.dex2jar file from that folder: now you get class files.
(下载java decompiler ,双击jd-gui,单击打开文件,然后从该文件夹中打开classes.dex.dex2jar文件:现在,您获得了类文件。)
Save all of these class files (In jd-gui, click File -> Save All Sources) by src name.
(通过src名称保存所有这些类文件(在jd-gui中,单击File-> Save All Sources)。)
At this stage you get the java source but the .xml files are still unreadable, so continue. (在此阶段,您获得了Java源代码,但是.xml文件仍然不可读,因此继续。)
Step 3: (第三步:)
Now open another new folder
(现在打开另一个新文件夹)
Put in the .apk file which you want to decode
(放入您要解码的.apk文件)
Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder
(下载最新版本的apktool 和 apktool安装窗口 (均可从同一链接下载)并将它们放置在同一文件夹中)
Open a command window
(打开命令窗口)
Now run command like apktool if framework-res.apk
(if you don't have it get it here )and next
(现在, apktool if framework-res.apk
运行apktool if framework-res.apk
命令(如果没有,请在此处获取 ),然后运行下一步)
apktool d myApp.apk
(where myApp.apk denotes the filename that you want to decode)
(apktool d myApp.apk
(其中myApp.apk表示要解码的文件名))
now you get a file folder in that folder and can easily read the apk's xml files.
(现在,您在该文件夹中获得一个文件夹,并且可以轻松读取apk的xml文件。)
Step 4: (第四步:)
It's not any step, just copy contents of both folders(in this case, both new folders) to the single one
(这不是任何步骤,只需将两个文件夹(在本例中为两个新文件夹)的内容复制到一个文件夹中)
and enjoy the source code...
(并享受源代码...)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…