mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-19 06:27:39 +00:00
install_module: simplify script
This commit is contained in:
parent
506961a10d
commit
c512496847
@ -202,10 +202,9 @@ static void abort(FILE *fp, const char *fmt, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr char install_module_script[] = R"EOF(
|
constexpr char install_module_script[] = R"EOF(
|
||||||
exec %s sh -c '
|
|
||||||
. /data/adb/magisk/util_functions.sh
|
. /data/adb/magisk/util_functions.sh
|
||||||
install_module
|
install_module
|
||||||
exit 0'
|
exit 0
|
||||||
)EOF";
|
)EOF";
|
||||||
|
|
||||||
void install_module(const char *file) {
|
void install_module(const char *file) {
|
||||||
@ -229,10 +228,7 @@ void install_module(const char *file) {
|
|||||||
xdup2(fd, STDERR_FILENO);
|
xdup2(fd, STDERR_FILENO);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
char cmds[256];
|
const char *argv[] = { BBEXEC_CMD, "-c", install_module_script, nullptr };
|
||||||
ssprintf(cmds, sizeof(cmds), install_module_script, bbpath());
|
|
||||||
|
|
||||||
const char *argv[] = { "/system/bin/sh", "-c", cmds, nullptr };
|
|
||||||
execve(argv[0], (char **) argv, environ);
|
execve(argv[0], (char **) argv, environ);
|
||||||
abort(stdout, "Failed to execute BusyBox shell");
|
abort(stdout, "Failed to execute BusyBox shell");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user