-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
su command failing in addon.d-v2+ scripts #972
Comments
what is the uid of |
Is the |
Yes, addon.d-v2 and v3 are for A/B devices and occur while the device is fully booted.
Took this during a running OTA, during addon.d execution: `ps` output
|
In case it's helpful, I think this is how Magisk first allowed update_engine's backuptool addon.d-v2+ scripts to access the su command by default: topjohnwu/Magisk@a636968#diff-5f9385472196feeced8e7d5479aab996b688ce4739f169c39fd763528fc8323aR127 |
Maybe you can add uid 1000 to allowlist? Anyway, I'll try it on LineageOS. |
Thanks! I didn't see a way to do that in the app, is there a way via command line? |
The |
Ah, yeah, it's Android System/android and I'd already tried it with no effect, unfortunately. Edit: Also, if KernelSU actually operates by UID then it would be great if the app would show the UID (name + number) associated with each allowed package somewhere. 👍 |
I tracked the SELinux rules in Magisk for update_engine and it gets replaced here back in May: topjohnwu/Magisk@bc94ea4#diff-a3d987545e3fa74fd639778c193afb15b147625ee45dbd4470d271699f658774L67 Could be useful to add what's needed to KSU's rules perhaps? Since whatever they added instead, |
Maybe. I find a device with LineageOS support, but i don't know how to reproduce it, how can i "Accept a ROM A/B OTA"? |
Can you send the dmesg log? |
You don't install the latest build, you install a slightly older one so that an OTA is available in Settings | Updater. Then once you've got the example script set up you Download and Install the OTA. I'll try to get you a dmesg as well, but you should be able to reproduce following those steps. 🤞 |
Here's a filtered logcat and a complete dmesg taken directly after the backuptool scripts run. These are with system_server (Android System/android) on the Superuser allow list. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Is it still necessary to add system_server to the allow list? |
I think we don't need to do that now. |
Tested with v0.7.5 (11434) in app and kernel on my OnePlus 7T on Lineage 20 and I'm still not seeing any change in behavior with my example 97-dumpimages.sh or any other addon.d-v2+ script using su. I tried with and without system_server on the allow list. Was it working in your testing of the merged fix @tiann / @Ylarod ? |
Describe the bug
KernelSU does not seem to have a way to allow su commands to function when executed from an addon.d script.
Steps to reproduce
chmod 755
it (e.g. 97-dumpimages.sh - unzip from attached 97-dumpimages.sh.zip)Log
I piped output from the su command in the script, which confirms it fails with the following:
Expected behaviour
KernelSU has a com.android.shell entry in the default list to allow
adb shell
su commands, and should have something similar to allow su commands from the update_engine/backuptool so that addon.d scripts using su can function like they would with Magisk.I tried enabling root for com.android.shell, and other system packages like android, systemui, Lineage's updater, etc, with no luck, but there must be something that KernelSU can do to allow it.
Smartphone info
The text was updated successfully, but these errors were encountered: