Use ProcessCompat

Fix #4895
This commit is contained in:
LoveSy 2021-11-07 19:43:34 +08:00 committed by John Wu
parent 4c1962f3c7
commit e0ea777249

View File

@ -8,7 +8,7 @@ import android.content.pm.PackageManager.*
import android.content.pm.ServiceInfo
import android.graphics.drawable.Drawable
import android.os.Build.VERSION.SDK_INT
import android.os.Process
import androidx.core.os.ProcessCompat
import com.topjohnwu.magisk.core.utils.currentLocale
import com.topjohnwu.magisk.ktx.getLabel
import java.util.*
@ -46,7 +46,7 @@ class AppProcessInfo(
fun isSystemApp() = info.flags and ApplicationInfo.FLAG_SYSTEM != 0
fun isApp() = Process.isApplicationUid(info.uid)
fun isApp() = ProcessCompat.isApplicationUid(info.uid)
private fun createProcess(name: String, pkg: String = info.packageName) =
ProcessInfo(name, pkg, denyList.any { it.process == name && it.packageName == pkg })