I'm going to edit the 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?
bat --dex' command that can be used to convert Java byte code (. class) files into a Dalvik executable (. dex) file. The next tool used in the "ant -verbose debug" command is the "dex" tool, which converts Java byte code into a .
Dalvik programs are written in Java using the Android application programming interface (API), compiled to Java bytecode, and converted to Dalvik instructions as necessary. A tool called dx is used to convert Java .class files into the .dex format.
You can use JAR files to store class files. The class file does not target a specific hardware platform, but instead targets the Java virtual machine architecture. You can use JAR as a general archiving tool and also to distribute Java programs of all types, including applets.
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"
For mac, the dx command tool is stored in different directory as said in the top answer. Here is how you do it in mac:
exampleName$ /Users/exampleName/Library/Android/sdk/build-tools/25.0.2/dx --dex --output="/Users/exampleName/Downloads/classes-dex2jar.jar" "/Users/exampleName/Downloads/name.dex"
More detailed explanation:
/Users/exampleName/Library/Android/sdk/build-tools/25.0.2/
dx --dex--output="c:\temp\app.apk" "c:\temp\in.jar"
If it's still not working for some reason, make sure you are following these requirements:
I know this is late, but I had to figure this out on my own after hours of trial and error—hope it helps some other mac user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With