This is a workaround for the Withings Health Mate battery drain issue described at:
- https://support.withings.com/hc/en-us/community/posts/19853868979857-Battery-drain-with-Withings-App-version-6-1-0
- https://www.reddit.com/r/withings/comments/18k9mii/details_on_android_battery_drain_issue_with/
- You'll need to uninstall the existing Withings app, meaning you'll lose any permission settings and will need to login again.
- Google OAuth won't work, so you'll need to sign in with your Withings username/password.
- If/when Withings fixes this, you'll need to manually uninstall your patched version (it won't auto-update).
- On ScanWatch 2, some of these notifications won't be displayed on your watch. That would require a proper fix which is more complicated. This behavior is identical to the 6.0 app though.
- Ideally use Linux or install WSL
- Install latest apktool
- Install other required tools:
sudo apt install patch apksigner zipalign
- Create a dummy java keystore if you don't already have one:
keytool -genkey -v -keystore my-release-key.keystore -alias my_alias -keyalg RSA -keysize 2048 -validity 10000
- Download the latest Withings Health Mate APK (not a xapk / bundle)
- Rename file to
com.withings.wiscale2.apk
- Run
apktool d com.withings.wiscale2.apk
- Find the smalli file containing
DeviceImageFactory.java
(it will be a different filename in each release due to obfusciation):
$ grep -rFl DeviceImageFactory.java com.withings.wiscale2
com.withings.wiscale2/smali_classes3/tj/b.smali
- Patch this file with the attached patch:
patch com.withings.wiscale2/smali_classes3/tj/b.smali < DeviceImageFactory.patch
- Rebuild the APK:
apktool b com.withings.wiscale2
- zipalign and sign the APK:
zipalign -f -p 4 com.withings.wiscale2/dist/com.withings.wiscale2.apk healthmate_patched.apk
apksigner sign --ks my-release-key.keystore healthmate_patched.apk
You will need to explicitly uninstall the stock Withings app since the signing keys are different. You can perform this step from the command line with adb
if USB Debugging is enabled.
adb uninstall com.withings.wiscale2
adb install --user 0 healthmatch_patched.apk
You may want to disable auto-updates of the Withings app from the app store as well, although they will all fail due to the different signing keys. If Withings releases a 6.3 version that still has the bug, you can patch and upgrade directly without needing to uninstall your 6.1 or 6.2 patched version.