用於J2ME的批處理工具

來源:互聯網
上載者:User

 

dejar.bat
  從jar反編譯出java原始碼檔案。

@echo off
rem
rem decompile the jar
rem class files will be put in ./class
rem source files will be put in  ./dsrc
rem

set JAD=jad
set JAR=jar
set CLSDIR=./class
set SRCDIR=./dsrc

if exist %CLSDIR% rmdir /S /Q %CLSDIR%
md %CLSDIR%

if exist %SRCDIR% rmdir /S /Q %SRCDIR%
md %SRCDIR%

rem ***** unzip jar *****
copy %1.jar %CLSDIR%
cd %CLSDIR%
%JAR% xf %1.jar
del %1.jar
cd..

rem ***** decompile class *****
%JAD% -o -r -d %SRCDIR% %CLSDIR%/*.class %CLSDIR%/**/*.class

echo Done!

---------------------------------------------

jax.bat
  將jar中檔案解壓所到當前的目錄下class目錄。
  同時提取menifest檔案。

@echo off
rem
rem Jax the_jar_file which will be extracted.
rem class files in it will be put in ./class
rem meta-inf/Manifest.mf in it will be put in .
rem

set CLSDIR="./class"
set JAR=jar

if exist %CLSDIR% rmdir /S /Q %CLSDIR%
md %CLSDIR%

rem ***** unzip *****
copy %1.jar %CLSDIR%
cd %CLSDIR%
%JAR% xf %1.jar
del %1.jar

rem ***** move manifest out *****
move ./meta-inf/Manifest.mf ..
rmdir /Q meta-inf

cd..

echo Done!

---------------------------------------------------

jaz.bat
  將class目錄下的檔案打包,參照目前的目錄下的manifest。

@echo off
rem
rem generate %1.jar file from 
rem ./MANIFEST.MF, ./class
rem 

set CLSDIR="./class"
if EXIST %1.jar del /Q %1.jar
jar cmf MANIFEST.MF %1.jar -C %CLSDIR% .

echo Done!

---------------------------------------------------------

Jad - the fast Java Decompiler.
Jad home page: http://www.kpdus.com/jad.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.