You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Move all xwrap to Rust
This commit is contained in:
@@ -123,7 +123,7 @@ static void exec_cmd(const char *action, vector<Extra> &data,
|
||||
ssprintf(exe, sizeof(exe), "/proc/self/fd/%d", app_process_32);
|
||||
#endif
|
||||
} else {
|
||||
strlcpy(exe, "/system/bin/app_process", sizeof(exe));
|
||||
strscpy(exe, "/system/bin/app_process", sizeof(exe));
|
||||
}
|
||||
|
||||
// First try content provider call method
|
||||
@@ -158,7 +158,7 @@ static void exec_cmd(const char *action, vector<Extra> &data,
|
||||
};
|
||||
|
||||
// Then try start activity without package name
|
||||
strlcpy(target, info->mgr_pkg.data(), sizeof(target));
|
||||
strscpy(target, info->mgr_pkg.data(), sizeof(target));
|
||||
exec_command_sync(exec);
|
||||
if (check_no_error(exec.fd))
|
||||
return;
|
||||
|
||||
@@ -142,7 +142,7 @@ void prune_su_access() {
|
||||
vector<bool> app_no_list = get_app_no_list();
|
||||
vector<int> rm_uids;
|
||||
char query[256], *err;
|
||||
strlcpy(query, "SELECT uid FROM policies", sizeof(query));
|
||||
strscpy(query, "SELECT uid FROM policies", sizeof(query));
|
||||
err = db_exec(query, [&](db_row &row) -> bool {
|
||||
int uid = parse_int(row["uid"]);
|
||||
int app_id = to_app_id(uid);
|
||||
@@ -412,7 +412,7 @@ void su_daemon_handler(int client, const sock_cred *cred) {
|
||||
char path[32];
|
||||
ssprintf(path, sizeof(path), "/proc/%d/cwd", ctx.pid);
|
||||
char cwd[PATH_MAX];
|
||||
if (realpath(path, cwd))
|
||||
if (canonical_path(path, cwd, sizeof(cwd)))
|
||||
chdir(cwd);
|
||||
ssprintf(path, sizeof(path), "/proc/%d/environ", ctx.pid);
|
||||
auto env = full_read(path);
|
||||
|
||||
Reference in New Issue
Block a user