Make sure busybox can be executed recursively

Busybox will execute itself. On some older Samsung devices, when it is located in /data, it will not have rights to execute other programs including itself. We should also relocate busybox in this case to workaround Samsung bullshit.
See topjohnwu/ndk-busybox@bdc8655
Fix the "app doesn't detect installed Magisk" issue in topjohnwu#4174
This commit is contained in:
canyie 2022-01-30 19:29:09 +08:00 committed by John Wu
parent 3bf47a6838
commit c921964938

View File

@ -42,7 +42,7 @@ class ShellInit : Shell.Initializer() {
if (shell.isRoot) { if (shell.isRoot) {
add("export MAGISKTMP=\$(magisk --path)/.magisk") add("export MAGISKTMP=\$(magisk --path)/.magisk")
// Test if we can properly execute stuff in /data // Test if we can properly execute stuff in /data
Info.noDataExec = !shell.newJob().add("$localBB true").exec().isSuccess Info.noDataExec = !shell.newJob().add("$localBB sh -c \"$localBB true\"").exec().isSuccess
} }
if (Info.noDataExec) { if (Info.noDataExec) {