Note: This app was converted with AI from the original python/kivy app at https://codeberg.org/vanous/huafetcher.
Huafetcher is a modern Android application written in Kotlin and Jetpack Compose for Amazfit, Xiaomi, and Huami wearable devices. It fetches device authentication keys (for companion apps such as Gadgetbridge) and downloads/packages aGPS satellite data to speed up GPS fixes on your smartwatch or fitness band.
- Device Auth Key Retrieval: Obtain MAC addresses and unique device
auth_keyvalues for pairing Amazfit and Xiaomi wearables with third-party tools like Gadgetbridge. - aGPS Ephemeris & Almanac Downloader: Download satellite data packs from Huami servers:
cep_1week.zip&cep_7days.zip(GPS CEP)lle_1week.zip(LLE / Long-term Orbit)cep_pak.binepo.zip(EPO)lto.zip(LTO)
- aGPS Binary Packager (
aGPS_UIHH.bin): Automatically unpacks, verifies CRC32 checksums, and compiles component almanac files (gps_alm.bin,gln_alm.bin,lle_*.lle) into standardaGPS_UIHH.binandgps_uihh.binbinaries with customUIHHheaders. - Dual Authentication Modes:
- Amazfit Account: Direct email and password login.
- Xiaomi / Mi Account: Built-in WebView OAuth authorization flow.
- Flexible Data Storage:
- Store generated files in External App Storage, Public Downloads, or Internal App Storage.
- Custom folder name configuration.
- One-click file cleaning and folder management.
- First-Start Wizard & Quick Setup: Guided onboarding workflow for first-time users to set up login credentials, preferred export files, and storage locations.
- Language: Kotlin
- UI Framework: Jetpack Compose with Material Design 3
- Architecture: MVVM (Model-View-ViewModel) with StateFlow
- Networking: OkHttp3
- Data Persistence: Android SharedPreferences (
PreferencesManager) - Binary & ZIP Processing:
java.util.zip(ZipInputStream, CRC32), Little-Endian binary packaging
- Android Studio Ladybug or later
- JDK 17+
- Android SDK (API 26+)
- Clone the repository:
git clone <repository-url>
- Open the project in Android Studio.
- Build the debug APK using Gradle:
gradle assembleDebug
- Install on your Android device or emulator:
gradle installDebug
- Initial Setup: On first run, complete the First-Start Setup Wizard to configure your login method (Amazfit or Xiaomi Account) and select storage preferences.
- Fetch Auth Keys: On the main dashboard, tap Fetch Auth Keys to retrieve your connected wearable device's MAC address and key.
- Fetch aGPS Data: Tap Fetch aGPS Data to download the latest satellite data packs.
- Build aGPS_UIHH.bin: Tap Pack UIHH File to synthesize component almanac packs into a ready-to-flash
aGPS_UIHH.bin. - Export & Share: Share or export generated files directly to Gadgetbridge or your filesystem.
Converted with AI from the original Python/Kivy Huafetcher project by vanous:
- Original Repository: https://codeberg.org/vanous/huafetcher