1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-05 04:21:35 +02:00
Commit Graph

417 Commits

Author SHA1 Message Date
Andreas Shimokawa
34b4943918 Also export and import device specific preference files 2019-05-09 14:55:37 +02:00
Andreas Shimokawa
41e607ce9b Amazfit Cor 2: Give own device type id, support flashing the firmware **UNTESTED** 2019-05-09 12:42:59 +02:00
Andreas Shimokawa
2dc228029a Mi Band 3: Whitelist FW 2.3.0.28 2019-05-09 11:28:24 +02:00
Andreas Shimokawa
f7fe3a836f Mi Band 3: Support flashing latest Japanese-Korean font file
This increases the supported file size to 2.0MB.
Somehow it is confusing that the new file is version 1 and the old version 2.
Also according to firmare.json both are version 1....
2019-05-07 11:13:48 +02:00
Andreas Shimokawa
0399bc048c Mi Band 3: Whitelist Firmware 2.3.0.6 2019-05-07 10:43:26 +02:00
Andreas Shimokawa
db48707764 Add a device specific settings activity, currently used for setting the auth key for Amazfit Bip/Cor
When connecting to a new device, a random key gets generated, which can be
looked up from the device specific settings (accessible via the gear icon in
the device card in the main activity). Old devices keep their 0123456789@ABCDE
key, they have to be re-paired to change that.
During pairing, long-pressing the device candidate in the discovery activity
will also start the device specific settings activity, where the auth key
can be set manually priror to pairing. This is usefull to keep the ability to
pair one device with multiple android devices.

Fixes #1308
2019-04-21 21:25:33 +02:00
License Bot
9aadb2f2fd Update license headers 2019-04-21 18:53:10 +02:00
Andreas Shimokawa
665b1b6b5a Bip: whitelist FW 1.1.5.16
Closes #1459
2019-03-17 18:26:47 +01:00
cpfeiffer
c9f1c110b0 Merge remote-tracking branch 'github/pr/1292' 2019-03-04 22:10:23 +01:00
cpfeiffer
8d6a9d98da Silence lgtm error messages
If the index would indeed be out of bounds, we would simply catch the exception and deal with that.
2019-02-27 20:52:16 +01:00
Sebastian Kranz
6a04c78b0e Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into zetime 2019-02-20 14:24:59 +01:00
Sebastian Kranz
a7553188f9 Reading the device preferences from the watch and set them in the ZeTime menu. 2019-02-20 14:09:21 +01:00
License Bot
8e4be724e1 Update license headers (fix duplicates) and contributors list 2019-02-13 21:01:14 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
Andreas Shimokawa
c66fade081 Amazfit Bip: Support disconnect notifications
Might also work with Cor, did not work with Mi Band 3
2019-02-13 13:06:42 +01:00
Andreas Shimokawa
095b2f53e5 Mi Band 3: Whitelist Firmware 2.3.0.2 2019-02-11 23:01:28 +01:00
Andreas Shimokawa
55f1dcc57b Amazfit Bip: Whitelist FW 1.1.5.12 2019-02-10 23:09:34 +01:00
Andreas Shimokawa
dad7ba7aaa Mi Band 3: Enable fetching sports activities and add "Exercise" type to generic code 2019-01-28 00:22:11 +01:00
Daniele Gobbetti
75d3dffb14 Migrate to androidx support libraries and bump compile SDK version
"Optimize imports" has been run on all source files, there might be
unrelated changes, but these should be harmless.
2019-01-26 16:00:56 +01:00
Andreas Shimokawa
4060efeeca Mi Band 3: Whitelist Firmware 2.2.0.42 2019-01-21 23:01:15 +01:00
cpfeiffer
903b50c2c5 Improved DB-based alarms
- got rid of GBAlarm
- added migration for prefs-based alarms
- various cleanups
2019-01-07 01:15:49 +01:00
Matthieu Baerts
c845e16cfa amazfitbit support: fix typo
senderOrTiltle -> senderOrTitle
2018-12-23 12:52:49 +01:00
Daniele Gobbetti
87d41bf09f Amazfit Cor: Whitelist firmware 1.7.20 and res 69 (stable) 2018-12-19 20:33:41 +01:00
Andreas Shimokawa
0e6c0e8926 Mi Band 3: Whitelist FW 2.2.0.14
Closes #1365
2018-12-16 16:11:43 +01:00
Andreas Shimokawa
b020d59f54 Implement factory reset feature in debug activity
Implemented for Mi Band 1/2/3, Cor, Bip

