Compare commits

..

6 Commits

Author SHA1 Message Date
José Rebelo
773132c4e1 Make all Zepp OS classes explicit
There are still some actual "Huami 2021" classes that are used in
non-ZeppOS devices, but this refactor improves the distinction.
2024-01-29 23:30:28 +00:00
Damien 'Psolyca' Gaignon
86461ada1a
[Huawei] Add new Crypto and authMode 2024-01-29 21:51:45 +01:00
Damien 'Psolyca' Gaignon
f759072a7c
[Huawei] Add PBKDF2 crypto 2024-01-29 21:34:08 +01:00
Damien 'Psolyca' Gaignon
2b5a49641a
[Huawei] Fix clientNonce for HiChainLite 2024-01-29 21:21:20 +01:00
José Rebelo
61116c5fc8 Upgrade to gradlew 7.6, mockito-core 2.28.2
Fixes the unit tests after the AGP upgrade from 1a92bcf8a
2024-01-29 18:50:40 +00:00
José Rebelo
c472f0ab9a Redmi Watch 2: Experimental support 2024-01-29 18:14:34 +00:00
138 changed files with 548 additions and 490 deletions

View File

@ -252,7 +252,7 @@ dependencies {
// testImplementation "ch.qos.logback:logback-core:1.1.3"
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:1.10.19"
testImplementation "org.mockito:mockito-core:2.28.2"
testImplementation "org.robolectric:robolectric:4.8.2"
testImplementation "org.hamcrest:hamcrest-library:1.3"
testImplementation "com.google.code.gson:gson:2.8.9"

View File

@ -22,15 +22,15 @@ import android.net.Uri;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitactive.AmazfitActiveSupport;
public class AmazfitActiveCoordinator extends Huami2021Coordinator {
public class AmazfitActiveCoordinator extends ZeppOsCoordinator {
@NonNull
@Override
public Class<? extends DeviceSupport> getDeviceSupportClass() {
@ -49,7 +49,7 @@ public class AmazfitActiveCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitActiveFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitActiveFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitActiveFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitActiveFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -24,14 +24,14 @@ import androidx.annotation.NonNull;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitactiveedge.AmazfitActiveEdgeSupport;
public class AmazfitActiveEdgeCoordinator extends Huami2021Coordinator {
public class AmazfitActiveEdgeCoordinator extends ZeppOsCoordinator {
@Override
public boolean isExperimental() {
return true;
@ -54,7 +54,7 @@ public class AmazfitActiveEdgeCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitActiveEdgeFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitActiveEdgeFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitActiveEdgeFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitActiveEdgeFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -24,14 +24,14 @@ import androidx.annotation.NonNull;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbalance.AmazfitBalanceSupport;
public class AmazfitBalanceCoordinator extends Huami2021Coordinator {
public class AmazfitBalanceCoordinator extends ZeppOsCoordinator {
@NonNull
@Override
public Class<? extends DeviceSupport> getDeviceSupportClass() {
@ -49,7 +49,7 @@ public class AmazfitBalanceCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitBalanceFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitBalanceFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitBalanceFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitBalanceFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitband7.AmazfitBand7Support;
public class AmazfitBand7Coordinator extends Huami2021Coordinator {
public class AmazfitBand7Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitBand7Coordinator.class);
@Override
@ -50,7 +48,7 @@ public class AmazfitBand7Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitBand7FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitBand7FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitBand7FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitBand7FWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip5.AmazfitBip5Support;
public class AmazfitBip5Coordinator extends Huami2021Coordinator {
public class AmazfitBip5Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitBip5Coordinator.class);
@NonNull
@ -51,7 +49,7 @@ public class AmazfitBip5Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitBip5FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitBip5FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitBip5FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitBip5FWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitcheetahpro.AmazfitCheetahProSupport;
public class AmazfitCheetahProCoordinator extends Huami2021Coordinator {
public class AmazfitCheetahProCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitCheetahProCoordinator.class);
@Override
@ -56,7 +54,7 @@ public class AmazfitCheetahProCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitCheetahProFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitCheetahProFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitCheetahProFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitCheetahProFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitcheetahround.AmazfitCheetahRoundSupport;
public class AmazfitCheetahRoundCoordinator extends Huami2021Coordinator {
public class AmazfitCheetahRoundCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitCheetahRoundCoordinator.class);
@Override
@ -61,7 +59,7 @@ public class AmazfitCheetahRoundCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitCheetahRoundFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitCheetahRoundFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitCheetahRoundFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitCheetahRoundFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitcheetahsquare.AmazfitCheetahSquareSupport;
public class AmazfitCheetahSquareCoordinator extends Huami2021Coordinator {
public class AmazfitCheetahSquareCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitCheetahSquareCoordinator.class);
@Override
@ -56,7 +54,7 @@ public class AmazfitCheetahSquareCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitCheetahSquareFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitCheetahSquareFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitCheetahSquareFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitCheetahSquareFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitfalcon.AmazfitFalconSupport;
public class AmazfitFalconCoordinator extends Huami2021Coordinator {
public class AmazfitFalconCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitFalconCoordinator.class);
@Override
@ -61,7 +59,7 @@ public class AmazfitFalconCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitFalconFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitFalconFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitFalconFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitFalconFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -25,16 +25,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr3.AmazfitGTR3Support;
public class AmazfitGTR3Coordinator extends Huami2021Coordinator {
public class AmazfitGTR3Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3Coordinator.class);
@NonNull
@ -64,7 +63,7 @@ public class AmazfitGTR3Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTR3FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTR3FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTR3FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTR3FWInstallHandler(Uri uri, Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr3pro.AmazfitGTR3ProSupport;
public class AmazfitGTR3ProCoordinator extends Huami2021Coordinator {
public class AmazfitGTR3ProCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3ProCoordinator.class);
@Override
@ -56,7 +54,7 @@ public class AmazfitGTR3ProCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTR3ProFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTR3ProFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTR3ProFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTR3ProFWInstallHandler(Uri uri, Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr4.AmazfitGTR4Support;
public class AmazfitGTR4Coordinator extends Huami2021Coordinator {
public class AmazfitGTR4Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR4Coordinator.class);
@Override
@ -56,7 +54,7 @@ public class AmazfitGTR4Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTR4FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTR4FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTR4FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTR4FWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtrmini.AmazfitGTRMiniSupport;
public class AmazfitGTRMiniCoordinator extends Huami2021Coordinator {
public class AmazfitGTRMiniCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTRMiniCoordinator.class);
@NonNull
@ -56,7 +54,7 @@ public class AmazfitGTRMiniCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTRMiniFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTRMiniFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTRMiniFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTRMiniFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts3.AmazfitGTS3Support;
public class AmazfitGTS3Coordinator extends Huami2021Coordinator {
public class AmazfitGTS3Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTS3Coordinator.class);
@Override
@ -51,7 +49,7 @@ public class AmazfitGTS3Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTS3FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTS3FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTS3FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTS3FWInstallHandler(Uri uri, Context context) {
super(uri, context);
}

View File

@ -25,15 +25,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts4.AmazfitGTS4Support;
public class AmazfitGTS4Coordinator extends Huami2021Coordinator {
public class AmazfitGTS4Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTS4Coordinator.class);
@Override
@ -57,7 +57,7 @@ public class AmazfitGTS4Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTS4FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTS4FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTS4FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTS4FWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts4mini.AmazfitGTS4MiniSupport;
public class AmazfitGTS4MiniCoordinator extends Huami2021Coordinator {
public class AmazfitGTS4MiniCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTS4MiniCoordinator.class);
@Override
@ -51,7 +49,7 @@ public class AmazfitGTS4MiniCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitGTS4MiniFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitGTS4MiniFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitGTS4MiniFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitGTS4MiniFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfittrex2.AmazfitTRex2Support;
public class AmazfitTRex2Coordinator extends Huami2021Coordinator {
public class AmazfitTRex2Coordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitTRex2Coordinator.class);
@Override
@ -56,7 +54,7 @@ public class AmazfitTRex2Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitTRex2FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitTRex2FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitTRex2FWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitTRex2FWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -27,16 +27,14 @@ import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfittrexultra.AmazfitTRexUltraSupport;
public class AmazfitTRexUltraCoordinator extends Huami2021Coordinator {
public class AmazfitTRexUltraCoordinator extends ZeppOsCoordinator {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitTRexUltraCoordinator.class);
@NonNull
@ -56,7 +54,7 @@ public class AmazfitTRexUltraCoordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new AmazfitTRexUltraFWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class AmazfitTRexUltraFWInstallHandler extends AbstractHuami2021FWInstallHandler {
class AmazfitTRexUltraFWInstallHandler extends AbstractZeppOsFwInstallHandler {
AmazfitTRexUltraFWInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}

View File

@ -22,15 +22,15 @@ import android.net.Uri;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.miband7.MiBand7Support;
public class MiBand7Coordinator extends Huami2021Coordinator {
public class MiBand7Coordinator extends ZeppOsCoordinator {
@Override
public boolean supports(final GBDeviceCandidate candidate) {
final String name = candidate.getName();
@ -38,7 +38,7 @@ public class MiBand7Coordinator extends Huami2021Coordinator {
}
@Override
public AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context) {
return new MiBand7FWInstallHandler(uri, context);
}

View File

@ -25,9 +25,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
class MiBand7FWInstallHandler extends AbstractHuami2021FWInstallHandler {
class MiBand7FWInstallHandler extends AbstractZeppOsFwInstallHandler {
MiBand7FWInstallHandler(Uri uri, Context context) {
super(uri, context);
}

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos;
import static nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryEntries.*;
@ -26,19 +26,20 @@ import org.slf4j.LoggerFactory;
import java.util.Date;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiActivitySummaryParser;
import nodomain.freeyourgadget.gadgetbridge.proto.HuamiProtos;
import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummary;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiActivityDetailsParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021ActivityDetailsParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021WorkoutTrackActivityType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsActivityDetailsParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsActivityType;
public class Huami2021ActivitySummaryParser extends HuamiActivitySummaryParser {
private static final Logger LOG = LoggerFactory.getLogger(Huami2021ActivitySummaryParser.class);
public class ZeppOsActivitySummaryParser extends HuamiActivitySummaryParser {
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsActivitySummaryParser.class);
@Override
public AbstractHuamiActivityDetailsParser getDetailsParser(final BaseActivitySummary summary) {
return new Huami2021ActivityDetailsParser(summary);
return new ZeppOsActivityDetailsParser(summary);
}
@Override
@ -59,12 +60,12 @@ public class Huami2021ActivitySummaryParser extends HuamiActivitySummaryParser {
}
if (summaryProto.hasType()) {
final Huami2021WorkoutTrackActivityType workoutTrackActivityType = Huami2021WorkoutTrackActivityType
final ZeppOsActivityType activityType = ZeppOsActivityType
.fromCode((byte) summaryProto.getType().getType());
final int activityKind;
if (workoutTrackActivityType != null) {
activityKind = workoutTrackActivityType.toActivityKind();
if (activityType != null) {
activityKind = activityType.toActivityKind();
} else {
LOG.warn("Unknown workout activity type code {}", String.format("0x%X", summaryProto.getType().getType()));
activityKind = ActivityKind.TYPE_UNKNOWN;

View File

@ -30,11 +30,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.InstallActivity;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.operations.ZeppOsAgpsFile;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
import nodomain.freeyourgadget.gadgetbridge.util.UriHelper;
@ -80,14 +78,14 @@ public class ZeppOsAgpsInstallHandler implements InstallHandler {
}
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
if (!(coordinator instanceof Huami2021Coordinator)) {
LOG.warn("Coordinator is not a Huami2021Coordinator: {}", coordinator.getClass());
if (!(coordinator instanceof ZeppOsCoordinator)) {
LOG.warn("Coordinator is not a ZeppOsCoordinator: {}", coordinator.getClass());
installActivity.setInfoText(mContext.getString(R.string.fwapp_install_device_not_supported));
installActivity.setInstallEnabled(false);
return;
}
final Huami2021Coordinator huami2021coordinator = (Huami2021Coordinator) coordinator;
if (!huami2021coordinator.supportsAgpsUpdates()) {
final ZeppOsCoordinator zeppOsCoordinator = (ZeppOsCoordinator) coordinator;
if (!zeppOsCoordinator.supportsAgpsUpdates()) {
installActivity.setInfoText(mContext.getString(R.string.fwapp_install_device_not_supported));
installActivity.setInstallEnabled(false);
return;

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos;
import android.app.Activity;
import android.content.Context;
@ -39,8 +39,8 @@ import nodomain.freeyourgadget.gadgetbridge.capabilities.password.PasswordCapabi
import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsAgpsInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsGpxRouteInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiExtendedSampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
@ -54,7 +54,7 @@ import nodomain.freeyourgadget.gadgetbridge.entities.HuamiSpo2SampleDao;
import nodomain.freeyourgadget.gadgetbridge.entities.HuamiStressSampleDao;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuami2021FWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.AbstractZeppOsFwInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.services.ZeppOsAlexaService;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.services.ZeppOsContactsService;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.services.ZeppOsLogsService;
@ -68,8 +68,8 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.service
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public abstract class Huami2021Coordinator extends HuamiCoordinator {
public abstract AbstractHuami2021FWInstallHandler createFwInstallHandler(final Uri uri, final Context context);
public abstract class ZeppOsCoordinator extends HuamiCoordinator {
public abstract AbstractZeppOsFwInstallHandler createFwInstallHandler(final Uri uri, final Context context);
@Override
public InstallHandler findInstallHandler(final Uri uri, final Context context) {
@ -87,7 +87,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
}
}
final AbstractHuami2021FWInstallHandler handler = createFwInstallHandler(uri, context);
final AbstractZeppOsFwInstallHandler handler = createFwInstallHandler(uri, context);
return handler.isValid() ? handler : null;
}
@ -263,7 +263,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
@Override
public ActivitySummaryParser getActivitySummaryParser(final GBDevice device) {
return new Huami2021ActivitySummaryParser();
return new ZeppOsActivitySummaryParser();
}
@Override
@ -313,7 +313,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
/**
* Returns a superset of all settings supported by Zepp OS Devices. Unsupported settings are removed
* by {@link Huami2021SettingsCustomizer}.
* by {@link ZeppOsSettingsCustomizer}.
*/
@Override
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) {
@ -491,7 +491,7 @@ public abstract class Huami2021Coordinator extends HuamiCoordinator {
@Override
public DeviceSpecificSettingsCustomizer getDeviceSpecificSettingsCustomizer(final GBDevice device) {
return new Huami2021SettingsCustomizer(device, getVibrationPatternNotificationTypes(device));
return new ZeppOsSettingsCustomizer(device, getVibrationPatternNotificationTypes(device));
}
@Override

View File

@ -30,11 +30,9 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.InstallActivity;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.operations.ZeppOsGpxRouteFile;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
import nodomain.freeyourgadget.gadgetbridge.util.UriHelper;
@ -79,14 +77,14 @@ public class ZeppOsGpxRouteInstallHandler implements InstallHandler {
}
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
if (!(coordinator instanceof Huami2021Coordinator)) {
LOG.warn("Coordinator is not a Huami2021Coordinator: {}", coordinator.getClass());
if (!(coordinator instanceof ZeppOsCoordinator)) {
LOG.warn("Coordinator is not a ZeppOsCoordinator: {}", coordinator.getClass());
installActivity.setInfoText(mContext.getString(R.string.fwapp_install_device_not_supported));
installActivity.setInstallEnabled(false);
return;
}
final Huami2021Coordinator huami2021coordinator = (Huami2021Coordinator) coordinator;
if (!huami2021coordinator.supportsGpxUploads()) {
final ZeppOsCoordinator zeppOsCoordinator = (ZeppOsCoordinator) coordinator;
if (!zeppOsCoordinator.supportsGpxUploads()) {
installActivity.setInfoText(mContext.getString(R.string.fwapp_install_device_not_supported));
installActivity.setInstallEnabled(false);
return;

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsUtils.hidePrefIfNoneVisible;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsUtils.populateOrHideListPreference;
@ -44,15 +44,17 @@ import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSett
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsHandler;
import nodomain.freeyourgadget.gadgetbridge.activities.loyaltycards.LoyaltyCardsSettingsConst;
import nodomain.freeyourgadget.gadgetbridge.capabilities.GpsCapability;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiVibrationPatternNotificationType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.services.ZeppOsConfigService;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class Huami2021SettingsCustomizer extends HuamiSettingsCustomizer {
private static final Logger LOG = LoggerFactory.getLogger(Huami2021SettingsCustomizer.class);
public class ZeppOsSettingsCustomizer extends HuamiSettingsCustomizer {
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsSettingsCustomizer.class);
public Huami2021SettingsCustomizer(final GBDevice device, final List<HuamiVibrationPatternNotificationType> vibrationPatternNotificationTypes) {
public ZeppOsSettingsCustomizer(final GBDevice device, final List<HuamiVibrationPatternNotificationType> vibrationPatternNotificationTypes) {
super(device, vibrationPatternNotificationTypes);
}
@ -438,18 +440,18 @@ public class Huami2021SettingsCustomizer extends HuamiSettingsCustomizer {
DeviceSettingsUtils.enforceMinMax((EditTextPreference) pref, minValue, maxValue);
}
public static final Creator<Huami2021SettingsCustomizer> CREATOR = new Creator<Huami2021SettingsCustomizer>() {
public static final Creator<ZeppOsSettingsCustomizer> CREATOR = new Creator<ZeppOsSettingsCustomizer>() {
@Override
public Huami2021SettingsCustomizer createFromParcel(final Parcel in) {
final GBDevice device = in.readParcelable(Huami2021SettingsCustomizer.class.getClassLoader());
public ZeppOsSettingsCustomizer createFromParcel(final Parcel in) {
final GBDevice device = in.readParcelable(ZeppOsSettingsCustomizer.class.getClassLoader());
final List<HuamiVibrationPatternNotificationType> vibrationPatternNotificationTypes = new ArrayList<>();
in.readList(vibrationPatternNotificationTypes, HuamiVibrationPatternNotificationType.class.getClassLoader());
return new Huami2021SettingsCustomizer(device, vibrationPatternNotificationTypes);
return new ZeppOsSettingsCustomizer(device, vibrationPatternNotificationTypes);
}
@Override
public Huami2021SettingsCustomizer[] newArray(final int size) {
return new Huami2021SettingsCustomizer[size];
public ZeppOsSettingsCustomizer[] newArray(final int size) {
return new ZeppOsSettingsCustomizer[size];
}
};
}

View File

@ -24,6 +24,7 @@ import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;
import javax.crypto.BadPaddingException;
@ -78,15 +79,17 @@ public class HuaweiCrypto {
public static final long ENCRYPTION_COUNTER_MAX = 0xFFFFFFFF;
protected int authVersion;
protected boolean isHiChainLite = false;
protected int authMode;
protected byte authAlgo;
public HuaweiCrypto(int authVersion) {
this.authVersion = authVersion;
}
public HuaweiCrypto(int authVersion, boolean isHiChainLite) {
public HuaweiCrypto(int authVersion, byte authAlgo, int authMode) {
this(authVersion);
this.isHiChainLite = isHiChainLite;
this.authMode = authMode;
this.authAlgo = authAlgo;
}
public static byte[] generateNonce() {
@ -115,26 +118,27 @@ public class HuaweiCrypto {
return CryptoUtils.calcHmacSha256(digestStep1, nonce);
}
public byte[] computeDigestHiChainLite(byte[] message, byte[] key, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException {
public byte[] computeDigestHiChainLite(byte[] message, byte[] key, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException {
byte[] digestStep1;
byte[] hashKey = CryptoUtils.digest(key);
byte[] digestSecret = getDigestSecret();
for (int i = 0; i < digestSecret.length; i++) {
digestSecret[i] = (byte) (((0xFF & hashKey[i]) ^ (digestSecret[i] & 0xFF)) & 0xFF);
}
// 2 possibilities:
// - type 1 : Pbk (SDK_INT>= 0x17) fallback to MacSha
// - type 2 : MacSha
// We force type 2 to avoid a new calculation
byte[] msgToDigest = ByteBuffer.allocate(18)
.put(digestSecret)
.put(message)
.array();
byte[] digestStep1 = CryptoUtils.calcHmacSha256(msgToDigest, nonce) ;
if (authAlgo == 0x01) {
digestStep1 = CryptoUtils.pbkdf2Sha256(msgToDigest, nonce, 0x3e8, 0x100);
} else {
digestStep1 = CryptoUtils.calcHmacSha256(msgToDigest, nonce);
}
return CryptoUtils.calcHmacSha256(digestStep1, nonce);
}
public byte[] digestChallenge(byte[] secretKey, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException {
if (isHiChainLite) {
public byte[] digestChallenge(byte[] secretKey, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException {
if (authMode == 0x02) {
if (secretKey == null)
return null;
if (authVersion == 0x02) {
@ -149,8 +153,8 @@ public class HuaweiCrypto {
return computeDigest(MESSAGE_CHALLENGE, nonce);
}
public byte[] digestResponse(byte[] secretKey, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException {
if (isHiChainLite) {
public byte[] digestResponse(byte[] secretKey, byte[] nonce) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException {
if (authMode == 0x02) {
if (secretKey == null)
return null;
if (authVersion == 0x02) {

View File

@ -55,6 +55,7 @@ public class HuaweiPacket {
protected byte[] pinCode = null;
protected byte interval;
protected byte authAlgo;
public void setAuthVersion(byte authVersion) {
this.authVersion = authVersion;
@ -134,6 +135,14 @@ public class HuaweiPacket {
public void setEncryptionCounter(long counter) {
this.encryptionCounter = counter;
}
public void setAuthAlgo(byte authAlgo) {
this.authAlgo = authAlgo;
}
public byte getAuthAlgo () {
return this.authAlgo;
}
}
public static abstract class ParseException extends Exception {

View File

@ -625,8 +625,7 @@ public class DeviceConfig {
public Request(
ParamsProvider paramsProvider,
byte[] challenge,
byte[] nonce,
boolean isHiChainLite
byte[] nonce
) {
super(paramsProvider);
@ -636,8 +635,8 @@ public class DeviceConfig {
this.tlv = new HuaweiTLV()
.put(0x01, challenge)
.put(0x02, nonce);
if (isHiChainLite)
this.tlv.put(0x03, (byte)0x02); // Force type 2
if (paramsProvider.getAuthMode() == 0x02)
this.tlv.put(0x03, paramsProvider.getAuthAlgo());
this.isEncrypted = false;
this.complete = true;
}

View File

@ -0,0 +1,63 @@
/* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.Nullable;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
public class RedmiWatch2Coordinator extends XiaomiCoordinator {
@Override
public boolean isExperimental() {
return true;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^Redmi Watch 2 [A-Z0-9]{4}$");
}
@Nullable
@Override
public InstallHandler findInstallHandler(final Uri uri, final Context context) {
final XiaomiInstallHandler handler = new XiaomiInstallHandler(uri, context);
return handler.isValid() ? handler : null;
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_redmi_watch_2;
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_amazfit_bip;
}
@Override
public int getDisabledIconResource() {
return R.drawable.ic_device_amazfit_bip_disabled;
}
}

View File

@ -28,7 +28,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
public class RedmiWatch2Lite extends XiaomiCoordinator {
public class RedmiWatch2LiteCoordinator extends XiaomiCoordinator {
@Override
public boolean isExperimental() {
return true;

View File

@ -177,7 +177,8 @@ import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8pro.MiBand8Pro
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartbandpro.RedmiSmartBandProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2lite.RedmiWatch2Lite;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2.RedmiWatch2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmiwatch2lite.RedmiWatch2LiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1.XiaomiWatchS1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1active.XiaomiWatchS1ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watchs1pro.XiaomiWatchS1ProCoordinator;
@ -243,7 +244,8 @@ public enum DeviceType {
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),
REDMISMARTBAND2(RedmiSmartBand2Coordinator.class),
REDMIWATCH2LITE(RedmiWatch2Lite.class),
REDMIWATCH2(RedmiWatch2Coordinator.class),
REDMIWATCH2LITE(RedmiWatch2LiteCoordinator.class),
REDMISMARTBANDPRO(RedmiSmartBandProCoordinator.class),
XIAOMI_WATCH_S1_ACTIVE(XiaomiWatchS1ActiveCoordinator.class),
XIAOMI_WATCH_S1_PRO(XiaomiWatchS1ProCoordinator.class),

View File

@ -18,6 +18,7 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.operations.AbstractMiBandOperation;
public abstract class AbstractHuamiOperation extends AbstractMiBandOperation<HuamiSupport> {
@ -30,7 +31,7 @@ public abstract class AbstractHuamiOperation extends AbstractMiBandOperation<Hua
// TODO: check which notifications we should disable and re-enable here
// builder.notify(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS), enable)
// .notify(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_SENSOR_DATA), enable);
if (getSupport() instanceof Huami2021Support) {
if (getSupport() instanceof ZeppOsSupport) {
// Disable 2021 chunked reads, otherwise firmware upgrades and activity sync get interrupted
builder.notify(getCharacteristic(HuamiService.UUID_CHARACTERISTIC_CHUNKEDTRANSFER_2021_READ), enable);
}

View File

@ -96,7 +96,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.ActivateDisplayOnLift;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.ActivateDisplayOnLiftSensitivity;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.DisconnectNotificationSetting;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Service;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiCoordinator;
@ -1691,7 +1691,7 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
this.fetchOperationQueue.add(new FetchSpo2NormalOperation(this));
}
if (Huami2021Coordinator.experimentalFeatures(getDevice())) {
if (ZeppOsCoordinator.experimentalFeatures(getDevice())) {
if ((dataTypes & RecordedDataTypes.TYPE_HEART_RATE) != 0 && coordinator.supportsHeartRateStats()) {
this.fetchOperationQueue.add(new FetchHeartRateManualOperation(this));
this.fetchOperationQueue.add(new FetchHeartRateMaxOperation(this));

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitActiveFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitActiveFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitactive.AmazfitActiveFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitActiveSupport extends Huami2021Support {
public class AmazfitActiveSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitActiveFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitActiveEdgeFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitActiveEdgeFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitactiveedge.AmazfitActiveEdgeFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitActiveEdgeSupport extends Huami2021Support {
public class AmazfitActiveEdgeSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitActiveEdgeFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitBalanceFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitBalanceFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbalance.AmazfitBalanceFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitBalanceSupport extends Huami2021Support {
public class AmazfitBalanceSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitBalanceFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitBand7FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitBand7FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitband7.AmazfitBand7FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitBand7Support extends Huami2021Support {
public class AmazfitBand7Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitBand7FWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitBip5FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitBip5FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip5.AmazfitBip5FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitBip5Support extends Huami2021Support {
public class AmazfitBip5Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitBip5FWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitCheetahProFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitCheetahProFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahpro.AmazfitCheetahProFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitCheetahProSupport extends Huami2021Support {
public class AmazfitCheetahProSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitCheetahProFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitCheetahRoundFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitCheetahRoundFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahround.AmazfitCheetahRoundFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitCheetahRoundSupport extends Huami2021Support {
public class AmazfitCheetahRoundSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitCheetahRoundFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitCheetahSquareFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitCheetahSquareFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcheetahsquare.AmazfitCheetahSquareFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitCheetahSquareSupport extends Huami2021Support {
public class AmazfitCheetahSquareSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitCheetahSquareFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitFalconFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitFalconFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitfalcon.AmazfitFalconFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitFalconSupport extends Huami2021Support {
public class AmazfitFalconSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitFalconFWHelper(uri, context);

View File

@ -28,9 +28,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTR3FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTR3FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3FirmwareInfo.class);
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{

View File

@ -26,9 +26,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr3.AmazfitGTR3FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTR3Support extends Huami2021Support {
public class AmazfitGTR3Support extends ZeppOsSupport {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3Support.class);
@Override

View File

@ -28,9 +28,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTR3ProFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTR3ProFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3ProFirmwareInfo.class);
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{

View File

@ -26,9 +26,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr3pro.AmazfitGTR3ProFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTR3ProSupport extends Huami2021Support {
public class AmazfitGTR3ProSupport extends ZeppOsSupport {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTR3ProSupport.class);
@Override

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTR4FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTR4FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
put(1699, "3.17.0.2");

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr4.AmazfitGTR4FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTR4Support extends Huami2021Support {
public class AmazfitGTR4Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitGTR4FWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTRMiniFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTRMiniFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtrmini.AmazfitGTRMiniFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTRMiniSupport extends Huami2021Support {
public class AmazfitGTRMiniSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitGTRMiniFWHelper(uri, context);

View File

@ -28,9 +28,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTS3FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTS3FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTS3FirmwareInfo.class);
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{

View File

@ -24,12 +24,11 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts3.AmazfitGTS3FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTS3Support extends Huami2021Support {
public class AmazfitGTS3Support extends ZeppOsSupport {
private static final Logger LOG = LoggerFactory.getLogger(AmazfitGTS3Support.class);
@Override

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTS4FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTS4FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4.AmazfitGTS4FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTS4Support extends Huami2021Support {
public class AmazfitGTS4Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitGTS4FWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitGTS4MiniFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitGTS4MiniFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts4mini.AmazfitGTS4MiniFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitGTS4MiniSupport extends Huami2021Support {
public class AmazfitGTS4MiniSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitGTS4MiniFWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitTRex2FirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitTRex2FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrex2.AmazfitTRex2FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitTRex2Support extends Huami2021Support {
public class AmazfitTRex2Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitTRex2FWHelper(uri, context);

View File

@ -25,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class AmazfitTRexUltraFirmwareInfo extends Huami2021FirmwareInfo {
public class AmazfitTRexUltraFirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
}};

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrexultra.AmazfitTRexUltraFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class AmazfitTRexUltraSupport extends Huami2021Support {
public class AmazfitTRexUltraSupport extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new AmazfitTRexUltraFWHelper(uri, context);

View File

@ -16,9 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.miband7;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
@ -28,9 +25,9 @@ import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021FirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsFirmwareInfo;
public class MiBand7FirmwareInfo extends Huami2021FirmwareInfo {
public class MiBand7FirmwareInfo extends ZeppOsFirmwareInfo {
private static final Map<Integer, String> crcToVersion = new HashMap<Integer, String>() {{
// firmware
put(26036, "1.20.3.1");

View File

@ -23,9 +23,9 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband7.MiBand7FWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
public class MiBand7Support extends Huami2021Support {
public class MiBand7Support extends ZeppOsSupport {
@Override
public HuamiFWHelper createFWHelper(final Uri uri, final Context context) throws IOException {
return new MiBand7FWHelper(uri, context);

View File

@ -45,7 +45,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.AbstractGattListenerWriteAction;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceBusyAction;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiOperation;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport;
import nodomain.freeyourgadget.gadgetbridge.util.ArrayUtils;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
@ -163,7 +163,7 @@ public abstract class AbstractFetchOperation extends AbstractHuamiOperation {
/**
* Validates that the received data has the expected checksum. Only
* relevant for Huami2021Support devices.
* relevant for ZeppOsSupport devices.
*
* @param crc32 the expected checksum
* @return whether the checksum was valid
@ -187,7 +187,7 @@ public abstract class AbstractFetchOperation extends AbstractHuamiOperation {
protected void startFetching(TransactionBuilder builder, byte fetchType, GregorianCalendar sinceWhen) {
final String taskName = StringUtils.ensureNotNull(builder.getTaskName());
final HuamiSupport support = getSupport();
final boolean isHuami2021 = support instanceof Huami2021Support;
final boolean isZeppOs = support instanceof ZeppOsSupport;
byte[] fetchBytes = BLETypeConversions.join(new byte[]{
HuamiService.COMMAND_ACTIVITY_DATA_START_DATE,
fetchType},
@ -201,9 +201,9 @@ public abstract class AbstractFetchOperation extends AbstractHuamiOperation {
if (ArrayUtils.equals(value, HuamiService.RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS, 0)) {
handleActivityMetadata(value);
if (expectedDataLength == 0 && isHuami2021) {
if (expectedDataLength == 0 && isZeppOs) {
// Nothing to receive, if we try to fetch data it will fail
sendAck2021(true);
sendAckZeppOs(true);
} else if (expectedDataLength != 0) {
TransactionBuilder newBuilder = createTransactionBuilder(taskName + " Step 2");
newBuilder.notify(characteristicActivityData, true);
@ -305,7 +305,7 @@ public abstract class AbstractFetchOperation extends AbstractHuamiOperation {
if (value.length == 7 && !validChecksum(BLETypeConversions.toUint32(value, 3))) {
LOG.warn("Data checksum invalid");
handleActivityFetchFinish(false);
sendAck2021(true);
sendAckZeppOs(true);
return;
}
@ -319,15 +319,15 @@ public abstract class AbstractFetchOperation extends AbstractHuamiOperation {
final boolean keepActivityDataOnDevice = HuamiCoordinator.getKeepActivityDataOnDevice(getDevice().getAddress());
sendAck2021(keepActivityDataOnDevice || !handleFinishSuccess);
sendAckZeppOs(keepActivityDataOnDevice || !handleFinishSuccess);
}
protected void sendAck2021(final boolean keepDataOnDevice) {
if (!(getSupport() instanceof Huami2021Support)) {
protected void sendAckZeppOs(final boolean keepDataOnDevice) {
if (!(getSupport() instanceof ZeppOsSupport)) {
return;
}
LOG.debug("Sending ack 2021, keepDataOnDevice = {}", keepDataOnDevice);
LOG.debug("Sending Zepp OS ack, keepDataOnDevice = {}", keepDataOnDevice);
// 0x01 to ACK, mark as saved on phone (drop from band)
// 0x09 to ACK, but keep it marked as not saved

View File

@ -82,7 +82,7 @@ public abstract class AbstractRepeatingFetchOperation extends AbstractFetchOpera
if (!success) {
// We need to explicitly ack this, or the next operation will fail fetch will become stuck
sendAck2021(true);
sendAckZeppOs(true);
super.handleActivityFetchFinish(false);
return false;
}
@ -112,7 +112,7 @@ public abstract class AbstractRepeatingFetchOperation extends AbstractFetchOpera
try {
final boolean keepActivityDataOnDevice = HuamiCoordinator.getKeepActivityDataOnDevice(getDevice().getAddress());
sendAck2021(keepActivityDataOnDevice);
sendAckZeppOs(keepActivityDataOnDevice);
startFetching();
return true;
} catch (final IOException ex) {

View File

@ -34,7 +34,6 @@ import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021ActivitySummaryParser;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiActivitySummaryParser;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipService;
import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummary;
@ -44,10 +43,8 @@ import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryParser;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiActivityDetailsParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021ActivityDetailsParser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport;
import nodomain.freeyourgadget.gadgetbridge.util.CheckSums;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
/**

View File

@ -28,14 +28,14 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiService;
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiFirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.ZeppOsSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType;
import nodomain.freeyourgadget.gadgetbridge.util.ArrayUtils;
public class UpdateFirmwareOperation2021 extends UpdateFirmwareOperation2020 {
private static final Logger LOG = LoggerFactory.getLogger(UpdateFirmwareOperation2021.class);
public UpdateFirmwareOperation2021(final Uri uri, final Huami2021Support support) {
public UpdateFirmwareOperation2021(final Uri uri, final ZeppOsSupport support) {
super(uri, support);
}
@ -62,8 +62,8 @@ public class UpdateFirmwareOperation2021 extends UpdateFirmwareOperation2020 {
}
@Override
public Huami2021Support getSupport() {
return (Huami2021Support) super.getSupport();
public ZeppOsSupport getSupport() {
return (ZeppOsSupport) super.getSupport();
}
@Override

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos;
import android.content.Context;
import android.graphics.Bitmap;
@ -36,13 +36,13 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.AbstractMiBandFWInstallHandler;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiFirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
public abstract class AbstractHuami2021FWInstallHandler extends AbstractMiBandFWInstallHandler {
private static final Logger LOG = LoggerFactory.getLogger(AbstractHuami2021FWInstallHandler.class);
public abstract class AbstractZeppOsFwInstallHandler extends AbstractMiBandFWInstallHandler {
private static final Logger LOG = LoggerFactory.getLogger(AbstractZeppOsFwInstallHandler.class);
public AbstractHuami2021FWInstallHandler(final Uri uri, final Context context) {
public AbstractZeppOsFwInstallHandler(final Uri uri, final Context context) {
super(uri, context);
}
@ -51,8 +51,8 @@ public abstract class AbstractHuami2021FWInstallHandler extends AbstractMiBandFW
final AbstractHuamiFirmwareInfo firmwareInfo = getHelper().getFirmwareInfo();
final boolean shouldCache = firmwareInfo.getFirmwareType().isApp() || firmwareInfo.getFirmwareType().isWatchface();
if (shouldCache) {
if (firmwareInfo instanceof Huami2021FirmwareInfo) {
saveToCache((Huami2021FirmwareInfo) firmwareInfo, device);
if (firmwareInfo instanceof ZeppOsFirmwareInfo) {
saveToCache((ZeppOsFirmwareInfo) firmwareInfo, device);
} else {
LOG.warn("firmwareInfo is {} - this should never happen", firmwareInfo.getClass());
}
@ -70,7 +70,7 @@ public abstract class AbstractHuami2021FWInstallHandler extends AbstractMiBandFW
return (HuamiFWHelper) helper;
}
private void saveToCache(final Huami2021FirmwareInfo firmwareInfo, final GBDevice device) {
private void saveToCache(final ZeppOsFirmwareInfo firmwareInfo, final GBDevice device) {
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
final File appCacheDir;

View File

@ -26,19 +26,18 @@ import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.Huami2021Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.Huami2021Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos.services.ZeppOsAlexaService;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public abstract class AbstractZeppOsService {
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsAlexaService.class);
private final Huami2021Support mSupport;
private final ZeppOsSupport mSupport;
private boolean encrypted;
public AbstractZeppOsService(final Huami2021Support support, final boolean encryptedDefault) {
public AbstractZeppOsService(final ZeppOsSupport support, final boolean encryptedDefault) {
this.mSupport = support;
this.encrypted = encryptedDefault;
}
@ -75,13 +74,13 @@ public abstract class AbstractZeppOsService {
// we will already know the capabilities
}
protected Huami2021Support getSupport() {
protected ZeppOsSupport getSupport() {
return mSupport;
}
protected Huami2021Coordinator getCoordinator() {
protected ZeppOsCoordinator getCoordinator() {
final DeviceCoordinator coordinator = getSupport().getDevice().getDeviceCoordinator();
return (Huami2021Coordinator) coordinator;
return (ZeppOsCoordinator) coordinator;
}
protected Prefs getDevicePrefs() {

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos;
import androidx.annotation.Nullable;
@ -36,9 +36,10 @@ import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummary;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityPoint;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack;
import nodomain.freeyourgadget.gadgetbridge.model.GPSCoordinate;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiActivityDetailsParser;
public class Huami2021ActivityDetailsParser extends AbstractHuamiActivityDetailsParser {
private static final Logger LOG = LoggerFactory.getLogger(Huami2021ActivityDetailsParser.class);
public class ZeppOsActivityDetailsParser extends AbstractHuamiActivityDetailsParser {
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsActivityDetailsParser.class);
private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
@ -56,7 +57,7 @@ public class Huami2021ActivityDetailsParser extends AbstractHuamiActivityDetails
private final ActivityTrack activityTrack;
private ActivityPoint lastActivityPoint;
public Huami2021ActivityDetailsParser(final BaseActivitySummary summary) {
public ZeppOsActivityDetailsParser(final BaseActivitySummary summary) {
this.timestamp = summary.getStartTime();
this.longitude = summary.getBaseLongitude();

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -24,7 +24,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
/**
* The workout types, used to start / when workout tracking starts on the band.
*/
public enum Huami2021WorkoutTrackActivityType {
public enum ZeppOsActivityType {
AerobicCombo(0x33),
Aerobics(0x6d),
AirWalker(0x90),
@ -147,11 +147,11 @@ public enum Huami2021WorkoutTrackActivityType {
Zumba(0x4d),
;
private static final Logger LOG = LoggerFactory.getLogger(Huami2021WorkoutTrackActivityType.class);
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsActivityType.class);
private final byte code;
Huami2021WorkoutTrackActivityType(final int code) {
ZeppOsActivityType(final int code) {
this.code = (byte) code;
}
@ -210,8 +210,8 @@ public enum Huami2021WorkoutTrackActivityType {
return ActivityKind.TYPE_UNKNOWN;
}
public static Huami2021WorkoutTrackActivityType fromCode(final byte code) {
for (final Huami2021WorkoutTrackActivityType type : values()) {
public static ZeppOsActivityType fromCode(final byte code) {
for (final ZeppOsActivityType type : values()) {
if (type.getCode() == code) {
return type;
}

View File

@ -15,7 +15,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@ -23,12 +23,10 @@ import android.graphics.BitmapFactory;
import androidx.annotation.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.nio.charset.StandardCharsets;
@ -39,19 +37,22 @@ import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.AbstractHuamiFirmwareInfo;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiFirmwareType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.UIHHContainer;
import nodomain.freeyourgadget.gadgetbridge.util.ArrayUtils;
import nodomain.freeyourgadget.gadgetbridge.util.BitmapUtil;
import nodomain.freeyourgadget.gadgetbridge.util.ZipFile;
import nodomain.freeyourgadget.gadgetbridge.util.ZipFileException;
public abstract class Huami2021FirmwareInfo extends AbstractHuamiFirmwareInfo {
private static final Logger LOG = LoggerFactory.getLogger(Huami2021FirmwareInfo.class);
public abstract class ZeppOsFirmwareInfo extends AbstractHuamiFirmwareInfo {
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsFirmwareInfo.class);
private final String preComputedVersion;
private GBDeviceApp gbDeviceApp;
public Huami2021FirmwareInfo(final byte[] bytes) {
public ZeppOsFirmwareInfo(final byte[] bytes) {
super(bytes);
this.preComputedVersion = preComputeVersion();
}
@ -333,7 +334,7 @@ public abstract class Huami2021FirmwareInfo extends AbstractHuamiFirmwareInfo {
return null;
}
public Huami2021FirmwareInfo repackFirmwareInUIHH() throws IOException {
public ZeppOsFirmwareInfo repackFirmwareInUIHH() throws IOException {
if (!firmwareType.equals(HuamiFirmwareType.FIRMWARE)) {
throw new IllegalStateException("Can only repack FIRMWARE");
}
@ -341,7 +342,7 @@ public abstract class Huami2021FirmwareInfo extends AbstractHuamiFirmwareInfo {
final UIHHContainer uihh = packFirmwareInUIHH(getBytes());
try {
final Constructor<? extends Huami2021FirmwareInfo> constructor = this.getClass().getConstructor(byte[].class);
final Constructor<? extends ZeppOsFirmwareInfo> constructor = this.getClass().getConstructor(byte[].class);
return constructor.newInstance((Object) uihh.toRawBytes());
} catch (final Exception e) {
throw new IOException("Failed to construct new " + getClass().getName(), e);

View File

@ -15,14 +15,14 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.zeppos;
import java.util.HashMap;
import java.util.Map;
public class Huami2021MenuType {
public class ZeppOsMenuType {
/**
* These somewhat match the ones in {@link HuamiMenuType}, but not all. The band sends and
* These somewhat match the ones in HuamiMenuType, but not all. The band sends and
* receives those as 8-digit upper case hex strings.
*/
public static final Map<String, String> displayItemNameLookup = new HashMap<String, String>() {{

Some files were not shown because too many files have changed in this diff Show More