fix security exception

This commit is contained in:
lucky 2021-11-21 07:27:26 +03:00
parent dd91805742
commit 1d34123e7b
1 changed files with 4 additions and 2 deletions

View File

@ -16,7 +16,9 @@ class ControlReceiver : BroadcastReceiver() {
!prefs.isServiceEnabled ||
intent.getStringExtra("code") != prefs.code) return
val dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager
try {
dpm.lockNow()
dpm.wipeData(0)
} catch (exc: SecurityException) {}
}
}