Running an app with root permission in Android

会有一股神秘感。 提交于 2019-12-06 05:54:47

问题


Do you know how to run an app in Android with root permission? I used the following snippet but the root permission is only granted to generated process, not the app itself.

process = Runtime.getRuntime().exec("su")

回答1:


You can't really, at least not without some kind of horrible hack.

You cannot make an existing process root, it must be that way from its creation.

Android applications run inside a Dalvik machine in a process that's forked off of a process called Zygote which maps a lot of system libraries into memory, so it's children inherit shared copies. You'd have to somehow modify zygote to tell it to leave the newly forked child root, instead of downgrading it to an application user.



来源:https://stackoverflow.com/questions/5753988/running-an-app-with-root-permission-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!