Could be implemented for Pebble by deleting all blobdbs etc

Related to #109
2018-12-16 16:06:12 +01:00
Andreas Shimokawa
29a5878d22 Mi Band 3: Whitelist FW 2.2.0.12
Closes #1353
2018-12-09 17:55:29 +01:00
Andreas Shimokawa
983bc606a4 Amazfit Bip: Allow flashing latest (beta?) GPS firmware
Closes #1358
2018-12-09 17:26:56 +01:00
Andreas Shimokawa
740cf103f6 Initial support for per-device alarms and raising the number of available alarms
TODO:
- Fix alarm widget (how can we get the deviceId?)
- Get rid of GBAlarm in favour of DAO generated Alarm class
- Find better defaults
- Bonus: migrate old preferece based shared settings
2018-11-24 12:16:47 +01:00
Andreas Shimokawa
d6a06d0c16 Amazfit Bip: Whitelist Firmware 1.1.5.04
Closes #1333
2018-11-13 19:34:03 +01:00
Andreas Shimokawa
3207d32818 Amazfit Bip: Whitelist Firmware 1.1.5.02 2018-11-08 17:53:24 +01:00
Andreas Shimokawa
3f062e5732 Amazfit Bip: Attempt fixing GPS tracks recorded with latest firmware 2018-11-08 17:13:00 +01:00
Andreas Shimokawa
8b3ba38344 Mi Band 3: Whitelist FW 2.0.0.4 2018-11-08 07:12:49 +01:00
cpfeiffer
5644ae5925 Display measured hr value in Debug activity + cleanup
Fixes #1320
2018-11-05 23:27:29 +01:00
Andreas Shimokawa
61872b7bbd Mi Band 3/Amazfit Bip/Amazfit Cor: Send Fahrenheit if units are set to imperial
Closes #1315
2018-11-03 20:44:30 +01:00
cpfeiffer
effffddd8d fixed lgtm warnings 2018-11-02 00:09:30 +01:00
cpfeiffer
7e9a9ca875 Added a TODO 2018-11-01 22:05:38 +01:00
cpfeiffer
435898ebc9 Move MiBand3-ism to MiBand3Support 2018-11-01 22:05:38 +01:00
Andreas Shimokawa
dde8a5044f Mi Band 3: Whitelist FW 1.8.0.0 2018-10-28 15:32:57 +01:00
Andreas Shimokawa
b1b318a18b Amazfit Bip: Allow flashing latest gps firmware from Mi Fit 3.5.1.1 (Mili_dth.gps)
This file seems to be for the Bip2, but firmwares.json also refereces this for the Bip.
And it seems to work.
2018-09-23 12:02:34 +02:00
cpfeiffer
6d4d92fd88 Live Activity: don't enable notifications every second
This caused the BLE queue to fill up more and more.
2018-09-17 23:02:18 +02:00
cpfeiffer
934f36f45a Use ActivityUser.defaultUserStepsGoal instead of hardcoded values
ActivityUser has room for improvement, though.
2018-09-16 20:49:00 +02:00
cpfeiffer
f9e600d369 Deduplicate code 2018-09-15 22:38:20 +02:00
cpfeiffer
d6f5e36e12 Huami devices: Fix seldom fetch failures (better support for app level ble feedback)
Fixes #1264
2018-09-15 22:24:27 +02:00
cpfeiffer
b6d68207cb Don't store the live step values in the db 2018-09-11 23:26:51 +02:00
Andreas Shimokawa
59ddedcf9a Mi Band 3: Whitelist FW 1.6.0.16 2018-09-11 21:35:30 +02:00
Andreas Shimokawa
6644ad0bb0 Mi Band 3: Allow enabling the "Workout" menu item
(This is called "Activity" in Gadgetbridge, since we have that on the Bip, we should probably rename that to Workout also for consistency with the menus)
2018-09-11 21:32:13 +02:00
Daniele Gobbetti
3e989cd89a Amazfit Cor: Whitelist FW 1.2.5.00 and RES 2018-08-29 21:33:38 +02:00
License Bot
696653eabf Update contributors list and license headers. 2018-08-29 21:30:23 +02:00
Andreas Shimokawa
b8c7bb2c2e Amazfit Bip: whitelist firmware 1.1.2.05 2018-08-28 22:19:53 +02:00
Andreas Shimokawa
13ff40c7a5 Mi Band 3: Whitelist some firmware version I tested 2018-08-28 22:10:58 +02:00
José Rebelo
9fda67b297 Mi Band 3: Night Mode 2018-08-27 22:54:37 +02:00
Andreas Shimokawa
ffc6bd5a73 Mi Band 3: Also fix diplay of SMS and EMAIL
We have to send a fake app source that is never displayed to make the text appear... :P
2018-08-19 00:51:04 +02:00
Andreas Shimokawa
3d70314e8c Mi Band 3: Fix messages not being displayed (send app source with notifications and use chunked characteristics where available)
This also sends the app name for Bip and Cor, which is actually displayed when there is no icon (unknown app for the device)

Fixes #1203
2018-08-19 00:35:50 +02:00
Andreas Shimokawa
c81965b88d Mi Band 3: Raise limit of RES files to 150000 bytes
Fixes #1223
2018-08-18 23:02:36 +02:00
cpfeiffer
50295864f5 Use a custom IntentListener callback instead of LocalBroadcastManager for ble profiles
The issue here is the following:

- we used intents in the generic BleProfile classes to notify about the results of e.g. certain read requests
- we used to send these results asynchronously via LocalBroadcastManager.sendBroadcast(), which always used the main thread for sending
- however, we noticed that reconnecting to devices sometimes failed because the results arrived too late and the next action in the BLE queue lacked the necessary information
- the fix was to use LocalBroadcastManager.setBroadcastSync(), so that the results arrive in time
- this unfortunately meant that they were not sent in the main thread anymore, and especially, this would send all pending intents that were previously queued via sendBroadcast() also in the "wrong" thread (in order to keep the order of events)

The fix is to use a custom IntentListener callback interface for synchronous notifications of ble profile results
*without* also causing other, previously queued intents to be sent.

Fixes #1218
2018-08-18 00:39:14 +02:00
cpfeiffer
f96b10cca0 Avoid potential NPE 2018-08-17 00:19:10 +02:00
Andreas Shimokawa
74f47c8e2e Mi Band 3: Support setting language to German, Italian, French, Polish, Japanese, Korean
NOTE:
- Needs latest firmware
- Setting to Japanese or Korean leads to empty menus on the device. When
  reconnecting you, will get a sceen which telling you to update. I highly
  suspect it requires flashing Mili_wuhan.ft.kj (kj=korean,japanese)
2018-08-13 00:00:46 +02:00
Andreas Shimokawa
3bb75a62be Mi Band 3: whitelist tested firmwares 2018-08-12 00:28:27 +02:00
Andreas Shimokawa
b48b52b175 Mi Band 3: Make order of menu items on screen deterministic again
(This partly reverts the logic of the previous commit)
2018-08-12 00:16:56 +02:00
José Rebelo
470efa3e51 Mi Band 3: Change display items 2018-08-12 00:00:38 +02:00
José Rebelo
338251597b Mi Band 3: Band screen unlock 2018-08-09 23:41:25 +02:00
Daniele Gobbetti
797a671ccd Amazfit Cor: only send music information when needed 2018-08-08 17:48:23 +02:00
Andreas Shimokawa
da58e22afe Only start MusicPlaybackReceiver if device supports music info
Also block sending music info in HuamiSupport if device does not support it
2018-08-07 12:44:00 +02:00
Daniele Gobbetti
3fac021ff2 Amazfit Cor: implement basic music controls
Play/pause and skip to previous/next song work. The currently playing song
name is shown on the Cor. The track length and progress are now shown as
we don't know how to send these yet.
2018-08-06 23:11:40 +02:00
cpfeiffer
ec0d62f67b If firmwareRevision is null, use softwareRevision 2018-08-06 20:26:39 +02:00
cpfeiffer
f7c9828cc1 Avoid potential NPE 2018-08-06 20:22:10 +02:00
Andreas Shimokawa
88714ece4d Amazfit Bip: fix current weather not being displayed with latest firmware 2018-08-05 15:27:28 +02:00
cpfeiffer
5bca05caac Fix loop condition! 2018-08-04 23:10:11 +02:00
Andreas Shimokawa
fe401bdcf5 Amazfit Cor: allow music control 2018-08-02 22:35:02 +02:00
Andreas Shimokawa
66391e10c9 Amazfit Cor: Allow to enable music menu on device 2018-08-02 22:29:52 +02:00
Andreas Shimokawa
cc7f6d7263 More Huami refactoring
- Rename MiBand2Service to HuamiService
- Move preferences around (Mi Band 2 has its own device specific settings now)
- Fix Cor menu items not syncing immediately in settings
- Try to support settings menu items on Mi Band 3 (buggy, disabled code for now)
2018-08-02 10:55:30 +02:00
Andreas Shimokawa
f464604b27 Amazfit Cor: Fix notification menu not being enabled 2018-08-01 23:13:36 +02:00
Andreas Shimokawa
486d7bdca6 Amazfit Cor: Allow setting menu items
(Also rename/refactor stuff from Mi Band 2 to Huami - still WIP)
2018-08-01 22:56:01 +02:00
cpfeiffer
16fb1a584d Errors during activity track timestamp fixup should be non-fatal
So just log them. #1134
2018-08-01 19:49:09 +02:00
cpfeiffer
7f1c0521ea Small fixes to activity point timestamp fixup 2018-08-01 19:33:33 +02:00
szilardx
14a086c1f3 Add missing ActivityPoints and timestamp 2018-08-01 19:33:33 +02:00
Daniele Gobbetti
2da6749a40 Add activity kind (if known) to gpx filename
Fixes #1161
2018-07-22 16:14:36 +02:00
Andreas Shimokawa
e96dcc69ab Amazfit Bip: try to support weather in newer firmwares 2018-07-21 17:18:08 +02:00
Andreas Shimokawa
d1253348dc Mi Band 3: whitelist tested firmware, res and font 2018-07-19 12:00:17 +02:00
Andreas Shimokawa
eef38d4680 Only use 0x00 as auth flags on Mi Band 3 - to not disturb other devices 2018-07-17 00:29:36 +02:00
Andreas Shimokawa
aa143577f8 Amazfit Cor: Support language switching on newer firmwares
I shamelessly assumed the firmware version (chose the version that was included in the same Mi Fit version when bip started to support the new command)
2018-07-16 15:18:46 +02:00
Andreas Shimokawa
f2aa71e32c Amazfit Bip: Support Russian language.
Closes #1145
2018-07-16 14:36:52 +02:00
Andreas Shimokawa
46f3686764 Mi Band 3: Also send AQI for weather to make current temperature appear 2018-07-16 14:19:02 +02:00
Andreas Shimokawa
3236e20657 Amazfit Bip/Cor: rework fimware detection to rely on strings instead of version numbers
The new version scheme and the fact that recent Bip and Cor firmwares are
impossible to distinguish by comparing data at fixed offsets make it necessary
to dynamically search for sequences of data. We do this now by searching for
"Amazfit Bip Watch" and "Amazfit Cor".
2018-07-08 12:16:26 +02:00
Andreas Shimokawa
6e34d313c7 Mi Band 3: allow setting language (english and spanish work) 2018-07-04 23:32:35 +02:00
Andreas Shimokawa
a3e22d573f Amazfit Bip: Whitelist FW 1.0.2.00 2018-07-01 23:26:03 +02:00
Andreas Shimokawa
d1cba54425 Mi Band 3: Allow flashing fonts (untested) 2018-07-01 22:41:37 +02:00
Andreas Shimokawa
9303214997 Amazfit Cor: allow flashing fonts (seem to be the same as for bip, untested) 2018-06-30 00:32:29 +02:00
Andreas Shimokawa
87f9424ee3 Amazfit Bip: allow flashing latest beta firmware 2018-06-29 23:04:38 +02:00
Andreas Shimokawa
49a5f349b0 Amazfit Cor: Whitelist FW 1.0.7.88
Closes #1104
2018-06-25 21:37:26 +02:00
License Bot
225a600aed Update license headers 2018-06-25 18:35:46 +02:00
Daniele Gobbetti
f99895da0c Remove activity transfer toast, add title to the transfer notification
Also create a separate channel that allows "muting" transfer notifications
on android oreo and above.
2018-06-19 22:03:49 +02:00
Andreas Shimokawa
9bcae3e000 Amazfit Bip: Whitelist FW 0.1.1.45 2018-06-16 23:35:02 +02:00
Andreas Shimokawa
99dec159f7 Mi Band 3: add untested and incomplete support
This also improves firmware/RES probing to distinguish Mi Band 2/3 firmware files and Mi Band 3/Bip RES files.

