2021-01-10 23:37:09 +01:00
|
|
|
/* Copyright (C) 2017-2021 Andreas Shimokawa, Carsten Pfeiffer
|
2019-06-12 23:44:01 +02:00
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.miband4;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.net.Uri;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
|
2019-07-24 09:33:53 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband4.MiBand4FWHelper;
|
2019-10-31 14:28:24 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
2019-06-12 23:44:01 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.miband3.MiBand3Support;
|
2021-03-24 23:49:52 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation;
|
2019-07-25 20:51:28 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperationNew;
|
2019-06-12 23:44:01 +02:00
|
|
|
|
|
|
|
public class MiBand4Support extends MiBand3Support {
|
|
|
|
|
2019-07-23 08:56:26 +02:00
|
|
|
@Override
|
|
|
|
public byte getCryptFlags() {
|
|
|
|
return (byte) 0x80;
|
|
|
|
}
|
|
|
|
|
2019-10-31 14:28:24 +01:00
|
|
|
@Override
|
2022-06-14 20:15:51 +02:00
|
|
|
protected boolean notificationHasExtraHeader() {
|
|
|
|
return true;
|
2019-10-31 14:28:24 +01:00
|
|
|
}
|
|
|
|
|
2019-06-12 23:44:01 +02:00
|
|
|
@Override
|
|
|
|
public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException {
|
2019-07-24 09:33:53 +02:00
|
|
|
return new MiBand4FWHelper(uri, context);
|
2019-06-12 23:44:01 +02:00
|
|
|
}
|
2019-07-25 20:51:28 +02:00
|
|
|
|
|
|
|
@Override
|
2021-03-24 23:49:52 +01:00
|
|
|
public UpdateFirmwareOperation createUpdateFirmwareOperation(Uri uri) {
|
2019-07-25 20:51:28 +02:00
|
|
|
return new UpdateFirmwareOperationNew(uri, this);
|
|
|
|
}
|
2019-06-12 23:44:01 +02:00
|
|
|
}
|