Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_module: simplify script #8417

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions native/src/core/scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ static void abort(FILE *fp, const char *fmt, ...) {
}

constexpr char install_module_script[] = R"EOF(
exec %s sh -c '
. /data/adb/magisk/util_functions.sh
install_module
exit 0'
exit 0
)EOF";

void install_module(const char *file) {
Expand All @@ -229,10 +228,7 @@ void install_module(const char *file) {
xdup2(fd, STDERR_FILENO);
close(fd);

char cmds[256];
ssprintf(cmds, sizeof(cmds), install_module_script, bbpath());

const char *argv[] = { "/system/bin/sh", "-c", cmds, nullptr };
const char *argv[] = { BBEXEC_CMD, "-c", install_module_script, nullptr };
execve(argv[0], (char **) argv, environ);
abort(stdout, "Failed to execute BusyBox shell");
}