Question security vs Syncthing on rooted Pixel 7 - Google Pixel 7

I rooted my pixel 7 the other day, but I was surprised to discover I couldn't sync some folders in my root directory using Syncthing.
Every other device I have rooted as well as an unrootable A70 running Android 11 permits this.
Is this normal behaviour for a rooted device running Android 13 or Android 12?
Do I just need to elevate permissions for an app to access these directories, in my case "Syncthing"?

Quoddity said:
Do I just need to elevate permissions for an app to access these directories, in my case "Syncthing"?
Click to expand...
Click to collapse
yes
did it here to sync my OSMap files because permission to read/write was disabled after update to Android 11 (I think)

DHGE said:
yes
did it here to sync my OSMap files because permission to read/write was disabled after update to Android 11 (I think)
Click to expand...
Click to collapse
Sorry for the noob question, haha, but how do I elevate permissions in this context?
I haven't used UNIX or Linux in years, so I'm very rusty with bash and phones are probably a little different from regular Linux anyway.
Do I use a Magisk module?
Or is it simply something like the following in the adb shell:. pm grant <app> android.permission.INTERACT_ACROSS_USERS_FULL ?

Run syncthing as root.
settings/verhalten(behaviour?;3rd from top)

Related

Alternative to installing Better Battery Stats as system app