Notes:
- Firmware flashing should might but is untested
- This basicall runs off the Amazfit Bip code which will probably incorrect (Mi Band 3 is proabably something between the Bip and the Mi Band 2)
2018-06-14 18:16:49 +02:00
Andreas Shimokawa
f46c204c75 Amazfit Cor: Whilelist FW 1.0.7.52
Closes #1087
2018-05-12 22:20:49 +02:00
Andreas Shimokawa
eb08e66674 Amazfit Cor: make sure that Veats firwmare does not get detected as a Cor firmware... 2018-05-12 00:15:14 +02:00
Andreas Shimokawa
746cb00460 Amazfit Cor: Fix recogition of new firmwares
Newer Cor and Bip firmwares seem to be indistinguishable,
What we do for now is use the version we already search for say
Bip firmwares are valid from 0.0.8.00 to < 1.0.5.00 (lastest as of today is 0.1.0.39)
Cor firmwares are valid from 1.0.5.00

This should work for a while.
Fixes #1095
2018-05-12 00:05:30 +02:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
Daniele Gobbetti
4f246b3ed9 Add Antox to the chat applications.
Notifications coming from the chat.tox.antox package are treated as chat
messages. This closes #910
2018-02-17 17:39:15 +01:00
Daniele Gobbetti
48b89f1bd2 Add Kontalk to the chat applications.
Notifications coming from the org.kontalk package are treated as chat
messages. This closes #994
2018-02-17 17:33:34 +01:00
Daniele Gobbetti
55d9ff0954 Amazfit Cor: Whitelist firmware 1.0.6.76
Reported as working on the issue tracker. Closes #984
2018-02-10 23:36:05 +01:00
Andreas Shimokawa
3871b6f0be Amazfit Cor: Allow watchfaces to be flashed
Untested as Cor has no maintainer
2018-02-01 14:22:18 +01:00
Andreas Shimokawa
f6f4d7ec40 Amazfit Cor: support flashing new res format also on Cor 2018-01-27 21:51:34 +01:00
Andreas Shimokawa
14a6c9a626 Amazfit Bip: support flashing new res, font, and latin font files
Required for firmware 0.1.0.66
2018-01-27 21:41:35 +01:00
Andreas Shimokawa
aca31c320a Amazfit Cor: allow to flash latest firmware 2018-01-13 16:29:48 +01:00
Lukas Veneziano
781359afba Added notification type for business calendar 2018-01-12 21:12:33 +01:00
Lukas Veneziano
6b339a3013 Added notification type for threema app 2017-12-31 00:10:39 +01:00
Andreas Shimokawa
ad750c0047 try to fix cor firmware recognition for newer versions 2017-12-21 09:35:33 +01:00
Andreas Shimokawa
b7b96b5ab5 Amazfit Bip/Cor: for untested installable files, at least display the type (res/font/gps/watchface)
For res the version is also displayed (the same as noted in the wiki)
2017-12-10 20:30:27 +01:00
Andreas Shimokawa
ff93122ddc Amazfit Bip/Cor: parse and display firmware version for unknown versions
Unfortunately that does not work for the Mi Band 2 yet
2017-12-10 11:31:42 +01:00
Andreas Shimokawa
c325ba1a22 Amazfit Bip: show find phone events (not yet supported) 2017-11-19 23:46:58 +01:00
Andreas Shimokawa
e3ca3872e1 Amazfit Bip: Allow watchface flashing and whitelist Firmware 0.0.9.40 2017-11-09 22:05:01 +01:00
Andreas Shimokawa
6b56e8e568 Amazfit Cor: Fix flashing of new .res files 2017-11-06 07:17:01 +01:00
Andreas Shimokawa
94cfaadc41 Amazfit Cor: whitelist latest .res and .fw
Add a note about this being totally untested, especially scary since the new res format is different.
2017-10-25 22:26:38 +02:00
License Bot
3ea2ac6dd2 Update license headers 2017-10-25 09:29:36 +02:00
Andreas Shimokawa
55cdc6d1c5 Amazfit Cor: Untested firmware update support
(refactor stuff along the way)
2017-10-24 22:01:25 +02:00
Andreas Shimokawa
a809ad214d Refactor some common Huami stuff (Mi Band 2 / Bip)
This also fixes a bug where every event from the device (like not worn detection) counted as a button press
2017-10-21 22:50:28 +02:00