[Q] Disable AdBlocking in ICSrewD? - AT&T Samsung Galaxy S II SGH-I777

I can't post in the ICScrewD thread in the Development section yet... Is there a way to disable the AdBlocking?
I just switched to ICScrewD from UnNamed. I use the Medscape medical app for school/work constantly, but ad blocking doesn't allow the app to connect to the internet. Is there a way around this like disabling Ad Blocking all together?

derekbro said:
I can't post in the ICScrewD thread in the Development section yet... Is there a way to disable the AdBlocking?
I just switched to ICScrewD from UnNamed. I use the Medscape medical app for school/work constantly, but ad blocking doesn't allow the app to connect to the internet. Is there a way around this like disabling Ad Blocking all together?
Click to expand...
Click to collapse
Stuff like this is why I believe firmware developers should NEVER use ad blocking by default.
I believe most of them do so by using a custom /system/etc/hosts file. Check to see if yours has anything more than this:
Code:
127.0.0.1 localhost

Just checked mine for giggles and found exactly that... Just
127.0.0.1 localhost
Nothing more. So if it's ad blocking its doing it some other way.
I'm running the latest icscrewed with entropy DD.
Sent from my SGH-I777 using xda premium

Rename host to host.bk for backup restart couple times. Should be good.
Sent from my SAMSUNG-SGH-I777 using xda premium

Thank you, but I'm lost...
Thank you for looking into this for me and posting the replies. I 'm not sure what I'm supposed to do though. I don't know much about this stuff and really just cross my fingers and follow what ever directions I find on these forums.
So using the File Manager that comes with ICScrewD, I went to /system/etc and opened "hosts" with the Text Editor and found "127.0.0.1 local host" and a a bunch of lines starting with "127.0.0.1".
So now I should rename "hosts" to "hosts.bk" and reboot the phone?
Thanks again!

127.0.0.1 is a loopback address known as localhost that refers to the same device that you are using (ie. your phone). What the hosts file on your phone is doing is rerouting any connection attempt to known ad servers to localhost, which then returns nothing and effectively blocks the ads. If the hosts file isn't there (or, alternatively, only contains the line "127.0.0.1 localhost"), then the adblocking feature goes away.
What Haas360 suggested is to rename the file with a different extension so that the operating system doesn't recognize it as being the hosts file anymore. The reboot is probably just to clear the DNS cache. It should achieve your objective.

Thank you
Thank you everyone for the help. I renamed the file like suggested and now Medscape is able to connect to the internet.
Now, a further question since I have learned something today. If I figure out which one of the servers Medscape is using, and delete that line from the host file, could I still block other ad servers and allow Medscape to connect?
I didn't see anything listed containing Medscape and a google searched also turned up nothing.

A quick search through my hosts file turned these up:
127.0.0.1 ads.medscape.com
127.0.0.1 adv.medscape.com
127.0.0.1 as.medscape.com
127.0.0.1 bi.medscape.com
You can try finding and deleting those lines in your hosts file (now hosts.bk I assume), then removing the .bk extension and rebooting. There's no guarantee that this will work since it's possible that there are other strings that don't contain "medscape" that are contributing to the app being blocked, but it's worth a try if you want to keep the adblocking functionality.

Related

[Solved] Web Pages Not Loading When On 4G?

I had this issue, where all apps would run fine, but web pages would freeze. Moreover, this would only happen when using 4G. Unfortunately, the problem is due to adfree replacing the hosts file. I am not sure why, and even more confused why it only affects 4G, but it is definitely the culprit. Currently, the only solution I have is to revert the hosts file and deal with the ads. So what it comes down to, is enjoy 4G in the browser, and have ads, or no ads and no 4G in the browser.
Here is the fix, courtesy of RyteSyde:
Open up adfree and choose custom ip, in the box enter
72.3.232.220
Then let adfree do its thing. That is all it takes to have 4G and no ads. If you appreciate this, give RyteSyde a thank you.
It could be one or several individual entries in your hosts. I don't use adfree but use a hosts file I compile myself and use on my win servers, clients etc. No probs on 3/4g or wireless. Have you tried replacing the hosts yourself...ie without adfree?
RyteSyde said:
It could be one or several individual entries in your hosts. I don't use adfree but use a hosts file I compile myself and use on my win servers, clients etc. No probs on 3/4g or wireless. Have you tried replacing the hosts yourself...ie without adfree?
Click to expand...
Click to collapse
I tried with some old hosts files I had, but still had issues. Could I trouble you to upload your hosts file? Thank you
cloverdale said:
I tried with some old hosts files I had, but still had issues. Could I trouble you to upload your hosts file? Thank you
Click to expand...
Click to collapse
Sure thing. Here's a zip with the hosts in unix and win formats. You can remove/add to the list but if you make changes to the unix list be sure to convert it back to unix format after saving so the carraige returns are correct. I use dos2unix for that. Also, if you open the unix in notepad they will all run together, but wordpad will line item them.
RyteSyde said:
Sure thing. Here's a zip with the hosts in unix and win formats. You can remove/add to the list but if you make changes to the unix list be sure to convert it back to unix format after saving so the carraige returns are correct. I use dos2unix for that. Also, if you open the unix in notepad they will all run together, but wordpad will line item them.
Click to expand...
Click to collapse
I appreciate it, thanks. (I run Linux, so format should not be an issue, but thanks for the warning).
also just in case anyone else reads this...
To copy the hosts yourself, though there are several ways, put the unix hosts file on you sd card. I typically just email it to myself since I'll get it right away via exchange and I don't have to USB the phone. Then I save the att to the sd card. From there I use root explorer and Mount R/W mode and navigate to the hosts file on the sd card and copy the hosts file. Then navigate to the /etc folder on the phone and paste the hosts file. If you only have the original hosts there is ony one line in it (127.0.0.1 localhost) so it's not super important to backup the original (I don't). You can always rename the original to hostsX or the like if you wish.
After you've copied it, reboot the phone and you're good to go.
The win version goes in windows\system32\drivers\etc and there's no need to reboot. Just do a command prompt "ipconfig /flushdns" and then "nbtstat -R" to clear the cache. The win hosts can also be merged with your current one with notepad or your flavor of text editor.
This will block a large majority of the ads out there on sites like drudge etc.
HTH
cloverdale said:
I appreciate it, thanks. (I run Linux, so format should not be an issue, but thanks for the warning).
Click to expand...
Click to collapse
Hey CD, just checking in to see if you've been able to resolve you 4g issue. Alls well?
RyteSyde said:
Hey CD, just checking in to see if you've been able to resolve you 4g issue. Alls well?
Click to expand...
Click to collapse
Unfortunately no, when I pushed your host file, my phone started boot looping. I did nothing else, just pushed the file, then rebooted. I am really confused by this, as it would have worked fine with my G1. I need to investigate further.
well that's really strange. Perhaps dos2unix didn't do it's job properly or something. Can you open the unix hosts file on your linux box, save it and then try?
Strange it's boot looping because hosts is pretty low on the resolution stack and should just bypass if it can't read/find a hosts and move on to DNS resolution.
RyteSyde said:
well that's really strange. Perhaps dos2unix didn't do it's job properly or something. Can you open the unix hosts file on your linux box, save it and then try?
Strange it's boot looping because hosts is pretty low on the resolution stack and should just bypass if it can't read/find a hosts and move on to DNS resolution.
Click to expand...
Click to collapse
That is what I was thinking. I will give it another shot after work tonight.
I got the same problem loading pages on 4G through the browser while using adfree. So I switched to Dolphin browser and that took care of it. That is a temp fix for now I guess but honestly Dolphin is a better browser to me anyway.
cloverdale said:
That is what I was thinking. I will give it another shot after work tonight.
Click to expand...
Click to collapse
I've confirmed this issue on my device as well and I'm about 99% sure I've confirmed what is causing it and it's not the structure or corruption of the hosts file but it has to do with it. Will post back when I have the update.
Okay got the fix for this. Sorry it took so long but my 4G at the moment won't hold a signal so I got in the truck, braved the 25degree temps and went and parked right next to my closest 4G tower so I could hold a signal and finally confirm this. It's not really a fix per-se, rather a correction. What AdFree does is use 127.0.0.1 to redirect domains away from their correct IP's. That's nothing new. When I modify hosts files, I never use 127.0.0.1 because it is an internal loopback designation. Will it work, yes but if 127.0.0.1 does not run a web server, your returns *can* be much slower vs. an actual web server that returns an immediate response, even if that response is "page not found" etc. Compare that to a simple wait for timeout for no response. So, for my setup here I have a domain controller, web/dns server etc. and all of my hosts files point to that server's LAN IP. Result...no ads (or very very few until I add them to the list) and pages are very fast to load. Actually, I just use the hosts file on the server and use that server as my primary DNS everywhere else so I don't have to update the hosts on multiple machines.
Obviously on the phone, it's not able to see my server's IP so I modified the hosts I uploaded to use 127.0.0.1, because we weren't having issues with timeouts. The problem comes with 4G and it's got to be because the 4G is going through a proxy server I'm not aware of yet (haven't investigated further) and when it tries to return back to 127.0.0.1, that is no longer *your* NIC. That's why some pages will load and others won't. If a page has content derived from any source that's listed in the hosts file, it will try to wait for the timeout before moving on to the remainder of the code. If you hit a page that doesn't have any references to anything in the hosts file, it'll load just fine.
So, the resolution is to modify the IP used in the hosts file. I decided to load up sprint.com and see what speeds I got from various derivatives and for *me* the fastest one was now.sprint.com, which resolves to 72.3.232.220. I replaced all of the 127.0.0.1 entries with 72.3.232.220 except for the first localhost, leaving that 127.0.0.1 and put that on the SD card. I went to the tower, fiddled around making sure it was doing the same thing and then loaded this hosts file. (FYI you don't need to reboot after replacing it). Now all the pages load like you'd expect.
So, I hope that drawn out explanation helps you and others. You can use really any IP you want for the hosts resolver, just try to make sure it's an actual web server to avoid the timeouts.
I'm uploading the hosts with the now.sprint.com IP for you and all to use. Let me know if it fixes your problem as it did mine.
Ryte
RyteSyde said:
Okay got the fix for this. Sorry it took so long but my 4G at the moment won't hold a signal so I got in the truck, braved the 25degree temps and went and parked right next to my closest 4G tower so I could hold a signal and finally confirm this. It's not really a fix per-se, rather a correction. What AdFree does is use 127.0.0.1 to redirect domains away from their correct IP's. That's nothing new. When I modify hosts files, I never use 127.0.0.1 because it is an internal loopback designation. Will it work, yes but if 127.0.0.1 does not run a web server, your returns *can* be much slower vs. an actual web server that returns an immediate response, even if that response is "page not found" etc. Compare that to a simple wait for timeout for no response. So, for my setup here I have a domain controller, web/dns server etc. and all of my hosts files point to that server's LAN IP. Result...no ads (or very very few until I add them to the list) and pages are very fast to load. Actually, I just use the hosts file on the server and use that server as my primary DNS everywhere else so I don't have to update the hosts on multiple machines.
Obviously on the phone, it's not able to see my server's IP so I modified the hosts I uploaded to use 127.0.0.1, because we weren't having issues with timeouts. The problem comes with 4G and it's got to be because the 4G is going through a proxy server I'm not aware of yet (haven't investigated further) and when it tries to return back to 127.0.0.1, that is no longer *your* NIC. That's why some pages will load and others won't. If a page has content derived from any source that's listed in the hosts file, it will try to wait for the timeout before moving on to the remainder of the code. If you hit a page that doesn't have any references to anything in the hosts file, it'll load just fine.
So, the resolution is to modify the IP used in the hosts file. I decided to load up sprint.com and see what speeds I got from various derivatives and for *me* the fastest one was now.sprint.com, which resolves to 72.3.232.220. I replaced all of the 127.0.0.1 entries with 72.3.232.220 except for the first localhost, leaving that 127.0.0.1 and put that on the SD card. I went to the tower, fiddled around making sure it was doing the same thing and then loaded this hosts file. (FYI you don't need to reboot after replacing it). Now all the pages load like you'd expect.
So, I hope that drawn out explanation helps you and others. You can use really any IP you want for the hosts resolver, just try to make sure it's an actual web server to avoid the timeouts.
I'm uploading the hosts with the now.sprint.com IP for you and all to use. Let me know if it fixes your problem as it did mine.
Ryte
Click to expand...
Click to collapse
Your idea worked perfectly. Rather than push the file, I was lazy and had adfree use the ip you gave, instead of 127.0.0.1, and everything works. Thank you very much.
cloverdale said:
Your idea worked perfectly. Rather than push the file, I was lazy and had adfree use the ip you gave, instead of 127.0.0.1, and everything works. Thank you very much.
Click to expand...
Click to collapse
My pleasure. I haven't used AdFree so didn't know it had the option to do that. Glad it worked for you.
RyteSyde said:
My pleasure. I haven't used AdFree so didn't know it had the option to do that. Glad it worked for you.
Click to expand...
Click to collapse
I know my Linux, but am fairly ignorant when it comes to networks. I really appreciate the help.
On the topic of adfree, I like to use it since it updates the hosts file with no effort on my part. I realize it is just downloading a list, then concatenating to the hosts file, but it is just one less thing I need to worry about.
I am a mathematician, so if that can ever be of help to you, please let me know.
cloverdale said:
Your idea worked perfectly. Rather than push the file, I was lazy and had adfree use the ip you gave, instead of 127.0.0.1, and everything works. Thank you very much.
Click to expand...
Click to collapse
This worked for me as well
Worked for me as well. Used adfree to push out the new IP.
Thanks, cloverdale and RyteSyde! Running Vin's Plutonium with cooked hosts file and this I needed this information. Wish I knew what makes me in the minority that needs a different IP, though.
solver404 said:
Thanks, cloverdale and RyteSyde! Running Vin's Plutonium with cooked hosts file and this I needed this information. Wish I knew what makes me in the minority that needs a different IP, though.
Click to expand...
Click to collapse
Glad this thread helped someone else. No ads makes such a difference.

[SUGGESTIONS][CHEFS] To chefs offering adblock for /etc/hosts

I was debugging on the phone, and all of a sudden I saw something that caught my eye:
Code:
D/FlurryAgent( 5172): Sending report to: http://data.flurry.com/aar.do
D/FlurryAgent( 5172): Report successful
I've checked the list of applications that I have installed (rename .apk to .zip and then use Total Commander to search for FlurryAgent within the archives) and I was almost shocked to see how many are containing a reference to the agent (within their classes.dex file).
I suspect that it wasn't put there for nothing ...
User britoso has provided a workaround here: you need to add three lines to /etc/hosts.
Chefs, please make sure your updates are including those three lines
PS: None of the applications asked if its ok to send usage data to analytics company flurry.com ...
sounds like the iphone scandal
andrewddickey said:
sounds like the iphone scandal
Click to expand...
Click to collapse
It seems so... we should be ready for valpurgis...
Ferrum Master said:
It seems so... we should be ready for valpurgis...
Click to expand...
Click to collapse
I'm not sure I get the connection...
There are *.flurry entries in the Adfree hosts file.
Ok, they said Flurry Analytics is to improve their apps. But, location? Is that really necessary? Glad I have Adfree installed.
Yea BC someone trying to steal/gain malicious information from u would go through the effort/be stupid enough to put evidence of it on logcat lol... come on ppl think. I mean I understand why this posted n more power to u. But if your THAT worried u need to be watching the traffic that doesn't broadcast it to yourself, not the traffic that does lol.
My 2 cents, take it for w/e its worth lol.
Sent from my Xoom using Tapatalk
blakwhite said:
There are *.flurry entries in the Adfree hosts file.
Click to expand...
Click to collapse
In my Adblock list I only found www.flurry.com, I'm still using V3.6 from wolf.
I guess I need a kernel with droid wall - and I will only allow certain applications to pass through.
And if some app requires internet connection and it doesn't tell me why beforehand, tough luck.
viulian said:
In my Adblock list I only found www.flurry.com, I'm still using V3.6 from wolf.
I guess I need a kernel with droid wall - and I will only allow certain applications to pass through.
And if some app requires internet connection and it doesn't tell me why beforehand, tough luck.
Click to expand...
Click to collapse
i recommend LBE Privacy Guard as well. It needs ONLY root and it allows you to totally take control over your apps' permissions
zmod already has these entries on hosts
Adolf1994 said:
i recommend LBE Privacy Guard as well. It needs ONLY root and it allows you to totally take control over your apps' permissions
Click to expand...
Click to collapse
Thanked, this is a very good app.

[Q] adownloader-security-data file question?

I'm currently using adownloader for non-copyright infringement torrents. I'm looking to block my ip address because i like being secure (that's why i have a firewall on my phone)
in the app settings->security->Data file refers to use iblocklist.com for details. I'm confused whether i put a web address from one of iblocklist.com numerous links or to actually put a downloaded file in there. if someone could help me out i'd appreciate!
Thanks!

Ad Blocker Blocking Too Much?

So in the development section someone asked about how they can see their Newegg.com ads now that they have an ad blocker (I use adfree personally).
First, you must understand that ad blockers simply put a bunch of addresses in a file called etc/hosts, and those addresses get blocked. There are several apps that will let you edit this, but I haven't found a free one that'll let you search and edit as freely as I'd like, so we're going Lo-Fi here.
---YOU'LL NEED TO BE ROOTED FOR THIS--- (then again, if you're not rooted, you probably couldn't get an ad blocker to work in the first place)
Get a root file explorer (I like ES File Explorer)
Copy /etc/hosts to /sdcard
Hook up your computer and mount your SD card
Use something (like Notepad) to edit "hosts"
<Ctrl>F to find, and type in newegg (or what ever ad you want to unblock)
erase every entry you find
Save and close
Unmount, and copy the edited file back to the original location
For that last step, you'll need to turn on all the "dangerous" options in your settings.
That should do it. If something isn't quite right, or if you've found a better app, PM me or post here. Thanks!
This belongs in the Themes/Apps section. Thank you.
Thread Moved.
-------------------------------------
Nine months before I was born, my dad took me to a party where he met my mom and took her home.
Brought to you courtesy of my Galaxy Note (i717), using XDA Premium.

what should be the contents of stock /etc/hosts?

Mine has grown to 38k entries after rooting the phone. And kind of feel it is slowing down (maybe I get spoiled.). Anyway, what should be the default contents of this /etc/hosts?
I've installed ABP for firefox and Ghostery. Collectively they block all the ads.
newshook said:
Mine has grown to 38k entries after rooting the phone. And kind of feel it is slowing down (maybe I get spoiled.). Anyway, what should be the default contents of this /etc/hosts?
I've installed ABP for firefox and Ghostery. Collectively they block all the ads.
Click to expand...
Click to collapse
The stock /system/etc/hosts file has one entry:
127.0.0.1 localhost

Categories

Resources