Fix shizuku being buggy for multi user setups (#494)
* Fix #493 Fetch the current userid separately because shizuku always runs as the main user and would otherwise install and update for the main user * Update app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> (cherry picked from commit 402e579a69391e7633754066eb8e6480bd9f247d) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt
This commit is contained in:
parent
345d0821c6
commit
a4d88515fb
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.installer
|
||||
import android.app.Service
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Process
|
||||
import eu.kanade.tachiyomi.extension.model.InstallStep
|
||||
import eu.kanade.tachiyomi.util.system.getUriSize
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
@ -51,7 +52,8 @@ class ShizukuInstaller(private val service: Service) : Installer(service) {
|
||||
val size = service.getUriSize(entry.uri) ?: throw IllegalStateException()
|
||||
service.contentResolver.openInputStream(entry.uri)!!.use {
|
||||
val createCommand = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
"pm install-create --user current -r -i ${service.packageName} -S $size"
|
||||
val userId = Process.myUserHandle().hashCode()
|
||||
"pm install-create --user $userId -r -i ${service.packageName} -S $size"
|
||||
} else {
|
||||
"pm install-create -r -i ${service.packageName} -S $size"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user