From 77d8445bfd20207fb79eca6525f7176cf8709646 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Wed, 24 Aug 2022 00:56:04 +0800 Subject: [PATCH] Avoid hardcode package name --- native/src/core/scripting.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/src/core/scripting.cpp b/native/src/core/scripting.cpp index 6d8e656b5..15bfcc02e 100644 --- a/native/src/core/scripting.cpp +++ b/native/src/core/scripting.cpp @@ -154,7 +154,7 @@ constexpr char install_script[] = R"EOF( APK=%s log -t Magisk "pm_install: $APK" log -t Magisk "pm_install: $(pm install -g -r $APK 2>&1)" -appops set com.topjohnwu.magisk REQUEST_INSTALL_PACKAGES allow +appops set %s REQUEST_INSTALL_PACKAGES allow rm -f $APK )EOF"; @@ -164,7 +164,7 @@ void install_apk(const char *apk) { .fork = fork_no_orphan }; char cmds[sizeof(install_script) + 4096]; - snprintf(cmds, sizeof(cmds), install_script, apk); + snprintf(cmds, sizeof(cmds), install_script, apk, JAVA_PACKAGE_NAME); exec_command_sync(exec, "/system/bin/sh", "-c", cmds); }