After reading the article
“Moving the MSD time zone to MSK - a new local scale Y2K” - was, to put it mildly, puzzled. Has nobody made any Android patch yet? Thoughtful googling led to confirmation of the information: yes, no patches. There are no updates either. Do what you want - and do it.
Well, actually - and started doing ...
Contradictory information
According to information found on the web, the time zone file on Android is:
- /etc/timezones.db - as stated in the above article;
- /etc/WPDB.zip - found in several forums;
- / system / usr / share / zoneinfo / - again, found in the forums.
Picking up adb, far and other necessary things, he began a mini-study. Total:
- /etc/timezones.db - no. Not time zones. Just a file in SQLite format, containing correspondences of the zone ID and its names in different languages (timezone table) and some metadata in the amount of one piece (android_metadata table);
- /etc/WPDB.zip - time zones. And not only. Inside the archive - 22 files with names a la "WP_0419RUS.db". Files - all the same SQLite. The file contains three tables, in each of which - yes, the names of the country, city and offset from UTC in minutes - but there is no information about winter / summer time;
- / system / usr / share / zoneinfo / - this is what we need. There are three files in the directory: zoneinfo.dat, zoneinfo.idx, zoneinfo.version. But where to take them? ..
Instruments
Briefly, because the “spreading of the cape over the tree” is unlikely to be interesting to anyone.
- The title of zoneinfo.dat was expected: TZif2. I just met it very often in a file;
- zoneinfo.idx suggested that we have a database in front of us - just how to collect it? In my head, idiotic thoughts from the series began to flash: “Deal with the format, write a“ collector ”, taking the necessary time zone files from the home server on FreeBSD as a basis;
In the end, everything turned out to be much easier. After half an hour of persistent search,
a link was
found that had a set of development tools for android, including a shell script that calls zic for a specific set of directories and generates output, and a Java source for actually creating zoneinfo.dat and zoneinfo .idx.
The archive with the data of time zones, to which the script should be set, was found
here .
results
As a result, we get the current time zone files for Android, it remains to upload them to the device. Alas, the update does not threaten users without root access to the phone.
Update options - two.
- Via ADB (Android Debug Bridge, part of the Android SDK);
- Via custom recovery, which allows installing ZIP files from the root of the SD card (I have installed CWM-AlphaRev Recovery)
Update via ADB
I suppose that with basic knowledge of adb: what it is, how to use it, where to get it - you are familiar. If not, then
here is the first link found on the go, studying ...
- Download the archive with the new time zones;
- We unpack archive somewhere more conveniently. For example, in c: \ Temp \ tz \;
- Run adb shell, verify that the / dev / block / mtdblock3 partition is mounted to / system:
# mount|grep system
mount|grep system
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
- Mount the / system partition in the RW mode (if no mtdblock3 is mounted to the / system, replace the value with your own):
su
mount -rw -o remount /dev/block/mtdblock3 /system
exit
- We upload new time zone files to the device:
adb push c:\Temp\tz\zoneinfo.version /system/usr/share/zoneinfo/zoneinfo.version
adb push c:\Temp\tz\zoneinfo.dat /system/usr/share/zoneinfo/zoneinfo.dat
adb push c:\Temp\tz\zoneinfo.idx /system/usr/share/zoneinfo/zoneinfo.idx
- Reboot the device.
Update via custom recovery using the example of CWM-AlphaRev Recovery
Description refers to HTC Desire A8181; on phones of other models, the process of entering recovery may be slightly different.
- Download the archive with the update of time zones ;
- We put the file in the root of the SD card of the device;
- We are entering Recovery: when the phone is off (owners of Android 2.3.x phones - before turning off the device, check that the menu item Settings - Applications - Fast Download is disabled!), Press and hold the "turn down volume" button, press the power button;
- In the menu that appears, use the volume keys to select the Recovery menu item, confirm the selection with the power button; the phone boots in recovery mode;
- Sequentially select the menu items (confirmation - by pressing the optical joystick):
-install zip from sdcard
-choose zip from sdcard
- zip
- File system navigation appears. Select the file timezone2011i.zip, which we downloaded there;
- We confirm the desire to install the selected file;
- After the installation process is completed, using the “back” key, we go two levels higher, select the reboot menu item. The phone will restart normally, the update is installed.
On this, perhaps, everything. Comments, corrections, additions - are welcome.