Commit 6ecc04a4 authored by 石松洲's avatar 石松洲 Committed by John Wu

Fix auto install stub

parent 15a7e9af
...@@ -119,20 +119,19 @@ int get_manager(int user_id, string *pkg, bool install) { ...@@ -119,20 +119,19 @@ int get_manager(int user_id, string *pkg, bool install) {
}; };
if (skip_mgr_check.test_and_set()) { if (skip_mgr_check.test_and_set()) {
if (mgr_app_id < 0) { if (mgr_app_id >= 0) {
goto not_found; // Just need to check whether the app is installed in the user
} const char *name = mgr_pkg->empty() ? JAVA_PACKAGE_NAME : mgr_pkg->data();
// Just need to check whether the app is installed in the user ssprintf(app_path, sizeof(app_path), "%s/%d/%s", APP_DATA_DIR, user_id, name);
const char *name = mgr_pkg->empty() ? JAVA_PACKAGE_NAME : mgr_pkg->data(); if (access(app_path, F_OK) == 0) {
ssprintf(app_path, sizeof(app_path), "%s/%d/%s", APP_DATA_DIR, user_id, name); // Always check dyn signature for repackaged app
if (access(app_path, F_OK) == 0) { if (!mgr_pkg->empty() && !check_dyn(user_id))
// Always check dyn signature for repackaged app goto not_found;
if (!mgr_pkg->empty() && !check_dyn(user_id)) if (pkg) *pkg = name;
return user_id * AID_USER_OFFSET + mgr_app_id;
} else {
goto not_found; goto not_found;
if (pkg) *pkg = name; }
return user_id * AID_USER_OFFSET + mgr_app_id;
} else {
goto not_found;
} }
} else { } else {
// Here, we want to actually find the manager app and cache the results. // Here, we want to actually find the manager app and cache the results.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment