SU app uid and supplementary groups - SuperSU

Hello,
Is it possible to impersonate as another (installed) app so that supplementary groups (which are, I believe, a result of granted app permissions) are also set?
Example: output of /system/bin/id command from Termux app
uid=10080(u0_a80) gid=10080(u0_a80) groups=10080(u0_a80),3003(inet),9997(everybody),50080(all_a80)
Output of /system/bin/id command when run as user 10080 (command: su 10080) from adb shell (from root):
uid=10080(u0_a80) gid=10080(u0_a80) groups=10080(u0_a80)
I am using SuperSU 2.68.
Thanks for your amazing work Chainfire!

I'm with the same issue right now, running SuperSU v2.82.

Related

How to keep env variable when SuperSu-ing?

I have a problem with SuperSU as well as Superuser app on my Razr i. The Razr i has its default LD_LIBRARY_PATH set like this:
LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/lib/arm
But when I have a su-App, it only sees this one
LD_LIBRARY_PATH=/vendor/lib:/system/lib
resulting in non-working apps because of missing libraries ("Openvpn Settings" in this case). The same happens when I'm sending a "su" on adb shell. I'm wondering now how I could set the default library path now...normally it should be possible to either call "su" with some special parameters to handle over the variables or to somewhere set those default values (they must come from somewhere). But at least the apps seem to not offer that?
BerniG said:
I have a problem with SuperSU as well as Superuser app on my Razr i. The Razr i has its default LD_LIBRARY_PATH set like this:
LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/lib/arm
But when I have a su-App, it only sees this one
LD_LIBRARY_PATH=/vendor/lib:/system/lib
resulting in non-working apps because of missing libraries ("Openvpn Settings" in this case). The same happens when I'm sending a "su" on adb shell. I'm wondering now how I could set the default library path now...normally it should be possible to either call "su" with some special parameters to handle over the variables or to somewhere set those default values (they must come from somewhere). But at least the apps seem to not offer that?
Click to expand...
Click to collapse
Try this (it usually works in Linux):
- Install Android Terminal Emulator
- Open it and type "su - "
- Allow via SuperSu or Superuser the Android Terminal Emulator to become root
- Edit .bashrc or .bash_profile with desired LD_LIBRARY_PATH you need.
- Save it
- Done!!

...has been denied Superuser permissions

Hello all,
A friend gave me his Droid 3 which was successfully rooted (Superuser version 3.13 is installed). When I look at the log I can see many past "Allowed" entries. However, I attempted to install Safestrap (version 3.05), and it was denied Superuser access (can see the denial in the log). I then attempted to grant other apps Superuser permissions and I get a "[App Name] has been denied Superuser permissions" message (and it shows "Denied" in the Superuser Log).
The really odd things are that (1) it doesn't prompt to allow or deny (despite the setting saying to prompt), and (2) if I select Superuser funcitons within the Superuser App, it will allow them. For example, if I select "temp unroot", it says "Superuser has been granted Superuser permissions".
I know I can SBF the phone and start over, but there are lots of paid Apps on the phone and I just assume try to work on getting Superuser working again if it's possible.
Please help!
Try setting to always allow
Sent from my DROIDX using XDA Free mobile app
Solved! Ok, with the device connected to my computer and playing around in adb, I noticed that the permissions for the SU binary were all goofed up. So I issued the command: adb shell "chmod 6755 /system/bin/su" and that solved the problem. Hope this helps someone else.
Shadow: Thank you sir for your reply. I should have mentioned in my original that I did try "always allow" in addition to prompting and it didn't make a difference. However, I solved it by changing the su binary's permissions (see above). Thanks again for takinig the time to reply.

Terminal Emulator and Magisk

