View Single Post
Old 10-12-2007, 20:01   #2 (permalink)
engart
Major Poster
 
Join Date: Nov 2004
Age: 49
Posts: 41
Member: 93767
Status: Offline
Thanks Meter: 2
JAVA REVERSE ENGINEERING: Decompiling and Recompiling Jar Files

TOOLS USED:

1. DJ Java Decompiler- Program which decompiles jar or class files to source code in text format *.java. More info at site:
Code:
http://members.fortunecity.com/neshkov/dj.html
2. JADMaker- Makes .jad file from .jar files
Code:
http://www.geocities.com/mangokun/jadmaker/jadmaker.htm
3. Java SDK- Platform to develop Java Applications.
Code:
http://java.sun.com/j2se/1.4.2/download.html
4. Sony Ericsson SDK 2.5.0 for the Java(TM) ME Platform (127 MB)- To recompile source codes to a jar file include an emulator.
Code:
http://developer.sonyericsson.com/getDocument.do?docId=96957
You can see the files in a jar file with winrar. There are image files, manifest file class files etc. I f you want change the jar file read carefully.

1. Step:
With JADMaker make a .jad file from .jar file. Drag and drop the jar file over the JADMaker icon.

2. Step:
From Java ME SDK menu open WTK2>KToolbar. You can use different SDK'S or more professional tools like eclipse or Netbeans IDE's.

From KToolbar File menu select Create Project from JAD/JAR File and select the .jad file created at first step.

Now we have created the folders. Where?
Inside C:\SonyEricsson\JavaME_SDK_CLDC\PC_Emulation\WTK2\ apps Folder.
We can make without creating a project this work, too.

3. Step:
Open with 1. tool java decompiler the .jar file. Archiver shows all the files within jar archive file. Select all with mouse and click Decompile button. Select Folder to save the files. The file structure must be the same as in jar file. Answer the question asked yes. Now inside the folder there are some class files and some jad files. Don't change the folder structure. .jad dosyaları files are source codes of class files. Change the .jad extensions to .java. You can delete class files. Now copy this folder inside the apps folder mentioned at 2nd step.
Now our project is ready. But icons and other files missing. Include them with opening the jar file with winrar. The folder structure must be the same.

4. Step:
We have source codes. So we can make changes. Some codes won't be decompiled. You can see some strange codes, but it is easy to guess the right code. Select Build from KToolbar menu. If we have made mistakes, the compiling will be aborted and errors will be shon under.
If compiling succeeded, when we select Run command, the application will be opened in emulator. Some applications wont run in the emulator or on phone.

5. Step
Now it's time to make jar file. From KTollbar Project menu select Create Package.

Inside the C:\SonyEricsson\JavaME_SDK_CLDC\PC_Emulation\WTK2\ apps folder of our project jar and jar files are ready inside the bin folder. You van use them now.

If you use a program, buy the program. This tutorial is written to show the weakness of jar files and to help the programmers.
  Reply With Quote
 
Page generated in 0.08888 seconds with 8 queries