VOOZH about

URL: https://www.javacodegeeks.com/2012/11/android-reverse-engineering-and-decompilation.html

⇱ Android Reverse Engineering and Decompilation


Reverse engineering of android java app using apktool, dex2jar, jd-gui to convert .apk file to .java.

By reverse engineering of android app (.apk file) we can get following :

  • understand how a particular UI in an App is constructed
  • reading AndroidManifest.xml – permissions, activities, intents etc in the App
  • native libraries and images used in that App
  • obsfucated code ( android SDK, by default, uses ProGuard tool which shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names.

Required Tools :

Download the followings first.

Using ApkTool

to extract AndroidManifest.xml and everything in res folder(layout xml files, images, htmls used on webview etc..)

Run the following command :

>apktool.bat d sampleApp.apk

It also extracts the .smali file of all .class files, but which is difficult to read.

##You can achieve this by using zip utility like 7-zip.

Using dex2jar

to generate .jar file from .apk file, we need JD-GUI to view the source code from this .jar.

Run the following command :

 >dex2jar sampleApp.apk

Decompiling .jar JD-GUI

it decompiles the .class files (obsfucated- in case of android app, but readable original code is obtained in case of other .jar file). i.e., we get .java back from the application.

Just Run the

jd-gui.exe and File->Open to view java code from .jar or .class file.

You May Also Like –

 
Reference: Android Reverse Engineering – decompile .apk-.dex-.jar-.java from our JCG partner Ganesh Tiwari at the GT’s Blog blog.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

👁 Photo of Ganesh Tiwari
Ganesh Tiwari
November 2nd, 2012Last Updated: November 2nd, 2012
10 359 1 minute read
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

10 Comments
Oldest
Newest Most Voted
12 years ago

With AndroChef Java Decompiler you can decompile apk., dex, jar and java class-files. It’s simple and easy. http://www.androiddecompiler.com/

0
Reply
Freeman Mobile
12 years ago

This way is just fine!
But JD-GUI homepage has changed!
Follow this tutorial to get updated link of JD-GUI
How to decompile Android APK file

0
Reply
Venkatesan
12 years ago

Hi,

I am very much eager to become a very good Android Development Engineer.I need one help from you.Currently I am having Source files,fully layout file and a manifest file.Will u go through it and compile it and help me.This project will help me out to become a very good Android Engineer.please help me.

Thanks and Regards,
Venkatesan.R

0
Reply
11 years ago

Is is possible to get native libraries using APK file, Thank you!

0
Reply
11 years ago

How to retrieve native libraries from apk file.

0
Reply
Rocky
11 years ago

Hi,
Is this is possible to read data from a server using modbus protocol. ?

0
Reply
Saravana
10 years ago

After decompileing the class file to java file in the setContentView the layout name to some 10 digit number how can I find the correct layout with that class. Is there any way to find out.

E.g:
setContentView (1234567890);

0
Reply
Andrew Rukin
10 years ago

There is new alternative: open-source APK and DEX decompiler called Jadx: https://sourceforge.net/projects/jadx/files/
It has online version here: http://www.javadecompilers.com/apk/

0
Reply
8 years ago

Really nice post.Thanks for sharing.
personalrekrutierung

0
Reply
8 years ago

I like this post .Thanks for sharing.
Internet Marketing Dienstleistungen in Deutschland

0
Reply
Back to top button
Close
wpDiscuz