You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] suCommand fails on devices without su -c support
Description
In the 8.2.1 version, the application was updated to support non-magisk SU implementations (su 0). The corresponding code was:
val suCommand get() =if (isMountMaster)
"su --mount-master 0"else"su 0"
However, the current code has changed to:
var suCommand:List<String> =listOf()
get() {
if (field.isEmpty()) {
field =when {
hasNsEnter ->listOf(
"su",
"-c",
"nsenter --mount=/proc/1/ns/mnt sh"
)
hasMountMasterOption ->listOf("su", "--mount-master")
else->listOf("su")
}
}
return field
}
This change causes failures on devices that do not support su -c. I am using AOSP's native su.
Steps To Reproduce
Use a device with AOSP's native su.
Try to backup the apk and data of an app, then failes and saying su -c is not supported.
Expected behavior
Commands should execute successfully on devices that do not support su -c, similar to the behavior in version 8.2.1.
Screenshots
N/A
System Information
Device: sunfish
Android Version: [version]
ROM: AOSP
App's Version: 8.3.6
Additional Notes
The issue persists in the latest GitHub version.
Possible Solution
Revert to the logic used in version 8.2.1 for suCommand or implement a check to avoid using -c if the device does not support it. Here is a suggested modification:
val suCommand:List<String> by lazy {
when {
hasNsEnter ->listOf(
"su",
"0",
"nsenter",
"--mount=/proc/1/ns/mnt",
"sh"
)
hasMountMasterOption ->listOf("su", "--mount-master", "0")
else->listOf("su", "0")
}
}
Thanks for reporting.
The text was updated successfully, but these errors were encountered:
sunfish:/ # su --help
usage: su [WHO [COMMAND...]]
Switch to WHO (default 'root') and run the given COMMAND (default sh).
WHO is a comma-separated list of user, group, and supplementary groups
in that order.
the latest pumpkins (see Telegram group, pinned messages of Bug Reports & Feature Requests) have made the suCommand editable...
it is tried first, so if it works (which means some tests are successful, which is rudimentary for now), it is taken.
So this should work for all cases, you just have to ensure that root commands work like expected.
Note, the commands are piped at stdin into that running shell/su/whatever.
It is usually necessary to provide the nsenter functionality, either your su does it by default or it must have an option like --mount-master that handles the mount namespace (or your Android is old..).
suCommand is executed by libsu as the shell and also by NB itself for the tar commands (to be able to pipe date in and out).
Bug Report Submission
[Bug]
suCommand
fails on devices withoutsu -c
supportDescription
In the 8.2.1 version, the application was updated to support non-magisk SU implementations (
su 0
). The corresponding code was:However, the current code has changed to:
This change causes failures on devices that do not support
su -c
. I am using AOSP's nativesu
.Steps To Reproduce
su
.su -c
is not supported.Expected behavior
Commands should execute successfully on devices that do not support
su -c
, similar to the behavior in version 8.2.1.Screenshots
N/A
System Information
Additional Notes
Possible Solution
Revert to the logic used in version 8.2.1 for
suCommand
or implement a check to avoid using-c
if the device does not support it. Here is a suggested modification:Thanks for reporting.
The text was updated successfully, but these errors were encountered: