Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,657 Members 43,521 Now Online
XDA Developers Android and Mobile Development Forum

[APP][4.0.3+ & GB][XPOSED] UnbelovedHosts

Tip us?
 
chw9999
Old
(Last edited by chw9999; 1st September 2014 at 07:42 PM.) Reason: ?
#231  
Senior Member
Thanks Meter 70
Posts: 359
Join Date: Dec 2006
Location: Bensheim
Hi, having the DefimDonator, I thought I'd try this... I used AddFree before, which worked all right for my sites visited.

However, when I use unbelovedHosts, a lot of ads get through, regardless of the board files I loaded. I even loaded the AdFree host file and still I got a lot of ads. so I compare the UH logs with and without AdFree:
Quote:
without AdFree:
2014-09-01 12:59:23 denies: Boat Browser == pixel.quantserve.com
2014-09-01 12:59:23 allows: Boat Browser == api.boatmob.com
2014-09-01 12:59:24 allows: Boat Browser == api.boatmob.com
2014-09-01 12:59:24 allows: Boat Browser == 192.241.158.76
2014-09-01 12:59:26 allows: Boat Browser == www.facebook.com
2014-09-01 12:59:27 allows: Boat Browser == fbstatic-a.akamaihd.net
2014-09-01 12:59:32 allows: Boat Browser == apis.google.com
2014-09-01 12:59:34 denies: Boat Browser == adkengage.com
2014-09-01 12:59:34 allows: Boat Browser == accounts.google.com
2014-09-01 12:59:35 allows: Boat Browser == oauth.googleusercontent.com
2014-09-01 12:59:35 allows: Boat Browser == ssl.gstatic.com
2014-09-01 12:59:36 allows: Boat Browser == s-static.ak.facebook.com
2014-09-01 12:59:37 denies: Google Play-Dienste == ssl.google-analytics.com
2014-09-01 12:59:37 denies: Google Play-Dienste == ssl.google-analytics.com
2014-09-01 12:59:37 allows: Google Play-Dienste == 127.0.0.1

with AdFree:
2014-09-01 13:01:37 denies: Google Play-Dienste == ssl.google-analytics.com
2014-09-01 13:01:37 allows: Google Play-Dienste == 127.0.0.1
2014-09-01 13:01:51 allows: Boat Browser == api.boatmob.com
2014-09-01 13:01:52 allows: Boat Browser == api.boatmob.com
2014-09-01 13:01:52 allows: Boat Browser == 192.241.158.76
2014-09-01 13:01:54 allows: Boat Browser == www.facebook.com
2014-09-01 13:01:55 allows: Boat Browser == fbstatic-a.akamaihd.net
Example: pixel.quantserve.com is definitely in the host file loaded into UH, but obviously not recognized. What can I do? I tried reboot and all, to no avail.

The xposed log says "initialized", btw, so seems ok to me...

ICS 4.0.3, BTW

Thanks!
 
madLyfe
Old
#232  
madLyfe's Avatar
Senior Member
Thanks Meter 18
Posts: 243
Join Date: Dec 2011
Quote:
Originally Posted by defim View Post
The files get updates, so maybe you want to download it more than 1 time
well it should show which ones you have downloaded, if there are updates, actionable option to either update manually or auto update when said update arrives.
 
defim
Old
#233  
Senior Member - OP
Thanks Meter 801
Posts: 1,557
Join Date: Feb 2012
@killoid: Thanks for report!

Quote:
Originally Posted by madLyfe View Post
well it should show which ones you have downloaded, if there are updates, actionable option to either update manually or auto update when said update arrives.
The file has to be downloaded to check if it is newer. Not all wbserver deliver file change date or size. So the simples is just download the file and add new hosts. With donator app (see OP for features) there is a timer which does this every 4 days and shows with a optional notification how much hosts where added. Additionally is there option to do this only by wlan


Quote:
Originally Posted by chw9999 View Post
Hi, having the DefimDonator, I thought I'd try this... I used AddFree before, which worked all right for my sites visited.

However, when I use unbelovedHosts, a lot of ads get through, regardless of the board files I loaded. I even loaded the AdFree host file and still I got a lot of ads. so I compare the UH logs with and without AdFree:

Example: pixel.quantserve.com is definitely in the host file loaded into UH, but obviously not recognized. What can I do? I tried reboot and all, to no avail.

The xposed log says "initialized", btw, so seems ok to me...

ICS 4.0.3, BTW

Thanks!

If the log shows "denies: ... == pixel.quantserve.com" the host was in the hosts file and UH sent back a changed ip.
"With/without AdFree": If you have a host in you hosts file set, Android does not need to resolve it, because you have set the ip in the hosts file!
Then UH does not get the request because ther's nothing to resolve.
Keep in mind: Resolved IPs are cached, so if you insert/delete hostnames, the it could be the app uses a old value - a reboot clears the cache
Motorola Defy+ aka MB526 Android 4.4.4 Cyanogen Mod
Samsung S4a aka GT-i9295 Android 4.2.2 Google Edition
My Android apps / Xposed modules: show Threads
The Following User Says Thank You to defim For This Useful Post: [ Click to Expand ]
 
