反编译Android apk

本文详细介绍如何将Android APK文件中的class.dex反编译回Java源代码。首先需将APK文件转换为ZIP格式并提取class.dex文件。利用dex2jar工具将其转换为jar文件,再借助JD-GUI查看并保存反编译后的Java源代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

找到Android 软件安装包中的class.dex:

把apk文件改名为.zip,然后解压缩其中的class.dex文件,它就是java文件编译再通过dx工具打包成的。
 
工具准备:
1、把dex文件反编译为jar文件的工具。(dex2jar)
 
2、把jar反编译为java的工具。(JD-GUI)
jd-gui-0.3.2.windows.zip


Size : 685.83 KB
MD5 checksum : a515eb2a360b62b21ab93b3b0a0adf6bjd-gui-0.3.2.linux.i686.tar.gz

jd-gui-0.3.2.linux.i686.tar.gz
Size : 967.11 KB
MD5 checksum : fc4765536d2730774ce53e33a2f2aeefjd-gui-0.3.2.osx.i686.dmg

jd-gui-0.3.2.osx.i686.dmg
Size : 1.58 MB
MD5 checksum : 4c9c06fbb8599ece8a8ff00a48a33735
Changes
 
反编译步骤:
1、把class.dex拷贝到dex2jar.bat所在目录。运行dex2jar.bat class.dex(linux下使用./dex2jar.sh class.dex),生成classes.dex.dex2jar.jar。
2、运行JD-GUI工具(它是绿色无须安装的),打开上面的jar文件,即可看到源代码。

 

----------------------

Java decompiler

    • for mac/linux: 2 steps, decompile into src zip, then attach to the jar in the eclipse library path
        • jar (or zip) all the classes you want decompiled together.
        • Launch JD-GUI and open your jar (zip) archive.
        • Use "File" - "Save All Sources" menu option. It will decompile all classes from your archive and save their sources into another zip file.
      1. you can add a 'source attachments' to a JAR. You must have the source of your JAR in a zip orjar archive as well.
        • - Select the project, in the context menu select Properties -> Java Build Path
        • - Go to the library page, select your JAR, press 'Attach Source...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值