文章目录
- 一、apktool_2.6.0.jar 下载和使用
- 二、使用 zipalign 工具进行对齐操作
- 三、使用 apksigner 工具进行签名
- 四、完整命令行输出
一、apktool_2.6.0.jar 下载和使用
在 https://ibotpeaches.github.io/Apktool/ 页面下载最新的 apktool 工具 ;
下载完毕后 , 使用
代码语言:javascript复制java -jar apktool_2.6.0.jar d out_old.apk -o out_old
命令解包 ;
完整命令行输出 :
代码语言:javascript复制D: 04_Operatedingxiangjiagu>java -jar apktool_2.6.0.jar d out_old.apk -o out_old
I: Using Apktool 2.6.0 on out_old.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:UsersoctopAppDataLocalapktoolframework1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
修改 apk 文件 , 然后使用
代码语言:javascript复制java -jar apktool_2.6.0.jar b out_old -o out.apk
命令 , 重新打包 ;
完整命令行输出 :
代码语言:javascript复制D: 04_Operatedingxiangjiagu>java -jar apktool_2.6.0.jar b out_old -o out.apk
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Copying libs... (/kotlin)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
二、使用 zipalign 工具进行对齐操作
对齐命令 :
代码语言:javascript复制D: 01_Develop 01_SDKSdkbuild-tools29.0.2zipalign -f 4 out.apk out_zipalign.apk
三、使用 apksigner 工具进行签名
签名命令 :
代码语言:javascript复制D: 01_Develop 01_SDKSdkbuild-tools29.0.2apksigner sign –ks midi.jks –ks-key-alias qianyinhulian –ks-pass pass:P@ssw0rd –key-pass pass:P@ssw0rd1501 –out plam_band.apk out_zipalign.apk
四、完整命令行输出
代码语言:javascript复制D: 04_Operatedingxiangjiagu>java -jar apktool_2.6.0.jar d out_old.apk -o out_old
I: Using Apktool 2.6.0 on out_old.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:UsersoctopAppDataLocalapktoolframework1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
D: 04_Operatedingxiangjiagu>java -jar apktool_2.6.0.jar b out_old -o out.apk
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Copying libs... (/kotlin)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
D: 04_Operatedingxiangjiagu>D: 01_Develop 01_SDKSdkbuild-tools29.0.2zipalign -f 4 out.apk out_zipalign.apk
D: 04_Operatedingxiangjiagu>D: 01_Develop 01_SDKSdkbuild-tools29.0.2apksigner sign -ks key.jks -ks-key-alias key -ks-pass pass:123456 -key-pass pass:123456789 -out app_singed.apk out_zipalign.apk
D: 04_Operatedingxiangjiagu>