Reduce ads by blocking ad serving domains - Motorola Atrix 2

Not sure if folks here are aware of this, but most of the ads pushed to my phone have disappeared after I mapped a lot of ad servers to 127.0.0.1 (localhost, the phone itself) -- the idea is from http://forum.xda-developers.com/showthread.php?t=509997 who finally made an app out of it, but what I simply follow (maybe once in a month, as the host file is updated with newer domains) is: (1) download http://winhelp2002.mvps.org/hosts.txt and save it as "hosts" without extension (2) adb shell; su; remount /system (3) copy this file over /system/etc/hosts (4) reboot
Kousik

kousik said:
Not sure if folks here are aware of this, but most of the ads pushed to my phone have disappeared after I mapped a lot of ad servers to 127.0.0.1 (localhost, the phone itself) -- the idea is from http://forum.xda-developers.com/showthread.php?t=509997 who finally made an app out of it, but what I simply follow (maybe once in a month, as the host file is updated with newer domains) is: (1) download http://winhelp2002.mvps.org/hosts.txt and save it as "hosts" without extension (2) adb shell; su; remount /system (3) copy this file over /system/etc/hosts (4) reboot
Kousik
Click to expand...
Click to collapse
This is included in some of our roms, and does not belong in the dev section, especially because it is not your work at all

Just use Luckypatcher to remove ads in apps

Hey, if you are going to use the free version of an app allow the ads to be displayed. At least the dev of the app gets some revenue from it because you are too cheap to buy the non-ad version for a few bucks.

Related

Fixing the user agent problem with the H builds

