Bump minSdk to 23

This commit is contained in:
topjohnwu
2023-03-17 04:24:16 -07:00
parent 33fb4653f0
commit af054e4e31
17 changed files with 98 additions and 208 deletions

View File

@@ -145,29 +145,19 @@ static void exec_cmd(const char *action, vector<Extra> &data,
return;
}
// Then try start activity with package name
strscpy(target, info->mgr_pkg.data(), sizeof(target));
vector<const char *> args{ START_ACTIVITY };
for (auto &e : data) {
e.add_intent(args);
}
args.push_back(nullptr);
exec_t exec {
.err = true,
.fd = -1,
.fd = -2,
.pre_exec = [] { setenv("CLASSPATH", "/system/framework/am.jar", 1); },
.fork = fork_dont_care,
.argv = args.data()
};
// Then try start activity without package name
strscpy(target, info->mgr_pkg.data(), sizeof(target));
exec_command_sync(exec);
if (check_no_error(exec.fd))
return;
// Finally, fallback to start activity with component name
args[4] = "-n";
ssprintf(target, sizeof(target), "%s/com.topjohnwu.magisk.ui.surequest.SuRequestActivity", info->mgr_pkg.data());
exec.fd = -2;
exec.fork = fork_dont_care;
exec_command(exec);
}