diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
index 72573b18f..80cf5e004 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
@@ -29,4 +29,5 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_BUTTON_2_FUNCTION = "button_2_function";
public static final String PREF_BUTTON_3_FUNCTION = "button_3_function";
public static final String PREF_VIBRATION_STRENGH_PERCENTAGE = "vibration_strength";
+ public static final String PREF_RELAX_FIRMWARE_CHECKS = "relax_firmware_checks";
}
\ No newline at end of file
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipLiteCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipLiteCoordinator.java
index e104c514e..6fe18a135 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipLiteCoordinator.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipLiteCoordinator.java
@@ -26,7 +26,9 @@ 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.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
@@ -63,4 +65,21 @@ public class AmazfitBipLiteCoordinator extends AmazfitBipCoordinator {
public int getBondingStyle() {
return BONDING_STYLE_REQUIRE_KEY;
}
+
+ @Override
+ public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
+ return new int[]{
+ R.xml.devicesettings_amazfitbip,
+ R.xml.devicesettings_timeformat,
+ R.xml.devicesettings_wearlocation,
+ R.xml.devicesettings_custom_emoji_font,
+ R.xml.devicesettings_liftwrist_display,
+ R.xml.devicesettings_disconnectnotification,
+ R.xml.devicesettings_sync_calendar,
+ R.xml.devicesettings_expose_hr_thirdparty,
+ R.xml.devicesettings_buttonactions_with_longpress,
+ R.xml.devicesettings_pairingkey,
+ R.xml.devicesettings_relax_firmware_checks,
+ };
+ }
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipLiteFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipLiteFirmwareInfo.java
index bfe279e8e..98607ec98 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipLiteFirmwareInfo.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipLiteFirmwareInfo.java
@@ -19,11 +19,14 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip;
import java.util.HashMap;
import java.util.Map;
+import nodomain.freeyourgadget.gadgetbridge.GBApplication;
+import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
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;
+import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class AmazfitBipLiteFirmwareInfo extends HuamiFirmwareInfo {
@@ -66,6 +69,15 @@ public class AmazfitBipLiteFirmwareInfo extends HuamiFirmwareInfo {
if (searchString32BitAligned(bytes, "Amazfit Bip Lite")) {
return HuamiFirmwareType.FIRMWARE;
}
+ GBDevice device = GBApplication.app().getDeviceManager().getSelectedDevice();
+ if (device != null) {
+ Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(device.getAddress()));
+ if (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_RELAX_FIRMWARE_CHECKS, false)) {
+ if (searchString32BitAligned(bytes, "Amazfit Bip")) {
+ return HuamiFirmwareType.FIRMWARE;
+ }
+ }
+ }
return HuamiFirmwareType.INVALID;
}
if (ArrayUtils.startsWith(bytes, WATCHFACE_HEADER)) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 60a0ac1ff..6f3901e4e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -186,6 +186,8 @@
Increases transfer speed, but might not work on some Android devices.
Enables calendar alerts, even when disconnected
Sync calendar events
+ Relax firmware checks
+ Enable this if you want to flash a firmware not intended for you device (at your own risk)
Vibration strength
Connect new device button
Always visible
diff --git a/app/src/main/res/xml/devicesettings_relax_firmware_checks.xml b/app/src/main/res/xml/devicesettings_relax_firmware_checks.xml
new file mode 100644
index 000000000..aad1eca53
--- /dev/null
+++ b/app/src/main/res/xml/devicesettings_relax_firmware_checks.xml
@@ -0,0 +1,8 @@
+
+
+
+