[RK3288][Android6.0] Decompile apk under Ubuntu to get source code and xml file

Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92

background:

Need to understand the OTA mechanism of RK, but the sdk only provides apk
write picture description here

Therefore, it is necessary to decompile and unpack. It should be noted that if the apk is code obfuscated during compilation, the decompiled code will be garbled and cannot be viewed.


tool:

apktool:  After decompilation, you can view the resources and layout files under res, as well as the AndroidManifest.xml file of apk
dex2jar: To view the source code, you need to convert the apk into a Jar file
JD-GUI: After getting the Jar file, you can use this tool to directly View source code

jd-gui download: https://download.csdn.net/download/kris_fei/10375837
apktool and dex2jar download: https://download.csdn.net/download/kris_fei/10375855

If apktool and dex2jar are too old, you can download them directly from the apktool website .

Note:
You may encounter errors when executing apktool and JD-GUI, please refer to:
[RK3288][Android6.0] Debugging Notes - AndrolibException occurs when using apktool
[RK3288][Android6.0] Debugging Notes - Executing gd-gui can not find libgtk-x11-2.0.so.0


Get the xml file:

kris@eco:~/Downloads/apktool$ ./apktool d RKUpdateService.apk
write picture description here

The parsed AndroidManifest.xml
write picture description here

layout file:
write picture description here


View source code:

First convert to jar file:
./dex2jar/dex2jar.sh RKUpdateService.apk
write picture description here

View with jd-gui:
kris@eco:~/Downloads/apktool$ ./jd-gui/jd-gui
open the jar package to view
write picture description here


refer to:

How to decompile apk file to get source code and XML file
decompile apk under Ubuntu(Linux)/Windows

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325987433&siteId=291194637
Recommended