Add -r flag to ShizukuInstaller createCommand (#7080)

This commit is contained in:
FourTOne5 2022-05-07 08:00:24 +06:00 committed by GitHub
parent 6d802063b4
commit 49d3ddb830
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,9 +52,9 @@ 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 -i ${service.packageName} -S $size"
"pm install-create --user current -r -i ${service.packageName} -S $size"
} else {
"pm install-create -i ${service.packageName} -S $size"
"pm install-create -r -i ${service.packageName} -S $size"
}
val createResult = exec(createCommand)
sessionId = SESSION_ID_REGEX.find(createResult.out)?.value