JAR と APK をデコードするための単純な Windows バッチ ファイルを作成したところ、次のように機能しました。
@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