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
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
The parsed AndroidManifest.xml
layout file:
View source code:
First convert to jar file:
./dex2jar/dex2jar.sh RKUpdateService.apk
View with jd-gui:
kris@eco:~/Downloads/apktool$ ./jd-gui/jd-gui
open the jar package to view
refer to:
How to decompile apk file to get source code and XML file
decompile apk under Ubuntu(Linux)/Windows