1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-08-26 01:00:52 +02:00

Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into fossil-q-hybrid

This commit is contained in:
Daniel Dakhno 2019-10-16 14:57:22 +02:00
commit 0d60d308aa
18 changed files with 272 additions and 53 deletions

View File

@ -1,8 +1,11 @@
### Changelog
#### Version 0.37.1
* Amazfit Bip Lite: Support flashing firmware and watchfaces
#### Version 0.37.0
* Initial Makibes HR3 support
* Amazfit Bip Lite: Inittal working support, firmware update is disabled for now (we do not have any firmware for testing)
* Amazfit Bip Lite: Initial working support, firmware update is disabled for now (we do not have any firmware for testing)
* Amazfit Cor 2: Enable Emoji Font setting and 3rd party HR access
* Find Phone now also vibration in addition to playing the ring tone
* ID115: All settings are now per-device

View File

@ -62,41 +62,6 @@ vendor's servers.
Please see [FEATURES.md](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/master/FEATURES.md)
## Getting Started (Pebble)
Please [this wiki article](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Pebble-Getting-Started)
## How to use (Mi Band 1+2)
* Invoke the discovery activity manually via the "+" button. It will ask you for some personal info that appears
to be needed for proper steps calculation on the band. If you do not provide these,
some hardcoded default "dummy" values will be used instead.
When your Mi Band starts to vibrate and blink during the pairing process,
tap it quickly a few times in a row to confirm the pairing with the band.
1. Configure other notifications as desired
2. Go back to the "Gadgetbridge" activity
3. Tap the Mi Band item to connect if you're not connected yet
4. To test, chose "Debug" from the menu and play around
**Known Issues:**
* The initial connection to a Mi Band sometimes takes a little patience. Try to connect a few times, wait,
and try connecting again. This only happens until you have "bonded" with the Mi Band, i.e. until it
knows your MAC address. This behavior may also only occur with older firmware versions.
* If you use other apps like Mi Fit, and "bonding" with Gadgetbridge does not work, please
try to unpair the band in the other app and try again with Gadgetbridge.
* While all Mi Band devices are supported, some firmware versions might work better than others.
You can consult the [projects wiki pages](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band)
to check if your firmware version is fully supported or if an upgrade/downgrade might be beneficial.
* In order to display text notifications on the Mi Band 2, you have to [install a font on the band](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-2).
## Features (Liveview)
* set time (automatically upon connection)
* display notifications and vibrate
## Authors
### Core Team (in order of first code contribution)

View File

