Today i want to share very important concept in android. Nowadays smart phone market is growing up because its usefulness to all type of persons. Android is very fast growing operating system in market because of it’s application response and it is also an opensource
operating system provided by google
Suppose you have to create one android application in mobile. The file format of that application is .apk
What are .dex file in android ?
Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically by Android translating compiled applications written in the Java programming language.
In android application all java classes are combined into single file name classess.dex . This file contains the main application logic.
Conversion of .apk file to normal ordinary java file.
It is very easy to convert .dex file to jar file. Actually in .apk file java classes are stored in classes.dex file.Suppose, you need those classes then you have to convert your .apk to jar format but you may not change your file extension. To invoke the java file from classes.dex file you need to follow the given steps
There are some standard steps. Lets see all steps as follows.
You have required two jar file for this conversion.
- External project jar.
- GD-GUI tool (Executable jar file).
Create one java project in eclipse define the project name any in bellow screen i am define project name as CodingBeginners_Decompiler.
Right click the project, select build path then configure build path then new window open.
Java Build Path ->
Configure build path
First you have to download jar file using below link.
Select external jar file option, browse above downloaded jar in your project like as following structure.Then click OK.
Now copy the apk file and paste in your java project. Check your java project structure like as below screen shot.
Now configure your java project in eclipse like as Right click on Project
Select Run As->
New window open.
On that window select java application option and enter this pxb.android.dex2jar.v3.Main Main class text box
Select argument tab enter the apk name with .apk extention in program argument text field.
Click on Apply button the press Run button. Then go to console screen in eclipse It will show some result like as below screen.
Now refresh your java project in eclipse tool one new file create with the name of (xxx.apk.dex2jar.jar)
Copy this file in to local drive.
This is main step of conversion , in that step we need one jar file tool. The name of that tool is GD_GUI. Download this tool in below link.
Open this tool (Execuatble jar file) like following.
Now open this jar file (In step:8 you store in local directory).
After pressing Open button you got normal java ordinary file from classes.dex file.
You also store all this classes in local directory (Go to option and select save all). Using above steps you can easily convert .dex format to .jar format in android apk.
If you like this blog then please subscribe and suppose you have any queries or suggestion then comment below.