Marshmallow not reading /system/etc/hosts? - T-Mobile HTC One (M8)

This is a weird one. I can't seem to get my T-Mobile One M8 running Marshmallow to use the entries in the hosts file.
First I rooted my phone and installed Adaway. Went through and made the sym link from /system/etc/hosts to /data/data/hosts, Adaway succeeded - but no ads were blocked. I opened both the raw file and the symlink in Root Explorer, and they looked fine, but pinging any of the entries went to the real server instead of 127.0.0.1.
So I tried more basic and put the stock /system/etc/hosts file back in place, then copied over StevenBlack's host file over it. Same result. It's like Marshmallow doesn't even give a crap that there's a hosts file there and refuses to load anything from it. I even verified it was saved in UNIX format via Notepad++.
For all the steps, I only made changes in TWRP after mounting the system rw, and the changes in the hosts files stayed after a reboot.
Any ideas? I'm really stumped.

Did you ever figure this out? I have the same issue...

Hi!
I've had the same problem on my M8s. Checked multiple times the permissions, file formatting and nothing worked. Then I've added a line
Code:
net.tethering.noprovisioning=true
to the /system/build.prop file and now hosts file is working as it should
Since I can't post links in my posts due to xda policy PM me if you need link to a full guide how to do this.

Spend long time to figure out why ad blocking doesn't work on mine HTC one. Thanks !

Related

how do i edit my build.prop

if i edit my build.prop with astro, on a reboot the changes are lost, the file is marked r-w, so something altering it on bootup, anybody know where the source comes from??
Download Root Explorer and use that. Trust.
tried that, it keeps getting overwritten with some king of backup.
mallard729 said:
tried that, it keeps getting overwritten with some king of backup.
Click to expand...
Click to collapse
If that's the case, then it's a problem specific to the ROM. I haven't tried it on my TP2 but it worked flawlessly on my G1.
Lemme take a look once I get a second.
why cant i find the directory /system/ ?!?! i cant find the build.prop from within windows or winmo?!
norpan111 said:
why cant i find the directory /system/ ?!?! i cant find the build.prop from within windows or winmo?!
Click to expand...
Click to collapse
Because it does not excist in winmo. It only excists in android.
I tried Root Explorer and it workers . I use latest froyo build with lower incall volume kernel .
Can somebody tell me when I delete apps in system/apps folder I delete from data.img or from system.ext2 ?
Same here, I change my build.prop file or replace it and it gets overwritten.
Using the build.prop for protected apps but can't get it to stay.
I am using the latest BLAZEN build from PPCGEEKS/Reefer.
Being an Ext2 file instead of sqsh I figure this would have worked flawless.
I'd really like to download logmein, gbahours, paypal and a few other protected apps. I can't without fixing this build.prop file....
OR
Find some way to get a working fingerprint Google has already approved.
Glad to see I'm not the only one looking into this I have the same problem in my android OS - different phone, but same custom OS. Hopefully this thread won't die - if I ever figure it out I'll be sure to post here as well

[SOLVED] here is copy of an adfree hosts file, and where to put it

i tried to get adfree to work using the supersonic rooted ROM, and managed to allow it root access, but it barfed every other time i try to run it, and when it doesn't barf, it forces a system reboot.
after doing some searching, i found a solution. at least for those of us with rooted evos. not sure if you other folks could push it or not, since it writes to /system
okay, for anyone that also hates ads, i found this thread that has a hosts file.
i did have a copy of that file. but i updated in the reply below (thanks phiqtion for the original!)
the way i got it to work was DL the hosts file, unzipped it, put it in my sdk/tools folder, then
adb reboot recovery
*i ran maejrep/flipz/pauls recovery bat file*
adb shell
# mount /dev/block/mtdblock4 /system
# exit
adb push hosts /system/etc
adb reboot
and voila! no more ads
of course, if anyone has a functioning copy of adfree and a more up to date hosts file, please post!
*note - i am running toastcfm's rooted pc36img ROM now, because the supersonic kept throwing up. but, this probably will not work if you are not rooted.
updated hosts file HERE
thanks mediocrehippie!
Here's one for you:
When I use an ad free hosts file on my EVO and I connect to the internet on my PC via the EVO and Android WiFi tether, it blocks ads on my PC browser as well!
Sweet!
you can put it in your computer and will block them even if you dont connect through your evo.
here is a copy of the latest hosts file from 7/31
-deck
Hmm. I've been doing it with root explorer. Copy the hosts file to /system/etc and over write existing file, then reboot. I think some off the new progs are pushing ads to us in other ways that the hosts file doesn't come into play with.
Sent from my PC36100 using XDA App
this needs root, no?
herbthehammer said:
Hmm. I've been doing it with root explorer. Copy the hosts file to /system/etc and over write existing file, then reboot. I think some off the new progs are pushing ads to us in other ways that the hosts file doesn't come into play with.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
when i try to do this it says there is not enough available memory. any thoughts?
I just used the hosts file from:
someonewhocares.org/hosts/​
He updates is very regularly, I haven't seen an add get by yet.
So, its has been awhile since the last update, here's the latest updated hosts file I just work on today...
timothydonohue said:
updated hosts file HERE
thanks mediocrehippie!
Click to expand...
Click to collapse
Is there a link to an updated and maintained hosts file?
m4f1050 said:
Is there a link to an updated and maintained hosts file?
Click to expand...
Click to collapse
Bump for info?...
Anybody knoe of an updated hosts file
Does adfree work now or do I have it installed for nothing? I used root explorer to replace the hosts file.
pittnuma said:
Anybody knoe of an updated hosts file
Does adfree work now or do I have it installed for nothing? I used root explorer to replace the hosts file.
Click to expand...
Click to collapse
Ad-free just installs the hosts file, so if you're doing it manually then the app is pointless. Gimme a sec & I'll upload an updated hosts for you.
Edit: here you go. This is from the app AdAway, it's better than Adfree imo.
http://db.tt/DKzwDtXl
Many thanks, appreciated.
if i'd like to add adfree hosts sources, which urls i need to use?
thanks, great app!