I found the Terminal emulator app that I want to use to do some ADB for PC commands without needing PC and usb. su gives permission denied. So I decided to use Magisk - just installed the Magisk zip from recovery and the Magisk Manager, both are green light in Magisk menu. Now can it grant SU or do I still need SuperSU? SuperSU never worked for me. So Im trying to make it work for Terminal emu, how do I add the Terminal to Magisk's Superuser apps? I also downloaded ADB module from Magisk not sure if there's some ADB native command with it to do the same commands from the phone?
Oh never mind when I typed su in Terminal after having installed Magisk and all its stuff, finally it detected it and the app appeared in Superuser list in Magisk where I can toggle on or off.
xdaprogramm said:
I found the Terminal emulator app that I want to use to do some ADB for PC commands without needing PC and usb. su gives permission denied. So I decided to use Magisk - just installed the Magisk zip from recovery and the Magisk Manager, both are green light in Magisk menu. Now can it grant SU or do I still need SuperSU? SuperSU never worked for me. So Im trying to make it work for Terminal emu, how do I add the Terminal to Magisk's Superuser apps? I also downloaded ADB module from Magisk not sure if there's some ADB native command with it to do the same commands from the phone?
Oh never mind when I typed su in Terminal after having installed Magisk and all its stuff, finally it detected it and the app appeared in Superuser list in Magisk where I can toggle on or off.
Click to expand...
Click to collapse
You will have to
# cd /data/adb
then
# rm ./magisk.db
Do note that in doing so, you have erased all the grant history. However Magisk provides no other options to accomplish this. So this is it.

How To Guide [GSI] Fix 'Communication error 22' on Android Auto

