为 APK 文件增加右键菜单组实现快捷安装、反编译、重签名、导出AndroidManifest、打印签名信息、类型转换、ZIPALIGN字节对齐、显示MD5等功能
Apktool-Windows-Registry
配置注册表为 APK 文件增加右键菜单组实现快捷安装、反编译、重签名、导出AndroidManifest、打印签名信息、类型转换、ZIPALIGN字节对齐、显示MD5等功能
效果
-
apk
-
dex
-
folder
-
aab
功能
- adb install -r / -t(需要在环境变量中配置adb所在路径)
- APK 重签名 v1 / v1&v2(需要修改 SDK_DIR 和 keystore 信息)
- 导出 apk 的 AndroidManifest.xml(需要在环境变量中配置
Android_Sdk\tools\bin
目录,在目录下新建脚本ApkAnalyzer.cmd,修改APP_HOME
) - apktool -d(脚本中写的
apktool.jar
是相对路径,根据需要修改) - apktool -b(同上)
- 打印 apk 中 rsa 文件的签名信息(需要配置 jdk 环境变量)
- 打印 keystore 和 jks 文件的签名信息(同上)
- dex2jar & dex2smali & dex2dexjar(
d2j
和baksmali.jar
需要配置) - cfr.jar(配置
cfr.jar
) - jar2dex(配置
dx.jar
) - class2dex(配置
SDK_DIR
) - bundletool-aab转apks&apks安装(配置
DIR
) - zipalign APK4字节检查与对齐(配置
BUILD_TOOLS_DIR
) - enjarify-反编译jar2dex(配置DIR)
- 通过CertUtil打印文件的MD5值
配置
-
在注册表中找到
HKEY_CLASSES_ROOT
下的.xxx
,确定拓展名对应的配置 -
如果没有拓展名,手动创建,然后新建项
.xxx/shell/name/command
或.xxx/shell/sub/shell/name/command
-
部分的类型被其他软件注册,可以看到
或
需要到对应的项下去配置,如
-
参照本机路径和环境、文件位置配置注册表命令
Todo
使用 GUI 实现全部功能
参考代码
adb
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ApkFile\shell\adb]
"Position"="Center"
"MUIVerb"="adb"
"SubCommands"=""
[HKEY_CLASSES_ROOT\ApkFile\shell\adb\shell]
[HKEY_CLASSES_ROOT\ApkFile\shell\adb\shell\installr]
@="adb install -r"
[HKEY_CLASSES_ROOT\ApkFile\shell\adb\shell\installr\command]
@="PowerShell -noexit adb install -r \"%1\""
[HKEY_CLASSES_ROOT\ApkFile\shell\adb\shell\installt]
@="adb install -t"
[HKEY_CLASSES_ROOT\ApkFile\shell\adb\shell\installt\command]
@="PowerShell -noexit adb install -r -t \"%1\""
sign
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ApkFile\shell\sign]
"Position"="Center"
"MUIVerb"="APK重签名"
"SubCommands"=""
[HKEY_CLASSES_ROOT\ApkFile\shell\sign\shell]
[HKEY_CLASSES_ROOT\ApkFile\shell\sign\shell\ApkSigner]
@="ApkSigner--v1&v2"
[HKEY_CLASSES_ROOT\ApkFile\shell\sign\shell\ApkSigner\command]
@="PowerShell -noexit SDK_DIR\\build-tools\\31.0.0\\apksigner.bat sign --out \"%1.signed.apk\" --ks Test.keystore --ks-key-alias test_alias \"%1\" "
[HKEY_CLASSES_ROOT\ApkFile\shell\sign\shell\Jarsigner]
@="Jarsigner--v1"
[HKEY_CLASSES_ROOT\ApkFile\shell\sign\shell\Jarsigner\command]
@="PowerShell -noexit jarsigner -verbose -keystore Test.keystore -storepass test_pwd -signedjar \"%1.signed.apk\" \"%1\" test_alias -digestalg SHA1 -sigalg MD5withRSA "
apkanalyzer
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ApkFile\shell\ApkAnalyzer]
@="导出AndroidManifest"
[HKEY_CLASSES_ROOT\ApkFile\shell\ApkAnalyzer\command]
@="PowerShell -noexit apkanalyzer manifest print \"%1\" > \"%1.AndroidManifest.xml\" "
apktoold
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ApkFile\shell\ApktoolD]
@="apktool -d"
[HKEY_CLASSES_ROOT\ApkFile\shell\ApktoolD\command]
@="PowerShell -noexit java -jar DIR\apktool\\apktool_2.5.0.jar d \"%1\" --only-main-classes "
apktoolb
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\APKTool\shell\apktoolb]
@="apktool b"
[HKEY_CLASSES_ROOT\Folder\shell\APKTool\shell\apktoolb\command]
@="PowerShell -noexit java -jar C:\\Users\\M\\Desktop\\Files\\Decompile\\libs\\apktool\\apktool_2.5.0.jar b \"%1\" -o new.apk"
cert
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.rsa\shell\PrintCert]
@="签名信息"
[HKEY_CLASSES_ROOT\.rsa\shell\PrintCert\command]
@="PowerShell -noexit keytool -printcert -file \\\"%1\\\""
keystore
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.keystore\shell\KeystoreInfo]
@="签名信息"
[HKEY_CLASSES_ROOT\.keystore\shell\KeystoreInfo\command]
@="PowerShell -noexit keytool -list -v -keystore \\\"%1\\\" "
[HKEY_CLASSES_ROOT\.jks\shell\KeystoreInfo]
@="签名信息"
[HKEY_CLASSES_ROOT\.jks\shell\KeystoreInfo\command]
@="PowerShell -noexit keytool -list -v -keystore \\\"%1\\\" "
dex
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.dex]
[HKEY_CLASSES_ROOT\.dex\shell]
[HKEY_CLASSES_ROOT\.dex\shell\dex2jar]
[HKEY_CLASSES_ROOT\.dex\shell\dex2jar\command]
@="PowerShell -noexit DIR\\dex2jar-2.0\\d2j-dex2jar.bat \"%1\" "
[HKEY_CLASSES_ROOT\.dex\shell\dex2smali]
[HKEY_CLASSES_ROOT\.dex\shell\dex2smali\command]
@="PowerShell -noexit java -jar DIR\\baksmali-2.4.0.jar d \"%1\" -o out "
[HKEY_CLASSES_ROOT\.dex\shell\dex2dexjar]
[HKEY_CLASSES_ROOT\.dex\shell\dex2dexjar\command]
@="PowerShell -noexit java -jar DIR\\dx.jar --dex --output=.\\classes.jar \"%1\" "
cfr
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Bandizip.jar\Shell\cfr]
@="CFR"
[HKEY_CLASSES_ROOT\Bandizip.jar\Shell\cfr\command]
@="PowerShell -noexit java -jar DIR\\cfr-0.151.jar \"%1\" --outputdir .\\cfr-out\\"
jar2dex
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Bandizip.jar\Shell\jar2dex]
[HKEY_CLASSES_ROOT\Bandizip.jar\Shell\jar2dex\command]
@="PowerShell -noexit java -jar DIR\\dx.jar --dex --output classes.dex \"%1\" "
class2dex
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.class\shell\d8]
@="class2dex"
[HKEY_CLASSES_ROOT\.class\shell\d8\command]
@="PowerShell -noexit SDK_DIR\\build-tools\\31.0.0\\d8.bat \"%1\" "
bundletool
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.aab\shell\bundletool]
"Position"="Center"
"MUIVerb"="aab2apks"
"SubCommands"=""
[HKEY_CLASSES_ROOT\.aab\shell\bundletool\shell]
[HKEY_CLASSES_ROOT\.aab\shell\bundletool\shell\universal]
@="mode=universal"
[HKEY_CLASSES_ROOT\.aab\shell\bundletool\shell\universal\command]
@="PowerShell -noexit java -jar DIR\\bundletool.jar build-apks --bundle=\"%1\" --output=outputs.apks --mode=universal --overwrite "
[HKEY_CLASSES_ROOT\.aab\shell\bundletool\shell\connected_device]
@="connected-device"
[HKEY_CLASSES_ROOT\.aab\shell\bundletool\shell\connected_device\command]
@="PowerShell -noexit java -jar DIR\\bundletool.jar build-apks --bundle=\"%1\" --output=outputs.apks --connected-device --overwrite "
[HKEY_CLASSES_ROOT\.apks\shell\install\]
@="install apks"
[HKEY_CLASSES_ROOT\.apks\shell\install\command]
@="PowerShell -noexit java -jar DIR\\bundletool.jar install-apks --apks=\"%1\" "
zipalign
```shell Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign]
"Position"="Center"
"MUIVerb"="ZipAlign"
"SubCommands"=""
[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign\shell]
[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign\shell\check]
@="zipalign -c"
[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign\shell\check\command]
@="PowerShell -noexit BUILD_TOOLS_DIR\zipalign.exe -c -v 4 "%1" "
[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign\shell\page-align]
@="zipalign -p"
[HKEY_CLASSES_ROOT\ApkFile\shell\zipalign\shell\page-align\command]
@="PowerShell -noexit BUILD_TOOLS_DIR\zipalign.exe -p -f -v 4 "%1" "%1.aligned.apk" "
## enjarify
<span id = "enjarify"/>
```shell
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.dex\Shell\enjarify]
[HKEY_CLASSES_ROOT\.dex\Shell\enjarify\command]
@="PowerShell -noexit DIR\\enjarify.bat \"%1\" "
md5
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\cert_util_md5\]
@="CertUtil-MD5"
[HKEY_CLASSES_ROOT\*\shell\cert_util_md5\command]
@="PowerShell -noexit certutil -hashfile \"%1\" MD5"