Android reverse engineering

Method 1


apktool function: the acquisition of resource files, you can extract image files and layout files for viewing
dex2jar function: decompile apk into java source (classes.dex into jar files)
jd-gui: Look at the jar file converted from classes.dex in APK, which is the source file

apktool download address:
dex2jar download address:
jd-gui download address:

1. Resource Decompilation

Download, install and use apktool
First, download the tools apktool needs from the official website:
Download address:
Installation steps:
It's clear that the apktool tool we downloaded needs to be renamed apktool.jar, and the system) is downloaded and placed in a folder.
The usage is as follows:

apktool.jar     bydr         dial                  googlePinyin.apk  IPVideoTalk_1.0.0.9.apk  kongge_145          MoretvApp3.2.1.apk     Skypeforbusiness.apk      bydr.apk     dial.apk              googleTalk        IPVideoTalkPro           kongge_145.apk      qq_5.1.1.6062_android  Softphone
linhu@linhu-Lenovo:~/document/Android_Notes/difProject/difTools$ ./ --help
Unrecognized option: --help
Apktool v2.3.3 - a tool for reengineering Android apk files
with smali v2.2.2 and baksmali v2.2.2
Copyright 2014 Ryszard Wiśniewski <>
Updated by Connor Tumbleson <>

usage: apktool
 -advance,--advanced   prints advance information.
 -version,--version    prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
 -p,--frame-path <dir>   Stores framework files into <dir>.
 -t,--tag <tag>          Tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
 -f,--force              Force delete destination directory.
 -o,--output <dir>       The name of folder that gets written. Default is apk.out
 -p,--frame-path <dir>   Uses framework files located in <dir>.
 -r,--no-res             Do not decode resources.
 -s,--no-src             Do not decode sources.
 -t,--frame-tag <tag>    Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
 -f,--force-all          Skip changes detection and build all files.
 -o,--output <dir>       The name of apk that gets written. Default is dist/name.apk
 -p,--frame-path <dir>   Uses framework files located in <dir>.

For additional info, see: 
For smali/baksmali info, see:

Decompiled resource files:

linhu@linhu-Lenovo:~/document/Android_Notes/difProject/difTools$ ./ d -f -s MoretvApp3.2.1.apk 
I: Using Apktool 2.3.3 on MoretvApp3.2.1.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/linhu/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying raw classes.dex file...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

2. Source Decompilation

Convert the DEX file retained in the previous step into a jar file using the dex2jar tool

After downloading dex2jar, the classes.dex file is copied to the decompressed directory, and classes.dex is transformed into jar package by. / tool.

linhu@linhu-Lenovo:~/document/Android_Notes/difProject/difTools/dex2jar-2.0$ ls
classes.dex       d2j-dex2jar.bat                d2j_invoke.bat      d2j-jasmin2jar.bat     lib
d2j-baksmali.bat     d2j-dex-recompute-checksum.bat    d2j-jar2jasmin.bat   d2j-std-apk.bat   d2j-dex2smali.bat   d2j-jar2dex.bat   d2j-smali.bat
linhu@linhu-Lenovo:~/document/Android_Notes/difProject/difTools/dex2jar-2.0$ ./ classes.dex
dex2jar classes.dex -> ./classes-dex2jar.jar

3. Open jar with jd-gui tool

Open the jar file with the jd-gui tool, and choose to save the source file from the file menu.

Method two

jadx is a very useful decompiling tool, which can decompile java files directly by opening apk.

brief introduction

Jadx is a very useful open source decompilation tool with the following characteristics:

  • Graphical interface.
  • Drag-and-drop operation.
  • Decompiled output Java code.
  • Export Gradle project.

Installation and use

jadx itself is an open source project, and the source code is already open source on Github.

Jadx Github :
Jadx Project Links

Interested can directly clone source code, and then compile it locally. But in most cases, we need a compiled version. The compiled version can be downloaded from sourceforge.

Sorceforge downloads jadx.

For more tips, please refer to the following links:

Keywords: github Java Linux Android

Added by Aliz on Fri, 17 May 2019 08:12:04 +0300