Sorry my bad English. I install AdFree app.
"Update Found!
New Hostnames..."
I klick 'Download & Install Hosts'
then "Error
Failed to replace your hosts file. Error message:"
What I do?
As far as I'm aware, the Adfree app cannot automatically download and install the new hosts files because we have no write access to /system when the phone is fully booted.
You would need to push the file manually via ADB whilst the phone is in recovery.
See this thread for further details.
Regards,
Dave
Or ask your Cook to implement the host file being symlinked correctly so AddFree can work off the bat.
Modaco Rom's have this and also include AddFree.
Error:
"failed to revert your hosts file the echo command seems to be missing"
Help please, i want ads back.
Btw leedroid rom with adfree preinstaled
you could just remove your hosts file from /system/etc
I think it's not safe just to delete file. Maybe update to default hosts. But i'm not sure how default file looks like.
And maybe leedroid uses something in hosts file...
I will have to live without ads
Hi guys,
I'm having trouble with the hosts file on my OPO3 and the latest stock firmware.
On Android 6 I booted into TWRP, mounted system and flashed my own hosts file to /system/etc/hosts. This worked fine.
Before updating I to Android 7 I pulled the hosts file and uploaded the same hosts file to android 7. However its getting completely ignored.
I tried various other hosts file, different encoding, blank line at the end of the file, tabs, no tabs, spaces, no spaces, 127.0.0.1, 0.0.0.0 etc but nothing works. If I go back into TWRP and pull the hosts file it actually is the hosts file that I pushed earlier so its not that Android is somehow overwriting the file.
Does anybody know what the problem could be?
PS I am NOT rooted and I don't want to root either.
Thanks
sjaak1234 said:
Hi guys,
I'm having trouble with the hosts file on my OPO3 and the latest stock firmware.
On Android 6 I booted into TWRP, mounted system and flashed my own hosts file to /system/etc/hosts. This worked fine.
Before updating I to Android 7 I pulled the hosts file and uploaded the same hosts file to android 7. However its getting completely ignored.
I tried various other hosts file, different encoding, blank line at the end of the file, tabs, no tabs, spaces, no spaces, 127.0.0.1, 0.0.0.0 etc but nothing works. If I go back into TWRP and pull the hosts file it actually is the hosts file that I pushed earlier so its not that Android is somehow overwriting the file.
Does anybody know what the problem could be?
PS I am NOT rooted and I don't want to root either.
Thanks
Click to expand...
Click to collapse
have you applied proper permissions to hosts file ?
JumboMan said:
have you applied proper permissions to hosts file ?
Click to expand...
Click to collapse
I think so? Didn't set any permissions myself.
C:\android>adb shell
~ # ←]6ngs -l /system/etc/hosts
-rw-r--r-- 1 root root 393105 Jan 27 01:21 /system/etc/hosts
sjaak1234 said:
I think so? Didn't set any permissions myself.
C:\android>adb shell
~ # ←]6ngs -l /system/etc/hosts
-rw-r--r-- 1 root root 393105 Jan 27 01:21 /system/etc/hosts
Click to expand...
Click to collapse
can you post link to hosts file that you are using so that i can try myself to see what is the problem
JumboMan said:
can you post link to hosts file that you are using so that i can try myself to see what is the problem
Click to expand...
Click to collapse
I'm not at home for the weekend so I can't pull the actual file but I used (among others) the one from http://someonewhocares.org/hosts/
Pasted in notepad++ with encoding utf without BOM and EOL Linux encoding. Tried copying it to Windows notepad as well.
I also tried the host file I pulled from my phone before upgrading. I'll upload that one once I get back to my PC. Should still have it somewhere.
sjaak1234 said:
I'm not at home for the weekend so I can't pull the actual file but I used (among others) the one from http://someonewhocares.org/hosts/
Pasted in notepad++ with encoding utf without BOM and EOL Linux encoding. Tried copying it to Windows notepad as well.
I also tried the host file I pulled from my phone before upgrading. I'll upload that one once I get back to my PC. Should still have it somewhere.
Click to expand...
Click to collapse
i would suggest you to upload the hosts file you currently have problem.
JumboMan said:
i would suggest you to upload the hosts file you currently have problem.
Click to expand...
Click to collapse
I've attached the hosts file that I pulled from my Md pushed to my OP3. Can't find the original untouched one from my OP3 anymore but this works fine on my M7 and its practically the same as the file that worked fine on my OP3 on Marshmellow.
sjaak1234 said:
I've attached the hosts file that I pulled from my Md pushed to my OP3. Can't find the original untouched one from my OP3 anymore but this works fine on my M7 and its practically the same as the file that worked fine on my OP3 on Marshmellow.
Click to expand...
Click to collapse
nothing suspicious except encoding.
can you try UTF-8 encoding.
I tried but it makes no difference. Tried notepad++ as well as windows notepad (files made in notepad++ look messed up in windows notepad and vica versa though).
Tried a clean file with just a couple of normal websites on it just for testing but no luck.
Does adjusting the hosts file on the stock nougat rom work for you?
****ing google
sjaak1234 said:
I tried but it makes no difference. Tried notepad++ as well as windows notepad (files made in notepad++ look messed up in windows notepad and vica versa though).
Tried a clean file with just a couple of normal websites on it just for testing but no luck.
Does adjusting the hosts file on the stock nougat rom work for you?
****ing google
Click to expand...
Click to collapse
can you try MOAB (search xda). I am using this on stock oos 328 without any problems.
*edit - also tried on stock oos 402. its working
Finally had some time to try again.
Moab doesn't work either. I ran a packet capture to make sure the ad urls are in the hosts file. They are. That ****ing piece of **** google is simply ignoring the hosts file.
sjaak1234 said:
Finally had some time to try again.
Moab doesn't work either. I ran a packet capture to make sure the ad urls are in the hosts file. They are. That ****ing piece of **** google is simply ignoring the hosts file.
Click to expand...
Click to collapse
Mine works fine but with AdAway.
Great.
Except on that piece of **** of mine this craptastic os is simply ignoring the hosts file. Even if I put in something like 127.0.0.1 cnn.com it won't block ****.
And no I'm not going to root because it breaks banking apps, pokemon go etc. No I'm not going to bother with endless workarounds for that either and finally no unroot does not work and has never worked.
sjaak1234 said:
Great.
Except on that piece of **** of mine this craptastic os is simply ignoring the hosts file. Even if I put in something like 127.0.0.1 cnn.com it won't block ****.
And no I'm not going to root because it breaks banking apps, pokemon go etc. No I'm not going to bother with endless workarounds for that either and finally no unroot does not work and has never worked.
Click to expand...
Click to collapse
I don't know if this is any help but on nougat with adaway app it only works properly when choosing systemless mode , whether or not you can make your hosts file systemless i don't know but i thought I'd mention it to see if it helps you out with the manual way...
sjaak1234 said:
Finally had some time to try again.
Moab doesn't work either. I ran a packet capture to make sure the ad urls are in the hosts file. They are. That ****ing piece of **** google is simply ignoring the hosts file.
Click to expand...
Click to collapse
you sure that data saver option is not on right? else it wont use your host, since it's proxi-ed to google server
otonieru said:
you sure that data saver option is not on right? else it wont use your host, since it's proxi-ed to google server
Click to expand...
Click to collapse
I'm sure that's not on. I've tried Firefox as well and the results are the same. Something weird though is that if I connect to my own vpn server and block a url on the firewall there, somehow chrome still finds a way around it while on Firefox the url will be blocked.
When I got time I'll root and try adaway. It's not really a solution for me as I can't keep root (and unrooting still permanently triggers some apps thinking the phone is rooted) but at least it it should narrow down the problem.
I cannot be the new dm verity in android 7 right? Somehow ignoring files that have been changed? I obviously do get that error/warning during boot because I changed the system partition.
@sjaak1234
Hi
I can confirm that my hosts file has been working fine on
OOS 3.2.8 to 4.0.3
CB5 to OB12
H2OS 7.0 & 7.1.1
So nothing wrong (as yet) with Android OS or Google or even OnePlus. I can share my hosts file if you want to try.
Two suggestions:
use Aroma File Manager to replace hosts file and set permission (644 or rw-r-r).
Use Magisk for root as well working banking apps (MagiskHide).
Good luck :good:
Have you tried creating a symlink to data/hosts?
In order to make adfree android the symlink is required,
Maybe the symlink is also needed to make the hosts file work without the app
https://forum.xda-developers.com/showpost.php?p=64554262&postcount=978
Maybe this also helps your cause
I am using xiaomi pad 5 (miui 13.1.3) for 3 months. Recently I have unlocked my bootloader and rooted my phone. After that I installed lucky patcher and tried to block ads(blocking all ads was the main purpose for rooting my device. ) But still ads were showing. Then I manually tried to replace “hosts” file inside the “system/etc” folder. But, root explorer said “can not replace hosts file”. It seems that original hosts file is uneditable. Can anyone help me to replace the original hosts file with custom one?
Ahamadmusa said:
I am using xiaomi pad 5 (miui 13.1.3) for 3 months. Recently I have unlocked my bootloader and rooted my phone. After that I installed lucky patcher and tried to block ads(blocking all ads was the main purpose for rooting my device. ) But still ads were showing. Then I manually tried to replace “hosts” file inside the “system/etc” folder. But, root explorer said “can not replace hosts file”. It seems that original hosts file is uneditable. Can anyone help me to replace the original hosts file with custom one?
Click to expand...
Click to collapse
I would recommend AdAway it's easy to use.
SubwayChamp said:
I would recommend AdAway it's easy to use.
Click to expand...
Click to collapse
Thanks brother. I have already tried adway. But, it also didn't work. It seems, the “system” folder is unmodifiable.
Ahamadmusa said:
Thanks brother. I have already tried adway. But, it also didn't work. It seems, the “system” folder is unmodifiable.
Click to expand...
Click to collapse
Stick a Pihole on your router - it'll take out the ads before they reach your devices without having to root, at home at least
It seems like Luck Patch getting less effective recently it's didn't work for me at all. Adaway is the best tool and if it's didn't work. It's gonna be hard to solve. I suggest maybe find a mod version of the apps
Ahamadmusa said:
Thanks brother. I have already tried adway. But, it also didn't work. It seems, the “system” folder is unmodifiable.
Click to expand...
Click to collapse
Sorry for delay, no, AdAway works perfectly.
You have to go to the Settings from Magisk, tap on Systemless host, then reboot, now open AdAway, and follow the on-screen instructions.
About the system, in newer Android versions, the system remains just RO (read-only), this is the reason, although you can edit the host file, you can't put it back.
SubwayChamp said:
Sorry for delay, no, AdAway works perfectly.
You have to go to the Settings from Magisk, tap on Systemless host, then reboot, now open AdAway, and follow the on-screen instructions.
About the system, in newer Android versions, the system remains just RO (read-only), this is the reason, although you can edit the host file, you can't put it back.
Click to expand...
Click to collapse
Thanks from deepest part of my heart, dear. It works like charm. Thanks . But, can u tell me, is there any way to convert the system from read only to writeable?
Ahamadmusa said:
Thanks from deepest part of my heart, dear. It works like charm. Thanks . But, can u tell me, is there any way to convert the system from read only to writeable?
Click to expand...
Click to collapse
Yes, and not. Unfortunately, there is not a universal solution for this Google based underlined method.
Most users rely on the need to use this, based on modules from Magisk, to make one thing here, and one thing there, I mean, a specific job in regard to that, and not, letting the system completely accessible to RW.
This script works for some device while it doesn't for others, so you could try on, https://forum.xda-developers.com/t/...-superrw-featuring-makerw-read-write.4247311/ This method worked for my last Redmi Note 10, but not for my current RN11 though.
And also, you could take a read on this method, https://forum.xda-developers.com/t/mount-system-read-write.4270857/
SubwayChamp said:
Yes, and not. Unfortunately, there is not a universal solution for this Google based underlined method.
Most users rely on the need to use this, based on modules from Magisk, to make one thing here, and one thing there, I mean, a specific job in regard to that, and not, letting the system completely accessible to RW.
This script works for some device while it doesn't for others, so you could try on, https://forum.xda-developers.com/t/...-superrw-featuring-makerw-read-write.4247311/ This method worked for my last Redmi Note 10, but not for my current RN11 though.
And also, you could take a read on this method, https://forum.xda-developers.com/t/mount-system-read-write.4270857/
Click to expand...
Click to collapse
Thank you brother. I shall try it during my freetime.
Ahamadmusa said:
I am using xiaomi pad 5 (miui 13.1.3) for 3 months. Recently I have unlocked my bootloader and rooted my phone. After that I installed lucky patcher and tried to block ads(blocking all ads was the main purpose for rooting my device. ) But still ads were showing. Then I manually tried to replace “hosts” file inside the “system/etc” folder. But, root explorer said “can not replace hosts file”. It seems that original hosts file is uneditable. Can anyone help me to replace the original hosts file with custom one?
Click to expand...
Click to collapse
Flash it in magisk.
U can edit the file with 7zip and replace host with yours
Keyvannn said:
Flash it in magisk.
U can edit the file with 7zip and replace host with yours
Click to expand...
Click to collapse
Thanks brother. After applying systemless host in magisk I was able to replace hosts file via adaway, but still some ads were showing in adm. After applying your zip file there is no ads, at least for now. Thanks dear.
Ahamadmusa said:
Thanks brother. After applying systemless host in magisk I was able to replace hosts file via adaway, but still some ads were showing in adm. After applying your zip file there is no ads, at least for now. Thanks dear.
Click to expand...
Click to collapse
If you want to update the host file , take it from here
GitHub - StevenBlack/hosts: 🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories. - GitHub - StevenBlack/hosts: 🔒 Consolidating a...
github.com
Keyvannn said:
If you want to update the host file , take it from here
GitHub - StevenBlack/hosts: 🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories. - GitHub - StevenBlack/hosts: 🔒 Consolidating a...
github.com
Click to expand...
Click to collapse
Then tell me, this can work apart from AdAway, no? I mean, once a new release is out, you can just flash it and it's done, no need to install and set it up AdAway, and no need to enable systemless host, I'm right?
SubwayChamp said:
Then tell me, this can work apart from AdAway, no? I mean, once a new release is out, you can just flash it and it's done, no need to install and set it up AdAway, and no need to enable systemless host, I'm right?
Click to expand...
Click to collapse
Actually u don't need to update if its working fine.
Just flash it with magisk, no need adaway app or any setting in magisk.