How to convert .jar or .class to .dex file?

Sadra Naddaf picture Sadra Naddaf · Dec 1, 2011 · Viewed 48k times · Source

I'm going to edit Opera Mini v6.5 server because it is blocked in our country.

Now I have unpacked the .apk file extracted classes.Dex then converted it via dex2jar.bat, now modified the server.

My problem is I want to repack the .jar or .class to classes.Dex. How do I do it?

Answer

Pavel Netesa picture Pavel Netesa · Dec 31, 2012

Here is a solution that was helpful in my case...

Suppose .jar file sits in "c:\temp\in.jar". In command prompt window cd to ..\android-sdk\platform-tools. To get .apk execute:

dx --dex --output="c:\temp\app.apk" "c:\temp\in.jar"

To get .dex file execute:

dx --dex --output="c:\temp\dx.dex" "c:\temp\in.jar"