我制作了一个简单的 Windows 批处理文件来解码 JAR 和 APK,它可以正常工作:
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
SET listejar=:core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar:java.awt.jar:svc.jar:am.jar:android.test.runner.jar:bmgr.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.samsung.device.jar:com.yamaha.android.media.jar:twframework.jar:send_bug.jar:GlobalConfig.jar:ime.jar:input.jar:javax.obex.jar:libvtmanagerjar.jar:minimode.jar:monkey.jar:pm.jar:seccamera.jar:secframework.jar:sechardware.jar:secmediarecorder.jar:sec_feature.jar
SET baksmali=c:\DO\baksmali.jar
SET smali=c:\do\smali.jar
SET BTP1=c:\do
SET BTP2=c:\do\framework
FOR %%F IN ("*.odex") DO (
@echo.
@echo.
@echo.
ECHO Decompiling %%F
java -Xmx1024m -jar %baksmali% -a 15 -d %btp1% -d %btp2% -c %listejar% -x "%%F" -o "%%~nF"
ECHO Compiling %%~nF classses.dex
md "%%~dpnF"_o
java -Xmx1024m -jar %smali% -a 15 %%~nF -o "%%~dpnF"_o\classes.dex
RD /s/q "%%~dpnF"
C:\DO\7z.exe u "%%~dpnF".jar %%~dpnF"_o\classes.dex >NUL
RD /s/q %%~dpnF"_o
DEL %%~dpnxF
ECHO %%~nF is Deodexed
)
cd..
CD app
FOR %%F IN ("*.odex") DO (
@echo:
@echo:
@echo:
ECHO Decompiling %%F
java -Xmx1024m -jar %baksmali% -a 15 -d %btp1% -d %btp2% -c %listejar% -x "%%F" -o "%%~nF"
ECHO Compiling %%~nF classses.dex
md "%%~dpnF"_o
java -Xmx1024m -jar %smali% -a 15 %%~nF -o "%%~dpnF"_o\classes.dex
RD /s/q "%%~dpnF"
C:\DO\7z.exe u "%%~dpnF".apk %%~dpnF"_o\classes.dex >NUL
RD /s/q %%~dpnF"_o
DEL %%~dpnxF
ECHO %%~nF is Deodexed
)
echo ALL DONE press any key to exit
pause >NUL
exit
但后来我试着让它变得更好一点,我不知道我做错了什么。它现在立即退出。对此事的帮助将不胜感激。
这是我在修订版中尝试做的事情:
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
SET listejar=:core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar:java.awt.jar:svc.jar:am.jar:android.test.runner.jar:bmgr.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.samsung.device.jar:com.yamaha.android.media.jar:twframework.jar:send_bug.jar:GlobalConfig.jar:ime.jar:input.jar:javax.obex.jar:libvtmanagerjar.jar:minimode.jar:monkey.jar:pm.jar:seccamera.jar:secframework.jar:sechardware.jar:secmediarecorder.jar:sec_feature.jar
SET baksmali=c:\DO\baksmali.jar
SET smali=c:\do\smali.jar
SET BTP1=c:\do
SET BTP2=c:\do\framework
CD framework
IF EXIST *.odex ( GOTO STARTFW ) ELSE ( ECHO Odex Not Found && GOTO FINISHEDFW )
:STARTFW
FOR %%F IN ("*.odex") DO (
@echo.
@echo.
@echo.
ECHO Decompiling %%~nxF
java -Xmx1024m -jar %baksmali% -a 15 -d %btp1% -d %btp2% -c %listejar% -x "%%F" -o "%%~nF"
ECHO Compiling %%~nF classses.dex
MD "%%~dpnF"_o
java -Xmx1024m -jar %smali% -a 15 %%~nF -o "%%~dpnF"_o\classes.dex
RD /s/q "%%~dpnF"
IF EXIST "%%~dpnF"_o\classes.dex (GOTO CONTINIUEFW) ELSE (GOTO CHECKFW)
:CHECKFFW
IF NOT EXIST C:\DO\Framework\ERORR ( MD C:\Framework\Error )
MOVE /Y "%%~dpnF".* C:\Framework\Error
ECHO Error With %%~nxF & %%~nF.jar
ECHO Moved To Error Folder
GOTO SKIPFW
:CONTINIUEFW
ECHO Injecting classes.dex to "%%~nF".jar
C:\DO\7z.exe u "%%~dpnF".jar %%~dpnF"_o\classes.dex >NUL
RD /s/q %%~dpnF"_o
DEL %%~dpnxF
ECHO %%~nF.jar is Deodexed
IF EXIST *.odex (
GOTO STARTFW
) ELSE (
ECHO Odex Not Found
GOTO FINISHEDFW
)
:SKIPFW
)
:FINISHEDFW
CD..
CD app
IF EXIST *.odex (
GOTO STARTAPP
) ELSE (
ECHO Odex Not Found
GOTO FINISHEDAPP
)
:STARTAPP
FOR %%F IN ("*.odex") DO (
@echo.
@echo.
@echo.
ECHO Decompiling %%~nxF
java -Xmx1024m -jar %baksmali% -a 15 -d %btp1% -d %btp2% -c %listejar% -x "%%F" -o "%%~nF"
ECHO Compiling %%~nF classses.dex
MD "%%~dpnF"_o
java -Xmx1024m -jar %smali% -a 15 %%~nF -o "%%~dpnF"_o\classes.dex
RD /s/q "%%~dpnF"
IF EXIST "%%~dpnF"_o\classes.dex ( GOTO CONTINIUEAPP ) ELSE ( GOTO CHECKAPP )
:CHECKFAPP
IF NOT EXIST C:\DO\app\ERORR ( MD C:\app\Error )
MOVE /Y "%%~dpnF".* C:\app\Error
ECHO Error With %%~nxF & %%~nF.apk
ECHO Moved To Error Folder
GOTO SKIPAPP
:CONTINIUEAPP
ECHO Injecting classes.dex to "%%~nF".apk
C:\DO\7z.exe u "%%~dpnF".apk %%~dpnF"_o\classes.dex >NUL
RD /s/q %%~dpnF"_o
DEL %%~dpnxF
ECHO %%~nF.apk is Deodexed
IF EXIST *.odex (
GOTO STARTAPP
) ELSE (
ECHO Odex Not Found
GOTO FINISHEDAPP
)
:SKIPAPP
)
echo ALL DONE press any key to exit
pause >NUL
exit