[Q] Edit hosts file

Hello,
After reading theads about this universal problem.
I'm still looking for a solution to edit hosts file.
I don't want to pay for root explorer app (sorry).
I've tried AdFree but it adds only "127.0.0.1 localhost"
is there a way to edit this f*** file. I've a hosts file to use but no possibilies to use it...
If someone can help me, (s)he will be very kind....
re Hello,
I've seen a thead a patch to make a link to a file on the sdcard (I don't know where on the forum exactly)
Is there someone to help me ?
I recently have been looking into changing my own hosts file. I use Astro with the root option enabled to copy the hosts file in /system/etc/ to my SD card. With Astro you can change file extensions. Rename your SD copy to hosts.txt and you can edit it with ThinkFree. As for copying that back over, I'm not sure if it's as direct. I would suggest using an Android terminal to do the edits because you can edit without having to use ADB (I found all this out through other threads). Make sure you're root(ed) as well (su command). Also you might have to reboot after copying over your new file. My PC has trouble with my hosts file.
Basically what I've seen is that there's a line in the file that the device can't "understand" (or find) perhaps. My PC file has a couple groups of sites that I copied from a website (after checking for loopback). All in all there was a box or something somewhere because the encoding wasn't the right one. (If you add the .txt extension on the device ThinkFree will ask you what encoding. I use the suggested but that's probably my issue on my PC.) My PC kept making a new, blank copy of my hosts and turning my custom one into an iCal file (?).
Hope this helps a little, even though you're only adding one line...
Sent from my SPH-M910 using Tapatalk
Hello
Thanks for the info.
I've manage to do a link to a hosts file located in the sdcard using adb when I'm in recovery mode.
Now When I use AdFree, the app can update without problem the file
Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts
Indirect said:
Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts
Click to expand...
Click to collapse
It's Ok,
when I do this, it outputs all the adress associated with 127.0.0.1
It displays the content of /sdcard/etc/hosts file.
Easy Host File
I have been able to change my hosts file with no paid apps,adb, or recovery. This will work with Astro or ES File Explorer.
Find and download the hosts file you wish to use; I use mvps. If you want to edit it or add entries do so now. To save it with no file extension on Windows under tools-->folder options enable "show file extensions for known types". Control click and select "rename"; rename "hosts.txt" as "hosts". Window will warn you about changing the extension but clear the warning. Copy this to the root of your sdcard.
On your rooted phone open your file manager (Astro or ES) and click menu. Allow root permission. You will see a legend that says your app has been granted superuser privileges. Navigate to sdcard and copy your desired hosts file. Go to root directory and paste the new file in /system/etc. You will get a warning that files will be overwritten/folders merged. Allow. Now you're done, easy money!
---------- Post added at 06:21 PM ---------- Previous post was at 06:15 PM ----------
To avoid a "blank" you have to show file types for known extensions. Editing is easy in Notepad++. This way you can add new annoyances at will. There's no place like 127.0.0.1!
I Understand the good side of your method.
Just a question. Can we do a link (ln -s....) via ADB with the original recovery ( the unrooted one) ?

Hosts file

I have recently acquired a custom hosts file that I would like to use in place of the built-in one. Of course, the hosts file on the phone is read-only I believe, so it can't just be replaced. I can access it with ES File Explorer, and change the attributes, but no matter what I try, it will not save. I have used the adb "push" command from my computer but I still get an error trying to replace the file. I have tried using ES File Explorer as a remote ftp server also. No luck so far. Short of manually typing the information from the custom hosts file, or copying and pasting chunks at a time, I am at a loss. I don't understand why this can't be done since I have changed the attributes of the file. Please forgive my ignorance if there is an obvious solution for this that I am overlooking. Any help would be appreciated.

need platform.xml

Can someone dump me platform.xml files, I made some changes to try and fix what I thought was a sdcard r/w permission error and tons of things are erroring out on my phone.
My phone is USA HTC10 / Unlocked
Need these two files, thanks!
/system/etc/platform.xml
/system/etc/permissions/platform.xml​
cauqazn said:
Can someone dump me platform.xml files, I made some changes to try and fix what I thought was a sdcard r/w permission error and tons of things are erroring out on my phone.
My phone is USA HTC10 / Unlocked
Need these two files, thanks!
/system/etc/platform.xml
/system/etc/permissions/platform.xml​
Click to expand...
Click to collapse
There is no platform.xml under etc, only etc/permissions
thank you. must have pasted it in the wrong place. im not sure what happened, filesystem created a platform.xml.backup file after I put my own.
after i figured out it wasn't anything to do with the file (the app i was using wasn't updated properly for 6.0+ yet), I simply deleted my platform, removed 'backup' from the file name and rebooted and phone went all crazy.

Categories

Resources