AdFree manual hosts installation


  1. Pioneer161

    Pioneer161 Active Member

    I've looked at several threads on different forums and none quite solve the issue I am having.

    I have a rooted Desire (which took a while and wasn't successful following any guide, but I got it) using unrEVOked 3.21 and am trying to use AdFree on Froyo 2.2 but I am told that the hosts file I need to block ads cannot be written to /system while Android is running. I did some searching but, alas, no luck on an answer.

    I also got Root Explorer off the market (which cannot simply copy the hosts file into /system/etc/ as it does not have access whilst Android is running) and I think the command prompt I need is the pc cmd prompt when the device is plugged into USB.

    I got the Android SDK with adb and made progress, but still stumped.
    I connect the Desire to the PC and with the Desire in recovery mode with ClockworkMod I run adb with:

    Code (Text):
    1.  
    2. adb shell
    3. # mount /system
    4. # exit
    5. adb push hosts /system/etc
    6. adb reboot
    7.  
    Following the example from here but it's a different device and dunno what to put for the first argument in '# mount /dev/block/mtdblock4 /system'. Any help at all would be much appreciated.

    Advertisement
    :
  2. SUroot

    SUroot Well-Known Member Developer

    You cant edit /system whilst android is running if you are not s-off.

    There is an option to symbolically link to /data though. If you are s-on, do that
  3. Pioneer161

    Pioneer161 Active Member

    You may have to elaborate a bit, the phrase s-off is new to me. Do I need an application or add-on to enable it, or is it an option on the device?

    Cheers for the response though.
  4. Pioneer161

    Pioneer161 Active Member

    Actually, I'll describe what I do in AdFree and why I think I need to do it manually.

    I uninstalled it and reinstalled from Market and added it to SU allow list. I tick 'Check for updates' and 'Download and Install Hosts' after it loads a bit it restarts the phone. The hosts file in system/etc/ is still only 127.0.0.1.
  5. SUroot

    SUroot Well-Known Member Developer

    S-off (security flag off) is achieved by flashing a custom alpharev hboot. The security flag that resides in radio nvram that protects the running android system is ignored by this hboot.

    For blocking ads, s-off is over kill. However without it, you are unable to modify anything in the system directory whilst android is running.

    Like I said earlier though, you just need to tick the symlink to /data tick box. This bypasses system all together so no need for s-off
    Pioneer161 likes this.
  6. Pioneer161

    Pioneer161 Active Member

    Thanks for another response!

    I have 'Check for updates' and 'symlink from data/data/hosts' and it reports that all is up to date, however I still see ads in apps. If this is indeed intentional, is there a way to hide ads in apps?

    Oh and additional, in HBOOT it is set to s-on. I am going to attempt to redo the root process and get s-off, or if you can recommend an easier way, I'd be happy to listen.
  7. SUroot

    SUroot Well-Known Member Developer

    It should work. Have you done symlink then downloaded manually via the button since doing ths symlink? Then reboot? definitely the same?

    Are you on a CDMA (no sim card) or GSM (sim card) desire?
  8. GrenW

    GrenW Well-Known Member

    The symlink does work with S-ON but I have found that the app doesn't block all ads. A lot of the time you just see the 'revolving circle' symbol where the ad should be but sometimes they do creep through. It all depends on whether the ip address of the ad site is in the hosts file downloaded
  9. Pioneer161

    Pioneer161 Active Member

    Ok, made some progress. My issue was that I need UnrEVOked Forever flashed to get s-off which will let me alter /system but have another issue.

    I have a standard HTC Desire with 2.2 Froyo, and when flashing Forever, I get:

    Now I am fairly sure this should work, the Desire's been rooted before. Any ideas?

    I have a SIM, so GSM. And I feel like I have just figured out why this won't work until they fix it...

    Thanks for the help thus far too!
  10. Pioneer161

    Pioneer161 Active Member

    Maybe all is not lost, but maybe there's still an issue. Apparently you can flash a new hosts file from a .zip.

    I was sent /hosts/ which contains an up to date hosts file, and it said it installed successfully but the hosts in /system/etc is still 127.0.0.1...
  11. SUroot

    SUroot Well-Known Member Developer


    See, if you answered my question before you started doing things, i would have saved you time :)

    Unrevoked does not S-Off GSM desires. only AlphaRev 1.8 will.

    However, like Gren said, it will not block every advert. Only whats in the file.

    Now before you do ANYTHING, please confirm you have done what I said in my last post.
  12. SUroot

    SUroot Well-Known Member Developer


    Can you copy the text from the hosts file please, they all always start 127.0.0.1. Are you sure you understand what you should be seeing?
  13. Pioneer161

    Pioneer161 Active Member

    Yeah the only thing in the hosts file is 127.0.0.1 localhost. I understand what it is, but it didn't work. I followed what you said earlier, but I was still getting 100% ads in several apps, whilst the hosts file was still only showing localhost.

    Now that I know I cannot get s-off, for now, I was looking for an alternative and found this how to: get Adfree Android working on htc Incredible. :) but it is dated last year.

    In the listed steps, it says to choose 'mount /system' and the others but I was only able to mount /sdcard and it was suggested to format system and data before you can mount it and I wanted to run it past you first. Formatting in the traditional sense is something you don't want to rush into.

    Thanks for your advice, this is being very productive.
  14. SUroot

    SUroot Well-Known Member Developer

    Formatting system does just that, so dont do it or you wont have a rom.

    You used unrevoked, so you have clockwork mod recovery.

    Out of interest, can you please download terminal emulator from the market.

    Open Terminal emulator and type:

    cat /proc/mtd

    ...and press enter...


    Let me know the erase size pelase
  15. Pioneer161

    Pioneer161 Active Member

    I downloaded the app, but it breaks on open. There's a paid one, but is it that important?

    So if I cannot flash a new hosts file, don't have s-off, and adfree does not work as is and I have a GSM phone, there is buckleys I can do about ads?

    Is there a way using adb? I was using it earlier, but could not mount system.
  16. SUroot

    SUroot Well-Known Member Developer

    You can also type:
    adb shell [enter]
    cat /proc/mtd [enter]

    So you can do it via your pc. I need to find out your erase size (unless you hboot doesnt say PVT4.

    If it says PVT4, this may help me understand why you cant mount system.
  17. Pioneer161

    Pioneer161 Active Member

    Righto will get on it.
    SUroot likes this.
  18. Pioneer161

    Pioneer161 Active Member

    I got:

    dev: size erasesize name
  19. SUroot

    SUroot Well-Known Member Developer

    Dont understand. They're the column headings. Were there no values underneath? it should say either 20,000 or 40,000 and I need to know which.

    Are you doing this with android on or in recovery?
  20. Pioneer161

    Pioneer161 Active Member

    Android is in recovery and I used adb with the command you said. No values.
  21. SUroot

    SUroot Well-Known Member Developer

    Something really dodgy there mate.
  22. Pioneer161

    Pioneer161 Active Member

    What should be listed there exactly? Worst case scenario, I do a system restore. It's a new device and I've only used it the last two days, so nothing is really worth keeping that I can't redo.

    If it's easier to root on a Mac, I'll try that if I do have to restart the process, but I guess I'm not done yet.

    Thanks for your help.
  23. SUroot

    SUroot Well-Known Member Developer

    Under erase size it should either say 20000 ot 40000. It is definitely one of these, it should never be nothing.

    I think you have a serious NAND problem.

    I would want to use an RUU to take it back to stock.

    Have you flashed a custom rom yet or are you still on stock?

    Does it say PVT on the hboot screen?
    Pioneer161 likes this.
  24. Pioneer161

    Pioneer161 Active Member

    Well I do not see a nandroid option when in recovery, unsure if it's even on. But I maybe talking about something utterly unrelated. I'm on stock HTC at the moment, no custom ROM.

    HBOOT screen says:
    BRAVO PVT4 SHIP S-ON
    HBOOT-0.93.0001
    MICROP-051d
    TOUCHPANEL-SYNW0101
    RADIO-5.09.05.30_2
  25. SUroot

    SUroot Well-Known Member Developer

    It is only pvt4 devices are 40000 but not all. Now clockwork mod doesn't work on 40000 so I assume this is the problem.

    Best thing to do is re root and install amon ra instead. See rooting faq. You need to select amon ra before connecting phone
    Pioneer161 likes this.
Loading...

Share This Page