mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 21:17:48 +00:00
Fixed crash where new application asks for root access
This commit is contained in:
parent
337fda2023
commit
0850401dc4
@ -44,7 +44,7 @@ class PolicyDao(
|
||||
condition {
|
||||
equals("uid", uid)
|
||||
}
|
||||
}.map { it.first().toPolicy(context.packageManager) }
|
||||
}.map { it.firstOrNull()?.toPolicy(context.packageManager) }
|
||||
.doOnError {
|
||||
if (it is PackageManager.NameNotFoundException) {
|
||||
delete(uid).subscribe()
|
||||
|
@ -110,7 +110,8 @@ class SuRequestViewModel(
|
||||
val bundle = connector.readSocketInput()
|
||||
val uid = bundle.getString("uid")?.toIntOrNull() ?: return false
|
||||
appRepo.deleteOutdated().blockingGet() // wrong!
|
||||
policy = appRepo.fetch(uid).blockingGet() ?: uid.toPolicy(packageManager)
|
||||
policy = runCatching { appRepo.fetch(uid).blockingGet() }
|
||||
.getOrDefault(uid.toPolicy(packageManager))
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user