From 2f1b0fe57f0b59c580a35e28832101eacbdf13b6 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 18 Feb 2019 03:08:40 -0500 Subject: [PATCH] Remove unused scripts --- native/jni/core/scripting.cpp | 26 -------------------------- native/jni/include/daemon.h | 1 - 2 files changed, 27 deletions(-) diff --git a/native/jni/core/scripting.cpp b/native/jni/core/scripting.cpp index addbaab97..a757588eb 100644 --- a/native/jni/core/scripting.cpp +++ b/native/jni/core/scripting.cpp @@ -116,29 +116,3 @@ void install_apk(const char *apk) { sprintf(cmds, install_script, apk); exec_command_sync(exec, MIRRDIR "/system/bin/sh", "-c", cmds); } - -static const char reinstall_script[] = -"PKG=%s;" -"while true; do" -" OUT=`pm path $PKG 2>&1`;" -" [ -z $OUT ] && exit 1;" -" if echo \"$OUT\" | grep -qE \"Can't|Error:\"; then" -" sleep 5;" -" continue;" -" fi;" -" APK=`echo $OUT | cut -d':' -f2`;" -" log -t Magisk \"apk_install: $APK\";" -" OUT=`pm install -r $APK`;" -" [ $? -eq 0 ] || exit 1;" -" log -t Magisk \"apk_install: $OUT\";" -" break;" -"done;" -"exit 0"; - -// Reinstall system apps to data -int reinstall_apk(const char *pkg) { - exec_t exec { .pre_exec = set_mirror_path }; - char cmds[sizeof(reinstall_script) + 256]; - sprintf(cmds, reinstall_script, pkg); - return exec_command_sync(exec, MIRRDIR "/system/bin/sh", "-c", cmds); -} diff --git a/native/jni/include/daemon.h b/native/jni/include/daemon.h index abd9d2652..85df78c9b 100644 --- a/native/jni/include/daemon.h +++ b/native/jni/include/daemon.h @@ -72,7 +72,6 @@ void exec_common_script(const char *stage); void exec_module_script(const char *stage, const std::vector &module_list); void migrate_img(const char *img); void install_apk(const char *apk); -int reinstall_apk(const char *pkg); /************** * MagiskHide *