Fix release build

This commit is contained in:
LoveSy 2023-06-10 20:54:29 +08:00 committed by John Wu
parent d1621845b8
commit bf6359abaa

View File

@ -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<PATH_MAX> 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;