From bf6359abaa65d9dc5c2873c59e256ab3d0f45f7b Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 10 Jun 2023 20:54:29 +0800 Subject: [PATCH] Fix release build --- native/src/core/package.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/native/src/core/package.cpp b/native/src/core/package.cpp index e944fa3d4..1fba87db9 100644 --- a/native/src/core/package.cpp +++ b/native/src/core/package.cpp @@ -223,13 +223,14 @@ int get_manager(int user_id, string *pkg, bool install) { ssprintf(app_path, sizeof(app_path), "%s/%d/" JAVA_PACKAGE_NAME, APP_DATA_DIR, u); if (stat(app_path, &st) == 0) { #if ENFORCE_SIGNATURE - string apk = find_apk_path(JAVA_PACKAGE_NAME); - int fd = xopen(apk.data(), O_RDONLY | O_CLOEXEC); + byte_array apk; + find_apk_path(byte_view(str[SU_MANAGER]), apk); + int fd = xopen((const char *) apk.buf(), O_RDONLY | O_CLOEXEC); string cert = read_certificate(fd, MAGISK_VER_CODE); close(fd); if (default_cert && cert != *default_cert) { // Found APK with invalid signature, force replace with stub - LOGE("pkg: APK signature mismatch: %s\n", apk.data()); + LOGE("pkg: APK signature mismatch: %s\n", apk.buf()); uninstall_pkg(JAVA_PACKAGE_NAME); invalid = true; install = true;