Detailed explanation of how Android starts viewserver on root device

preface

For information on what the hierarchy viewer is, please check the official documentation: http://developer.android.com/tools/debugging/debugging-ui.html 。

Personal understanding: the hierarchy viewer can obtain the real-time UI information of the current mobile phone, which brings great convenience to interface designers and automation testers.

The hierarchy viewer tool provides a visual interface to display the hierarchical structure of the layout, so that we can debug and optimize the interface layout structure. It needs to be used with the viewserver on the mobile phone

However, it cannot be used on the real machine. The official Android document mentions that for security reasons, the hierarchy viewer can only be connected to Android development phones or simulators

In the code, the restrictions are made in the windowmanagerservice.java class, as follows

You can see that the values of ro.secure and ro.debuggable are determined in the issystemsecure() function

So our idea is

Make systemproperties.get (system_secure, "1") return 0

Or systemproperties.get (system_debuggable, "0") returns 1

You can achieve your goal

These two attributes are defined in the / default.prop file. Each time the system starts, they will be loaded into memory. I've seen some methods to modify the system before, but it's risky to brush the machine. Today, a tool mprop is accidentally returned

This tool can modify the values of some properties in memory, but it needs to be modified after the phone is restarted, but it's all a trivial matter

Follow the steps given in the tool to change the value of ro.debuggable to 1, and then use the following command

Model: one plus two oxygen OS 6.0.1. Other different models and systems need to be tested by themselves, which does not guarantee success

summary

The above is the whole content of this article. I hope the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message. Thank you for your support for programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>