5,606,297 Members 31,989 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] Adfree System without RW Access to /system

Tip us?
 
Havoc2k
Old
(Last edited by Havoc2k; 24th December 2013 at 11:21 PM.)
#1  
Senior Member - OP
Thanks Meter 14
Posts: 195
Join Date: Dec 2011
Location: Munich
Default [MOD] Adfree System without RW Access to /system

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!

Quote:
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)
Quote:
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
Attached Files
File Type: zip hosts.zip - [Click for QR Code] (216.9 KB, 14 views)
HTC ONE - running Android Revolution
Sony Xperia Tablet Z - running rooted stock
The Following User Says Thank You to Havoc2k For This Useful Post: [ Click to Expand ]
 
Cat McGowan
Old
#2  
Cat McGowan's Avatar
Senior Member
Thanks Meter 303
Posts: 739
Join Date: Apr 2012
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.
Xperia Tablet Z (SGP312U1/B) with Android 4.2.2 build 10.3.1.C.0.136 Rooted
Sony Tablet S (SGPT112US/S) with Android 4.0.3r5a build TISU0013410 Rooted
 
Havoc2k
Old
#3  
Senior Member - OP
Thanks Meter 14
Posts: 195
Join Date: Dec 2011
Location: 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
HTC ONE - running Android Revolution
Sony Xperia Tablet Z - running rooted stock
 
Rootk1t
Old
#4  
Rootk1t's Avatar
Senior Member
Thanks Meter 43
Posts: 192
Join Date: Jun 2013
Quote:
Originally Posted by Havoc2k View Post
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.
Sony Xperia Tablet Z SGP321
OS: Android JB 4.3
Rom: Stock, rooted
Build: 10.4.1.B.0.101
Kernel: Stock
Recovery: XZDualRecovery (CWM+TWRP)
MicroSDHC: SanDisk 32GB Class 10 UHS-I
 
Havoc2k
Old
#5  
Senior Member - OP
Thanks Meter 14
Posts: 195
Join Date: Dec 2011
Location: 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
HTC ONE - running Android Revolution
Sony Xperia Tablet Z - running rooted stock
The Following User Says Thank You to Havoc2k For This Useful Post: [ Click to Expand ]
 
Rootk1t
Old
#6  
Rootk1t's Avatar
Senior Member
Thanks Meter 43
Posts: 192
Join Date: Jun 2013
Quote:
Originally Posted by Havoc2k View Post
But there is no RW access
strange thing that with root there is no RW access.
Sony Xperia Tablet Z SGP321
OS: Android JB 4.3
Rom: Stock, rooted
Build: 10.4.1.B.0.101
Kernel: Stock
Recovery: XZDualRecovery (CWM+TWRP)
MicroSDHC: SanDisk 32GB Class 10 UHS-I
 
Cat McGowan
Old
(Last edited by Cat McGowan; 25th December 2013 at 04:17 PM.)
#7  
Cat McGowan's Avatar
Senior Member
Thanks Meter 303
Posts: 739
Join Date: Apr 2012
Quote:
Originally Posted by Havoc2k View Post
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.
Xperia Tablet Z (SGP312U1/B) with Android 4.2.2 build 10.3.1.C.0.136 Rooted
Sony Tablet S (SGPT112US/S) with Android 4.0.3r5a build TISU0013410 Rooted

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Google Glass Now Open to Anyone… with $1500 to Spend (Update: Not Anymore)

Google Glass, which recently received its official update … more

Android 4.4.2 OTA Now Available for the Verizon Droid DNA

A couple of days ago, we talked about how the Android 4.4.2 upgrade for the HTC … more

UnbelovedHosts Uses Xposed to Block Unwanted Connections

First popularized by mvps, hosts-based ad blocking has become the de facto standard … more