[MOD] Adfree System without RW Access to /system

Search This thread

Havoc2k

Senior Member
Dec 7, 2011
216
14
Munich
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)

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



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
 

Attachments

  • hosts.zip
    216.9 KB · Views: 64
Last edited:
  • Like
Reactions: juanyunis

Cat McGowan

Senior Member
Apr 28, 2012
823
374
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.
 

Havoc2k

Senior Member
Dec 7, 2011
216
14
Munich
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 :)
 

Rootk1t

Senior Member
Jun 2, 2013
2,118
870
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 :)
after vroot, install SuperSU and then all app ad-blocking apps are working good.
 

Havoc2k

Senior Member
Dec 7, 2011
216
14
Munich
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
 
  • Like
Reactions: Half Alive

Cat McGowan

Senior Member
Apr 28, 2012
823
374
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

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.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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)

    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



    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
    1
    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