Now very easy to convert the .apk file to ordinary java file before going that we should want two jar files
1. JD-GUI.zip
2. dex2jar.zip
3.Eclipse
Download that two zip files extract and store in your local directory....
Steps to extract the .dex to .jar
Step 1 : Now You just create one java project in eclipse like the following.....
Step 2: Right click the project --> Select build path --> then configure build path
one window appear like
Step 3 : Now select Add external JARs option --> browse upto dex2jar lib directory select all jar files -->
Click OK
Ensure all jar are added or not
Step 4 : Now copy the .apk file and paste into the project
Check the folder structure should look like above
Step 5: Now you want to configure
Right click the project ---> Select Run As --> Then Select Run Configurations...
one window show like
On that window select Java Application Option which is placed in left side menu.
Step 6 : Then Enter this one in pxb.android.dex2jar.v3.Main Main Class Text box
Step 7: select Argument tab Enter the Apk name with .apk extension in Program arguments text field
Step 8 : Click Apply and Run
U just go and check in console It will give result like this.
Now refresh the Java project one new file created with the name of (xxx.apk.dex2jar.jar) copy that file and then paste to your local drive
Step to convert .jar file to ordinary class file
Now you go to Jd-gui tools select xxx.apk.dex2jar.jar file
It will show like
Now you got ordinary java file from .dex file...
1. JD-GUI.zip
2. dex2jar.zip
3.Eclipse
Download that two zip files extract and store in your local directory....
Steps to extract the .dex to .jar
Step 1 : Now You just create one java project in eclipse like the following.....
one window appear like
Step 3 : Now select Add external JARs option --> browse upto dex2jar lib directory select all jar files -->
Click OK
Ensure all jar are added or not
Step 5: Now you want to configure
Right click the project ---> Select Run As --> Then Select Run Configurations...
one window show like
On that window select Java Application Option which is placed in left side menu.
Step 6 : Then Enter
Step 8 : Click Apply and Run
U just go and check in console It will give result like this.
Now refresh the Java project one new file created with the name of (xxx.apk.dex2jar.jar) copy that file and then paste to your local drive
Step to convert .jar file to ordinary class file
Now you go to Jd-gui tools select xxx.apk.dex2jar.jar file
It will show like
Now you got ordinary java file from .dex file...
Hey i am getting an error while converting to jar, can you check this?
ReplyDeleteException in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Hey santhu., Check your compilation jre and & running jre it should be same
ReplyDeleteThink you very much for this help.
ReplyDeleteGood! Very useful!
ReplyDeleteGreat guide!
ReplyDeleteIf "pxb.android.dex2jar.v3.Main" does not work, press search and type Main. Then you will find the correct one. On my system I used "com.googlecode.dex2jar.v3.Main".
This comment has been removed by a blog administrator.
ReplyDelete" Now refresh the Java project one new file created with the name of (xxx.apk.dex2jar.jar) copy that file and then paste to your local drive"
ReplyDeletei cannot get the rosie.apk.dex2jar.jar to show up. any ideas?
Excellent Tool...
ReplyDeleteGreat Job
hi all,even thou i changed t main class to com.googlecode.dex2jar.v3.Main i still get error as cannot find main class
ReplyDeletejava.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
suggest me a solution
i get this exception while i running
ReplyDeleteException in thread "main" java.lang.NoClassDefFoundError: pxb/android/dex2jar/v3/Main
ty, it works! just that pxb.android.dex2jar.v3.Main has to become: com.googlecode.dex2jar.v3.Main
ReplyDeleteHi,
ReplyDeleteI tried as the guide is given, but i got java.lang.NoClassDefFoundError: com/googlecode/dex2jar/v3/Main error, when i search for the Main Class it says no record found, Any help/suggestion please.
Hi there,
ReplyDeleteI got the below exception:
0 [main] INFO com.googlecode.dex2jar.v3.Main - version:0.0.7.10-SNAPSHOT
16 [main] INFO com.googlecode.dex2jar.v3.Main - dex2jar Autotextreply.apk -> Autotextreply.apk.dex2jar.jar
47 [main] ERROR com.googlecode.dex2jar.v3.Main - . while process file: [Autotextreply.apk]
47 [main] ERROR com.googlecode.dex2jar.v3.Main - .. ROOT cause:
java.util.zip.ZipException: unexpected EOF
at java.util.zip.ZipInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.closeEntry(Unknown Source)
at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
at com.googlecode.dex2jar.v3.Main.doFile(Main.java:144)
at com.googlecode.dex2jar.v3.Main.main(Main.java:89)
47 [main] INFO com.googlecode.dex2jar.v3.Main - Done.
What to do?
APK was not build in project even after pasting in workSpace ... I never saw it ever there . So is this some other eclipse ?
ReplyDeletehow to revert back from jar to dex?
ReplyDeleteHi,
ReplyDeleteFor this to work we need to install jdk version 1.6 and above.
Appreciate you help , Thanks.
ReplyDeleteThanks
ReplyDeleteAppreciate
ReplyDeleteGreat Job
ReplyDeleteExcellent tool ..just a small correction in the instructions .. looks like the Main class has changed to this .. com.googlecode.dex2jar.v3.Main
ReplyDeleteExcellent tool ..just a small correction though ..looks like the Main class has changed to com.googlecode.dex2jar.v3.Main
ReplyDeleteGood Stuff...
ReplyDeleteGood Stuff...
ReplyDeleteHey dude..!
ReplyDeleteException in thread "main" java.lang.NoClassDefFoundError: pxb/android/dex2jar/v3/Main
Caused by: java.lang.ClassNotFoundException: pxb.android.dex2jar.v3.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pxb.android.dex2jar.v3.Main. Program will exit.
This is what i got.! though I have imported the jar files
Hi dude,
ReplyDeleteThis is what i got, Though i have imported the jar files.
Exception in thread "main" java.lang.NoClassDefFoundError: pxb/android/dex2jar/v3/Main
Caused by: java.lang.ClassNotFoundException: pxb.android.dex2jar.v3.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: pxb.android.dex2jar.v3.Main. Program will exit.
Very informative! Thanks!
ReplyDeletewoooooooooooooooow
ReplyDeleteNice tutorial.............Thanks.......
ReplyDeleteNice Tutorial..................Thanks...
ReplyDeleteVeryyy Niceee
ReplyDeleteThank you very much. Very useful and easy-to-understand tutorial
ReplyDeleteThanks a lot. It helped me very much.
ReplyDeleteThanks alot....
ReplyDeleteThanx alot for the help....
ReplyDeleteIt's good tutorial... can you also show how to check layouts as well?
ReplyDeleteSuper Thank you very much...
ReplyDeleteThank you very much, works great and is very useful.
ReplyDelete