maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Blocking ads on N9 (Custom hosts file HOW-TO) (https://talk.maemo.org/showthread.php?t=82180)

cddiede 2012-02-09 15:03

Re: Blocking ads on N9?
 
So I finally cat'ed the spam domains from my old /etc/hosts file onto the end of the one in my N9 after removing the N900 specific line in the old file. Seems to be working without error at least as well as it did on the N900.

Already observed several blank banner ads, but that may be random as I haven't been observing for very long yet.

balisingh 2012-02-09 17:32

Re: Blocking ads on N9?
 
so i does this by bluetoothing hosts file over to my n9. then i gains the devel-su on da terminal. then i moves the hosts file beamed over. mv \home\user\MyDocs\hosts \etc\. this gives me a warning about cant preserve ownership. also i renamed the original file but its not there no more, itsmusta not took.
my slashes maybe backward cuz my bluetooth keyboard is the one for sony playstation and its all jacked up! i think its working.
what text editor should i use on the n9 to add the rm696 line? not vi please.:eek:

jalyst 2012-02-09 20:16

Re: Blocking ads on N9?
 
Quote:

Originally Posted by balisingh (Post 1162560)
why cant we circumvent it?

It is circumvented (w/some possible caveats) read OP of thread I mentioned here:
http://talk.maemo.org/showpost.php?p...2&postcount=11
Worthwhile skimming through the whole thing too....

balisingh 2012-02-10 02:25

Re: Blocking ads on N9?
 
Quote:

Originally Posted by jalyst (Post 1162805)
It is circumvented (w/some possible caveats) read OP of thread I mentioned here:
http://talk.maemo.org/showpost.php?p...2&postcount=11
Worthwhile skimming through the whole thing too....

i read that thread and part of the one that it came from (javis makes good points but i can see Aegis' value). i want to circumvent as in keep the original kernel and work around the security, not circumvent as in remove it completely from the kernel and therefore have to deal with a totally separate kernel.
" Protects sensitive data with encryption and signing, by using a key derived from a hardware-protected device-specific secret." this makes it hard to circumvent too. looks like aegis is too serious of a protection mechanism.

anyways i am happy that i can use a custom hosts file. you cant do that on Android without root.

shmerl 2012-02-10 04:29

Re: Blocking ads on N9?
 
Hopefully Adblock will be supported in XUL mobile Firefox past version 12. But it's not yet clear. See this thread:

https://adblockplus.org/forum/viewtopic.php?f=1&t=9376
https://adblockplus.org/forum/viewto...=9376&start=15

Manatus 2012-02-10 06:23

Re: Blocking ads on N9?
 
Quote:

Originally Posted by balisingh (Post 1162747)
so i does this by bluetoothing hosts file over to my n9. then i gains the devel-su on da terminal. then i moves the hosts file beamed over. mv \home\user\MyDocs\hosts \etc\. this gives me a warning about cant preserve ownership. also i renamed the original file but its not there no more, itsmusta not took.
my slashes maybe backward cuz my bluetooth keyboard is the one for sony playstation and its all jacked up! i think its working.
what text editor should i use on the n9 to add the rm696 line? not vi please.:eek:

You can use Nano for that. Just be careful you don't press enter or edit any of the lines that end with dollar sign (eg. ones that are longer than screen width). Nano can be found in Nokia Market as well as under the one of the utility packs that can be found under developer mode in settings of N9.

It is normal to see ownership preservation warnings when copying from FAT-filesystem (normal user storage area on N9) to linux filesystems (such as /etc has). Privileges should be in order automatically even when it complains a bit.

'ls -l /etc/hosts' should show:
'-rw-r--r-- 1 root root' etc.

If not, it can be fixed with
'chmod ugo+r /etc/hosts'
and after that
'chmod u+w /etc/hosts'

cr0c0 2012-02-10 14:59

Re: Blocking ads on N9?
 
I implemented an ad blocking hosts file. I've tested some of the sites I usually visit, and all the ads are gone.

Here is a step by step guide how to do it easily.

NOTE: This procedure ONLY works if you've rooted the N9 since you need terminal and root access to /etc.

PC part:

1. Download the latest version of the hosts file TO YOUR PC from:
There are a lot of other versions out there, but this one seems to be updated on a regular basis, the latest version is less than a month old.

2. Open the hosts file in Notepad++, or your favorite text editor. Make sure it is a pure text editor, as some will introduce formatting into the file and they will destroy the hosts file contents.

3. Replace the uncommented first line
Quote:

127.0.0.1 localhost
with
Quote:

127.0.0.1 RM696 localhost
This bit seems to be very important on the N9 as others pointed out.

4. Save the new hosts file.

5. Connect the N9 to your PC via USB Mass Storage and copy the new hosts file to it. When you disconnect the N9, the file will be located in
Quote:

/home/user/MyDocs/
N9 part:

6. Open Terminal and gain root access. The default password is rootme.
Quote:

devel-su
7. Rename the original N9 hosts file, and keep it as a backup:
Quote:

mv /etc/hosts /etc/hosts.orig
8. Copy the new hosts file to /etc
Quote:

cp /home/user/MyDocs/hosts /etc/
9. Enjoy a (mostly) ad free browsing experience on the N9. :D As I said, some ads may slip through and eventually your hosts file will become obsolete. Getting a new hosts file every once in a while will fix that.

I am sure there are dozens of ways to accomplish this, and the commands I listed use hard paths. That's so it works no matter which folder the Terminal is opened in.

Morpog 2012-08-09 20:06

Re: Blocking ads on N9 (Custom hosts file HOW-TO)
 
Great stuff, still works on PR1.3.

Hacker 2012-11-29 09:44

Re: Blocking ads on N9 (Custom hosts file HOW-TO)
 
This is fantastic. Every N9 owner should do this! Works with PR 1.3 and the file was updated October 2012, so it's VERY recent. Goodbye ads. Browser loads pages MUCH faster and uses less of your data plan.

vi_ 2012-11-29 12:08

Re: Blocking ads on N9 (Custom hosts file HOW-TO)
 
Easy mode


As root, on device;

Code:

wget -O ~/hosts http://www.mvps.org/winhelp2002/hosts.txt && echo "127.0.0.1 rm696 localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts
***big fat warning. I do not actually have an N9 so I do not know if this will actuall work...it should, it works on an n900.
***this will wipe your hosts file, so if you have put anything custom in there, you will have to re-ad it.


All times are GMT. The time now is 08:07.

vBulletin® Version 3.8.8