Modification of the HTC Sense Weather app(version 10.00.1113635) to replace the proprietary AccuWeather API (which requires a paid API key) with Open-Meteo — a completely free, open-source weather API that requires no API key and has no usage limits.
HTC discontinued their AccuWeather API key, breaking the built-in weather app on all HTC devices. This mod restores full weather functionality using free APIs, with no expiration date.
Version 10.00.1113635 works on Android 6+.
Since app requires htc signature to function properly, original signature was copied to modified apk. It means that app cannot be installed without root access.
For example, you can use Magisk module to disable app signature verification.
In my case(HTC M9 Plus, Android 6) installation steps are:
- Download Weather.apk.
- Delete existing weather app folder(in /system/app or /system/priv-app).
- Copy Weather.apk to the /system/app or /system/priv-app and set 0644 permission.
- Reboot and clean data of weather and weather clock widget apps.
- Done
Smali modifications were permormed by Claude AI.
OpenMeteoAdapter.smali— Adapter class that fetches weather data from Open-Meteo and returns AccuWeather-compatible JSON, so all original UI parsing code works unchanged.
b.smali(AccuWeatherJsonParser) — Redirects weather data fetching through the adapter; resolves legacy city codes to lat/lon coordinates via the built-in city databaseb$a.smali(Location Cache) — Replaces AccuWeather geoposition lookup with Open-Meteo timezone API + nearest-city lookup from built-in databaseAccuWeatherOnlineSearchHelper.smali— Replaces AccuWeather city search with Open-Meteo Geocoding APIa.smali(AccuWeatherAddressProvider) — GPS location resolution now uses the adapterb.smali(AddressProviderManager) — Chain logging for location resolution
| API | Purpose | URL |
|---|---|---|
| Open-Meteo Forecast | Current conditions, hourly & daily forecasts | api.open-meteo.com/v1/forecast |
| Open-Meteo Geocoding | City name search | geocoding-api.open-meteo.com/v1/search |
- Current weather conditions — temperature (C/F), humidity, wind speed/direction, visibility, weather icon, feels-like temperature
- 10-day daily forecast — high/low temps, sunrise/sunset, precipitation probability, day/night weather icons
- 12-hour hourly forecast — temperature, weather icon, precipitation probability
- City search — search by name in any language via Open-Meteo Geocoding
- Built-in city database — 3,641 pre-loaded cities with localized names work via lat/lon lookup from the existing
wpdb.zipdatabase - GPS current location — detects nearest city from built-in database + timezone from Open-Meteo
- Weather.com links — clicking weather entries opens the corresponding Weather.com page:
- Current:
weather.com/weather/today/l/{lat},{lon} - Hourly:
weather.com/weather/hourbyhour/l/{lat},{lon} - Daily:
weather.com/weather/tenday/l/{lat},{lon}
- Current:
The key design decision was creating an adapter layer (OpenMeteoAdapter.smali) that translates Open-Meteo API responses into AccuWeather-compatible JSON format. This means:
- All original JSON parsing code in
AccuWeatherJsonParserremains completely untouched - Only the URL construction and HTTP fetch steps were swapped out
- The adapter handles all format translation: WMO weather codes → AccuWeather icon numbers, Celsius ↔ Fahrenheit conversion, timezone offset formatting, etc.
Open-Meteo uses WMO standard weather codes (0-99) while AccuWeather uses proprietary icon numbers (1-44). The adapter maps between them with day/night variants:
| WMO | Condition | AccuWeather (Day/Night) |
|---|---|---|
| 0 | Clear sky | 1 / 33 |
| 1 | Mainly clear | 2 / 34 |
| 2 | Partly cloudy | 3 / 35 |
| 3 | Overcast | 7 |
| 45, 48 | Fog | 11 |
| 51-55 | Drizzle | 12, 18 / 39 |
| 61-65 | Rain | 12, 18 / 39 |
| 71-77 | Snow | 22 |
| 80-82 | Rain showers | 12, 18 / 39 |
| 95-99 | Thunderstorm | 15 / 42 |
The original app used AccuWeather's proprietary location IDs (e.g., 328328 for London). The mod replaces this with a "lat,lon" string format (e.g., "51.508,-0.126"). This flows through the entire system:
- City search returns
"lat,lon"as the location code - Built-in database cities are resolved from legacy codes (e.g.,
EUR|UK|UK124|LONDON) to"lat,lon"via thelocationlistcontent provider - GPS detection uses the nearest city from the built-in 3,641-city database
- Weather URLs use lat/lon directly — no intermediate location ID needed
Older HTC devices have outdated SSL certificates that can't verify Let's Encrypt (used by Open-Meteo). The adapter uses HTTP instead of HTTPS for API calls. This is acceptable because:
- Weather data is not sensitive
- The app runs on a local device (not a server)
- Browser handles HTTPS fine for the Weather.com links
The adapter uses its own HttpURLConnection implementation instead of the app's built-in f.a() utility, which failed for non-AccuWeather domains. Features:
- 10-second connect/read timeouts
- Custom User-Agent header
- Proper error handling with retry logic
Requires APKTool:
java -jar apktool.jar b -c -f "Weather" -o "Weather.apk"The -c flag preserves the original AndroidManifest.xml.
- Open-Meteo — Free weather API (no key required, open source)
- Weather.com — Weather web pages for click-through links