@ -25,8 +25,8 @@ android {
targetSdkVersion 27
// Note: always bump BOTH versionCode and versionName!
versionName "0.37.0"
versionCode 158
versionName "0.37.1"
versionCode 159
vectorDrawables.useSupportLibrary = true
}
buildTypes {

View File

@ -55,7 +55,8 @@ public class AmazfitBipLiteCoordinator extends AmazfitBipCoordinator {
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
AmazfitBipLiteFWInstallHandler handler = new AmazfitBipLiteFWInstallHandler(uri, context);
return handler.isValid() ? handler : null;
}
@Override

View File

@ -0,0 +1,44 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipLiteFirmwareInfo;
public class AmazfitBipLiteFWHelper extends HuamiFWHelper {
public AmazfitBipLiteFWHelper(Uri uri, Context context) throws IOException {
super(uri, context);
}
@NonNull
@Override
protected void determineFirmwareInfo(byte[] wholeFirmwareBytes) {
firmwareInfo = new AmazfitBipLiteFirmwareInfo(wholeFirmwareBytes);
if (!firmwareInfo.isHeaderValid()) {
throw new IllegalArgumentException("Not a an Amazifit Bip Lite firmware");
}
}
}

View File

@ -0,0 +1,49 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip;
import android.content.Context;
import android.net.Uri;
import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.AbstractMiBandFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.AbstractMiBandFWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
class AmazfitBipLiteFWInstallHandler extends AbstractMiBandFWInstallHandler {
AmazfitBipLiteFWInstallHandler(Uri uri, Context context) {
super(uri, context);
}
@Override
protected String getFwUpgradeNotice() {
return mContext.getString(R.string.fw_upgrade_notice_amazfitbip_lite, helper.getHumanFirmwareVersion());
}
@Override
protected AbstractMiBandFWHelper createHelper(Uri uri, Context context) throws IOException {
return new AmazfitBipLiteFWHelper(uri, context);
}
@Override
protected boolean isSupportedDeviceType(GBDevice device) {
return device.getType() == DeviceType.AMAZFITBIP_LITE;
}
}

View File

@ -0,0 +1,94 @@
/* Copyright (C) 2017-2019 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip;
import java.util.HashMap;
import java.util.Map;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType;
import nodomain.freeyourgadget.gadgetbridge.util.ArrayUtils;
public class AmazfitBipLiteFirmwareInfo extends HuamiFirmwareInfo {
// this is the same as Bip and Cor
private static final byte[] FW_HEADER = new byte[]{
0x00, (byte) 0x98, 0x00, 0x20, (byte) 0xA5, 0x04, 0x00, 0x20, (byte) 0xAD, 0x04, 0x00, 0x20, (byte) 0xC5, 0x04, 0x00, 0x20
};
private static Map<Integer, String> crcToVersion = new HashMap<>();
static {
// firmware
crcToVersion.put(11059, "1.1.6.02");
// Latin Firmware
// resources
crcToVersion.put(57510, "1.1.6.02");
// font
crcToVersion.put(61054, "8");
crcToVersion.put(59577, "9 (Latin)");
}
public AmazfitBipLiteFirmwareInfo(byte[] bytes) {
super(bytes);
}
@Override
protected HuamiFirmwareType determineFirmwareType(byte[] bytes) {
if (ArrayUtils.startsWith(bytes, NEWRES_HEADER)) {
if ((bytes.length <= 100000) || (bytes.length > 700000)) { // dont know how to distinguish from Cor/Mi Band 3 .res
return HuamiFirmwareType.INVALID;
}
return HuamiFirmwareType.RES;
}
if (ArrayUtils.startsWith(bytes, FW_HEADER)) {
if (searchString32BitAligned(bytes, "Amazfit Bip Lite")) {
return HuamiFirmwareType.FIRMWARE;
}
return HuamiFirmwareType.INVALID;
}
if (ArrayUtils.startsWith(bytes, WATCHFACE_HEADER)) {
return HuamiFirmwareType.WATCHFACE;
}
if (ArrayUtils.startsWith(bytes, NEWFT_HEADER)) {
if (bytes[10] == 0x01) {
return HuamiFirmwareType.FONT;
} else if (bytes[10] == 0x02 || bytes[10] == 0x0A) {
return HuamiFirmwareType.FONT_LATIN;
}
}
return HuamiFirmwareType.INVALID;
}
@Override
public boolean isGenerallyCompatibleWith(GBDevice device) {
return isHeaderValid() && device.getType() == DeviceType.AMAZFITBIP_LITE;
}
@Override
protected Map<Integer, String> getCrcMap() {
return crcToVersion;
}
}

View File

@ -20,7 +20,10 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip;
import android.content.Context;
import android.net.Uri;
import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipLiteFWHelper;
public class AmazfitBipLiteSupport extends AmazfitBipSupport {
@ -35,7 +38,7 @@ public class AmazfitBipLiteSupport extends AmazfitBipSupport {
}
@Override
public HuamiFWHelper createFWHelper(Uri uri, Context context) {
return null;
public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException {
return new AmazfitBipLiteFWHelper(uri, context);
}
}

View File

@ -433,7 +433,7 @@ Temps de sommeil préféré en heures</string>
<string name="pref_title_pebble_enable_bgjs">Activer tâche de fond JS</string>
<string name="pref_summary_pebble_enable_bgjs">Si activé, autorise l\'affichage de la météo, niveau de batterie, etc.</string>
<string name="activity_web_view">Activité Web View</string>
<string name="controlcenter_connect">Connexion</string>
<string name="controlcenter_connect">Connexion</string>
<string name="fw_upgrade_notice_amazfitcor">Vous êtes sur le point d\'installer le micrologiciel %s sur votre Amazfit Cor.
\n
\nVeuillez installer le fichier .fw, puis le fichier .res. Votre montre redémarrera après installation du fichier .fw.
@ -626,7 +626,7 @@ Temps de sommeil préféré en heures</string>
<string name="filter_mode">Mode Filtre</string>
<string name="mode_configuration">Mode Configuration</string>
<string name="save_configuration">Sauvegarder la configuration</string>
<string name="appwidget_not_connected">Non connecté, l\'alarme n\'est pas définie</string>
<string name="appwidget_not_connected">Non connecté, lalarme nest pas définie.</string>
<string name="prefs_disconnect_notification">Notification de déconnexion</string>
<string name="zetime_title_settings">Paramètres ZeTime</string>
<string name="zetime_title_heartrate">Paramètres Fréquence Cardiaque</string>
@ -687,11 +687,11 @@ Temps de sommeil préféré en heures</string>
\n
\nVeuillez installer le fichier .fw, puis le fichier .res. Votre montre redémarrera après installation du .fw.
\n
\nNote : Il n\'est pas nécessaire d\'installer le fichier .res si celui-ci est identique à celui installé précédemment.
\nNote : il n\'est pas nécessaire d\'installer le fichier .res si celui-ci est identique à celui installé précédemment.
\n
\nCONTINUEZ À VOS RISQUES !
\n
\nNON TESTÉ, IL PEUT ÊTRE NÉCESSAIRE DE FLASH UN micrologiciel BEATS_W SI LE NOM DE L\'APPAREIL EST \"Amazfit Band 2\"</string>
\nNON TESTÉ, IL PEUT ÊTRE NÉCESSAIRE DE FLASHER UN MICROLOGICIEL BEATS_W SI LE NOM DE L\'APPAREIL EST « Amazfit Band 2 »</string>
<string name="dutch">Néerlandais</string>
<string name="turkish">Turc</string>
<string name="ukrainian">Ukrainien</string>
@ -720,4 +720,49 @@ Temps de sommeil préféré en heures</string>
<string name="pref_title_charts_range">Gamme des graphiques</string>
<string name="weekstepschart_steps_a_month">Pas par mois</string>
<string name="weeksleepchart_sleep_a_month">Sommeil par mois</string>
<string name="menuitem_nfc">NFC</string>
<string name="pref_title_use_custom_font">Utiliser une police personnalisée</string>
<string name="activity_DB_test_export_message">Exportation de la base de données …</string>
<string name="activity_db_management_exportimport_label">Exportation et importation</string>
<string name="widget_steps_label">Étapes : %1$02d</string>
<string name="widget_listing_label">État et alarmes</string>
<string name="widget_set_alarm_after">Régler lalarme après :</string>
<string name="widget_5_minutes">5 minutes</string>
<string name="widget_10_minutes">10 minutes</string>
<string name="widget_20_minutes">20 minutes</string>
<string name="widget_1_hour">1 heure</string>
<string name="pref_display_add_device_fab_on">Toujours visible</string>
<string name="pref_display_add_device_fab_off">Visible uniquement si aucun appareil n\'est ajouté</string>
<string name="prefs_find_phone_duration">Durée de la sonnerie en secondes</string>
<string name="maximum_duration">Durée</string>
<string name="pref_charts_range_on">La portée des graphs est réglée sur un mois</string>
<string name="pref_charts_range_off">La portée des graphs est réglée sur une semaine</string>
<string name="devicetype_mijia_lywsd02">Mijia Smart Clock</string>
<string name="pref_summary_expose_hr">Permettre aux autres applis d\'accéder aux données de fréquence cardiaque en temps réel lorsque Gadgetbridge est connecté</string>
<string name="pref_title_expose_hr">Accès tiers fréq. cardiaque</string>
<string name="pref_summary_use_custom_font">À activer si votre appareil a une police spéciale embarquée pour prendre en charge les émoticônes</string>
<string name="activity_db_management_autoexport_explanation">L\'export automatique des données est réglé vers :</string>
<string name="activity_db_management_autoexport_label">Export auto</string>
<string name="activity_DB_ExportButton">Export de données</string>
<string name="activity_DB_import_button">Import de données</string>
<string name="activity_DB_test_export_button">Lancer l\'export maintenant</string>
<string name="activity_DB_delete_legacy_button">Supprimer les anciennes données</string>
<string name="activity_DB_empty_button">Vider la base de données</string>
<string name="activity_db_management_empty_DB">Vide la base de données</string>
<string name="activity_db_management_empty_db_warning">Attention ! Ce bouton détruit votre base de données et réinitialise.</string>
<string name="appwidget_sleep_alarm_widget_label">Réveil</string>
<string name="widget_sleep_label">"Dormir %1$ s"</string>
<plurals name="widget_alarm_target_hours">
<item quantity="one">%d heure</item>
<item quantity="other">%d heures</item>
</plurals>
<string name="pref_display_add_device_fab">Bouton pour connecter un nouvel appareil</string>
<string name="activity_error_no_app_for_gpx">Pour visualiser votre géolocalisation, installez une appli qui lit les fichiers GPX.</string>
<string name="preferences_makibes_hr3_settings">Réglages Makibes HR3</string>
<string name="devicetype_makibes_hr3">Makibes HR3</string>
<string name="devicetype_amazfit_bip_lite">Amazfit Bip Lite</string>
<string name="prefs_find_phone">Trouver le téléphone</string>
<string name="prefs_enable_find_phone">Activer « Trouver le tél. »</string>
<string name="prefs_find_phone_summary">Utilisez votre bande pour lire l\'alarme de votre téléphone.</string>
<string name="discovery_need_to_enter_authkey">Cet appareil a besoin d\'une clé d\'auth. Pression longue sur celui-ci pour la saisir. Lisez le wiki.</string>
</resources>

View File

@ -759,4 +759,5 @@
<string name="prefs_find_phone_summary">ניתן להשתמש בצמיד כדי שהטלפון שלך ישמיע צלצול.</string>
<string name="prefs_find_phone_duration">משך זמן הצלצול בשניות</string>
<string name="maximum_duration">משך</string>
<string name="discovery_need_to_enter_authkey">למכשיר זה נדרש מפתח אימות סודי, יש לגעת נגיעה ארוכה על המכשיר כדי להזין אותו. פרטים נוספים בוויקי.</string>
</resources>

View File

@ -755,4 +755,11 @@
<string name="activity_error_no_app_for_gpx">For å vise aktivitetsspor, installer et program som kan håndtere GPX-filer.</string>
<string name="preferences_makibes_hr3_settings">Makibes HR3-innstillinger</string>
<string name="devicetype_makibes_hr3">Makibes HR3</string>
<string name="devicetype_amazfit_bip_lite">Amazfit Bip Lite</string>
<string name="prefs_find_phone">Finn telefon</string>
<string name="prefs_enable_find_phone">Skru på \"Finn telefon\"</string>
<string name="prefs_find_phone_summary">Bruk båndet ditt til å spille av telefonens ringetone.</string>
<string name="prefs_find_phone_duration">Anropsvarighet i sekunder</string>
<string name="maximum_duration">Varighet</string>
<string name="discovery_need_to_enter_authkey">Denne enheten trenger en hemmelig identitetsbekreftelsesnøkkel. Trykk lenge på enheten for å skrive den inn. Les wiki-en.</string>
</resources>

View File

@ -347,7 +347,7 @@
<string name="dateformat_time">Tijd</string>
<string name="dateformat_date_time">Tijd &amp; datum</string>
<string name="mi2_prefs_button_actions">Knoppen acties</string>
<string name="mi2_prefs_button_actions_summary">Specificeer actie voor de Mi Band knopdruk</string>
<string name="mi2_prefs_button_actions_summary">Specificeer actie voor de Mi Band 2 knopdruk</string>
<string name="mi2_prefs_button_press_count">Aantal knopdrukken</string>
<string name="mi2_prefs_button_press_count_summary">Aantal knopdrukken nodig om een bericht te sturen</string>
<string name="mi2_prefs_button_press_broadcast">Uit te sturen bericht</string>

View File

@ -765,8 +765,9 @@
<string name="devicetype_makibes_hr3">Makibes HR3</string>
<string name="devicetype_amazfit_bip_lite">Amazfit Bip Lite</string>
<string name="prefs_find_phone">Encontrar telefone</string>
<string name="prefs_enable_find_phone">Ativar encontrar telefone</string>
<string name="prefs_enable_find_phone">Ativar \"Encontrar telefone\"</string>
<string name="prefs_find_phone_summary">Use sua pulseira para reproduzir o toque sonoro do seu celular.</string>
<string name="prefs_find_phone_duration">Duração do toque sonoro em segundos</string>
<string name="maximum_duration">Duração</string>
<string name="discovery_need_to_enter_authkey">Esse dispositivo precisa de sua chave de autenticação secreta, realize pressionamento longo no dispositivo para inseri-lo. Leia o wiki.</string>
</resources>

View File

@ -766,4 +766,5 @@
<string name="prefs_find_phone_summary">使用您的手环以在手机上播放铃声。</string>
<string name="prefs_find_phone_duration">铃声将持续数秒</string>
<string name="maximum_duration">持续</string>
<string name="discovery_need_to_enter_authkey">此设备需要认证密钥,请在设备上长按以输入密钥。具体请阅读 Wiki 。</string>
</resources>

View File

@ -55,6 +55,7 @@
<string name="title_activity_fw_app_insaller">FW/App installer</string>
<string name="fw_upgrade_notice">You are about to install the %s.</string>
<string name="fw_upgrade_notice_amazfitbip">You are about to install the %s firmware on your Amazfit Bip.\n\nPlease make sure to install the .fw file, then the .res file, and finally the .gps file. Your watch will reboot after installing the .fw file.\n\nNote: You do not have to install .res and .gps if these files are exactly the same as the ones previously installed.\n\nPROCEED AT YOUR OWN RISK!</string>
<string name="fw_upgrade_notice_amazfitbip_lite">You are about to install the %s firmware on your Amazfit Bip Lite.\n\nPlease make sure to install the .fw file, and after that the .res file. Your watch will reboot after installing the .fw file.\n\nNote: You do not have to install .res if it is exactly the same as the one previously installed.\n\nPROCEED AT YOUR OWN RISK!</string>
<string name="fw_upgrade_notice_amazfitcor">You are about to install the %s firmware on your Amazfit Cor.\n\nPlease make sure to install the .fw file, and after that the .res file. Your band will reboot after installing the .fw file.\n\nNote: You do not have to install .res if it is exactly the same as the one previously installed.\n\nPROCEED AT YOUR OWN RISK!</string>
<string name="fw_upgrade_notice_amazfitcor2">You are about to install the %s firmware on your Amazfit Cor 2.
\n
@ -447,7 +448,7 @@
<string name="miband_prefs_hr_sleep_detection">Use heart rate sensor to improve sleep detection</string>
<string name="miband_prefs_device_time_offset_hours">Device time offset in hours (for detecting sleep of shift workers)</string>
<string name="prefs_find_phone">Find phone</string>
<string name="prefs_enable_find_phone">Enable find phone</string>
<string name="prefs_enable_find_phone">Turn on \\\'Find phone\\\'</string>
<string name="prefs_find_phone_summary">Use your band to play your phone\'s ringtone.</string>
<string name="prefs_find_phone_duration">Ring duration in seconds</string>
<string name="miband2_prefs_dateformat">Date format</string>

View File

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog>
<release version="0.37.1" versioncode="159">
<change>Amazfit Bip Lite: Support flashing firmware and watchfaces</change>
</release>
<release version="0.37.0" versioncode="158">
<change>Initial Makibes HR3 support</change>
<change>Amazfit Bip Lite: Inittal working support, firmware update is disabled for now (we do not have any firmware for testing)</change>
<change>Amazfit Bip Lite: Initial working support, firmware update is disabled for now (we do not have any firmware for testing)</change>
<change>Amazfit Cor 2: Enable Emoji Font setting and 3rd party HR access</change>
<change>Find Phone now also vibration in addition to playing the ring tone</change>
<change>ID115: All settings are now per-device</change>

View File

@ -1,5 +1,5 @@
* Initial Makibes HR3 support
* Amazfit Bip Lite: Inittal working support, firmware update is disabled for now (we do not have any firmware for testing)
* Amazfit Bip Lite: Initial working support, firmware update is disabled for now (we do not have any firmware for testing)
* Amazfit Cor 2: Enable Emoji Font setting and 3rd party HR access
* Find Phone now also vibration in addition to playing the ring tone
* ID115: All settings are now per-device

View File

@ -0,0 +1 @@
* Amazfit Bip Lite: Support flashing firmware and watchfaces