mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
Make SYSTEM_UID a special case
This commit is contained in:
parent
bf2f823b8c
commit
18acb97dfe
@ -3,6 +3,7 @@ package com.topjohnwu.magisk.ui.superuser
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES
|
import android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES
|
||||||
|
import android.os.Process
|
||||||
import androidx.databinding.ObservableArrayList
|
import androidx.databinding.ObservableArrayList
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
@ -59,7 +60,9 @@ class SuperuserViewModel(
|
|||||||
val policies = ArrayList<PolicyRvItem>()
|
val policies = ArrayList<PolicyRvItem>()
|
||||||
val pm = AppContext.packageManager
|
val pm = AppContext.packageManager
|
||||||
for (policy in db.fetchAll()) {
|
for (policy in db.fetchAll()) {
|
||||||
val pkgs = pm.getPackagesForUid(policy.uid)
|
val pkgs =
|
||||||
|
if (policy.uid == Process.SYSTEM_UID) arrayOf("android")
|
||||||
|
else pm.getPackagesForUid(policy.uid)
|
||||||
if (pkgs == null) {
|
if (pkgs == null) {
|
||||||
db.delete(policy.uid)
|
db.delete(policy.uid)
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user