Hi, want to rewrite hosts file in system/ets/hosts to block ads but every time when I restart my phone it is back the original hosts file. I have rooted phone but I tried many ways to rewrite it but nothing works form me. It works but just until restart anyone knows how to do it?
Related
I would really like to do away with adds, and have been struggling with this. Here is what I have tried so far:
1. After a temp root I ran adfree, which claimed to be a success, but upon trying out the browser and various apps the ads remained.
2. Noting that after a run of adfree, it states that the DNS cache must be cleared, I opened a root terminal and entered clear dns. Upon opening an ad filled app, I was delighted to find the ads gone. Tempting fate, I opened the browser and found that any site containing ads would freeze, and not load (xda for example).
3. I thought that maybe clearing the dns was the issue, so I took the hosts file generated by adfree, placed it on my sd, and made a visionary.sh script in /data/local, which upon boot placed the host file in /system/etc. The script ran fine, all ads were gone in apps, but again, websites with ads would not load.
This is where I am stuck. Getting the host file in the correct directory upon boot is not a problem, but I cannot figure why blocking ads causes the websites to not load. Any input would be appreciated.
I have experienced something kinda similar, but not exactly. I didn't have any luck with the app. A long time ago when I was running 1.5 it worked but not anymore. I learned about replacing the file with a modified hosts file into /system/etc. The only time it worked is when there was full root and my file manager of choice, root explorer, was able to truely write in the system folder and others. I always had to reboot in order for it to take. Since we don't have full root, after reboot, the stock hosts file is restored. I'm sure you already know this by the sounds of it.
Full root should be uploaded by tonight, so I would just wait for that if I were you
Sent from my PG06100 using XDA App
Yeah, this thread should probably be closed, as I made it prior to tonights great news.
Per OP request, closed
I have been using the hosts file from the Adeo rom to block ads on my atrix. I no longer use the rom but just the one file. Before updating to 4.1.57 I reverted to the original hosts file thinking that was why my update was not working. (later found out I had not succesfuly removed the webtop mod)
When I went to put it back I accidentaly replaced the hosts file located in /etc instead of the one in /system/etc.
Should I be concerned and will this cause issues with my device? Also could someone email me or upload the original /etc/hosts file?
Thanks in advance.
Hello Everybody,
Last week i upgraded my SGS2 to 4.0.3, and i made a full reset, because some minor things did not work as expected. Now i got the stock firmware (I9100XXLPQ) with The CF root kernel (3.0.15-I9100XXLPQ-CL223505) on it.
Now my problem. AdFree does not work anymore. AdAway and manually copy the hosts file to /etc/ neither. Of course i rebooted my phone several times. hope i did not make any other noob mistake... I tried different hosts files, one of them worked as expected on my friends HTC Sensation.
Someone got any help for me? im freakin' out because of these advertisements^^
Wish you a nice day and thx 4 all helpful answers
ad free
Working for me on CM9.
You might need to check the settings in 'Superuser'.
install adfree back and do everything like instructed... and if it still doesnt work, try to check the hosts file size? if its WAY TOO SMALL then u did something wrong and Adfree didnt modify ur host file correctly
it still does not work maybe there are some local files that i have to delete? (like dns cache which clears by rebooting the phone)
Adfree doesn't seem to work on ICS. Try adaway.
Make a copy of the hosts file .
Open hosts file on phone with notepad delete all the data save and close .
Run one of the add apps and see what happens to the file .
jje
I deleted everything i "modded" with the hosts file, downloaded AdAway and now it seems to work. I think the hosts file from AdAway is very incomplete, but manually adding urls works now.
I couldnt figure out the problem. Maybe you just have to do it twice
Does anyone know how to get the advertisements urls from the apps? i want to block them manually.
thx 4 all the ansers.
I too noticed AdFree is not working on ICS, currently on the SG2 Epic 4G Touch FF18 update. Checked hosts file and it is updated with entries. I tested with manual entry and confirmed the hosts file works, but it seems like apps are bypassing it.
Control Test:
1. open www.purple.com (simple page that loads purple, handy for testing internet routing) - page loaded without issue
2. updated default hosts file with "127.0.0.1 www.purple.com"
3. open www.purple.com - receive "Webpage not available"
App Test:
1. Angry Birds in game ad still shows up
2. click ad, browser opens to "Webpage not available" - This proves hosts file is working, but because the ad still shows up in game is what makes me think apps are somehow bypassing hosts file...
I installed AdAway and when he created the hosts file can not and he said "lack of space on the partition!
Attempt to modify the hosts file in the preferences for target / data / data / hosts "
johnny8910 said:
Working for me on CM9.
You might need to check the settings in 'Superuser'.
Click to expand...
Click to collapse
Thanks.. I had to revoke the permissions from SuperUser and re-started Ad-away. The app asked for permission again and this time manage to write the host files
Hi guys,
I'm currently trying to manipulate the file /data/system/packages.xml in order to make Android start one of my apps with another user id. However, this doesn't work because it seems that Android recreates the file completely when shutting down the system which means the old user id is being written back into the file.
Without rebooting, changing the file's contents (or even deleting it completely) doesn't do anything either, it seems that the contents are being loaded into the memory on boot.
What I need are your ideas on how I can make my app run as another user (or edit the file permanently) I need this because I want to access another app's non-exported service.
Thanks in advance!
edit: Even if I try editing the file and then shutting down the system unexpectedly (One X, holding down power for like 10 seconds without using the software shutdown), the file is being restored after reboot. When I check the file in CWM after a normal shutdown, it's also back to normal. So I guess Android rebuilds it on shutdown AND on boot.. or something?
edit2: I just tried the following: Rebooting into CWM, editing /data/system/packages.xml from there, checking file contents (worked), rebooting system - file contents restored. I'm starting to think that this isn't the file I have to edit. But which one is it?
edit3: Tried editing /data/system/packages.list instead, didn't work either. The file is also being restored to the original state.
- Android 4.1.1, CM10, German
did u managed anything?got same issue
Hi guys, i got root on my Honor 10 and would like to modify the hosts file to block ads.
I assume the correct one is /sytsem/etc/hosts right?
I can confirm that i have root acces because i can rename the hosts file and create other files.
I am using the AdAway app which worked just fine on my old phones.
But this time it says "replacement of hosts file failed" ... no further information.
Since i know the sources where AdAway is getting its information from i would like to simply modify the host file by myself.
What format does the hosts file needs to have to work? Like .txt file and remove the file extension afterwards.
Any ideas?
If you are rooted why not try masigk host file?