revanced-cli icon indicating copy to clipboard operation
revanced-cli copied to clipboard

Broken mount scripts

Open oSumAtrIX opened this issue 3 years ago • 5 comments

Currently, mount scripts are being created for patched applications when they are deployed to a device. Rebooting the device shows, that the mount scripts do not work properly.

oSumAtrIX avatar May 25 '22 21:05 oSumAtrIX

I believe Xinto mentioned this a while ago, that the sleep code works correctly on some phones, and on others, it doesn't.

Sculas avatar May 28 '22 16:05 Sculas

I believe Xinto mentioned this a while ago, that the sleep code works correctly on some phones, and on others, it doesn't.

I know a workaround for this,

Magisk ships with a feature complete BusyBox binary (including full SELinux support). The executable is located at /data/adb/magisk/busybox

Instead of using the phones sleep run /data/adb/magisk/busybox sleep $x

See also the official guides of Magisk

This also seems of interest:

Magisk’s BusyBox supports runtime toggle-able “ASH Standalone Shell Mode”. What this standalone mode means is that when running in the ash shell of BusyBox, every single command will directly use the applet within BusyBox, regardless of what is set as PATH.

tillnelown avatar May 28 '22 16:05 tillnelown

Please PR this at line: https://github.com/revanced/revanced-cli/blob/a4ef47a28521f101c2fa71e423a0a39a5de8e2bf/src/main/kotlin/app/revanced/utils/adb/Constants.kt#L53

oSumAtrIX avatar May 28 '22 16:05 oSumAtrIX

Actually, I don't think it was that. It's probably the OS setting sys.boot_completed to 1 while it's actually not 100% done, so it's probably a race condition.

Sculas avatar May 28 '22 16:05 Sculas

I believe Xinto mentioned this a while ago, that the sleep code works correctly on some phones, and on others, it doesn't.

This is not the case, Magisk already overwrites the path to sleep with its own implementation and therefore makes all phones use the same sleep.

See this:

Every single shell script running in the context of Magisk will be executed in BusyBox’s ash shell with standalone mode enabled. For what is relevant to 3rd party developers, this includes all boot scripts and module installation scripts.

What this standalone mode means is that when running in the ash shell of BusyBox, every single command will directly use the applet within BusyBox, regardless of what is set as PATH.

Magisk ships with a feature complete BusyBox binary (including full SELinux support).

tillnelown avatar May 28 '22 18:05 tillnelown