📜 ⬆️ ⬇️

HTC Sense and weather widget - add your city

Today, I’ll tell you how to teach the weather app in HTC Sense to recognize your city. By default, the application knows very few cities, and auto-locating sometimes gives misfires, which is what happened in my case.

WTF? Must be the city of Ukhta.

Well, let's try to help the patient.
First you need to get root access to the device and upload a custom recovery image. This is a separate topic, and I don’t want to touch it here. Read on the example of HTC Desire here and there .
Having rummaged a little in the file system of the patient, we find out that the list of cities is stored in the file /system/etc/WP.zip . We need the file WP_0419RUS.db from this archive (for other locales - by analogy). On closer examination, the file turns out to be nothing more than a SQLite database. Well, take the first autopsy tool (for example, Lita - SQLite Administration Tool ) and find the “locationlist” table. It now remains to add a new entry to the table. The main attribute here is “code” , of the type _||| . The easiest way to copy this field is from the existing city of your region, replacing the city with your own. You can check the correct spelling of the city on accuweather.com .

We pack back our modified file and fill it in the root of the patient's card. Reboot the device in recovery-mode, connect via usb and run adb:

C:\android-sdk\tools\>adb shell
# mount /system
# mount /sdcard
# rm /system/etc/WP.zip
# cp /sdcard/WP.zip /system/etc

It remains only to restart the patient and clear the data of the Weather Provider application.

Now we confidently launch the Weather and find our newly added city. Voila, magic has happened!

Allow me to bow to this, I hope the information will be useful to someone.

PS: If there is an opportunity to check on devices other than Desire, please in the comments.

Update : as prompted by the MainNika user, loading recovery-mode is optional:
In USB debugging mode, you can enter
./adb remount
and / system will be writable
then back
./adb remount

Source: https://habr.com/ru/post/105053/

All Articles