本文介绍了打开不明来源编程设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开不明来源的非根深蒂固的设备编程设定。我跟这个code检查:
布尔成功;
INT结果= Settings.Secure.getInt(getContentResolver()
Settings.Secure.INSTALL_NON_MARKET_APPS,0);
如果(结果== 0){
成功= Settings.Secure.putString(getContentResolver(),Settings.Secure.INSTALL_NON_MARKET_APPS,1);
}
和具有以下权限:
<使用许可权的android:NAME =android.permission.WRITE_SETTINGS/>
<使用许可权的android:NAME =android.permission.WRITE_SECURE_SETTINGS/>
但执行时,它说许可被拒绝:写保护设置需要android.permission.WRITE_SECURE_SETTINGS
我已经给
我与设备管理权限此应用程序。
解决方案
You cannot hold that permission, unless you are signed by the same signing key that signed the firmware or if you were installed on the system partition (e.g., by a rooted device user).
That has nothing to do with modifying secure settings programmatically.
这篇关于打开不明来源编程设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!