I wonder why nobody has noticed this but the default user-agent is actually stored in a simple XML file under /data/data/com.android.browser/shared_prefs/
So if you unzip the attached file and push it to your phone, you will be using the new ua next time you start the browser
Code:
adb push com.android.browser_preferences.xml /data/data/com.android.browser/shared_prefs/com.android.browser_preferences.xml
This is tested to survive a reboot.
billc.cn said:
I wonder why nobody has noticed this but the default user-agent is actually stored in a simple XML file under /data/data/com.android.browser/shared_prefs/
So if you unzip the attached file and push it to your phone, you will be using the new ua next time you start the browser
Code:
adb push com.android.browser_preferences.xml /data/data/com.android.browser/shared_prefs/com.android.browser_preferences.xml
This is tested to survive a reboot.
Click to expand...
Click to collapse
Nice Job. Worked great.
Sorry
I'm a little new on this is there any way to do this on Os X ?
Thanks!
If you're semi-lazy and don't do adb (I've never really tried to get it working under Linux) you can do those copies under the root terminal emulator. It's the same process (cp) as copying the mountd and init files when you originally rooted the phone. The only difference is, /data is mounted read/write to begin with so you don't have to re-mount it.
you can extract the zip to the root of your sdcard and type the following in terminal
Code:
su
cp /sdcard/com.android.browser_preferences.xml /data/data/com.android.browser/shared_prefs/
Hi,
This is a working broswer for the H builds.
Bookmarks saved and deleted.
Sites display correctly.
Zoom function works.
Rename Browser.zip to Browser.apk and push to phone.

[MOD] Enable / Disable AdBlock in your rooted ROM

This MOD is two files:
Enable Adblock Update File
Disable Adblock Update File
Download this two files to your SD card, apply (flash from recovery) first file if you need AdBlock, apply second if you don't need AdBlock. This files works at all rooted Android ROM's and phones, not only for Desire.
Source for AdBlock hosts file:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
See also my B&W Theme for Desire :-D.
Thank you
Thanks, works like a charm!
this block adds in apps?
Works very good! Thank you!
pinkolin said:
This MOD is two files:
Enable Adblock Update File
Disable Adblock Update File
Download this two files to your SD card, apply (flash from recovery) first file if you need AdBlock, apply second if you don't need AdBlock. This files works at all rooted Android ROM's and phones, not only for Desire.
Source for AdBlock hosts file:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
See also my B&W Theme for Desire :-D.
Click to expand...
Click to collapse
where do we put hosts.txt file?
pinkolin, there are extra lines at the end of the hosts file:
Code:
</pre>
</body>
</html>
I suppose they should not be there, even if they do not cause issues.
kmetek said:
where do we put hosts.txt file?
Click to expand...
Click to collapse
It's in /system/etc but if you flash the ZIP file above, it will put the file at the right place by itself.
Thank you
what is the difference between adblock and ad free? does one block website adverts and the other block adverts in apps, or do they do the same thing?
Another way to do it...
And with this solution you can use AdFree with no freeze :
With ROM Manager, reboot in clockworkmod recovery...
From your computer with adb in DOS mode (adb-windows.exe for me) do this :
> adb-windows.exe shell
you should have now a # prompt
# mount /system
# mount /data
# cd /system/etc/
# mv hosts /data/data/
# ln -s /data/data/hosts hosts
# cd /
# umount /data
# umount /system
Now you can reboot your system from Clockworkmod recovery menu
Install ADFree from the market, and it should work.
It worked well for me.
Use it at your own risk.
Just to explain what it does :
When phone is working the partition /system is in read only. ADFree tries to write in it, it crash.
The solution I give is the same as for bootanimation.zip
Move the file "hosts" from read-only file-system (/system) to a writable file-system (/data) and make a symbolic link to it in /system to fake it position.
Phone believes "hosts" is still in /system. and ADFree can write in it because it is in /data for real....
Thank you so much Orphee. This eventually fixed it for me after struggling for a couple of hours without success. Couldn't write hosts to system/etc/ while system running; couldn't get Droid explorer to mount files (device in recovery mode). Tried with Root Explorer and couldn't copy hosts to /system/etc/ due to 'file too large/not enough room' error. Tried with adb and again couldn't successfully copy hosts file. All very frustrating, and I wish I understood the problem better.
Anyway, your symbolic link solution finally cracked it, though I had to try twice. FIrst time Adfree stalled. Second time I ran 'Revert' first and it then it worked fine.
Hi there. I can't get this to flash. I get:
Code:
E:Failure at line 3:
copy_dir PACKAGE:system SYSTEM:
Installation aborted.
What now?
Orphee said:
Another way to do it......
Click to expand...
Click to collapse
Best explanation and instructions I've seen on this - thanks a lot!
hey guys,
I don;'t know if you already knew this but,
if i've installed adfree on my phone the application
pingchat! wont work anymore it cant get connected to the server
to send the messages :s and when i delete adfree it works normally...
I used the 'enable' zip, but my hosts file still cannot be changed. Using CM 6.0.2
Can this be applied from ClockworkMod recovery mode to a stock Froyo sense rooted phone that is odexed and s-on?
Also not answered is does it block website ads when in browser or/& ads that appear when running apps.
Anyone???
Edit: Worked like a charm! No more damm ads.
Thanks
Worked like a charm!!
carlos67 said:
Can this be applied from ClockworkMod recovery mode to a stock Froyo sense rooted phone that is odexed and s-on?
Also not answered is does it block website ads when in browser or/& ads that appear when running apps.
Anyone???
Click to expand...
Click to collapse
Yes it blocks the ads from apps & browser
Woah! Great! so, no ads when im playng Angry Birds!
Pure Calendar Widget (Agenda)
I use the "Pure Calendar Widget (Agenda)" from the market, after flashing the MOD and rebooting the widget fails to load my calendar. Have flashed the disable MOD and it's back to working as normal. Weird as its a paid app and there is no advertising in it.

Revert Adblocking on WB 2.3.3

Hello guys
I really like this rom but there is one thing that takes the piss, i normally use adblock app from market so i can block and later on revert so i can use apps like TV Shows stream, Animewatch and stuff that need advertisements to work. I'd like to know the IP wolf used to revert his adblocking.
Thanks in advance
P.S: I didn't know where to place this so i went for the ''Apps'' section.
Isn't there a RESTORE on the app itself?
Sendou said:
Hello guys
I really like this rom but there is one thing that takes the piss, i normally use adblock app from market so i can block and later on revert so i can use apps like TV Shows stream, Animewatch and stuff that need advertisements to work. I'd like to know the IP wolf used to revert his adblocking.
Thanks in advance
P.S: I didn't know where to place this so i went for the ''Apps'' section.
Click to expand...
Click to collapse
ad block is directly at hosts file
location /system/etc/hosts
if you want to remove ad block temporarily just create a backup copy of hosts and write a new hosts file with just one line
127.0.0.1 localhost
that will remove native adblocking....
now if you want to use any ad blocking software you can also use that.
Thank you, Sir
Looks like it's the app that is malfunctioning.
edit the host files at /system/etc/hosts using root explorer.
anantshri said:
ad block is directly at hosts file
location /system/etc/hosts
if you want to remove ad block temporarily just create a backup copy of hosts and write a new hosts file with just one line
127.0.0.1 localhost
that will remove native adblocking....
now if you want to use any ad blocking software you can also use that.
Click to expand...
Click to collapse
thanks sir =)
anantshri said:
ad block is directly at hosts file
location /system/etc/hosts
if you want to remove ad block temporarily just create a backup copy of hosts and write a new hosts file with just one line
127.0.0.1 localhost
that will remove native adblocking....
now if you want to use any ad blocking software you can also use that.
Click to expand...
Click to collapse
thx..
it works on me~

