- Nov 13, 2010
- 24
- 11
Update: http://www.miui-dev.com/forums/show...ith-MIUI-Weather&p=31797&viewfull=1#post31797
I'm not sure which section to put this in, but I've been trying a few things with MIUI weather to workaround the China-weather-only issue. I don't know if anybody's done anything like this yet and whether it was successful or not...but here goes anyway.
Here's what I've done:
Now, retrieving weather data yields this (screenshots):
http://miui-dev.com/forums/attachment.php?attachmentid=822&stc=1&d=1296991893
http://miui-dev.com/forums/attachment.php?attachmentid=823&stc=1&d=1296992375
You should be able to see how all of the values have changed to nonsense, as a proof of concept. All of the weather information is in accordance with this JSON data:
Quick Ideas
Potential problems for this workaround:
I'm kind of tired right now so a lot of this may have been incoherent and meaningless, but if anybody's interested in helping at all or if there's any advice for me, I'll gladly take it. Also, if any of you know for sure that this is a DEAD END EFFORT then please tell me
Where I got all of my information: http://www.google.com/webhp#hl=en&s...A&q="miui_city.db"&nfpr=1&fp=ac5229e2e8efe107
I'm not sure which section to put this in, but I've been trying a few things with MIUI weather to workaround the China-weather-only issue. I don't know if anybody's done anything like this yet and whether it was successful or not...but here goes anyway.
Here's what I've done:
- Sniffed out the url (http://www.miui.com/weather.api.php?city=101010100) at which the weather app grabs its weather data for Beijing.
- Redirected "miui.com" to to point to the IP of a server I am hosting using /system/etc/hosts on my device
- Served a bunch of JSON encoded weather data (copy pasted with some values changed as proof of concept) from my server
Now, retrieving weather data yields this (screenshots):
http://miui-dev.com/forums/attachment.php?attachmentid=822&stc=1&d=1296991893
http://miui-dev.com/forums/attachment.php?attachmentid=823&stc=1&d=1296992375
You should be able to see how all of the values have changed to nonsense, as a proof of concept. All of the weather information is in accordance with this JSON data:
Code:
{
"weatherinfo": {
"weather4": "weather4",
"weather5": "weather5",
"weather6": "weather6",
"date_y": "2011\u5e742\u67086\u65e5",
"weather1": "\u5c0f\u96e8(Rain)",
"weather2": "weather2",
"weather3": "weather3",
"\u9493\u9c7c\u6307\u6570": "chinese 1",
"\u7d2b\u5916\u7ebf\u6307\u6570": "chinese 2",
"sktime": "13:37",
"temp3": "temp3",
"temp2": "temp2",
"temp1": "temp1",
"sktq": "sktq",
"temp6": "temp6",
"temp5": "temp5",
"temp4": "temp4",
"wind3": "wind3",
"\u8fd0\u52a8\u6307\u6570": "chinese 3",
"fx2": "fx2",
"\u611f\u5192\u6307\u6570": "chinese 4",
"st4": "st4",
"\u4ea4\u901a\u6307\u6570": "chinese 5",
"index_ls": "index_ls",
"jrrc": "13:38",
"fl1": "fl1",
"index": "index",
"fl3": "fl3",
"fl2": "fl2",
"fl5": "fl5",
"fl4": "fl4",
"fl6": "fl6",
"cityid": "101010100",
"st5": "st5",
"st6": "st6",
"st1": "st1",
"city_en": "city_en",
"index48": "index48",
"\u667e\u6652\u6307\u6570": "chinese 6",
"fchh": "fchh",
"\u6d17\u8f66\u6307\u6570": "chinese 7",
"week": "week",
"fx": "fx",
"\u901b\u8857\u6307\u6570": "chinese 8",
"\u7ea6\u4f1a\u6307\u6570": "chinese 9",
"st2": "st2",
"city": "city",
"index_xc": "index_xc",
"index_co": "index_co",
"index_cl": "index_cl",
"st3": "st3",
"\u8212\u9002\u5ea6\u6307\u6570": "chinese 10",
"\u5212\u8239\u6307\u6570": "chinese 11",
"\u7f8e\u53d1\u6307\u6570": "chinese 12",
"\u65c5\u6e38\u6307\u6570": "chinese 13",
"mrrl": "13:39",
"\u5316\u5986\u6307\u6570": "chinese 14",
"\u6668\u7ec3\u6307\u6570": "chinese 15",
"\u8def\u51b5\u6307\u6570": "chinese 16",
"date": "date",
"wind2": "wind2",
"wind1": "wind1",
"fl": "fl",
"wind6": "wind6",
"wind5": "wind5",
"wind4": "wind4",
"mrrc": "13:40",
"\u7a7f\u8863\u6307\u6570": "chinese 17",
"\u7a7a\u6c14\u6c61\u67d3\u6269\u6563\u6761\u4ef6\u6307\u6570": "chinese 18",
"\u96e8\u4f1e\u6307\u6570": "chinese 19",
"fx1": "fx1",
"\u591c\u751f\u6d3b\u6307\u6570": "chinese 20",
"index_tr": "index_tr",
"index48_uv": "index48_uv",
"pubtime": "2011-01-01 13:41",
"index_uv": "index_uv",
"jrrl": "13:42"
}
}
Quick Ideas
- I can replace city codes and city data in the "miui_city.db" in the apk so that the query string to whatever server is hosting the data can serve the weather info for the user's chosen city.
- I should be able to fetch weather data off another source and translate it into a readable JSON form (in the codeblock above) so that the weather app can read it.
- Is there a better way to redirect 'miui.com' to an IP of my choice than using the hosts file? Is there a way to overwrite it in the apk? Is decompiling an option?
Potential problems for this workaround:
- The weather animation changes in accordance with the weather data, but it's matching against a Chinese string, so serving weather data in English won't trigger the correct animation. In the first screenshot, I got the rain animation to show by including, in the string, 2 Chinese characters which mean 'rain'.
- If using hosts redirection, anything else that points to miui.com won't function unless I pull off some fancy redirection using my server
- My server is hosted on a dynamic IP and as such I can't do a permanent redirection for anybody else.
I'm kind of tired right now so a lot of this may have been incoherent and meaningless, but if anybody's interested in helping at all or if there's any advice for me, I'll gladly take it. Also, if any of you know for sure that this is a DEAD END EFFORT then please tell me
Where I got all of my information: http://www.google.com/webhp#hl=en&s...A&q="miui_city.db"&nfpr=1&fp=ac5229e2e8efe107