How to traverse to Android bottom

Source: Internet
Author: User

For Android development, most of the work is actually in the application layer, but in order to reflect the "technical content" and "know why", so that in the face of problems are not helpless. It is therefore necessary to understand the underlying working mechanism.

Since Android is an open source system, it is very easy to learn its internal work mechanism, and there are some books on Android source code analysis.

I've always thought that the development of the application layer has little to do with the bottom level, but one time because of the problem of application permissions, there is some understanding of the Android framework layer, the use of a source code analysis of the book to understand how Android works is not as difficult as imagined.

Unlike other places, I use the little-known code injection technology (not dependency injection), for Android devices with root privileges, Just inject a. So file into the system process, and then use the. so file to get the JVM execution environment, you can load the Java code, and inject your own Java code into the system process.

The Java code is injected into the framework layer, so we successfully traverse from the application layer to the Android bottom.

Of course, if you want to execute your own code at the framework level, it is also possible to replace the system files directly. One way is to download the Android source code, build the compilation environment, and another way is to decompile the jar files in the system to compile back to this is also possible. Reference (not tested): http://dss16694.iteye.com/blog/1436466

Code Injection Reference: http://blog.csdn.net/jiangwei0910410003/article/details/40949475

Of course, the replacement system files and code injection need to have root permissions, the latest Android default enabled SELinux, get root permissions may be in trouble, so it is best to use the system under 4.3 to study.

Android Bottom is based on Linux, after the system boot, the first run is the linux,android run environment from the app_process executable file run, by init.rc specify the file path and startup parameters. App_process started the JVM, and then into the Java World, Java programs are mostly placed under the/system/framework folder, unlike the normal jar package, where Java is based on Dalvik. The anti-compilation can get ordinary jar file, put in the project can be used as LIB, through the function of the jar call system function.

If you want to play the form out of the game can refer to here.
http://blog.csdn.net/innost/article/details/47660193
(This is not a normal form)

Dalvik the contents of the virtual machine, as well as the latest art content, please do your own Baidu or Google to understand.

For an analysis of the loading process of Android systems and the contents of various system services, please refer to the Android source code analysis book.

From the structure of the Android system can be seen that many of the Android code is implemented in Java, and Java can be cross-platform, theoretically so long as the launcher app_process and related executables can be run on Windows and other systems, Android can run directly on other operating systems such as Windows.

In fact, such a transplant has been implemented, Chrome arc can, although a lot of software does not work, and now see the windowsandroid is also ported to run Android instead of through the virtual machine, there may be other.

But I haven't seen open source projects, or already have such open source projects I haven't found out, if anyone knows tell me about ha.

Another interesting event is the ability to separate the Android UI, so that you can develop desktop applications in the way that Android apps are developed, with the ready-made development tools and a multitude of developers. The SWT and swing in Java are almost forgotten.

All right, let's talk about this a lot. Please follow my public number: Zhaojietec

How to traverse to Android bottom

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.