If you've installed a custom ROM that doesn't come with Android Auto pre-installed, you'll get the following error when connecting your phone to your car (the Android Auto app opens correctly, the error is only shown when you connect to the car):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This error happens because Android Auto is not installed as a system app under /system/priv-app.
The following steps will ensure you can convert Android Auto from a user app to a system app. As usual, I'm not responsible for any damage to your device due to this guide.
Requirements:
Magisk and Magisk Manager (I've tested with 24.3)
Android Auto installed as a user app (I have 7.6.621734-release)
A computer with ADB or an app like Termux
I've tested this on a Xiaomi 11T Pro with Pixel Experience Plus Slim 12.1 (GSI) and Android 12, but it should work for other devices and ROMs as well.
Steps:
Install BusyBox from the Play Store
I could only install to /system/bin, but try out what works for you ROM
Click "Install" and wait for a successful message
(optional) This is just a BusyBox installer, I think you can remove the app at the end of this tutorial
Download terminal_systemizer Magisk module. Keep in mind the latest official release is outdated and does not work on Android 12 and Magisk 24.3. Because of this, you can download it from this post on XDA or clone this fork on GitHub and zip it
Install the Magisk module through Magisk Manager and reboot
Now connect your phone to your computer and launch an adb shell with adb shell, or open Termux
Enter root mode by typing su (not sure if this is required on Termux, but you must do it on adb shell)
Verify that the systemizer module is working by running the help command
Code:
# systemize -h
App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia
Usage: systemize
or: systemize [options]...
Options:
-nc removes ANSI escape codes
-f use 'Set SELinux' in the session for faster app listing
-a [package name] systemizes the package name(s) provided
-d [apk dir] systemizes the apk(s) provided
-l list all systemized apps
-h show this message
If you get a similar output, you're ready to proceed
Now run the systemize command without any arguments and answer the prompts accordingly. The app you want to systemize is com.google.android.projection.gearhead, which is Android Auto. You want to install it to /system/priv-app and NOT to /system/app.
Below is a sample output:
Code:
============================================
App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia
============================================
BusyBox v1.32.0-Stericson
/system/bin/busybox
============================================
Enter logs to upload logs
============================================
Set SELinux Enabled: false
SELinux Status: Enforcing
============================================
1 - Systemize Installed Apps (Listed)
2 - Systemize Installed Apps (Enter label)
3 - Systemize given APK
s - Set SELinux
0 - Exit
[CHOICE]: 1
Loading Apps [/]
============================================
Installed Apps =============================
============================================
...
18 - com.google.android.projection.gearhead
...
To systemize multiple apps, enter multiple number. Example: "1 23 30"
x - Back to Menu
r - Refresh list
0 - Exit
[CHOICE]: 18
============================================
Systemizing com.google.android.projection.gearhead
Checking APK directory - OK
Checking package name - com.google.android.projection.gearhead
Where to install?
< 1 - /system/app | 2 - /system/priv-app | 0 - cancel > : 2
Checking APK size - 41M
Transfering base.apk(com.google.android.projection.gearhead) to '/system/priv-app'...
Transfering libs
Granting Permissions
/system/bin/systemize[584]: aapt: can't execute: Permission denied
com.google.android.projection.gearhead - Done
Reboot to apply changes
Return to menu? < y | n >: n
Notice that it threw an error at the end, but it still worked for me. Not sure what happened, let me know if this also happened to you.
Reboot
Check that Android Auto is a system app by opening its app info page. If there is no uninstall button like below, it's installed as a system app
Please reply if you have any questions or issues!
Hope this helps
Good guide
Yh this error comes because Android auto needs to be installed as an system app.
Thank you for sharing this, I made all the steps, it worked without errors but I see the app as system app but I don't have "open" button, in fact the app itself doesn't appear with others (I had to search in settings>app)
Any idea? Thx
suiller said:
Thank you for sharing this, I made all the steps, it worked without errors but I see the app as system app but I don't have "open" button, in fact the app itself doesn't appear with others (I had to search in settings>app)
Any idea? Thx
Click to expand...
Click to collapse
Hm that's weird, I don't see how that could happen.
Try grabbing an APK from apkmirror and installing the app again (must be the same version or newer)
I managed it... now I see the app as regular (system) app...
The problem was busybox, I used that one provided as magisk module and worked at 1st attempt
diogotc said:
Hm that's weird, I don't see how that could happen.
Click to expand...
Click to collapse
I dunno why but busybox was the problem, I just installed the version provided here in 1st post, even if without error something happened so I had the app moved under priv but it wasn't available as regular/working app
Anyway I had to:
restore androidauto from systemize, reboot
deinstall androidauto, reboot
install busybox as module from magisk
re-run systemize as instructions at 1st post, reboot
Hi
no work for me
have asus rog 5 with china rom
installed android auto
root ok
i follow this guide...android auto install is marked ok and seems all ok....it is system app
but in my car i obtain a loop android auto: link, after 1 sec stop, then link, then stop and so away
if i run systemize again, android auto is not became a system app anymore
Thanks bro work great Xiaomi 12s ultra 13.0.8
Thanks for your guide,it worked on a Redmi Note 7 with latest PPUI ROM, but as soon as I remove Magisk the app reverts to user app and not system app. Since I cant get my bank app to work on rooted phones, even with Magisk hidden, is there a way to keep AA as system app without having to keep Magisk installed?
farrayoles said:
Thanks for your guide,it worked on a Redmi Note 7 with latest PPUI ROM, but as soon as I remove Magisk the app reverts to user app and not system app. Since I cant get my bank app to work on rooted phones, even with Magisk hidden, is there a way to keep AA as system app without having to keep Magisk installed?
Click to expand...
Click to collapse
As far as I know you'll need Magisk installed. The latest version of the Pixel Experience GSI already includes an Android Auto stub to avoid this problem, maybe you can ask that ROM developer to do the same.
Anyway, you should be able to bypass your banking app verification. Have you added it to the DenyList as well as change the package name of MagiskManager?
You can try an app like RootBeer to see what else you need to do.
It might also help deleting the data from the banking app, since it might store if you had root or not.
Hope that helps!
Skyline_r said:
Thanks bro work great Xiaomi 12s ultra 13.0.8
Click to expand...
Click to collapse
Does wireless android auto work for you? My AA crashes on the xiaomi mi fold x 2
Does Root is required to do so before start? Becuase I can't install Busybox if the phone is not rooted.
I tried this on my SM-X200 and all the steps worked (can not uninstall at app info) but when I went to plug the tablet into my car it still gives me error 22
Skyline_r said:
Thanks bro work great Xiaomi 12s ultra 13.0.8
Click to expand...
Click to collapse
hi, can i check if you performed these steps on a custom rom? or the chinese rom? thanks!
diogotc said:
If you've installed a custom ROM that doesn't come with Android Auto pre-installed, you'll get the following error when connecting your phone to your car (the Android Auto app opens correctly, the error is only shown when you connect to the car):
View attachment 5636057
This error happens because Android Auto is not installed as a system app under /system/priv-app.
The following steps will ensure you can convert Android Auto from a user app to a system app. As usual, I'm not responsible for any damage to your device due to this guide.
Requirements:
Magisk and Magisk Manager (I've tested with 24.3)
Android Auto installed as a user app (I have 7.6.621734-release)
A computer with ADB or an app like Termux
I've tested this on a Xiaomi 11T Pro with Pixel Experience Plus Slim 12.1 (GSI) and Android 12, but it should work for other devices and ROMs as well.
Steps:
Install BusyBox from the Play Store
I could only install to /system/bin, but try out what works for you ROM
Click "Install" and wait for a successful message
(optional) This is just a BusyBox installer, I think you can remove the app at the end of this tutorial
Download terminal_systemizer Magisk module. Keep in mind the latest official release is outdated and does not work on Android 12 and Magisk 24.3. Because of this, you can download it from this post on XDA or clone this fork on GitHub and zip it
Install the Magisk module through Magisk Manager and reboot
Now connect your phone to your computer and launch an adb shell with adb shell, or open Termux
Enter root mode by typing su (not sure if this is required on Termux, but you must do it on adb shell)
Verify that the systemizer module is working by running the help command
Code:
# systemize -h
App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia
Usage: systemize
or: systemize [options]...
Options:
-nc removes ANSI escape codes
-f use 'Set SELinux' in the session for faster app listing
-a [package name] systemizes the package name(s) provided
-d [apk dir] systemizes the apk(s) provided
-l list all systemized apps
-h show this message
If you get a similar output, you're ready to proceed
Now run the systemize command without any arguments and answer the prompts accordingly. The app you want to systemize is com.google.android.projection.gearhead, which is Android Auto. You want to install it to /system/priv-app and NOT to /system/app.
Below is a sample output:
Code:
============================================
App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia
============================================
BusyBox v1.32.0-Stericson
/system/bin/busybox
============================================
Enter logs to upload logs
============================================
Set SELinux Enabled: false
SELinux Status: Enforcing
============================================
1 - Systemize Installed Apps (Listed)
2 - Systemize Installed Apps (Enter label)
3 - Systemize given APK
s - Set SELinux
0 - Exit
[CHOICE]: 1
Loading Apps [/]
============================================
Installed Apps =============================
============================================
...
18 - com.google.android.projection.gearhead
...
To systemize multiple apps, enter multiple number. Example: "1 23 30"
x - Back to Menu
r - Refresh list
0 - Exit
[CHOICE]: 18
============================================
Systemizing com.google.android.projection.gearhead
Checking APK directory - OK
Checking package name - com.google.android.projection.gearhead
Where to install?
< 1 - /system/app | 2 - /system/priv-app | 0 - cancel > : 2
Checking APK size - 41M
Transfering base.apk(com.google.android.projection.gearhead) to '/system/priv-app'...
Transfering libs
Granting Permissions
/system/bin/systemize[584]: aapt: can't execute: Permission denied
com.google.android.projection.gearhead - Done
Reboot to apply changes
Return to menu? < y | n >: n
Notice that it threw an error at the end, but it still worked for me. Not sure what happened, let me know if this also happened to you.
Reboot
Check that Android Auto is a system app by opening its app info page. If there is no uninstall button like below, it's installed as a system app
View attachment 5636069
Please reply if you have any questions or issues!
Hope this helps
Click to expand...
Click to collapse
Hey Bro. I'm trying to follow your instruction but I'm not able to use the busy box it's saying that I should remove the superuser.
Can you please help?
Hi, diogotc
Thank you so much, worked flawlessly. The instructions you provided were excellent. I used the systemizer on AA 8.3.624114. I used this on a Lenovo Legion Duel 2 with CN rom Android 12, with Magisk 25.2.
One difference I had was the AA app was just named Android Auto (number 3) in the systemizer list, but I had zero issues.
Thanks again!
The con.android.... path does not appear... I stay un systemize option 1 por 2 and it tells me that the file does not existe, do i hace to create it un busybox?
I don't understand why it doesn't appear it xd
Thanks for this
Just followed your instructions running ThinROM A13 v4 [15/12/2022]-[GVK9-[EXYNOS]-[SM-N986B]-[SM-N985F] on my SGN20U (SM-N986B/DS)
I couldn't get SU permission, Terminal Systemizer was greyed out in MM, so installed ADB Root v1.0 and it all worked like a charm from there.
Hi,
Thanks for the guide. I want to install the Android Auto on Redmi Pad so that I can use the pad as an Entertainment HeadUnit in my car. Can I follow these instructions and still it will work ?
Let me know. Appreciate your help and support
Thanks for that useful post but i'm receiving error after choose 2 - /system/priv-app and paste com.google.android.projection.gearhead
/data/app/com.google.android.projection.gearhead-*/base.apk doesn't exist!
Android auto is already insattaled. i'm using windows 10 and adb shell command.
Any idea ?

Abnormal State - "su" binary not from Magisk has been detected

Hello!
I am on LOS GSI 19.1, S20 FE LTE Exynos (with TWRP) - when starting Magisk have this msg:
Abnormal State
A "su" binary not from Magisk has been
detected. Please remove any competing
root solution and/or reinstall Magisk.
What could be reason of that and how to fix it. :/ Maybe someone can help...
Found your thread while searching for a solution of the same problem.
I thought I will share a solution as finding useful info novadays gets harder every day.
Not to get into detailed description, generally it's caused by su existing in /system/xbin path, and in most cases shell is started with su privileges due to an entry in /system/build.prop
Just rename the /system/xbin/su under adb shell or terminal to for example ssu/zu/subackup whatever the name is and after reboot magisk shouldn't yell with a popup.
btw. I haven't encountered any misbehaviour of magisk, but for the sake of not getting this popup I made the change by the way of working with shell on other things.
YoShake said:
Found your thread while searching for a solution of the same problem.
I thought I will share a solution as finding useful info novadays gets harder every day.
Not to get into detailed description, generally it's caused by su existing in /system/xbin path, and in most cases shell is started with su privileges due to an entry in /system/build.prop
Just rename the /system/xbin/su under adb shell or terminal to for example ssu/zu/subackup whatever the name is and after reboot magisk shouldn't yell with a popup.
btw. I haven't encountered any misbehaviour of magisk, but for the sake of not getting this popup I made the change by the way of working with shell on other things.
Click to expand...
Click to collapse
Hi I found that for some reason downgrading to android 12 PE works for some reason but when I update to android 13 EvolutionX it shows the popup do you mind sharing the command for adb on how to do this because it denied access for me when I tried remounting from r/o to r/w.
AirForceNBA said:
do you mind sharing the command for adb on how to do this because it denied access for me when I tried remounting from r/o to r/w.
Click to expand...
Click to collapse
if rom you use is complied with adb root capabilites, then just use linux mv command after connecting to shell
Code:
adb root
adb shell
mv /system/xbin/su /system/xbin/zu
if not, then maybe under twrp commandline it could be possible?
AirForceNBA said:
Hi I found that for some reason downgrading to android 12 PE works for some reason but when I update to android 13 EvolutionX it shows the popup do you mind sharing the command for adb on how to do this because it denied access for me when I tried remounting from r/o to r/w.
Click to expand...
Click to collapse
I solve this issue in my gsi evolution X android 13 after flash overlyfs.zip in my magisk manager ... Click Download System Rw in this site
Magisk Modules - some Daily use Magisk Mods in 2022 | Use these Modules Daily ! ยป Tech Karan
Magisk Modules are here !
techkaran.co.in
and then flash overlyfs.zip using magisk manager...
Need telegram apps and account to download the file...
Hi I have the same issue. I tried to rename su in xbin but I got permission denied. Root explorer granted root and system is rw. In abd with the command above also permission denied. Xbin folder is not visible in recovery. Overlayfs module is not working with my kernel. Galaxy S21+, TWRP, Lineage 19.1, Hari GSI kernel. Any idea?
Did
K_a_m_i said:
Any idea?
Click to expand...
Click to collapse
Did you set rw on /system or /system/xbin?
Set rw on the top dir, not nested one in which you want to make changes, or you won't get permissions to change anything in any nested directory you set rw on.
Try to copy the file somewhere else and then delete it from its original path. But I bet you won't succeed. Maybe changing the owner/group and all permissions to 777 would do.
I'd also try in safe mode, or in native recovery mode (not twrp, assuming you still have access to it) using ADB
For me it disapeard by reinstalling magisk by the TWRP.
K_a_m_i said:
Hi I have the same issue. I tried to rename su in xbin but I got permission denied. Root explorer granted root and system is rw. In abd with the command above also permission denied. Xbin folder is not visible in recovery. Overlayfs module is not working with my kernel. Galaxy S21+, TWRP, Lineage 19.1, Hari GSI kernel. Any idea?
Click to expand...
Click to collapse
Are you try to flash Overlyfs first without any module in your magisk...
After you flash magisk manager in your phone and installed already, open it and then restart your phone.. then
First: flash only Overlyfs.zip in your magisk without any module installed.. then restart your phone
Second: download root explorer and grant root
Third: find su in system/xbin and rename it in ZU and save and delete zu then restart your phone
I hope I helped you with this post

Categories

Resources