mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-12 04:56:13 -08:00
Move find_apk_path to Rust
This commit is contained in:
@@ -169,8 +169,9 @@ int get_manager(int user_id, string *pkg, bool install) {
|
||||
if (stat(app_path, &st) == 0) {
|
||||
int app_id = to_app_id(st.st_uid);
|
||||
|
||||
string apk = find_apk_path(str[SU_MANAGER].data());
|
||||
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);
|
||||
close(fd);
|
||||
|
||||
@@ -178,7 +179,7 @@ int get_manager(int user_id, string *pkg, bool install) {
|
||||
if (str[SU_MANAGER] == *mgr_pkg) {
|
||||
if (app_id != mgr_app_id || cert != *mgr_cert) {
|
||||
// app ID or cert should never change
|
||||
LOGE("pkg: repackaged APK signature invalid: %s\n", apk.data());
|
||||
LOGE("pkg: repackaged APK signature invalid: %s\n", apk.buf());
|
||||
uninstall_pkg(mgr_pkg->data());
|
||||
invalid = true;
|
||||
install = true;
|
||||
|
||||
Reference in New Issue
Block a user