Wednesday, December 08, 2010

Properly Removing HTC News and Stocks

This article explains how to properly remove the HTC News and Stocks item from a HTC Desire without causing the Sync Accounts to be messed up. This is a fairly advanced topic, and should not be done without reading this entire article. No warranty of any kind is provided with these instructions, any consequences of you following these directions are yours to bear.

You will need the following tools:
  1. A rooted HTC Desire, or maybe another HTC android device.
  2. ADB, and some knowledge of a linux shell.
  3. SQLite3, and some knowledge of SQL.
  4. Text editor (vim, etc)
Shut down the phone and reboot into recovery mode.

Open a shell, and use ADB to pull the following files.
/data/system/accounts.db
/data/system/sync/accounts.xml

Open accounts.xml in a text editor and remove the News and Stocks entries.





...


Save the file and exit.

Open the sqlite database accounts.db and remove the News and Stocks entries from the accounts table.
sqlite> select * from accounts;
1|News|com.htc.newsreader|
2|Weather|com.htc.sync.provider.weather|
3|Stocks|com.htc.android.Stock|
sqlite> delete from accounts where _id = 1;
sqlite> delete from accounts where _id = 3;
You can also clear the authtokens, grants, and extras tables of related entries. The following is an example of clearing the authtokens table with the accounts_ids from above.
sqlite> delete from authtokens where accounts_id in (1,3);
Exit from SQLite.

Remove the following files from the /system/app directory.
Note: this list also includes the Footprints application.
DCSStock.apk
DCSStock.odex
Stock.apk
Stock.odex
com.htc.StockWidget.apk
com.htc.StockWidget.odex

NewsReader.apk
NewsReader.odex
com.htc.NewsReaderWidget.apk
com.htc.NewsReaderWidget.odex
HtcFootprints.apk
HtcFootprints.odex
HtcFootprintsWidget.apk
HtcFootprintsWidget.odex
Exit the ADB shell and click "reboot" on the phone.