-
Notifications
You must be signed in to change notification settings - Fork 76
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
USB Debugging does not work when installed #2
Comments
This means that adbd is not starting. Reasons could be different. What android version? What phone, firmware? Does it work if you switch selinux to permissive mode? |
Phone: Samsung SM-G900F I'll try setting SELinux to permissive and let you know. |
Nop. Same. Setenforce is set to 0 (Permissible). Restarted the device (SELinux persist the state Permissible).
Can I execute the module with debug (stdout/err) info from the console (I can ssh into the phone)? |
Ok, found the hotfix: Init
Confirmation
Now I'm wondering what is the issue that kills adbd on my phone. :/ |
same issue on samsung j2core (j260gu) 8.1.0 oreo. |
Same issue on Oneplus 7T Pro Oxygen OS 10.0.12 |
Any error messages in dmesg? I wonder if something like frida/frida#877 (comment) would work. |
No, it won't work. SELinux (most probably) kills adb root because this policy https://github.com/evdenis/adb_root/blob/master/sepolicy.rule is not enough on Samsung SM-G900F, samsung j2core, Oneplus 7T Pro devices. I don't have these devices and can't debug and test the module on them. The simplest and universal way to solve the issue on these devices is to switch SELinux to permissive mode during boot process. |
@evdenis that does not work, see this; #2 (comment) |
That's why I wrote "(most probably)". I don't know the exact reason on your phone and obviously can't debug it. I only know that SELinux can kill the process or the kernel itself (on samsung devices it's true because of this code https://github.com/CruelKernel/samsung-exynos9820/blob/1039ba0bf7e89464e0b233b78f31277c6da5bdd0/fs/exec.c#L1837, https://github.com/CruelKernel/samsung-exynos9820/blob/1039ba0bf7e89464e0b233b78f31277c6da5bdd0/security/samsung/defex_lsm/defex_rules.c#L85). Maybe selinux in your case starts in enforcing mode during boot and switches to permissive too late. You can check kernel log or /proc/avc_msg file for strings like 'avc' or 'denied' or 'adb'. |
The way you fixed your problem with starting adbd manually is another "indirect evidence" for me that you struggle with SELinux, because I also faced the exactly the same behaviour while writing the module. SELinux killed adbd on my phone and it was possible to start adbd manually from termux with root privileges. I solved the case by writing additional policy https://github.com/evdenis/adb_root/blob/master/sepolicy.rule that magisk injects to selinux during the boot process. This policy is enough on OnePlus 5T, Samsung S10 and these are the only devices I can test the module on. |
Just in case, if you use LineageOS you don't need this module since it's possible to switch adbd root in settings. |
@duraki So basically I connect the mobile to computer through USB. Now how do I know what port to connect to? |
@leovarmak you need |
@duraki Thank you so much!!! I am a QA, so incase if you ever want feedback about whatever you work now, I am here 😁 |
@evdenis USB Debugging does not work once this module is installed and enabled in Magisk.
The text was updated successfully, but these errors were encountered: