3

is there any possible to convert dex2.jar file into classes.dex again without compile.here i sucessfully coverted the apk file to normal java source code using reverse enginerring process.

asked Feb 27, 2012 at 3:54

2 Answers 2

1

If your goal is to modify the application, do not modify it at the java level. This will fail for all but the most trivial of projects! Decompilers such as dex2jar, jeb, and enjarify are too low fidelity to trust not to alter behavior (read: break the code).

At best, use a decompiler (like dex2jar) to view the java and understand what you want to change. Then, get the smali disassembly using baksmali and make your changes at the smali level. Finally, use the smali tool to compile it back into a dex file.

It's more difficult, but it's much more likely to be successful. There are lots of guides online for how to modify smali code. It will take a little more time, but it's really the only way.

answered Aug 14, 2015 at 17:16
Sign up to request clarification or add additional context in comments.

Comments

0

The 'dx' tool will let you do this.

dx inputfile.jar --output classes.dex

Why don't you want to just run it through the standard compiler, again?

answered Feb 27, 2012 at 4:11

7 Comments

Because if i decompile the source code it gets lot of error.i want to do some changes only in the decompiled code.is it possible?
I'm not sure what you mean. If your 'decompiler' produces something that doesn't compile and run on Android, then it's a problem with your decompiler. I'm not sure what this has to do with compiling a jar back to a dex, however, since it's not really specified in your question.
now i have unpacked the .apk file extract classes.Dex then convert in via dex2jar.bat now modified the server code. here is a big problem i wanna to repack the .jar or .class to classes.Dex but no way to do it. how to ???
I'm still not sure what you're saying. You can use the dx tool to make a new .apk with the new code you've got. If you can make a .jar, then you can use dx to make a new apk. APKs are simply zip files, so in theory all you do is unzip one, do whatever you want to its classes.dex, replace classes.dex, and zip it up again. (Of course it needs to be signed, etc.., but tools can do this for you..)
You can also use the smali and baksmali assembly/disassembler pair to make changes to the dex file, without having to convert it back to a jar file.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.