bat class to java Jad反编译

 

反编译所使用的工具是jad.exe

有时候需要批量操作,写个BAT处理,此过程中参考了 seavers的专栏 , 和 Java反编译工具Jad详解

 

上BAT脚本:

@echo off

echo 请指定class 路径和对应的生成java 路径,JAD路径

set LOCATION=C:/ui-c
set CLASS_PATH=class
set JAVA_PATH=src
set JAD_PATH=C:/jad/jad.exe

echo source path "%LOCATION%/%CLASS_PATH%"
echo target path "%LOCATION%/%JAVA_PATH%"

if exist "%LOCATION%/%JAVA_PATH%" rd "%LOCATION%/%JAVA_PATH%" /q/s

setlocal EnableDelayedExpansion
for /R "%LOCATION%/%CLASS_PATH%"  %%i in (*.*) do (
	if '%%~xi'=='.class' (
		"%JAD_PATH%"  -o -r -sjava -ff -b -nonlb -space -t -8 -d"%LOCATION%/%JAVA_PATH%" "%%~si"
	) else (
		set TEMP_PATH=%%i & echo f|xcopy "%%i" "!TEMP_PATH:%LOCATION%/%CLASS_PATH%=%LOCATION%/%JAVA_PATH%!"
	)
)
endlocal EnableDelayedExpansion
pause 

 

 

你可能感兴趣的:(Class)