Starting with Android 4.4 (KitKat) Better Battery Stats (BBS) require installation as system app to be able to collect the stats.
BBS must re re-installed as system app after each ROM upgrade (upgrade that does not preserve third party system apps).
I have found an alternative to this - the required permissions can be granted to BBS when it is installed as a regular user app by running these commands in Android Terminal (or ADB shell session):
Code:
su
pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
pm grant com.asksven.betterbatterystats android.permission.DUMP
After using these commands it might be required to restart BBS process (e.g. reboot the device). Permissions granted this way will be preserved across ROM upgrades (even across those completely overwriting /system partition).
This has been tested on CyanogenMod 12.1 nightlies (Android 5.1.1).
Update! This post on BBS thread describes a related method for granting (at least part of) the permissions without root.
Hi DavisNT,
I'm confirming that your adb code appears to be a successful workaround for the normal version of BBS downloaded from the Play Store when the phone is running Lollipop. I'm running the paid version of BBS, on the current CM12.1 Nightly (jfltetmo for my T-Mobilr SGH-M919 Galaxy S4).
Procedure:
1. Install BBS from the Play Store.
2. Use ADB (easy to cut and paste from here) or another terminal program (you'll be typing) to install the code.
3. Reboot the phone.
You'll notice that when you launch BBS, CM's "Privacy Guard" will see that BBS is trying to gain root access, and will prompt you to allow this. I selected "Always Allow" until I'm done my battery testing. You'll notice that you now see "#" up on the phone's status bar. That indicates an app is running with root access. You could probably quiescence this by choosing "Ignore" via Privacy Guard.
Could the developer please approve that this relatively easy workaround is kosher?
Thanks . . .
Moved to main thread to avoid orphan
For apk downloaded from xda change the code to
pm grant com.asksven.betterbatterystats_xdaedition android.permission.BATTERY_STATS
pm grant com.asksven.betterbatterystats_xdaedition android.permission.DUMP
I tried this method, but failed on the BATTERY_STATS permission, the error said this 'permission type is not changeable'
is this method still valid?
andycjw said:
I tried this method, but failed on the BATTERY_STATS permission, the error said this 'permission type is not changeable'
is this method still valid?
Click to expand...
Click to collapse
On what version of Android did this fail? And was 'su' used before 'pm grant'?
Same problem. I'm on CM, Android version 4.4.4. Used 'su' before.
bobcote said:
Same problem. I'm on CM, Android version 4.4.4. Used 'su' before.
Click to expand...
Click to collapse
Most likely this method works only on Lollipop and Marshmallow.
Looks like on KitKat BATTERY_STATS permission does not have development in its protectionLevel, but on Lollipop and Marshmallow it has.
I assume (please correct me if I am wrong, preferably with link to some authoritative documentation) that development in protectionLevel allows a permission to be granted by pm grant command.
Thanks
I can confirm that this method works flawlessly for the Sprint version of the Galaxy Note 3 5.0. Many thanks.
Guys where is the main thread? Pls ?
DavisNT said:
Starting with Android 4.4 (KitKat) Better Battery Stats (BBS) require installation as system app to be able to collect the stats.
BBS must re re-installed as system app after each ROM upgrade (upgrade that does not preserve third party system apps).
I have found an alternative to this - the required permissions can be granted to BBS when it is installed as a regular user app by running these commands in Android Terminal (or ADB shell session):
Code:
su
pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS
pm grant com.asksven.betterbatterystats android.permission.DUMP
After using these commands it might be required to restart BBS process (e.g. reboot the device). Permissions granted this way will be preserved across ROM upgrades (even across those completely overwriting /system partition).
This has been tested on CyanogenMod 12.1 nightlies (Android 5.1.1).
Click to expand...
Click to collapse
Does this method work on marshmallow?
Thank you
RoxAbout said:
Does this method work on marshmallow?
Thank you
Click to expand...
Click to collapse
Most likely yes. Feel free to test. [emoji2]
Can anyone post BBS apk please!! TQIA
Thanks dude. The command for xdaedition worked flawlessly on my RR rom. Android 6.0.1 Galaxy S3
Worked! Thanks.
Does this works on a non-rooted phone? if it works, is uninstalling as simple as accessing app under setting to uninstall?
Thanks.
nuthing03 said:
Does this works on a non-rooted phone? if it works, is uninstalling as simple as accessing app under setting to uninstall?
Thanks.
Click to expand...
Click to collapse
AFAIK This method should NOT work on non-rooted phones (but you can still try it :fingers-crossed: ). If it will work, uninstalling the app (via Settings - Applications) would also revoke the granted permissions.
Original Thread here: http://bit.ly/1ov1NNy
Can confirm that the workaround is OK on Samsung S6 with Android 6.0.1 (stock DTM/rooted).
Best regards
Glad I found this, thought BBS was bugged when it kept wanting the BATTERY_STAT permission despite having the XPosed module :\
Executing those 2 lines fixed the problem.... wonder why it's not like that by default. I even checked AppOpsXposed and didn't see anything about DUMP/BATTERY_STAT
Installing BBS into /system would break OTA, no? I've read somewhere the claim that it doesn't--maybe even in the app itself

Microsoft Intune Company Portal

Hi
I've search the forums but apart from finding several people with the same issue, i didn't find anything useful.
I'm running LOS14.1 on a OP3 with latest Magisk. Safetynet passes but the MS Intune company portal seems to be detecting that the device is rooted. Turning off root however is not fixing this. Any idea on how it detects this or are there solutions via Magisk for dealing with this (or other solutions off course).
Regards
Mrhubris
mrhubris said:
Hi
I've search the forums but apart from finding several people with the same issue, i didn't find anything useful.
I'm running LOS14.1 on a OP3 with latest Magisk. Safetynet passes but the MS Intune company portal seems to be detecting that the device is rooted. Turning off root however is not fixing this. Any idea on how it detects this or are there solutions via Magisk for dealing with this (or other solutions off course).
Regards
Mrhubris
Click to expand...
Click to collapse
I am on stock Lollipop rooted using Magisk 11.6. Outlook wouldn't start for me even though magisk hide was enabled and safetynet passed. I used the Tasker app to get around the root check with the with the following tasks:
Launch App (Outlook)
Run Shell command:
su
chmod 0754 /data/magisk
sleep 25
chmod 0755 /data/magisk
This launches the outlook app and changes the permissions of the magisk folder for 25 seconds so that when it does the root check after I input my pin everything checks out. After 25 seconds it restores the permissions to what they were, and root continues to work. I exported this as an app (long hold on task, click menu in upper right and export as app) and it seems to work like a charm.
I tried changing permissions on the individual files in the /system/data/magisk folder, but that didn't work. changing the permissions on the whole /system/data/magisk directory to 0754 seems to do the trick.
You can also use a root file manager to change the permissions, but you have to be careful because if the file browser loses its root privilege before changing the permissions back, you will lose your root capabilities until rebooting into TWRP recovery to do a chmod 0755 on the magisk folder. It's more inconvenient than having tasker do it, but it works.
Hope this helps somewhat.
The only issue I'm having is that tasker seems to be a paid app. I'm not willing to pay money if I'm not sure it works.
This is why asked the question. In the other threads I read it was clear that this is not always working so I asked the question in here specifically for magisk.
Regards
Mrhubris
mrhubris said:
The only issue I'm having is that tasker seems to be a paid app. I'm not willing to pay money if I'm not sure it works.
This is why asked the question. In the other threads I read it was clear that this is not always working so I asked the question in here specifically for magisk.
Regards
Mrhubris
Click to expand...
Click to collapse
Tasker is definitely worth it! If you're worried you can try by doing the chmod manually first.
@dizzybrow
Thank you! Purchased Tasker just to do this and it worked!
dizzybrow said:
I am on stock Lollipop rooted using Magisk 11.6. Outlook wouldn't start for me even though magisk hide was enabled and safetynet passed. I used the Tasker app to get around the root check with the with the following tasks:
Launch App (Outlook)
Run Shell command:
su
chmod 0754 /data/magisk
sleep 25
chmod 0755 /data/magisk
This launches the outlook app and changes the permissions of the magisk folder for 25 seconds so that when it does the root check after I input my pin everything checks out. After 25 seconds it restores the permissions to what they were, and root continues to work. I exported this as an app (long hold on task, click menu in upper right and export as app) and it seems to work like a charm.
I tried changing permissions on the individual files in the /system/data/magisk folder, but that didn't work. changing the permissions on the whole /system/data/magisk directory to 0754 seems to do the trick.
You can also use a root file manager to change the permissions, but you have to be careful because if the file browser loses its root privilege before changing the permissions back, you will lose your root capabilities until rebooting into TWRP recovery to do a chmod 0755 on the magisk folder. It's more inconvenient than having tasker do it, but it works.
Hope this helps somewhat.
Click to expand...
Click to collapse
I can use Outlook app without Magisk Hide, I don't understand why you need do that.
Deic said:
I can use Outlook app without Magisk Hide, I don't understand why you need do that.
Click to expand...
Click to collapse
Each company has different policies. Also some don't use intune (maybe that's you).
Time for another update.
The problem is not necessarly the oulook app. It's the Intune Company Portal that's closing everything up. Is there a way around this?
From my experience it even trips on unsigned custom roms. Currently Paranoid Android is the only one not giving me problems.
as far as i can tell it detects:
- signed / Un-signed
- root (the binaries itself). Disabling root results in the exact same error notification
If magisk.hide is enabled for the app, there is no way it will detect the root binaries.
Detection could be due to the build props .. ones such as
ro.build.tags=release-keys
ro.build.type=user
Have you tried setting the above build.prop properties to the value mentioned above. These are not set like this for custom roms.
You may try the attached magisk module to set these.
Changing these build props is not working.
Root beer sample is still detecting dangerous props and safetynet is also triggering.
mrhubris said:
Changing these build props is not working.
Root beer sample is still detecting dangerous props and safetynet is also triggering.
Click to expand...
Click to collapse
Then you have some other issue. Both, root bear and safteynet should pass easily with magisk on custom roms.
candiesdoodle said:
Then you have some other issue. Both, root bear and safteynet should pass easily with magisk on custom roms.
Click to expand...
Click to collapse
Intune is just detecting specific aspects and the company i work for says that in those cases no configuration (of email for example) is allowed to happen.
But i've got no clue as to what it is detecting.
If i run Paranoid Android as a ROM it is possible. If i switch to LineageOS or Resurrection it's not.
Somehow the setup of these ROM's differs in a way to MS Intune trips or not. Is it possible to figure this out in some way?
I having same problems too but with onedrive, atm at work we are testing intune and now it would not let me use onedrive as the intune app detects root...
It could be detecting apps that require root as a secondary check, do you have anything like root explorer , Titanium backup etc ?
Sent from my ONEPLUS A5000 using Tapatalk
For me, It's detecting something in sbin even though magisk unmounts it. If I remove read or execute permissions from sbin then Company Portal and all associated apps launch just fine. Of course nothing that needs root works anymore since without those permissions nothing can access su or anything else needed for root.
Sent from my Nexus 6 using Tapatalk
i found out @dizzybrow fix works in magisk 11.6 but not 13 (didn't try 12). i'm staying on 11.6 just for this reason.
Any better ways to fix this problem?
illwafer said:
i found out @dizzybrow fix works in magisk 11.6 but not 13 (didn't try 12). i'm staying on 11.6 just for this reason.
Click to expand...
Click to collapse
So you are using Magisk Hide on 11.6 and Intune is not detecting root? I tried that and it didn't work for me.
Anyone else have any ideas?
Are you using Tasker with the variables provided by dizzybrow? If so, it should work with 11.6 (safetynet still fails).
illwafer said:
Are you using Tasker with the variables provided by dizzybrow? If so, it should work with 11.6 (safetynet still fails).
Click to expand...
Click to collapse
I am trying to, but I am not all that familiar with Tasker, so apparently I am doing something wrong. I would appreciate any assistance as far as setting it up correctly.

Magisk Issue On OmniROM 8.1

I'm using official Omni 8.1. The issue I'm facing is that the Magisk Manager can't seem to remember the apps it has granted Superuser permission. Even in the Superuser tab it shows "No apps found". Result being I have to grant Superuser permission every time when I open an app like Root Explorer.
Please look into this issue.
Magisk Manager: v5.5.2
Magisk Root: v15.1 Stable
I don't have this issue on version 5.5.0 and 15.1 on the latest Omni 8.1 weekly on my Oneplus 3T.
Edit: You didn't mention what device, so I doubt anyone would be able to help you. But I guess you're running a Oneplus 3T or a Oneplus 5 since there are no 8.1 Omni weeklies for any other devices, yet. Maybe you could try to attach some logs.
For me Magisk v15.1 doesn't boot anymore, it just fails and goes back to recovery.
v14.6 works fine.
Omni 8.1 on Oneplus 5T
Same problem here. Any solution?
Look into this issue, doesn't boot, solutions?
Where are the logs?
How do you expect someone to help you without that?
For all the praise Magisk seems to get, it sure does have some issues. Lately, it's been kind of a lottery figuring out which version will work with which ROM... These things never happend to me on SuperSu
Jazavchar said:
For all the praise Magisk seems to get, it sure does have some issues. Lately, it's been kind of a lottery figuring out which version will work with which ROM... These things never happend to me on SuperSu
Click to expand...
Click to collapse
I'd say it has to do with the incredible speed that the Magisk development has been going at. Looking back over the past year, a lot has happened. This kind of speed can cause instabilities...
Now, it's most likely at a point where the focus will be on stability and compatibility development.
Having said that, though, all users experiencing issues can help with that by providing as much details as possible and relevant logs.
I can confirm this. It seems Magisk has a problem opening the sqlite3 database, on OmniROM 8.1 at least.
The Superuser request can be granted, and it goes through (as in the app gets its root access), however nothing is permitted "forever".
Superuser log in Magisk Manager is empty, so is the list of apps granted Superuser access.
From my log:
Code:
sqlite3 open failure: unable to open database file
Either the sqlite3 database is located somewhere else, or Magisk didn't get the correct writing rights during the install. Did something change regarding this in 8.1?
There is also a somewhat unrelated issue with Magisk Hide, where the hidelist-file doesn't exist/wasn't initially created upon installation:
Code:
fopen: /sbin/.core/img/.core/hidelist failed with 2: No such file or directory
Full log attached.
debichu said:
I can confirm this. It seems Magisk has a problem opening the sqlite3 database, on OmniROM 8.1 at least.
The Superuser request can be granted, and it goes through (as in the app gets its root access), however nothing is permitted "forever".
Superuser log in Magisk Manager is empty, so is the list of apps granted Superuser access.
From my log:
Code:
sqlite3 open failure: unable to open database file
Either the sqlite3 database is located somewhere else, or Magisk didn't get the correct writing rights during the install. Did something change regarding this in 8.1?
There is also a somewhat unrelated issue with Magisk Hide, where the hidelist-file doesn't exist/wasn't initially created upon installation:
Code:
fopen: /sbin/.core/img/.core/hidelist failed with 2: No such file or directory
Full log attached.
Click to expand...
Click to collapse
Two things I'm curious about (at the moment):
What are the permissions for /data/adb/magisk.db?
Do you now have a hidelist file in /sbin/.core/img/.core?
Didgeridoohan said:
Two things I'm curious about (at the moment):
What are the permissions for /data/adb/magisk.db?
Do you now have a hidelist file in /sbin/.core/img/.core?
Click to expand...
Click to collapse
There is no such file in that location. There is a magisk.img in that folder with -rw-r--r--, and a magisk/ folder but not containing any magisk.db file either.
Yes, there is now a hidelist file in /sbin/.core/img/.core with -rw-rw-rw-
Bonus info:
I did a complete wipe (I initially did that but I wanted to be certain), and I got this error while installing Magisk right after OmniROM (also see attached):
Code:
! System installed root detected, mount rw :(
Now, OmniROM doesn't ship with root built in - at least not to my knowledge. So I don't know what this "system installed root" Magisk is detecting.
debichu said:
There is no such file in that location. There is a magisk.img in that folder with -rw-r--r--, and a magisk/ folder but not containing any magisk.db file either.
Yes, there is now a hidelist file in /sbin/.core/img/.core with -rw-rw-rw-
Bonus info:
I did a complete wipe (I initially did that but I wanted to be certain), and I got this error while installing Magisk right after OmniROM (also see attached):
Code:
! System installed root detected, mount rw :(
Now, OmniROM doesn't ship with root built in - at least not to my knowledge. So I don't know what this "system installed root" Magisk is detecting.
Click to expand...
Click to collapse
Number 1 is an issue, because that's the su database... If there is none, it's no wonder why granted superuser requests aren't saved.
Hi, do you have a solution?
@Didgeridoohan i am facing same issue like this . it keeps asking for superuser req .
cpt.macp said:
@Didgeridoohan i am facing same issue like this . it keeps asking for superuser req .
Click to expand...
Click to collapse
As far as I know, so far the only known working solution is to reformat /data as ext4. Or stay on an old version of Magisk.
Didgeridoohan said:
As far as I know, so far the only known working solution is to reformat /data as ext4. Or stay on an old version of Magisk.
Click to expand...
Click to collapse
which version you suggest also my /data is ext4 only .
also i would like to tell you one more thing after tinkering little bit and observed following things
as soon as i dont open the magsik app and using root by simple toast and granting the permission it works but as soon as i open the app , it starts misbehaving . i wonder why .
cpt.macp said:
which version you suggest also my /data is ext4 only .
also i would like to tell you one more thing after tinkering little bit and observed following things
as soon as i dont open the magsik app and using root by simple toast and granting the permission it works but as soon as i open the app , it starts misbehaving . i wonder why .
Click to expand...
Click to collapse
Let me guess: you're not using OmniROM...
Since you're posting in this thread, I kind of assumed you did, so my answer was given accordingly.
If you need help, post all possible details and lots of relevant logs.
I've had the same error. Magisk seems unstable on OmniROM 8.1 on OnePlus 5. Probably an issue with the ROM, but the developer seems like the kind of guy who will tell you to go f*ck yourself if you have a problem like this.
Sometimes it works sometimes it doesn't.
A temporary workaround with the permission issue on /data/adb/magisk.db, even after not working trying 0666 permissions, was to change ownership. None of many other solutions worked for me until I found the user for Magisk. You can use a shell as root or with apps like FX File Explorer with root capability to see which user owns files in "/data/adb/magisk/" . Then I applied that user as the owner of magisk.db. Verified that apps which ask for root permission get saved now. The user of Magisk will be different for you since it is marked as "app_##' which I suppose is up to the amount of apps you have installed.
I have a problem and think it caused by the same reason other users here.. My issue is after installing omni rom and gapps ONLY i can't use my banking apps because ( i guess) it thinks my device is rooted.
Device : oneplus 5
I wasn't planning to root my device to keep those kind of issues away
saidmsb said:
I have a problem and think it caused by the same reason other users here.. My issue is after installing omni rom and gapps ONLY i can't use my banking apps because ( i guess) it thinks my device is rooted.
Device : oneplus 5
I wasn't planning to root my device to keep those kind of issues away
Click to expand...
Click to collapse
No... I don't think so. This thread is about an issue with Magisk and f2fs on Android 8.1 ROMs. Your issue could be that OmniROM sets some sensitive props to triggering values.
That can be taken care of by using Magisk and MagiskHide. Take a look here for more info:
https://www.didgeridoohan.com/magisk/MagiskHide#hn_Sensitive_props
If you decide to install Magisk, this part of the guide might also be useful (all of it is useful, really):
https://www.didgeridoohan.com/magisk/MagiskHide#hn_Hiding_root_from_apps

Editing Build.Prop with regards to WiFi hotspot

Hello, recently got myself a new pixel 4 from Google and using it on Verizon without issue. I've yet to root but I'm getting ready to do it. From what I've read, it's a little bit of a pain once you root to get the monthly security updates installed, but I will probably do it anyways. The main thing I read is that you cant modify system files in any way. The main reason I want to root is for WiFi hotspot and maybe to run AdAway. AdAway can be used with systemless hosts once set on magisk, but the method for hotspot is as follows
Modify Build.Prop as follows
net.tethering.noprovisioning=true
And then adb shell
settings put global tether_dun_required 0
But if I run these commands in ADB won't I be modifying the system directly and therefore would be botching my phone from being able to take monthly security updates?
My last phone was an HTC 10 on Android 7... Soooo, this phone and the dual partition and Android 10 are all new to me. Apologize if this is an elementary question. I ultimately want WiFi hotspot, GPay, NetFlix, etc. and the ability to easily get security updates. Just not sure how to proceed. TIA.
I don't think you can root Android 10 yet, right?
OfficeLinebacker said:
I don't think you can root Android 10 yet, right?
Click to expand...
Click to collapse
sure you can with magisk
The Magisk repository module "MagiskHide Props Config" will allow you to set arbitrary build.prop settings systemlessly.
I haven't been keeping up with the news, but you might want to do some research about GPay and SafetyCheck API always failing if your bootloader is unlocked by the user. (Google started using a capability they've had for years but did not use)

Magisk 24.3 "su" Permission denied

Greetings, I've been attempting for several days to execute "su" from adb shell. Essentially, Magisk 24.3 is properly installed within Android 12 on a Google Pixel 6. My primary purpose for rooting is to add my LAN entries to /system/etc/hosts.
An androidforums.com thread details the steps taken several times.
I would very much appreciate your help in getting "su" to work in Android 12 on a Pixel 6. No such problem occurred in Android 8.2 on a Nexus 6P.
Magisk is now uninstalled from the phone, and doesn't appear in the list of apps on the Pixel 6.
On the laptop:
$ adb install Magisk-v24.3.apk
Performing Streamed Install
Success
Invoking Magisk on the phone indicates that the App 24.3 (24300)(27) is installed, Magisk "Installed: NA"
From the factory image, unzipping image-oriole-sp2a.220305.013.a3.zip into a tmp directory:
$ adb push boot.img /storage/emulated/0/Download/boot.img
boot.img: 1 file pushed, 0 skipped. 51.4 MB/s (67108864 bytes in 1.246s)
In Magisk Install "Select and Patch a file", the boot.img is selected. "LET'S GO" results in a sequence ending with the name of the patched file and "All done!"
On the laptop:
adb pull /storage/emulated/0/Download/magisk_patched-24300_jdnPc.img magisk_patched.img
/storage/emulated/0/Download/magisk_patched-24300_jdnP...ulled, 0 skipped. 35.6 MB/s (67108864 bytes in 1.796s)
$ adb reboot bootloader
$ fastboot flash boot magisk_patched.img
Sending 'boot_a' (65536 KB) OKAY [ 1.683s]
Writing 'boot_a' OKAY [ 0.100s]
Finished. Total time: 1.785s
Android reboots normally. The Magisk app reports "Installed: 24.3 (24300)
On the laptop:
$ adb shell
oriole:/ $ su
Permission denied
13|oriole:/ $ exit
$
Please tell me where was my rooting error.
{
"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"
}
I assure you that the correct factory boot.img was transferred to Magisk, and the correct patched *.img file was uploaded and flashed to the phone.
hstroph said:
Greetings, I've been attempting for several days to execute "su" from adb shell. Essentially, Magisk 24.3 is properly installed within Android 12 on a Google Pixel 6. My primary purpose for rooting is to add my LAN entries to /system/etc/hosts.
I would very much appreciate your help in getting "su" to work in Android 12 on a Pixel 6. No such problem occurred in Android 8.2 on a Nexus 6P.
Click to expand...
Click to collapse
I think what you are facing is less about su rights and privileges and more about modern versus legacy partitioning and file systems. See this StackExchange Q&A, in particular the second answer about a hosts file solution.
But instead of mounting /system in Android 12, which is more hardened than 10 and 11, a safer method would involve systemless hosts courtesy of Magisk. One issue with that, though, is that most people use systemless hosts for block lists that redirect in bulk to 127.0.0.0 or 0.0.0.0. Adding friendly host names and IPs gets tricky because ad blocking apps like Adaway tend to overwrite when updating, although Adaway's whitelisting option may do the trick. I've never tried it.
I'm in a similar boat since jumping from Android 9 to 12 when I bought a Pixel 6. Eventually I'd like to use my Pixel for accessing a localhost web server. Until a better idea comes along I'll either use my old Pie phone for local browsing or simply publish to the www server (for testing layouts and responsiveness, etc.). I haven't gotten serious about it yet but I'm interested in any method that doesn't involve /system modifications or reconfiguring my router.
manjaroid said:
I think what you are facing is less about su rights and privileges and more about modern versus legacy partitioning and file systems. See this StackExhange Q&A, in particular the second answer about a hosts file solution. ...
Click to expand...
Click to collapse
Thank you, that got me excited as termux allowed a root prompt. "mount -o rw,remount /" executed, the vi alias was created, but "vi /system/etc/hosts" informed me that the file was read-only.
Not sure what to do next, but again, thank you.
hstroph said:
Thank you, that got me excited as termux allowed a root prompt. "mount -o rw,remount /" executed, the vi alias was created, but "vi /system/etc/hosts" informed me that the file was read-only.
Not sure what to do next, but again, thank you.
Click to expand...
Click to collapse
We need to approach our hosts files differently than was possible with Oreo or Pie. The path with least resistance will be Magisk's built-in systemless hosts module. Mounting /system as rw may have worked for Android 10 or 11, but 12 is stricter and messing with anything on /system could cause a cascade of problems.
Also, the /system partition dynamically stays full despite usage reported in Settings/Storage, so there's no elbow room for even the smallest change and you might even see out of space errors if not read-only errors.
What to try? I don't have a good answer yet, only ideas. I will be looking into it and am happy to report back. Hopefully somebody smarter than me will chime in.
Thank you for your interest and efforts.
This XDA thread was revisited today and it reminded me to take a stab at my Pixel's hosts file. With little effort I'm now browsing web server hosts on a Windows laptop from Android 12. All I did was edit its hosts file same way I've always done. Obviously I didn't have have a good grasp of the Magisk overlay and how it symlinks Android's native hosts file.
/system in Android 10+ may be off limits to many legacy operations but not the hosts file as long as Magisk's systemless hosts module is enabled. For su access it's just a matter of granting it to a root capable file manager with a text editor, such as MiXplorer or Solid Explorer.
Here's an example of what's needed for Android 12 browsers to connect to Apache virtualhosts on Windows:
Windows 10 laptop (192.168.1.234) - c:\Windows\System32\drivers\etc\hosts
127.0.0.1 site1.local
127.0.0.1 site2.local
Android 12 Pixel - /system/etc/hosts
192.168.1.234 site1.local
192.168.1.234 site2.local
Hope this is pertinent to what you're trying. Sorry for making it sound impossible earlier.
manjaroid said:
This XDA thread was revisited today and it reminded me to take a stab at my Pixel's hosts file. With little effort I'm now browsing web server hosts on a Windows laptop from Android 12. All I did was edit its hosts file same way I've always done. Obviously I didn't have have a good grasp of the Magisk overlay and how it symlinks Android's native hosts file.
/system in Android 10+ may be off limits to many legacy operations but not the hosts file as long as Magisk's systemless hosts module is enabled. For su access it's just a matter of granting it to a root capable file manager with a text editor, such as MiXplorer or Solid Explorer.
...
Click to expand...
Click to collapse
I'd very much like to know what "little effort" it took, please.
Magisk has the systemless module enabled, both MIXplorer and Solid Explorer have root privileges, but neither can copy my downloaded hosts file to /system/etc/hosts ... no success using the MIXplorer text editor either as per your suggestion
hstroph said:
I'd very much like to know what "little effort" it took, please.
Click to expand...
Click to collapse
I edited the hosts file directly by tapping it in MiXplorer and picking an editor. Then I just added a few lines, saved, and that was it. If you have lots of tedious entries try copy/pasting your text instead of trying to replace the file.
I know it doesn't quite make sense since your file managers have root. But overwriting a file on read-only /system is something completely different than opening and editing the hosts file like an ad blocker would do, which is only possible because of the systemless hosts module.
manjaroid said:
... But overwriting a file on read-only /system is something completely different than opening and editing the hosts file like an ad blocker would do, which is only possible because of the systemless hosts module.
Click to expand...
Click to collapse
Which hosts file are you successfully editing, please? Android 12 absolute pathname, if you would be so kind.
hstroph said:
Which hosts file are you successfully editing, please? Android 12 absolute pathname, if you would be so kind.
Click to expand...
Click to collapse
Edit /system/etc/hosts just as you would have done before Android 10, which didn't require the systemless hosts module.
I don't understand most of how systemless root works. But as far as I know, Magisk's systemless hosts module 'hijacks' (for lack of better discription) the hosts file from the system and makes it systemless, similar to a system app converting to a user app.
manjaroid said:
Edit /system/etc/hosts just as you would have done before Android 10, which didn't require the systemless hosts module.
Click to expand...
Click to collapse
I have attempted that many times:
$ adb shell
oriole:/ $ su
Permission denied
13|oriole:/ $
This was in anticipation of a "mount -o rw,remount /system" command in Android 8.2 on a Nexus 6P phone. It no longer works on Android 12 on a Pixel 6. Even a successful su in Termux fails to edit the /system/etc/hosts, or to make either / or /system rw.
Are you actually using Android 12, or are you reciting from memory? Your screen shots are appreciated.
hstroph said:
Are you actually using Android 12, or are you reciting from memory? Your screen shots are appreciated.
Click to expand...
Click to collapse
My Pixel runs Android 12 build SPA2A.220405.004 and Magisk 24.3. Screen shots won't show anything useful.
The su command in adb shell or Termux aren't needed even if mounting /system with write permission was possible. You're chasing your tail going about it this way.
A root file manager used as described is all that's needed to edit the hosts file. If you're being denied write access there must be something wrong with Magisk, systemless hosts, interference from other Magisk modules or something else.
To trouble shoot Magisk,
- try disabling systemless hosts in Magisk, reboot, re-enable it again & reboot again
- if using Magisk Canary try the more stable 24.3
A simple way to test systemless hosts is to install Adaway, choose the root option and grant su access. If the module is working Adaway will build a large hosts file from preset lists.
- a storage full error on the first run isn't unusual, but it should write to the hosts file next run
- if there's constant errors something isn't right, probably with Magisk or systemless hosts
- if it does write to the hosts file you should be able to edit it manually
- disable all block lists before uninstalling Adaway to empty the hosts file
manjaroid said:
My Pixel runs Android 12 build SPA2A.220405.004 and Magisk 24.3. ...
Click to expand...
Click to collapse
My Pixel 6 runs Android 12 build SPA2A.220305.013.A3 with Magisk 24.3
manjaroid said:
A root file manager used as described is all that's needed to edit the hosts file. If you're being denied write access there must be something wrong with Magisk, systemless hosts, interference from other Magisk modules or something else.
...
A simple way to test systemless hosts is to install Adaway, choose the root option and grant su access. If the module is working Adaway will build a large hosts file from preset lists.
Click to expand...
Click to collapse
Before Adaway (from adb shell):
oriole:/ $ wc -l /system/etc/hosts
2 /system/etc/hosts
After Adaway:
oriole:/ $ wc -l /system/etc/hosts
110315 /system/etc/hosts
manjaroid said:
- if it does write to the hosts file you should be able to edit it manually
Click to expand...
Click to collapse
I can add a LAN line before all the 127.0.0.1 entries using the rooted MIXplorer text editor, but the file still won't save.
manjaroid said:
- disable all block lists before uninstalling Adaway to empty the hosts file
Click to expand...
Click to collapse
There were no previous block lists of any kind. I have simply been trying to add a couple dozen LAN entries on this new phone.
I think I've followed instructions as carefully as possible, but still no luck.
hstroph said:
My Pixel 6 runs Android 12 build SPA2A.220305.013.A3 with Magisk 24.3
Before Adaway (from adb shell):
oriole:/ $ wc -l /system/etc/hosts
2 /system/etc/hosts
After Adaway:
oriole:/ $ wc -l /system/etc/hosts
110315 /system/etc/hosts
I can add a LAN line before all the 127.0.0.1 entries using the rooted MIXplorer text editor, but the file still won't save.
There were no previous block lists of any kind. I have simply been trying to add a couple dozen LAN entries on this new phone.
I think I've followed instructions as carefully as possible, but still no luck.
Click to expand...
Click to collapse
Systemless hosts appears to be working if there were no errors and 110315 entries were written to hosts.
In MiXplorer's Settings/More Settings, is the first item for Allow Root checked? I don't remember if the default is checked or not but it needs to be checked. The equivalent setting in Solid Explorer is off by default.
My two screenshots show before and after enabling/disabling Adaway's block lists. The second image shows Adaway's leftovers along with my own lines added manually and the file is saved (save button being greyed out). If you're unable to get the same results I'm stumped and need to think about what's going wrong.
manjaroid said:
..
In MiXplorer's Settings/More Settings, is the first item for Allow Root checked? I don't remember if the default is checked or not but it needs to be checked.
Click to expand...
Click to collapse
It is checked in MIXplorer.
manjaroid said:
The equivalent setting in Solid Explorer is off by default.
Click to expand...
Click to collapse
I'm unable to locate an equivalent setting in Solid Explorer (SE), but root usage was granted through Magisk 24.3 when I used SE for the first time.
manjaroid said:
My two screenshots show before and after enabling/disabling Adaway's block lists. The second image shows Adaway's leftovers along with my own lines added manually and the file is saved (save button being greyed out). If you're unable to get the same results I'm stumped and need to think about what's going wrong.
Click to expand...
Click to collapse
My attached image shows a failure to save in MIXplorer after adding a single "192.168.1.13 tncpi" line.
I've been stumped on the matter ever since Android 12 on this new Pixel 6.
Is Zygisk enabled in Magisk? I assume you followed this guide for rooting.
[GUIDE] Pixel 6 "oriole": Unlock Bootloader, Update, Root, Pass SafetyNet
⚠️⚠️⚠️WARNING! IF YOU ARE UPDATING TO ANDROID 13 FOR THE FIRST TIME, READ THIS FIRST! ⚠️⚠️⚠️ If you are looking for my guide on a different Pixel, find it here: Pixel 3 Pixel 3XL Pixel 3a Pixel 3aXL Pixel 4 Pixel 4XL Pixel 4a Pixel 4a (5G)...
forum.xda-developers.com
Appending a line using Termux works for me also. Are you denied when you try?
Code:
$ su
# echo 192.186.1.234 site3.local >> /system/etc/hosts
If that works there's no reason a root file manager shouldn't work. (To enable root in Solid Explorer tap the hamburger icon upper left then the sprocket icon and scroll down.)
If nothing works I'm thinking either 1) root isn't complete or 2) attempts at /system mounting had a negative effect. Options to consider:
- remove Magisk and repeat the root process
- remove Magisk, install the April OTA update, then root
- factory reset or flash the April factory zip, then root
My suggestion: Might as well go the full route and factory reset or clean flash. Particularly if there's any chance something went wrong in the root file system.
manjaroid said:
Is Zygisk enabled in Magisk?
Click to expand...
Click to collapse
It is now, so I have more to learn what Zygisk enables.
manjaroid said:
I assume you followed this guide for rooting.
[GUIDE] Pixel 6 "oriole": Unlock Bootloader, Update, Root, Pass SafetyNet
⚠️⚠️⚠️WARNING! IF YOU ARE UPDATING TO ANDROID 13 FOR THE FIRST TIME, READ THIS FIRST! ⚠️⚠️⚠️ If you are looking for my guide on a different Pixel, find it here: Pixel 3 Pixel 3XL Pixel 3a Pixel 3aXL Pixel 4 Pixel 4XL Pixel 4a Pixel 4a (5G)...
forum.xda-developers.com
Click to expand...
Click to collapse
Correct ... re-flashed factory image, then rooted with Magisk. Process repeated several times carefully, all with same results.
manjaroid said:
Appending a line using Termux works for me also. Are you denied when you try?
Click to expand...
Click to collapse
Appending a line works with Termux. Saving /system/etc/hosts after editing within Termux or Solid Explorer fails.
manjaroid said:
Code:
$ su
# echo 192.186.1.234 site3.local >> /system/etc/hosts
Click to expand...
Click to collapse
Success.
manjaroid said:
If that works there's no reason a root file manager shouldn't work. (To enable root in Solid Explorer tap the hamburger icon upper left then the sprocket icon and scroll down.)
Click to expand...
Click to collapse
Well, neither root file explorer works to save the file, but appending other text to /system/etc/hosts works, so I'll just write a simple shell script that I can run as needed.
I want to thank you so much for your patient help. I never thought Google would make things so difficult for those of us who need the use of a pocket Linux computer.
Please consider this thread closed.

Categories

Resources