From a6f0aff659091d7c1b523f7a644145045230dd67 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 13 Nov 2019 02:36:34 -0500 Subject: [PATCH] Only store UID for current user --- .../main/java/com/topjohnwu/magisk/model/entity/MagiskPolicy.kt | 2 +- .../com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/MagiskPolicy.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/MagiskPolicy.kt index 2d4a26604..b11304ab3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/entity/MagiskPolicy.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/MagiskPolicy.kt @@ -7,7 +7,7 @@ import com.topjohnwu.magisk.model.entity.MagiskPolicy.Companion.INTERACTIVE data class MagiskPolicy( - val uid: Int, + var uid: Int, val packageName: String, val appName: String, var policy: Int = INTERACTIVE, diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt index 6adce2a59..20bd9ceea 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt @@ -9,6 +9,7 @@ import android.hardware.fingerprint.FingerprintManager import android.os.CountDownTimer import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.Config +import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.R import com.topjohnwu.magisk.base.viewmodel.BaseViewModel import com.topjohnwu.magisk.data.database.PolicyDao @@ -165,6 +166,7 @@ class SuRequestViewModel( policy.policy = action policy.until = until + policy.uid = policy.uid % 100000 + Const.USER_ID * 100000 if (until >= 0) policyDB.update(policy).blockingAwait()