Settings.System.setInt("","") 所需權限

Settings.System.setInt("","")  所需權限

 

關於使用 Settings 直接對系統相關參數進行修改所需權限

 <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <!-- https://www.cnblogs.com/wanqieddy/p/4135239.html -->
    <uses-permission
        android:name="android.permission.WRITE_SECURE_SETTINGS"/>
     <uses-permission android:name="android.permission.WRITE_CONTACTS" />
     <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />

 

 

android:sharedUserId="android.uid.system"    需要在

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

              android:sharedUserId="android.uid.system" 

 

添加該標籤還需要對應的系統簽名    自己去找系統給

相關報錯

java.lang.SecurityException: Package android does not belong to 10061

adb shell settings get system telephony_call_app
adb shell settings put system telephony_call_app  com.xxx.demo(packagename)

主要是   java.lang.SecurityException

 

 

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章