Fix permissions???

I see this in the theme and development section at times...but have no idea what it means and how to use it correctly if you will.
Everything I found gave smartass answers, so hoping to get some straight answers here.
It does exactly what it says... Repairs permissions. You're supposed to do it whenever you modify the Android System. It repairs file permissions to access what they need to access.
In Android, each app runs as its own UID (user ID) just like multiple people would have their own UID on a big UNIX system. The reasoning is the same, to prevent apps (people) from messing with each other's data. The data for each app has to be 'owned' by the UID the app runs as, and additionally the app itself (.apk file) has to be that same UID. Unlike big UNIX systems, these IDs are stored in the packages.xml file in /data/system. This file, in addition to storing UIDs, stores the android permissions of each program as described in its manifest (permissions like writing to the sdcard, monitoring phone state, turning wifi on and off, accessing bluetooth, etc). If the file is damaged, deleted, or otherwise unreadable, it is regenerated. The app UIDs are assigned initially in the order you install them (10001, 10002, etc.). When the packages.xml regenerates, it grabs the Android permissions from the .apks but doesn't know what the old UIDs were. That's where fix_permissions comes in. Whether run from recovery or a booted system, fix_permissions reads through the packages.xml file and performs a chown/chmod command (which changes owner/change read-write-execute permissions) on each .apk and the data directory for it. It doesn't fix Android permissions (e.g. if phone.apk lost the ability to make calls, fix_permissions wouldn't help)
To execute the fix_permissions script from your G2x:
Open the "Terminal" app from the application drawer type
Code:
su
fix_permissions
In ADB
Code:
adb shell fix_permissions
You can also do it as an option in CWM and when booted into recovery mode.
So basically you want to do it whenever you're flashing something in CWM?
Not really, unless you get a random FCs when trying to access your apps. But it's good practice I guess.

Hulu and the hosts file in custom ROMs

Can't really believe this hasn't been covered for the Sensation, so here goes nothing:
Many custom ROMs that come with their own hosts file (ones that don't use AdFree Android to manage it) will automagically break apps like Hulu out of the box. Hulu will get to the point where it should start streaming an ad before your video, and it will just hang there. Eventually it gives you a message about your connection being bad, and returns you to the video list.
ROM chefs that create their own hosts file know this, but seem reluctant to fix it. I understand that a large hosts file is a popular feature in ROMs, but not when it breaks apps.
If anyone shares my concern, there is an easy way to fix this. The way I'm going to get around it for now is to first download (if you haven't already) adb. Then run
Code:
adb pull /etc/hosts
which pulls it to the local folder. Open the file in notepad, wipe it clean (or remove the hulu advertisers, if anyone can advise on what they are, I would appreciate that so I can have a nice hosts file). Save the file, then run
Code:
adb remount
followed by
Code:
adb push hosts /etc/hosts
You should now be able to watch Hulu on your Sensation with a custom ROM.
(x-posted from a Sensation ROM thread because I know it will get lost there. Posted here for posterity when people have the question)

Categories

Resources