Android系统的权限通过根 [英] Android System Permissions Through Root

查看:149
本文介绍了Android系统的权限通过根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

W/PackageManager(61): Not granting permission android.permission.SET_ACTIVITY_WATCHER to package 

这是不使用的平台署名签字,不会被授予应用程序许可的一个例子。随着中说,我想知道运行植根设备上如何的任何应用程序(使用/系统/斌/苏SuperUser.apk)可以被授予任何这些权限。

This is one such example of a permission that will not be granted to applications without being signed using the platform signature. With that said I would like to know how any application running on a rooted device (with /system/bin/su and SuperUser.apk) can be granted any of these permissions.

Process p = Runtime.getRuntime().exec("su");
p.waitFor();

否则将提示接受或拒绝的超级用户对话,但 SecurityException异常,则仍抛出。

推荐答案

您可以声明你的应用程序作为一个系统应用程序通过设置sharedUserId在AndroidManifest.xml如下运行

You can declare your app to run as a system app by setting the sharedUserId as follows in the AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="[your package name]"
        android:sharedUserId="android.uid.system">

详细信息可以在这里找到:如何注册与Android应用系统签名?

这篇关于Android系统的权限通过根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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