Android Framework Source Anti-compilation

Source: Internet
Author: User

Some devices crash in the framework code, but do not correspond to open source code, it is necessary to pull the framework inside the device and decompile the source code troubleshooting problems.

1. Get the Framework file:

ADB pull/system/framework

Get the content under the Framework folder, There may be framework.jar and Framework.odex, if the Framework.jar decompression out has Dex then decompile Dex can, if Framework.jar inside without Dex need to first decompile Framework.odex file to Dex file;

2. Decompile the Odex file:

Pull Framework folder when it is best to get it all, because there is a dependency on the anti-compilation, in the framework folder to get the anti-compilation do not worry about the lack of reliance on the problem;

Tools to decompile Odex files: Smali and Baksmali jar files

Https://github.com/JesusFreke/smali

https://bitbucket.org/JesusFreke/smali/downloads/

(1) decompile Odex file for Smali file:

Java-jar baksmali-2.2. 2  -jar baksmali-2.2. 2

After successful execution, will produce an out directory, which is placed in the intermediate files, find the corresponding Smali file can see the corresponding source code, you can find the corresponding line number codes, this is very useful!

(2) Generate Dex file

-jar smali-2.2. 2  -jar smali-2.2. 2. Jar Assemble out

(3) Generate JAR file

dex2jar-2.0  out.dex# use JD-gui to view Out-dex2jar.jar

Reference Documentation:

Https://www.cnblogs.com/ungshow/p/3511330.html

Http://blog.sina.com.cn/s/blog_4e1e357d0102yg5o.html

Android Framework Source Anti-compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.