Using AdFree on rooted HTC Legend

Seems the old method no longer works, HTC have been sneaky or something has changed.  When I try and install a new hosts file on my rooted HTC Legend, AdFree fails with an error, and the phone reboots.  This is some form of protection going on in the rom, even thou it’s rooted.

It CAN be done however.  After a bit of digging, I have worked out how.

Some rough instructions from a HTC Incredible and some tweaks for the Legend and it all works.

  1. Search for Adfree Android on the market
  2. Install and run
  3. allow it to download and install new hosts file, it will copy it to your sdcard and try to replace /system/etc/hosts but fail (it should reboot the phone shortly)Phone may reboot, this is fine, don’t worry. if it doesn’t reboot, check your SD card for a file simply named “hosts”. if it’s there, then continue on.
  4. Power off the phone and hold Volume Down and power.
  5. Use volume down to select recovery.
  6. Download and extract this file to your C:\ drive
  7. run recovery-windows.bat
  8. In clockwork recovery trackpad down to “partitions menu” and hit the track pad to select
  9. Select “mount /system”, “mount /sdcard” and “mount /data”
  10. Plug in your usb cord and open a command line on your pc
  11. enter adb shell and type: cp /sdcard/hosts /data/data/hosts (This copies the AdFree hosts file from the SD Card to the /data partition, where it can be edited by AdFree)
  12. mv /system/etc/hosts /system/etc/hosts.bak (This renames the current hosts file, rather than deleting it, should you ever want to remove AdFree and return to the original hosts file)
  13. ln -s /data/data/hosts /system/etc/hosts (This creates a symbolic link, which allows AdFree to edit the hosts file stored in /data while allowing the OS to use the file as if it were stored in /system. You won’t need to reboot into recovery each time you want to update the hosts file!)
  14. Reboot and enjoy.

Thanks to jasonb1985 on AndfroidForums for most of the work here.  I just adapted it slightly and documented it and packaged a couple of files up.

NOTE:  If you want to do stuff like remove the totally useless PDFViewer.apk (now that there is a proper Adobe Reader for Android), you can do it after step 13 before rebooting.

example:

  • cd/system/apps
  • rm PDFViewer.apk
  • rm PDFViewer.odex
  • rm Quickoffice.apk

Removing system apps from Android devices

Just flashed a rooted 2.1 ROM on my HTC here, there were a couple of apps I didn’t want in there taking up space (like the old PDF viewer, now there is a proper Adobe app,  and QuickOffice).

Anyway for the record (and so I can remember how I did it next time), here is how to do it.

1.  Get a root console.   (either use a Terminal Appliction, or use ‘adb shell’ and then ‘su’ with development mode enabled)

2. Type the following commands:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
cd /system/app
rm <uslesscrap>
mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
sync

Then reboot the phone..

Autosports Android App

Posted Version 1.3 of my Autosport Android news application to the Android marketplace.

There is a free ad supported version, and an ad-free paid for version for £0.50p

Get them from the Android Marketplace or use the QR codes below:

Autosports (FREE)

Autosports (FREE)

Autosports (Ad-Free, 0.50p)

Autosports (Ad-Free, 0.50p)

Joystiq Android App

Just uploaded v1.11 of my FREE Joystiq news app for Android 1.5+

It fixes a problem where Joystiq are totally incapable of producing compliant RSS.  I’m now using feeburner as a proxy to fix the non-compliant RSS.

Pick from the following feeds:

  • PS3
  • PSP
  • Wii
  • DS
  • Xbox
  • PC
  • Mobile

Get it in the Android Marketplace, or use the QR Code below.

GamingNews FREE

GamingNews