mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Fix shizuku being buggy for multi user setups
Fetch the current userid separately because shizuku always runs as the main user and would otherwise install and update for the main user
This commit is contained in:
parent
fabc9f4c1b
commit
fa0e565fa5
2 changed files with 4 additions and 1 deletions
|
@ -30,6 +30,7 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
||||||
- Handle some uncaught crashes
|
- Handle some uncaught crashes
|
||||||
- Fixed crashes due to GestureDetector's firstEvent is sometimes null on some devices
|
- Fixed crashes due to GestureDetector's firstEvent is sometimes null on some devices
|
||||||
- Fixed download failed caused by invalid XML 1.0 character
|
- Fixed download failed caused by invalid XML 1.0 character
|
||||||
|
- Fixed issues with shizuku in a multi user setup (@Redjard)
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
- Simplify network helper code
|
- Simplify network helper code
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.os.Process
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
import co.touchlab.kermit.Logger
|
import co.touchlab.kermit.Logger
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
@ -92,7 +93,8 @@ class ShizukuInstaller(private val context: Context, val finishedQueue: (Shizuku
|
||||||
val size = context.getUriSize(entry.uri) ?: throw IllegalStateException()
|
val size = context.getUriSize(entry.uri) ?: throw IllegalStateException()
|
||||||
context.contentResolver.openInputStream(entry.uri)!!.use {
|
context.contentResolver.openInputStream(entry.uri)!!.use {
|
||||||
val createCommand = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
val createCommand = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
"pm install-create --user current -r -i ${context.packageName} -S $size"
|
val userId = Process.myUserHandle().hashCode()
|
||||||
|
"pm install-create --user $userId current -r -i ${context.packageName} -S $size"
|
||||||
} else {
|
} else {
|
||||||
"pm install-create -r -i ${context.packageName} -S $size"
|
"pm install-create -r -i ${context.packageName} -S $size"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue