我怎样才能获得通过Android SDK root权限? [英] How can I get root permissions through the Android SDK?

查看:305
本文介绍了我怎样才能获得通过Android SDK root权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习机器人编程,我想打它具有以root身份运行的应用程序。合乎逻辑的做法是添加在Android清单根权限。

I'm learning Android programming, and I want to make an application which has to run as root. The logical thing would be to add a root permission in the Android Manifest.

我看到的文档中此链接,特别指出的 FACTORY_TEST 许可

I saw this link in the documentation, and especially noted the FACTORY_TEST permission:

公共静态最后弦乐FACTORY_TEST

自:API级别1

作为一个工厂测试运行   应用程序,运行在root用户。   仅当该设备是   在制造商测试模式下运行。   常数值:   android.permission.FACTORY_TEST

Run as a manufacturer test application, running as the root user. Only available when the device is running in manufacturer test mode. Constant Value: "android.permission.FACTORY_TEST"

时,最好的方法是什么?

Is that the best way?

如果它使用SDK是不可能的,我怎样才能使一个根推广应用工作?

If it's not possible using the SDK, how can I make a "root" application work?

推荐答案

您需要做的是一样的东西:

What you need to do is something like:

Process root = Runtime.getRuntime().exec("su");

这会导致超级用户才能显示,它可以让你要么允许或root访问阻断它。如果用户的根源并非是这种方法可能无法正常工作。 <一href="http://www.stealthcopter.com/blog/2010/01/android-requesting-root-access-in-your-app/">Here是一种方式,您可以测试它。

That causes SuperUser to show, which lets you either Allow or Block it from root access. This approach might not work if the user is not rooted. Here is a way you can test it.

这篇关于我怎样才能获得通过Android SDK root权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