[MOD] Adfree System without RW Access to /system - Xperia Tablet Z Android Development

Hey there,
this is my first thread ever created by me in a development forum.
I wanted to share my sollution for a adfree Android system, without unlocking the boatloader to get R/W access to /system.
I did try it on my device, everything went fine, but i will not take any kind of reponsibility for your devices. Also your warranty may be void!
What you need:
- rooted XTZ (i tried it on the 16GB Wifi only version)
- busybox installed
- Android SDK or adb.exe
- patched hosts file, I took mine from my HTC ONE with adaway installed (unzip first)
Click to expand...
Click to collapse
How to do it:
- get a patched hosts file from another device, or use mine (attached)
- put the file on the root of your sd card (so it will be /sdcard/hosts)
- connect your tablet to your PC, make sure usb debuggig is turned on
- launch cmd window, where your adb.exe is located
- entering following commands:
Code:
0. adb shell
1. su
2. stop ric
3. busybox pkill -f /sbin/ric
4. mount -ro remount,rw /system
5. busybox cp -af /sdcard/hosts /system/etc/hosts
- if everything went ok, you should now be able to see all the entries in your /system/etc/hosts file
- sadly you have to update the file if there some new adhosts, but it will remove a lot of annoying ads from all apps and the browser
- the changes are permanent, even at a reboot
Click to expand...
Click to collapse
Just let me know, if you have some kind of questions!
thanks @juanyunis for the [TEMPORAL-FIX] Remount RW /system reboot thread, from which i got some ideas.
Greetings from Germany

I have been using the AdAway app continuously since Google decided to eliminate all ad blocking apps from its Play Store and from my experience, AdAway does not require an unlocked boot loader to work, it only requires root access, and AdAway has no problem installing a hosts file in the /system/etc directory, so I am curious about why you have to go through all that.

The problem is, that if you using vroot like i did, and you doing nothing else, you don't have read write access to /system. So adaway, adfree and whatever can't edit the hosts file. Therefore is my little mod to get it done manually

Havoc2k said:
The problem is, that if you using vroot like i did, and you doing nothing else, you don't have read write access to /system. So adaway, adfree and whatever can't edit the hosts file. Therefore is my little mod to get it done manually
Click to expand...
Click to collapse
after vroot, install SuperSU and then all app ad-blocking apps are working good.

nope sorry, i did it, installed vroot, switched to normal superSU and installed busybox. But there is no RW access, so the ad blocking apps will work, but only to the next systemreboot / userswitch
tried all of them, and tried to manually edit the host file, but without access it will not happen
greetings

Havoc2k said:
But there is no RW access
Click to expand...
Click to collapse
strange thing that with root there is no RW access.

Havoc2k said:
nope sorry, i did it, installed vroot, switched to normal superSU and installed busybox. But there is no RW access, so the ad blocking apps will work, but only to the next systemreboot / userswitch
tried all of them, and tried to manually edit the host file, but without access it will not happen
greetings
Click to expand...
Click to collapse
I have tested and have for several months ran AdAway on my XTZ, on which Vroot was used to gain root access and SuperSU is installed, and AdAway has no problem writing a hosts file to the /system/etc directory even though the permissions for the /system and /system/etc directories are set to read-only. So, because I have no problem with AdAway and you apparently have a problem with AdAway, I believe it is likely there is a flaw in your root access setup. But hey, I could be wrong.

Related

Why the root message isn't showed like Hero&Others ?

