fix: Mount install (#3111)

This commit is contained in:
Omar
2026-03-19 16:50:04 +02:00
committed by GitHub
parent 4c21b2f168
commit 3ef22a351a
2 changed files with 6 additions and 1 deletions

View File

@@ -117,6 +117,8 @@ class RootInstaller(
execute("pm install -r -d --user 0 \"${stockApp.absolutePath}\"")
.assertSuccess("Failed to install stock app")
stockApp.delete()
}
remoteFS.getFile(modulePath).apply {

View File

@@ -45,6 +45,7 @@ import app.revanced.manager.util.Options
import app.revanced.manager.util.PM
import app.revanced.manager.util.PatchSelection
import app.revanced.manager.util.tag
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.withContext
@@ -265,7 +266,9 @@ class PatcherWorker(
Result.failure()
} finally {
patchedApk.delete()
if (args.input is SelectedApp.Local && args.input.temporary) {
// Only delete the input APK right after patching finishes when the user isn't rooted, since it would be needed for mounting
// (it would be deleted right after installing with root)
if (args.input is SelectedApp.Local && args.input.temporary && Shell.isAppGrantedRoot() == false) {
args.input.file.delete()
}
}