From 3a2fa30676338518ab4a320e16c4c1fab78e0615 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 7 May 2022 05:41:34 +0200 Subject: [PATCH] fix: unmount script `CONTENT_UMOUNT_SCRIPT` --- src/main/kotlin/app/revanced/utils/adb/Constants.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/utils/adb/Constants.kt b/src/main/kotlin/app/revanced/utils/adb/Constants.kt index 32f7bf1e..df757e85 100644 --- a/src/main/kotlin/app/revanced/utils/adb/Constants.kt +++ b/src/main/kotlin/app/revanced/utils/adb/Constants.kt @@ -12,7 +12,7 @@ internal object Constants { internal const val COMMAND_RESTART = "monkey -p $PLACEHOLDER 1 && kill ${'$'}($COMMAND_PID_OF $PLACEHOLDER)" // default mount file name - private const val NAME_MOUNT_SCRIPT = "mount_$PLACEHOLDER.sh" + private const val NAME_MOUNT_SCRIPT = "mount_revanced_$PLACEHOLDER.sh" // initial directory to push files to via adb push internal const val PATH_INIT_PUSH = "/sdcard/revanced.delete" @@ -41,7 +41,9 @@ internal object Constants { internal val CONTENT_UMOUNT_SCRIPT = """ #!/system/bin/sh - while read line; do echo ${'$'}{line} | grep $PLACEHOLDER | awk '{print ${'$'}2}' | xargs umount -l; done< /proc/mounts + + stock_path=${'$'}{ pm path $PLACEHOLDER | grep base | sed 's/package://g' } + umount -l $PLACEHOLDER; done< /proc/mounts """.trimIndent() // mount script @@ -54,4 +56,4 @@ internal object Constants { stock_path=${'$'}{ pm path $PLACEHOLDER | grep base | sed 's/package://g' } mount -o bind ${'$'}base_path ${'$'}stock_path """.trimIndent() -} \ No newline at end of file +}