All others rooted phones have a message showed when an application asks root, why don't we have this on Tattoo ?
On Tattoo root permissions are always enabled
Ok, it's nice but we can't see which application ask root :/
Like Terminal Emulator, when you launch it, the shell is always in normal user "$", not in root :/
JoOoSs said:
Ok, it's nice but we can't see which application ask root :/
Like Terminal Emulator, when you launch it, the shell is always in normal user "$", not in root :/
Click to expand...
Click to collapse
This is true, but I dont know how, after isntalling 5faif ROM, terminal emulator shows me the #, id command shows me that I'm root.
I'm on stock ROM, this is the problem i think!
Anybody has SetCPU ?
The problem with this is that every application can obtain root without our knowledge.
It is a serious security flaw.
Not really. Android is pretty secure. Even if you get a brick from a Andirus (Virus + Android), it's a piece of cake to undo the damage.
Netbuster said:
This is true, but I dont know how, after isntalling 5faif ROM, terminal emulator shows me the #, id command shows me that I'm root.
Click to expand...
Click to collapse
Because that rom you've flashed contains custom boot.img by mainfram3 that gives to you root at startup and loads tattoo-hack.ko (partition r/w always mounted)
Coburn64 said:
Not really. Android is pretty secure. Even if you get a brick from a Andirus (Virus + Android), it's a piece of cake to undo the damage.
Click to expand...
Click to collapse
Actually i wasn't having viruses in mind. More like keyloggers and such. SU prompt wasn't invented for no reason...
I think the OP was asking about SuperUser.apk.
It's a modified su plus a service that asks for user intervention when a program calls /system/bin/su. It's nifty and it should be used by everyone.
Android apps are prevented from looking into other apps data. If su is readily available, a app can escalated it's privileges and steal your personal info, by reading data from other apps.
mainfram3 said:
I think the OP was asking about SuperUser.apk.
It's a modified su plus a service that asks for user intervention when a program calls /system/bin/su. It's nifty and it should be used by everyone.
Android apps are prevented from looking into other apps data. If su is readily available, a app can escalated it's privileges and steal your personal info, by reading data from other apps.
Click to expand...
Click to collapse
Exactly my point.
MoDaCo Custom ROM 1 includes Superuser apk for root access.
P
Anyone know how to fix Superuser Permissions manually?
I have Tattoo with rooted boot.img (mainfram3)
I pushed su into /system/bin/
Made chmod 4577 /system/bin/su
Pushed superuser.apk from Modaco Rom to /system/app/
Restart sure...
SuperUser Permissions can be executed (list is clear)
But any app doesn't send request to Superuser Permissions.
What i could forget?
Finally, I solved it partially.
Sure, i have rooted boot.img
I extracted from Modaco Custom ROM for Tattoo:
su
Superuser.apk
copied su to: /system/bin/su
copied Superuser.apk to: /system/app
run in terminal: chmod 4577 /system/bin/su
restarted and everything works fine now... Superuser Permissions shows all root-requests, Titanium Backup works, other root-things works too
But i notice, that su-binary from Modaco ROM is about 34-36 kb, but
su-binary from guide of getting root is about 80-85 kb.
1-2 months ago we faced with difference in size of su. We choosed bigger su in case, what it can run "flash_image", smaller su can't run.
But maybe it fixed already? I did not test it yet.
Thanks @5[Strogino]
I was trying to use Titanium today to back up my apps but it didn't work.
lukic said:
Thanks @5[Strogino]
I was trying to use Titanium today to back up my apps but it didn't work.
Click to expand...
Click to collapse
What exactly wrote TB?
Did you download busybox via TB?
I don't remember exactly.
It did ask me to download busybox and I did that, but still it didn't work.

No space in /system while df says there are 14.7MB

