mirror of https://github.com/x13a/Wasted.git
parent
f7247c43a0
commit
36c2d99e43
|
@ -31,6 +31,10 @@ class DeviceAdminManager(private val ctx: Context) {
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setMaximumFailedPasswordsForWipe(num: Int) {
|
||||||
|
dpm?.setMaximumFailedPasswordsForWipe(deviceAdmin, num)
|
||||||
|
}
|
||||||
|
|
||||||
fun wipeData() {
|
fun wipeData() {
|
||||||
var flags = 0
|
var flags = 0
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||||
|
|
|
@ -107,7 +107,9 @@ open class MainActivity : AppCompatActivity() {
|
||||||
prefs.isWipeESIM = isChecked
|
prefs.isWipeESIM = isChecked
|
||||||
}
|
}
|
||||||
maxFailedPasswordAttempts.addOnChangeListener { _, value, _ ->
|
maxFailedPasswordAttempts.addOnChangeListener { _, value, _ ->
|
||||||
prefs.maxFailedPasswordAttempts = value.toInt()
|
val num = value.toInt()
|
||||||
|
prefs.maxFailedPasswordAttempts = num
|
||||||
|
admin.setMaximumFailedPasswordsForWipe(num.shl(1))
|
||||||
}
|
}
|
||||||
wipeOnInactivitySwitch.setOnCheckedChangeListener { _, isChecked ->
|
wipeOnInactivitySwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||||
if (!setWipeOnInactivityComponentsState(prefs.isServiceEnabled && isChecked)) {
|
if (!setWipeOnInactivityComponentsState(prefs.isServiceEnabled && isChecked)) {
|
||||||
|
|
Loading…
Reference in New Issue