笔记:如何使用apktool+dex2jar反编译apk并发布新apk

1.apktool
在这里插入图片描述
ubuntu16.04版的apt install 版本的用不了,手动下载最新版的:

下载好之后,按教程复制到相关地方:
教程链接:添加链接描述

Install Instructions
Quick Check

Is at least Java 1.8 installed?
Does executing java -version on command line / command prompt return 1.8 or greater?
If not, please install Java 8+ and make it the default. (Java 7 will also work at this time)

Installation for Apktool

Windows:
    Download Windows wrapper script (Right click, Save Link As apktool.bat)
    Download apktool-2 (find newest here)
    Rename downloaded jar to apktool.jar
    Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
    If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
    Try running apktool via command prompt
Linux:
    Download Linux wrapper script (Right click, Save Link As apktool)
    Download apktool-2 (find newest here)
    Rename downloaded jar to apktool.jar
    Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
    Make sure both files are executable (chmod +x)
    Try running apktool via cli

使用方法:
添加链接描述

解包:

apktool d xxx.apk

打包:

$ apktool b bar -o new_bar.apk
// builds bar folder into new_bar.apk

获取你需要的相应的东西,比如:class.dex
然后用(bak)smali进行转换。

2.dex2jar
在这里插入图片描述

下载好zip包,解压,如何操作:

笔记:如何使用apktool+dex2jar反编译apk并发布新apk_第1张图片使用方法:

d2j-dex2jar.sh class.dex

dex2jar下载: https://sourceforge.net/projects/dex2jar/

3.signapk.jar
下载signapk.jar platform.x509.pem platform.pk8。
使用方法:

 java -jar signapk.jar platform.x509.pem platform.pk8 yourapp.apk yourappSigned.apk

参考链接:

安卓apk反编译、修改、重新打包、签名全过程

Android对apk源码的修改–反编译+源码修改+重新打包+签名【附HelloWorld的修改实例】

一步一步带你反编译apk,并教你修改smali和重新打包

Android 用 platform.pk8 和 platform.x509.pem 生成 keystore 系统签名文件

注意的点:
1.apktool 用最新版
2.apktool 打包后要进行签名,否则安装时会说“解析安装包出错”
3.逆向之后的AndoridManifest.xml还是无法阅读,需要另一个工具:
AXMLPrinter2.jar
使用方法:

 java -jar AXMLPrinter2.jar AndroidManifest.xml AndroidManifest.txt

好了,简单的逆向搞定了,然而想在里面加文件夹等好像还没成功,替换的话倒简单。
往apk里添加一个文件(夹)

你可能感兴趣的:(笔记:如何使用apktool+dex2jar反编译apk并发布新apk)