From b297e767addd51ee477f1c6a1ef010b89838c1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 16 Aug 2023 12:27:00 +0100 Subject: [PATCH] Amazfit Bip 3 Pro: Initial support --- README.md | 1 + .../AmazfitBip3ProCoordinator.java | 169 ++++++++++++++++++ .../AmazfitBip3ProFWHelper.java | 39 ++++ .../AmazfitBip3ProFWInstallHandler.java | 49 +++++ .../gadgetbridge/model/DeviceType.java | 1 + .../service/DeviceSupportFactory.java | 3 + .../AmazfitBip3ProFirmwareInfo.java | 82 +++++++++ .../amazfitbip3pro/AmazfitBip3ProSupport.java | 79 ++++++++ .../gadgetbridge/util/DeviceHelper.java | 2 + app/src/main/res/values/strings.xml | 2 + .../res/xml/devicesettings_amazfitbip3pro.xml | 13 ++ 11 files changed, 440 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProCoordinator.java create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWHelper.java create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWInstallHandler.java create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProFirmwareInfo.java create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProSupport.java create mode 100644 app/src/main/res/xml/devicesettings_amazfitbip3pro.xml diff --git a/README.md b/README.md index 5f303b56c..99535ad46 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ vendor's servers. - [Band 5](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Band-5), [Band 7](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Band-7) [**\[!\]**](#special-pairing-procedures) - [Bip](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Bip) - [Bip Lite](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Bip-Lite), [Bip S](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Bip-S), [Bip U](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Bip-U) [**\[!\]**](#special-pairing-procedures) + - [Bip 3 Pro](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Bip-3-Pro) [**\[!\]**](#special-pairing-procedures) - [Cor](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Cor), [Cor 2](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-Cor-2) - [GTR](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTR), [GTR 2/2e](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTR), [GTR 3](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTR-3), [GTR 3 Pro](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTR-3-Pro), [GTR 4](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTR-4) [**\[!\]**](#special-pairing-procedures) - [GTS](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTS), [GTS 2/2e](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTS), [GTS 3](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTS-3), [GTS 4](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTS-4), [GTS 4 Mini](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Amazfit-GTS-4-Mini) [**\[!\]**](#special-pairing-procedures) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProCoordinator.java new file mode 100644 index 000000000..6e5a93bef --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProCoordinator.java @@ -0,0 +1,169 @@ +/* Copyright (C) 2023 José Rebelo + + 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 . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro; + +import android.bluetooth.BluetoothDevice; +import android.content.Context; +import android.net.Uri; + +import androidx.annotation.NonNull; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiCoordinator; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; +import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; + +public class AmazfitBip3ProCoordinator extends HuamiCoordinator { + private static final Logger LOG = LoggerFactory.getLogger(AmazfitBip3ProCoordinator.class); + + @Override + public DeviceType getDeviceType() { + return DeviceType.AMAZFITBIP3PRO; + } + + @NonNull + @Override + public DeviceType getSupportedType(final GBDeviceCandidate candidate) { + try { + final BluetoothDevice device = candidate.getDevice(); + final String name = device.getName(); + if (name != null && name.equalsIgnoreCase("Amazfit Bip 3 Pro")) { + return DeviceType.AMAZFITBIP3PRO; + } + } catch (final Exception ex) { + LOG.error("unable to check device support", ex); + } + return DeviceType.UNKNOWN; + } + + @Override + public InstallHandler findInstallHandler(final Uri uri, final Context context) { + final AmazfitBip3ProFWInstallHandler handler = new AmazfitBip3ProFWInstallHandler(uri, context); + return handler.isValid() ? handler : null; + } + + @Override + public int getBondingStyle() { + return BONDING_STYLE_REQUIRE_KEY; + } + + @Override + public boolean supportsHeartRateMeasurement(final GBDevice device) { + return true; + } + + @Override + public boolean supportsActivityTracks() { + return true; + } + + @Override + public boolean supportsWeather() { + return true; + } + + @Override + public boolean supportsMusicInfo() { + return true; + } + + @Override + public int getWorldClocksSlotCount() { + return 20; // as enforced by Zepp + } + + @Override + public int getWorldClocksLabelLength() { + return 30; // at least + } + + @Override + public boolean supportsUnicodeEmojis() { + return true; + } + + @Override + public boolean supportsStressMeasurement() { + return true; + } + + @Override + public boolean supportsSpo2() { + return true; + } + + @Override + public boolean supportsPai() { + return true; + } + + public int[] getSupportedDeviceSpecificSettings(final GBDevice device) { + return new int[]{ + R.xml.devicesettings_amazfitbip3pro, + R.xml.devicesettings_vibrationpatterns, + R.xml.devicesettings_wearlocation, + R.xml.devicesettings_heartrate_sleep_alert_activity_stress, + R.xml.devicesettings_goal_notification, + R.xml.devicesettings_timeformat, + R.xml.devicesettings_dateformat, + R.xml.devicesettings_world_clocks, + R.xml.devicesettings_liftwrist_display_sensitivity, + R.xml.devicesettings_inactivity_dnd, + R.xml.devicesettings_sync_calendar, + R.xml.devicesettings_reserve_reminders_calendar, + R.xml.devicesettings_expose_hr_thirdparty, + R.xml.devicesettings_bt_connected_advertisement, + R.xml.devicesettings_device_actions, + R.xml.devicesettings_high_mtu, + R.xml.devicesettings_overwrite_settings_on_connection, + R.xml.devicesettings_huami2021_fetch_operation_time_unit, + R.xml.devicesettings_transliteration + }; + } + + @Override + public String[] getSupportedLanguageSettings(GBDevice device) { + return new String[]{ + "auto", + "cs_CZ", + "de_DE", + "el_GR", + "en_US", + "es_ES", + "fr_FR", + "id_ID", + "it_IT", + "ja_JP", + "ko_KO", + "nl_NL", + "pl_PL", + "pt_BR", + "ru_RU", + "th_TH", + "tr_TR", + "uk_UA", + "vi_VN", + "zh_CH", + "zh_TW", + }; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWHelper.java new file mode 100644 index 000000000..606fc7463 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWHelper.java @@ -0,0 +1,39 @@ +/* Copyright (C) 2023 José Rebelo + + 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 . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro; + +import android.content.Context; +import android.net.Uri; + +import java.io.IOException; + +import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip3pro.AmazfitBip3ProFirmwareInfo; + +public class AmazfitBip3ProFWHelper extends HuamiFWHelper { + public AmazfitBip3ProFWHelper(final Uri uri, final Context context) throws IOException { + super(uri, context); + } + + @Override + protected void determineFirmwareInfo(final byte[] wholeFirmwareBytes) { + firmwareInfo = new AmazfitBip3ProFirmwareInfo(wholeFirmwareBytes); + if (!firmwareInfo.isHeaderValid()) { + throw new IllegalArgumentException("Not an Amazfit Bip 3 Pro firmware"); + } + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWInstallHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWInstallHandler.java new file mode 100644 index 000000000..f6f67c0b0 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip3pro/AmazfitBip3ProFWInstallHandler.java @@ -0,0 +1,49 @@ +/* Copyright (C) 2023 José Rebelo + + 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 . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro; + +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 AmazfitBip3ProFWInstallHandler extends AbstractMiBandFWInstallHandler { + AmazfitBip3ProFWInstallHandler(final Uri uri, final Context context) { + super(uri, context); + } + + @Override + protected String getFwUpgradeNotice() { + return mContext.getString(R.string.fw_upgrade_notice_amazfitbip3pro, helper.getHumanFirmwareVersion()); + } + + @Override + protected AbstractMiBandFWHelper createHelper(final Uri uri, final Context context) throws IOException { + return new AmazfitBip3ProFWHelper(uri, context); + } + + @Override + protected boolean isSupportedDeviceType(final GBDevice device) { + return device.getType() == DeviceType.AMAZFITBIP3PRO; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java index d871ec78c..8603551a0 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -75,6 +75,7 @@ public enum DeviceType { AMAZFITGTS4MINI(10047, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_gts4_mini), AMAZFITTREX2(10048, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_trex_2), AMAZFITGTR3PRO(10049, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr3_pro), + AMAZFITBIP3PRO(10051, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_bip3_pro), HPLUS(40, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_hplus), MAKIBESF68(41, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_makibes_f68), EXRIZUK8(42, R.drawable.ic_device_hplus, R.drawable.ic_device_hplus_disabled, R.string.devicetype_exrizu_k8), diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java index 99e0bb332..2756f461d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java @@ -44,6 +44,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitband5.A import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitband7.AmazfitBand7Support; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipLiteSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip3pro.AmazfitBip3ProSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbips.AmazfitBipSLiteSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbips.AmazfitBipSSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbipu.AmazfitBipUSupport; @@ -222,6 +223,8 @@ public class DeviceSupportFactory { return new ServiceDeviceSupport(new AmazfitBipUSupport()); case AMAZFITBIPUPRO: return new ServiceDeviceSupport(new AmazfitBipUProSupport()); + case AMAZFITBIP3PRO: + return new ServiceDeviceSupport(new AmazfitBip3ProSupport()); case AMAZFITPOP: return new ServiceDeviceSupport(new AmazfitPopSupport()); case AMAZFITPOPPRO: diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProFirmwareInfo.java new file mode 100644 index 000000000..a182b651c --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProFirmwareInfo.java @@ -0,0 +1,82 @@ +/* Copyright (C) 2023 José Rebelo + + 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 . */ +package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip3pro; + +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.service.devices.huami.miband4.MiBand4FirmwareInfo; +import nodomain.freeyourgadget.gadgetbridge.util.ArrayUtils; + +public class AmazfitBip3ProFirmwareInfo extends HuamiFirmwareInfo { + private static final Map crcToVersion = new HashMap<>(); + + static { + // firmware + + // resources + + // gps + } + + public AmazfitBip3ProFirmwareInfo(final byte[] bytes) { + super(bytes); + } + + @Override + protected HuamiFirmwareType determineFirmwareType(final byte[] bytes) { + if (ArrayUtils.equals(bytes, MiBand4FirmwareInfo.FW_HEADER, MiBand4FirmwareInfo.FW_HEADER_OFFSET)) { + if (searchString32BitAligned(bytes, "\0\0Amazfit Bip 3 Pro")) { + return HuamiFirmwareType.FIRMWARE; + } + return HuamiFirmwareType.INVALID; + } + + if (ArrayUtils.startsWith(bytes, NEWRES_HEADER)) { + return HuamiFirmwareType.RES; + } + + if (ArrayUtils.startsWith(bytes, UIHH_HEADER) && (bytes[4] == 1 || bytes[4] == 2)) { + return HuamiFirmwareType.WATCHFACE; + } + + if (ArrayUtils.startsWith(bytes, AGPS_UIHH_HEADER)) { + return HuamiFirmwareType.AGPS_UIHH; + } + + for (byte[] gpsHeader : GPS_HEADERS) { + if (ArrayUtils.startsWith(bytes, gpsHeader)) { + return HuamiFirmwareType.GPS; + } + } + return HuamiFirmwareType.INVALID; + } + + @Override + public boolean isGenerallyCompatibleWith(final GBDevice device) { + return isHeaderValid() && device.getType() == DeviceType.AMAZFITBIP3PRO; + } + + @Override + protected Map getCrcMap() { + return crcToVersion; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProSupport.java new file mode 100644 index 000000000..3cff3805f --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip3pro/AmazfitBip3ProSupport.java @@ -0,0 +1,79 @@ +/* Copyright (C) 2023 José Rebelo + + 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 . */ +package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip3pro; + +import android.content.Context; +import android.net.Uri; + +import java.io.IOException; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro.AmazfitBip3ProFWHelper; +import nodomain.freeyourgadget.gadgetbridge.model.CallSpec; +import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation2020; + +public class AmazfitBip3ProSupport extends AmazfitBipSupport { + @Override + public byte getCryptFlags() { + return (byte) 0x80; + } + + @Override + protected byte getAuthFlags() { + return 0x00; + } + + @Override + protected boolean notificationHasExtraHeader() { + return true; + } + + @Override + public boolean supportsSunriseSunsetWindHumidity() { + return true; + } + + @Override + public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException { + return new AmazfitBip3ProFWHelper(uri, context); + } + + @Override + public UpdateFirmwareOperation createUpdateFirmwareOperation(final Uri uri) { + return new UpdateFirmwareOperation2020(uri, this); + } + + @Override + public void onSetCallState(final CallSpec callSpec) { + onSetCallStateNew(callSpec); + } + + @Override + public int getActivitySampleSize() { + return 8; + } + + @Override + protected AmazfitBip3ProSupport setDisplayItems(final TransactionBuilder builder) { + setDisplayItemsNew(builder, false, false, R.array.pref_gtsgtr2_display_items_default); + return this; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java index 7faffc1d8..95c2f3fd5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java @@ -81,6 +81,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2.AmazfitGTS import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitneo.AmazfitNeoCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipLiteCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip3pro.AmazfitBip3ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbips.AmazfitBipSCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbipu.AmazfitBipUCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbipupro.AmazfitBipUProCoordinator; @@ -299,6 +300,7 @@ public class DeviceHelper { result.add(new AmazfitBipSLiteCoordinator()); result.add(new AmazfitBipUCoordinator()); result.add(new AmazfitBipUProCoordinator()); + result.add(new AmazfitBip3ProCoordinator()); result.add(new AmazfitPopCoordinator()); result.add(new AmazfitPopProCoordinator()); result.add(new AmazfitBand5Coordinator()); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 628e57f1c..6a48a47b1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -137,6 +137,7 @@ You are about to install the %s. 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! 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! + You are about to install the %s firmware on your Amazfit Bip 3 Pro.\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! 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! You are about to install the %s firmware on your Amazfit Cor 2. \n @@ -1275,6 +1276,7 @@ Amazfit GTS 4 Mini Amazfit GTR 3 Amazfit GTR 3 Pro + Amazfit Bip 3 Pro Amazfit GTR 4 Amazfit T-Rex 2 Amazfit Band 5 diff --git a/app/src/main/res/xml/devicesettings_amazfitbip3pro.xml b/app/src/main/res/xml/devicesettings_amazfitbip3pro.xml new file mode 100644 index 000000000..2858ce11a --- /dev/null +++ b/app/src/main/res/xml/devicesettings_amazfitbip3pro.xml @@ -0,0 +1,13 @@ + + + +