From 6403e13c9bc3a806e9c59f92c7d3e2ccd2e63449 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Sat, 29 May 2021 15:26:05 +0300 Subject: [PATCH] SerializedName should be a bit more explicit and theoretically allows reflectionless deserialization --- .../devices/pinetime/InfiniTimeDFUPackage.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/InfiniTimeDFUPackage.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/InfiniTimeDFUPackage.java index 631fba9c0..9b47e2c90 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/InfiniTimeDFUPackage.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/InfiniTimeDFUPackage.java @@ -16,34 +16,41 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.devices.pinetime; -import androidx.annotation.Keep; +import com.google.gson.annotations.SerializedName; import java.math.BigInteger; import java.util.List; -@Keep public class InfiniTimeDFUPackage { + @SerializedName("manifest") InfiniTimeDFUPackageManifest manifest; } -@Keep class InfiniTimeDFUPackageManifest { + @SerializedName("application") InfiniTimeDFUPackageApplication application; + @SerializedName("dfu_version") Float dfu_version; } -@Keep class InfiniTimeDFUPackageApplication { + @SerializedName("bin_file") String bin_file; + @SerializedName("dat_file") String dat_file; + @SerializedName("init_packet_data") InfiniTimeDFUPackagePacketData init_packet_data; } -@Keep class InfiniTimeDFUPackagePacketData { + @SerializedName("application_version") BigInteger application_version; + @SerializedName("device_revision") BigInteger device_revision; + @SerializedName("device_type") BigInteger device_type; + @SerializedName("firmware_crc16") BigInteger firmware_crc16; + @SerializedName("softdevice_req") List softdevice_req; }