如何创建具有 root 访问权限的 Android 应用程序?
我发现有很多应用程序需要 root 访问权限。
他们是如何创建这些应用程序的?他们在哪里找到所有资源? 有没有关于root权限的官方文档?或者需要一些黑客的方式?
哪些类型的访问需要 root 访问权限? 代理是其中之一吗?我没有找到任何有关在任何地方访问代理的文档。
===更新===
我认为有些人误解了我的问题。我知道手机需要root才能获得root访问权限。但我想知道的是,什么样的服务需要root权限? 我看到一些是无线系绳,另一个是清除缓存(是否甚至需要根访问权限才能清除缓存?),还有其他应用程序。有没有列出我从 root 访问中获得的优势?
I found out that there's so many apps out there which required root access.
How were they able to create those apps? Where did they found all the resource?
Is there any official document about the root access? Or will it need some hackish way?
And what kinds of access which required root access?
Is proxy one of them? I didn't found any documentation about accessing the proxy anywhere.
=== UPDATE ===
I think some people mistaken by my question. I know that the phone need to be rooted to get root access. but the things I want to find out is, what kind of services are need root access?
Some I see wireless tether, the other is to clear cache (is it even need root access just to clear cache?), and the other apps out there. is there any list of what I kind of advantage I get from root access?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你需要在手机中安装su(当然)。详细信息在这里:
http://forum.xda-developers.com/showthread.php?t= 682828
使用它就像运行 su 命令一样简单。这是我用来以编程方式重新启动手机的示例(从这个答案复制: Android 2.2:以编程方式重新启动设备)
You need su installed in the phone (of course). Details here:
http://forum.xda-developers.com/showthread.php?t=682828
And to use it, is as simple as running su command. Here is a sample I use to reboot the phone programmatically (copied from this answer: Android 2.2: Reboot device programmatically )
应该适用于大多数版本:
Should work on most versions:
使用此函数并在项目的任何地方使用它
使用上述函数并以 root 用户身份使用任何类型的 shell 命令
Use this function and use it anywhere of your project
Usage of the above function and use it any type of shell commands with root users
许多应用程序依赖于以 su 为前缀的 shell 脚本/命令。
我认为没有办法在 Android API 中请求另一个上下文或提升权限。
Many of the applications depend on a shell script/command prefixed with su.
I do not think there is a way to request another context or elevate privileges in Android API.
通常,获得 root 权限的应用程序仅使用“su ...”等命令,如果没有 root 访问权限,则无法使用这些命令。通过执行这些命令,他们可以实现一切(即删除系统应用程序或增强您的 Android 设备)
Usually rooted apps are just using commands like "su ...", which they aren't able to use without root access. And with these command executions can they reach everything (i.e. removing a system app or boosting your android device)