Using android.permission.WRITE_SECURE_SETTINGS

feelgood4

New member
I want to use permission from adb hack as in macdroid for changing airplane mode in my app. I granted it through adb command. But when my app use it with broadcast, system sends security exception.

My code:
```
class MainActivity: AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Settings.Global.putInt(
contentResolver,
Settings.Global.AIRPLANE_MODE_ON, 0
)
val intent = Intent("android.intent.action.AIRPLANE_MODE")
intent.putExtra("state", false)
sendBroadcast(intent)
}
}
```

Please tell what code you use for sending broadcast in your app. Or i should downgrade compileSdk from 33-34
 

feelgood4

New member
I understand. I was interested how you trigger system to change airplane mode with all communications without standard secure intent without root with adb hack
 
Top