WRITE_SECURE_SETTINGS +根 [英] WRITE_SECURE_SETTINGS + root

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

问题描述

我的应用程序使用户能够获得root权限,以允许访问一些系统功能(NFC)的选项。默认情况下它从不要求根。

所以,权限被授予后,我想它应该工作,但我仍然得到可怕的:

  22 08-10:06:49.320:W / System.err的(9421):java.lang.SecurityException异常:产生的原因WRITE_SECURE_SETTINGS许可要求:无论是用户还是10174当前进程android.permission.WRITE_SECURE_SETTINGS。

错误。我缺少的东西吗?
我要求的 WRITE_SECURE_SETTINGS 的许可,所以不能吧。

有趣的是,我有NFC启用/禁用工作,但在我安装了一个新的ROM,我不断收到此错误。从4.0.3升级到4.0.4,但据我可以告诉有问题的code没有改变...任何想法?


解决方案

  

我缺少的东西吗?


您缺少 WRITE_SECURE_SETTINGS 的权限。


  

我要求的WRITE_SECURE_SETTINGS许可,所以不能吧。


据我所知,是根本无关的权限,直接。持有 WRITE_SECURE_SETTINGS ,您的应用程序要么必须由签署固件相同的签名证书签署的的安装在系统分区。作为根既不是这些东西。

my application gives the user the option to grant root access to allow access to some system function (NFC). By default it never asks for root.

So, after permissions is granted, I figured it should work, but I am still getting the dreaded:

08-10 22:06:49.320: W/System.err(9421): Caused by: java.lang.SecurityException: WRITE_SECURE_SETTINGS permission required: Neither user 10174 nor current process has android.permission.WRITE_SECURE_SETTINGS.

error. Am I missing something? I am asking for the WRITE_SECURE_SETTINGS permission, so that can't be it.

The funny thing is I had NFC enable/ disable working, but after I installed a new Rom, I keep getting this error. It updated from 4.0.3 to 4.0.4, but no changes to the code in question as far as I can tell...any ideas?

解决方案

Am I missing something?

You are missing the WRITE_SECURE_SETTINGS permission.

I am asking for the WRITE_SECURE_SETTINGS permission, so that can't be it.

AFAIK, being root has nothing to do with permissions, directly. To hold WRITE_SECURE_SETTINGS, your app must either be signed by the same signing certificate that signed the firmware or be installed on the system partition. Being root is neither of those things.

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

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