shadeMe
Old
#234  
Senior Member
Thanks Meter 33
Posts: 183
Join Date: Feb 2013
Has anybody been able to get this module to work on Paranoid Android 4.X? I simply can't seem to, regardless of which package I download. The log file doesn't register any hits/denies apart from the lone Google Analytics IP.
 
CHEF-KOCH
Old
#235  
CHEF-KOCH's Avatar
Senior Member
Thanks Meter 64
Posts: 130
Join Date: Jan 2012
As I wrote here it's not working for me, and if I use my large host file ~ 23MB end enable your module, my system gets unstable. System hangs, Keyboard crash and other problems, maybe it's a site effect with a large hosts (as mentioned) file but the main problem is that it still gets ignored by the system and I don't know why. I'm not using a kernel with selinux enabled or another module which can be cause this problem, so I think it comes from the os itself. I tested all under stock/slim/omni. (4.4/4.4.4). If you need logs I can provide some but I think that will not change anything and is it possible ro re-apply the hosts file after connectivity change or every xyz minutes? Thx for the support.
 
defim
Old
#236  
Senior Member - OP
Thanks Meter 801
Posts: 1,557
Join Date: Feb 2012
Quote:
Originally Posted by CHEF-KOCH View Post
As I wrote here it's not working for me, and if I use my large host file ~ 23MB end enable your module, my system gets unstable. System hangs, Keyboard crash and other problems, maybe it's a site effect with a large hosts (as mentioned) file but the main problem is that it still gets ignored by the system and I don't know why. I'm not using a kernel with selinux enabled or another module which can be cause this problem, so I think it comes from the os itself. I tested all under stock/slim/omni. (4.4/4.4.4). If you need logs I can provide some but I think that will not change anything and is it possible ro re-apply the hosts file after connectivity change or every xyz minutes? Thx for the support.
An Xposed module changes Java-VM based things, not on kernel level. This could not be changed because of design of Xposed (Cydia can it, but is not really supported - after weeks no answers in the thread).
The module changes the answers Java gives to host name resolution requests. So no need to reload hosts, they are loaded to system start or if you change the configuration.
You could not use eg a "terminal" app to test, this is working on linux level (regardingless of root). And dont forget Android caches name resolution, a reboo could be needed to clear it
If you enable logging, you dont see anything?
Motorola Defy+ aka MB526 Android 4.4.4 Cyanogen Mod
Samsung S4a aka GT-i9295 Android 4.2.2 Google Edition
My Android apps / Xposed modules: show Threads
 
CHEF-KOCH
Old
(Last edited by CHEF-KOCH; 13th September 2014 at 04:20 PM.)
#237  
CHEF-KOCH's Avatar
Senior Member
Thanks Meter 64
Posts: 130
Join Date: Jan 2012
Hey defim, thanks for the answer, after ~ 20 or more hard restarts I was now able to feel the "magic". I searched a manual way to flush the dns cache like under windows
Code:
ipconfig /flushdns
but seems Android doesn't provide such "easy" method. We only can use
Code:
settings -> applications -> Network Location -> Clear data
but that's not really easy and annoying doing this every time. After some more reseach I found a better solution over here. It's called NetworkManagementService.flushDefaultDnsCache() method which should work on most android devices. Via terminal it worked quite good but after a restart I need to do all again, which was also pretty annoying, so I added now
Code:
networkaddress.cache.ttl=0
and
Code:
networkaddress.cache.negative.ttl=0
values to my build.prop and it did the job. Someone said over here it was fixed since JB but seems for me it was not fixed at all (see also here). Now I was able to cache the entries every 600 seconds (10 minutes). And after some more reboots and more flushes the /system/etc/hosts entries worked for me, I checked against terminal with simply ping command e.g. ping www. mom-nude.com gave me such as unknown host or something like that.

The only bigger problem I face now is that Windows <-> Android ignores the hosts if I'm using tethering over rmnet1 (IPv6 disabled on Android and Windows) [but still need to add the ::1 localhost under Windows to see the names]. If I'm using the same hosts file from Android, Windows is not abe to get a connection (no ping works and no internet connection, but icon seems all is fine). So, if I'm gonna to use not such big hosts it works, but it not recognize the entries from Android, strange problem what?
Maybe you can integrate
Code:
ndc resolver flushdefaultif
and
Code:
ndc resolver flushif wlan0
somehow in the app (params needs root (and fly mode enabled) but we still have root since XPosed Installer needs root). Or add this into the topic, if someone facing the same problem like me, as written it should be fixed since JB but not all have this fix included.

Maybe you know more to fix my last problem Windows <-> Android tethering, it must be possible to only use one hosts file that get re-applied after dns flush and connectivity change. I would pay for that.
 
defim
Old
(Last edited by defim; Today at 08:34 AM.)
#238  
Senior Member - OP
Thanks Meter 801
Posts: 1,557
Join Date: Feb 2012
@CHEF-KOCH:
Thanks for you research! I will try to run flushDefaultDnsCache() with Xposed

EDIT: Added in latest version
Motorola Defy+ aka MB526 Android 4.4.4 Cyanogen Mod
Samsung S4a aka GT-i9295 Android 4.2.2 Google Edition
My Android apps / Xposed modules: show Threads

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes