December 19, 2014

Reverse Engineering .apk file (or) Getting Java source code from .apk by extracting

Hi friends,

Today we are going to see how the .apk can be reverse engineered to see the original source code

Procedure

  1. Get the .apk file (Here I'm taking example apk called psr.apk)
  2. Rename the extention from psr.apk to psr.zip file
  3. Extract the psr.zip file
  4. It will create folder named "psr" and contents will be inside that
  5. Download the tool "dex2jar" from the official link
  6. Extract the downloaded "dex2jar" zip
  7. Navigate to the "dex2jar" extracted directory
  8. Execute the following command
    • ./d2j-dex2jar.sh psr/classes.dex
  9. Now it will generate classes-dex2jar.jar file
  10. Extract the jar file, it will create "classes-dex2jar" folder
  11. Now, open you "intelliJ IDEA"
    • Install "Java Decompiler IntelliJ Plugin" in "intelliJ IDEA"
    • In IDE, click "File->Open"
    • Select the "classes-dex2jar" folder path
  12. Now, click on any of the .class file, then you should be able to see the original java source code of it

Isn't it awesome guys :)

Keep enjoying the coding :)

Please send your feedback and comments to psrdotcom@gmail.com

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com