Only store UID for current user

This commit is contained in:
topjohnwu 2019-11-13 02:36:34 -05:00
parent 171ddab32b
commit a6f0aff659
2 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import com.topjohnwu.magisk.model.entity.MagiskPolicy.Companion.INTERACTIVE
data class MagiskPolicy( data class MagiskPolicy(
val uid: Int, var uid: Int,
val packageName: String, val packageName: String,
val appName: String, val appName: String,
var policy: Int = INTERACTIVE, var policy: Int = INTERACTIVE,

View File

@ -9,6 +9,7 @@ import android.hardware.fingerprint.FingerprintManager
import android.os.CountDownTimer import android.os.CountDownTimer
import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.Config
import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.base.viewmodel.BaseViewModel import com.topjohnwu.magisk.base.viewmodel.BaseViewModel
import com.topjohnwu.magisk.data.database.PolicyDao import com.topjohnwu.magisk.data.database.PolicyDao
@ -165,6 +166,7 @@ class SuRequestViewModel(
policy.policy = action policy.policy = action
policy.until = until policy.until = until
policy.uid = policy.uid % 100000 + Const.USER_ID * 100000
if (until >= 0) if (until >= 0)
policyDB.update(policy).blockingAwait() policyDB.update(policy).blockingAwait()