Just upgrade to android 6.0.1 and redoing the root,busybox stuff
While rooting, I learn that /system is quite packed. After a few research time, many suggest that to place something in /system, delete some system app(particularly those available at Play Store, e.g. Sheets, Slides, Google Music, etc). So I delete some of them and thought I can flash busybox easily.
I was wrong.
Even I go to TWRP and mount /system rewritable, no matter I use "adb push" or "cp (in adb shell)" to place busybox into /system/xbin, they tell me there is no space.
But if a use "df" in adb shell, non su mode, it tells me there are 14.7MB, while my busybox binaries only 1.05MB.
Do anyone got idea to solve this and so kind to help me? Thank you.
xerubium said:
Just upgrade to android 6.0.1 and redoing the root,busybox stuff
While rooting, I learn that /system is quite packed. After a few research time, many suggest that to place something in /system, delete some system app(particularly those available at Play Store, e.g. Sheets, Slides, Google Music, etc). So I delete some of them and thought I can flash busybox easily.
I was wrong.
Even I go to TWRP and mount /system rewritable, no matter I use "adb push" or "cp (in adb shell)" to place busybox into /system/xbin, they tell me there is no space.
But if a use "df" in adb shell, non su mode, it tells me there are 14.7MB, while my busybox binaries only 1.05MB.
Do anyone got idea to solve this and so kind to help me? Thank you.
Click to expand...
Click to collapse
yes, google did it on purpose. its not full, but it is. use a root file explorer, delete some apps, reboot. then youll be fine after
An alternative solution is to backtrack your modifications to /system and install SuperSU in systemless mode. Installing Busybox afterward will send the files to the /su/xbin directory. As a bonus, Android Pay should function normally.
Use a root explorer or in TWRP mount system and delete /system/app/(any foreign keyboards you don't need, such as GoogleHindiIME, GoogleJapaneseIME, GooglePinyinIME, KoreanIME)
I used systemless root. Then I could install busybox at /su/xbin instead?
And just for report, it seems uninstall won't help without manual deletion of /system/app, all system apps I uninstalled through Titanium Backup automatically revived after reboot.
Sent from my Nexus 6 using XDA Free mobile app
I don't know about the other busybox installers, but Stericson's busybox installer does have /su/xbin as an available install location if systemless root is detected.

Can't write on /system after root

I'm rooted with SuperSU 2.79 systemless on OOS 4.1.0 and I can't get permission to write on /system.
I tried using ES FIle Explorer and the option keeps changing to RO. I also tried via recovery. Root permissions are granted and It's properly root.
Any clues?
belumira said:
I'm rooted with SuperSU 2.79 systemless on OOS 4.1.0 and I can't get permission to write on /system.
I tried using ES FIle Explorer and the option keeps changing to RO. I also tried via recovery. Root permissions are granted and It's properly root.
Any clues?
Click to expand...
Click to collapse
I had the same issue. I don't remember what I did. Try uninstalling super su from the app and then install it again.
Migdilu said:
I had the same issue. I don't remember what I did. Try uninstalling super su from the app and then install it again.
Click to expand...
Click to collapse
Did that, I even clean flashed OOS again nothing seems to be working.
belumira said:
I'm rooted with SuperSU 2.79 systemless on OOS 4.1.0 and I can't get permission to write on /system.
I tried using ES FIle Explorer and the option keeps changing to RO. I also tried via recovery. Root permissions are granted and It's properly root.
Any clues?
Click to expand...
Click to collapse
I also had problem with ES File Explorer while writing to system. Try solid Explorer. It's better
Vaibhunk786 said:
I also had problem with ES File Explorer while writing to system. Try solid Explorer. It's better
Click to expand...
Click to collapse
Still nothing. For some reason permissions won't change.
You have systemless root?
If yes I think you can only modify data Partition. Maybe you need a magisk module?
Remove superSU and just go with Magisk. It works much better than SuperSU ever will. It's easily removable and won't adjust partition permissions, including system. Make sure you mount system in twrp before flashing any root access zip file as well. It helps prevent problems like this.
Fix To Grant ES File Explorer SuperSU Access Using Terminal Emulator
Start Terminal Emulator. Type su.
ENTER EXACTLY LIKE THIS: echo "BINDSYSTEMXBIN=true" >> /data/.supersu
Spaces.......................................................................................... ^....^.........
Make a backup first incase ****e goes south... This has worked for me on a couple of devices.
Standard disclaimer... Yada...
I have the same problem.
jhill110 said:
Fix To Grant ES File Explorer SuperSU Access Using Terminal Emulator
Start Terminal Emulator. Type su.
ENTER EXACTLY LIKE THIS: echo "BINDSYSTEMXBIN=true" >> /data/.supersu
Spaces.......................................................................................... ^....^.........
Make a backup first incase ****e goes south... This has worked for me on a couple of devices.
Standard disclaimer... Yada...
Click to expand...
Click to collapse
Sorry but I dont understand what I have to write, I understand type su
and type echo "BINDSYSTEMXBIN=true" >> /data/.supersu
but whats mean:
Spaces.......................................................................................... ^....^.........
Mean: ^ ^
doesnt mean anything? :crying::crying:

How on earth do I remount system as rw on S10 rooted stock rom?

Hi, Forgive me as I've been off the android scene for a while, at least to the point I have had to keep up with developments.
I want to replace /etc/hosts on my device to save using a vpn, etc. to block ads. On my Nexus 6P this was easy, remount rw, replace, or adfreezip.
On my S10 this is not so easy. I am unable to remount system as rw, I presume as this is 'systemless', I am also unable to remount the entire filesystem '/' as rw.
Does anyone know how I achieve this or how I replace a hosts file?
I am rooted with magisk but not with TWRP (I did flash TWRP before but could not install zips to the filesystem from twrp so just did not bother this time).
Comedy- said:
Hi, Forgive me as I've been off the android scene for a while, at least to the point I have had to keep up with developments.
I want to replace /etc/hosts on my device to save using a vpn, etc. to block ads. On my Nexus 6P this was easy, remount rw, replace, or adfreezip.
On my S10 this is not so easy. I am unable to remount system as rw, I presume as this is 'systemless', I am also unable to remount the entire filesystem '/' as rw.
Does anyone know how I achieve this or how I replace a hosts file?
I am rooted with magisk but not with TWRP (I did flash TWRP before but could not install zips to the filesystem from twrp so just did not bother this time).
Click to expand...
Click to collapse
AdAway works if you want a much easier solution.
Joe333x said:
AdAway works if you want a much easier solution.
Click to expand...
Click to collapse
Thanks. I actually realised though that Magisk has an option to generate a systemless hosts file so I've turned that on and it has done what I need.
I run a pihole at home that has a script which generates a standard hosts file from the blocklist. I can just on occasion save it to /sdcard/ and then cat /sdcard/hosts > /etc/hosts
When I get around to it I will probably just add this as a cron job

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