From 0de1370b97b5f1c8a3f2adc5678598dc8aa5047c Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 16 Sep 2018 10:19:25 +0200 Subject: [PATCH] CommonInstaller: improve custom magisk migration --- CommonInstaller | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CommonInstaller b/CommonInstaller index b586e4b..81d1fbd 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -245,9 +245,11 @@ migrate_magisk_custom () { cp -r ${1} /data/adb/magisk - mkdir -p /data/app/com.topjohnwu.magisk-1 - cp ${1}/magisk.apk /data/app/com.topjohnwu.magisk-1/base.apk - set_perm_data -r /data/app/com.topjohnwu.magisk-1 + if [ -z "$(find /data/app -type d -name 'com.topjohnwu.magisk*')" ]; then + mkdir -p /data/app/com.topjohnwu.magisk-1 + cp ${1}/magisk.apk /data/app/com.topjohnwu.magisk-1/base.apk + set_perm_data -r /data/app/com.topjohnwu.magisk-1 + fi } detect_mode () {