From 1a9c72660a56da183725fc26ba54620e7afff7d2 Mon Sep 17 00:00:00 2001 From: Martin Zeitler Date: Mon, 25 Mar 2024 00:08:26 +0100 Subject: [PATCH] models updates, annotations removed. --- .../agconnect/constants/EndpointUrl.java | 3 ++ .../agconnect/constants/ErrorMessage.java | 7 ++++ .../agconnect/constants/ResultCode.java | 3 ++ .../agconnect/model/ApiConfigFile.java | 2 -- .../agconnect/model/AppConfigFile.java | 12 +++---- .../agconnect/model/AppConfigInfo.java | 10 +++--- .../agconnect/model/AppIdListResponse.java | 1 - .../io/syslogic/agconnect/model/AppInfo.java | 1 - .../agconnect/model/AppInfoAppId.java | 1 - .../model/AppInfoDeviceMaterial.java | 1 - .../agconnect/model/AppInfoDeviceType.java | 1 - .../agconnect/model/AppInfoLanguage.java | 1 - .../agconnect/model/AppInfoLocalization.java | 1 - .../agconnect/model/AppInfoResponse.java | 1 - .../agconnect/model/AppInfoSimple.java | 32 +++++++++++++++++++ .../agconnect/model/AppSubmitResponse.java | 19 +++++++++++ .../syslogic/agconnect/model/AuditInfo.java | 1 - .../agconnect/model/CompileStateResponse.java | 1 - .../model/FileInfoUpdateRequest.java | 2 +- .../model/FileInfoUpdateResponse.java | 1 - .../agconnect/model/FileUploadInfo.java | 2 +- .../agconnect/model/PhasedReleaseInfo.java | 1 - .../agconnect/model/ResponseStatus.java | 1 - .../agconnect/model/TokenRequest.java | 2 +- .../agconnect/model/TokenResponse.java | 1 - .../agconnect/model/UploadChunkedRequest.java | 1 - .../model/UploadChunkedResponse.java | 1 - .../agconnect/model/UploadFileItem.java | 1 - .../agconnect/model/UploadFileResponse.java | 1 - .../agconnect/model/UploadResponse.java | 1 - .../agconnect/model/UploadResponseWrap.java | 1 - .../agconnect/model/UploadUrlRequest.java | 2 +- .../agconnect/model/UploadUrlResponse.java | 1 - 33 files changed, 78 insertions(+), 39 deletions(-) create mode 100644 src/main/java/io/syslogic/agconnect/constants/ErrorMessage.java create mode 100644 src/main/java/io/syslogic/agconnect/model/AppInfoSimple.java create mode 100644 src/main/java/io/syslogic/agconnect/model/AppSubmitResponse.java diff --git a/src/main/java/io/syslogic/agconnect/constants/EndpointUrl.java b/src/main/java/io/syslogic/agconnect/constants/EndpointUrl.java index 5b59782..ff020ee 100644 --- a/src/main/java/io/syslogic/agconnect/constants/EndpointUrl.java +++ b/src/main/java/io/syslogic/agconnect/constants/EndpointUrl.java @@ -39,6 +39,9 @@ public class EndpointUrl { /** Link to AppGallery Connect Console */ public static final String AG_CONNECT_APP_INFO = "https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/myApp/{appId}/97458334310914199"; + /** Link to AppGallery Connect Console */ + public static final String AG_CONNECT_INTEGRATION = "https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/myProject/99536292102543196/97458334310914194?appId={appId}"; + /** Link to AppGallery Connect Console */ public static final String AG_CONNECT_API_CLIENT = "https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/ups/9249519184595983326"; } diff --git a/src/main/java/io/syslogic/agconnect/constants/ErrorMessage.java b/src/main/java/io/syslogic/agconnect/constants/ErrorMessage.java new file mode 100644 index 0000000..e651dc3 --- /dev/null +++ b/src/main/java/io/syslogic/agconnect/constants/ErrorMessage.java @@ -0,0 +1,7 @@ +package io.syslogic.agconnect.constants; + +public class ErrorMessage { + + public static final String APP_SIGNING_NOT_ENABLED = "[cds]add apk failed, additional msg is [app bundle must do app signature.]"; + public static final String ONGOING_INTEGRATION_CHECK = "[cds]update service failed, additional msg is [The new service has can't be edited service,which can't be updated!]"; +} diff --git a/src/main/java/io/syslogic/agconnect/constants/ResultCode.java b/src/main/java/io/syslogic/agconnect/constants/ResultCode.java index 16652e5..e448b9e 100644 --- a/src/main/java/io/syslogic/agconnect/constants/ResultCode.java +++ b/src/main/java/io/syslogic/agconnect/constants/ResultCode.java @@ -28,6 +28,9 @@ public class ResultCode { /** API result code. */ public static final int FAILED_TO_UPLOAD_PACKAGE = 204144646; + + public static final int FAILED_TO_UPDATE_PACKAGE = 204144647; + /** API result code. */ public static final int ADD_APK_HAS_FAILED = 204144662; } diff --git a/src/main/java/io/syslogic/agconnect/model/ApiConfigFile.java b/src/main/java/io/syslogic/agconnect/model/ApiConfigFile.java index bdd19db..ee1d46c 100644 --- a/src/main/java/io/syslogic/agconnect/model/ApiConfigFile.java +++ b/src/main/java/io/syslogic/agconnect/model/ApiConfigFile.java @@ -4,12 +4,10 @@ /** * Abstract Model: ApiConfig - * * This is file distribution/agc-apiclient.json. * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class ApiConfigFile { @SerializedName("configuration_version") diff --git a/src/main/java/io/syslogic/agconnect/model/AppConfigFile.java b/src/main/java/io/syslogic/agconnect/model/AppConfigFile.java index 7f31700..e2000f0 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppConfigFile.java +++ b/src/main/java/io/syslogic/agconnect/model/AppConfigFile.java @@ -2,21 +2,21 @@ import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; + /** * Abstract Model: AppConfig - * * This is file agconnect-services.json, where only appInfo.appId is of interest. * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppConfigFile { @SerializedName("configuration_version") private String configVersion; - @SerializedName("app_info") - private AppConfigInfo appInfo; + @SerializedName("appInfos") + private ArrayList appInfos; /** @return the configVersion. */ public String getConfigVersion() { @@ -24,7 +24,7 @@ public String getConfigVersion() { } /** @return the AppConfigInfo. */ - public AppConfigInfo getAppInfo() { - return this.appInfo; + public ArrayList getAppInfos() { + return this.appInfos; } } diff --git a/src/main/java/io/syslogic/agconnect/model/AppConfigInfo.java b/src/main/java/io/syslogic/agconnect/model/AppConfigInfo.java index 99dc0ba..1bdf3cb 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppConfigInfo.java +++ b/src/main/java/io/syslogic/agconnect/model/AppConfigInfo.java @@ -4,23 +4,21 @@ /** * Abstract Model: AppConfigInfo - * * This is file agconnect-services.json, where only appId is of interest. * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppConfigInfo { - @SerializedName("app_id") - private Long appId; - @SerializedName("package_name") private String packageName; + @SerializedName("app_info") + private AppInfoSimple appInfo; + /** @return the appId. */ public Long getAppId() { - return this.appId; + return this.appInfo.getAppId(); } /** @return the packageName. */ diff --git a/src/main/java/io/syslogic/agconnect/model/AppIdListResponse.java b/src/main/java/io/syslogic/agconnect/model/AppIdListResponse.java index 2ff0674..32d3b25 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppIdListResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/AppIdListResponse.java @@ -9,7 +9,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppIdListResponse { @SerializedName("ret") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfo.java b/src/main/java/io/syslogic/agconnect/model/AppInfo.java index 14accb6..b89f668 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfo.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfo.java @@ -11,7 +11,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfo { @SerializedName("releaseState") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoAppId.java b/src/main/java/io/syslogic/agconnect/model/AppInfoAppId.java index a1d620b..e6b42e8 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoAppId.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoAppId.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoAppId { @SerializedName("key") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceMaterial.java b/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceMaterial.java index 2208372..f2fbe37 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceMaterial.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceMaterial.java @@ -5,7 +5,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoDeviceMaterial { @Override diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceType.java b/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceType.java index f07bc31..98cb502 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceType.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoDeviceType.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoDeviceType { @SerializedName("deviceType") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoLanguage.java b/src/main/java/io/syslogic/agconnect/model/AppInfoLanguage.java index 1bf64c0..97cb25d 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoLanguage.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoLanguage.java @@ -9,7 +9,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoLanguage { @SerializedName("lang") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoLocalization.java b/src/main/java/io/syslogic/agconnect/model/AppInfoLocalization.java index 7cc531c..6648185 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoLocalization.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoLocalization.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoLocalization { @SerializedName("lang") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoResponse.java b/src/main/java/io/syslogic/agconnect/model/AppInfoResponse.java index 7ad6e70..35075c6 100644 --- a/src/main/java/io/syslogic/agconnect/model/AppInfoResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoResponse.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AppInfoResponse { @SerializedName("ret") diff --git a/src/main/java/io/syslogic/agconnect/model/AppInfoSimple.java b/src/main/java/io/syslogic/agconnect/model/AppInfoSimple.java new file mode 100644 index 0000000..fa79757 --- /dev/null +++ b/src/main/java/io/syslogic/agconnect/model/AppInfoSimple.java @@ -0,0 +1,32 @@ +package io.syslogic.agconnect.model; + +import com.google.gson.annotations.SerializedName; + +/** + * Abstract Model: AppInfo Simple + * + * @author Martin Zeitler + */ +public class AppInfoSimple { + + @SerializedName("app_id") + private Long appId; + + @SerializedName("package_name") + private String packageName; + + public Long getAppId() { + return this.appId; + } + public String getPackageName() { + return this.packageName; + } + + @Override + public String toString() { + return "AppInfoSimple {" + + "appId: \"" + this.getAppId() + "\", " + + "packageName: \"" + this.getPackageName() + "\" " + + "}"; + } +} diff --git a/src/main/java/io/syslogic/agconnect/model/AppSubmitResponse.java b/src/main/java/io/syslogic/agconnect/model/AppSubmitResponse.java new file mode 100644 index 0000000..2a19b2b --- /dev/null +++ b/src/main/java/io/syslogic/agconnect/model/AppSubmitResponse.java @@ -0,0 +1,19 @@ +package io.syslogic.agconnect.model; + +import com.google.gson.annotations.SerializedName; + +/** + * Abstract Model: AppSubmitResponse + * + * @author Martin Zeitler + */ +public class AppSubmitResponse { + + @SerializedName("ret") + private ResponseStatus ret; + + /** @return response status. */ + public ResponseStatus getRet() { + return this.ret; + } +} diff --git a/src/main/java/io/syslogic/agconnect/model/AuditInfo.java b/src/main/java/io/syslogic/agconnect/model/AuditInfo.java index 4b5aab5..6701fc3 100644 --- a/src/main/java/io/syslogic/agconnect/model/AuditInfo.java +++ b/src/main/java/io/syslogic/agconnect/model/AuditInfo.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class AuditInfo { /** Overall review comments of an app. */ diff --git a/src/main/java/io/syslogic/agconnect/model/CompileStateResponse.java b/src/main/java/io/syslogic/agconnect/model/CompileStateResponse.java index 98f5916..8d7ef21 100644 --- a/src/main/java/io/syslogic/agconnect/model/CompileStateResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/CompileStateResponse.java @@ -9,7 +9,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class CompileStateResponse { @SerializedName("ret") diff --git a/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateRequest.java b/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateRequest.java index 1d85d46..e3403c7 100644 --- a/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateRequest.java +++ b/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateRequest.java @@ -8,7 +8,7 @@ * * @author Martin Zeitler */ -@SuppressWarnings({"unused", "FieldMayBeFinal"}) +@SuppressWarnings({"FieldMayBeFinal"}) public class FileInfoUpdateRequest { @SerializedName("lang") diff --git a/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateResponse.java b/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateResponse.java index fdfa1c6..baf297d 100644 --- a/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/FileInfoUpdateResponse.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class FileInfoUpdateResponse { @SerializedName("ret") diff --git a/src/main/java/io/syslogic/agconnect/model/FileUploadInfo.java b/src/main/java/io/syslogic/agconnect/model/FileUploadInfo.java index 625a23c..7cfa8fa 100644 --- a/src/main/java/io/syslogic/agconnect/model/FileUploadInfo.java +++ b/src/main/java/io/syslogic/agconnect/model/FileUploadInfo.java @@ -7,7 +7,7 @@ * * @author Martin Zeitler */ -@SuppressWarnings({"unused", "FieldMayBeFinal"}) +@SuppressWarnings({"FieldMayBeFinal"}) public class FileUploadInfo { @SerializedName("fileName") diff --git a/src/main/java/io/syslogic/agconnect/model/PhasedReleaseInfo.java b/src/main/java/io/syslogic/agconnect/model/PhasedReleaseInfo.java index 1ab20f7..17cfb2b 100644 --- a/src/main/java/io/syslogic/agconnect/model/PhasedReleaseInfo.java +++ b/src/main/java/io/syslogic/agconnect/model/PhasedReleaseInfo.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class PhasedReleaseInfo { /** diff --git a/src/main/java/io/syslogic/agconnect/model/ResponseStatus.java b/src/main/java/io/syslogic/agconnect/model/ResponseStatus.java index 3cc22c5..52a86ed 100644 --- a/src/main/java/io/syslogic/agconnect/model/ResponseStatus.java +++ b/src/main/java/io/syslogic/agconnect/model/ResponseStatus.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class ResponseStatus { @SerializedName(value="errorCode", alternate={"code"}) diff --git a/src/main/java/io/syslogic/agconnect/model/TokenRequest.java b/src/main/java/io/syslogic/agconnect/model/TokenRequest.java index 4bfd95e..8f46c2b 100644 --- a/src/main/java/io/syslogic/agconnect/model/TokenRequest.java +++ b/src/main/java/io/syslogic/agconnect/model/TokenRequest.java @@ -7,7 +7,7 @@ * * @author Martin Zeitler */ -@SuppressWarnings({"unused", "FieldMayBeFinal"}) +@SuppressWarnings({"FieldMayBeFinal"}) public class TokenRequest { @SerializedName("grant_type") diff --git a/src/main/java/io/syslogic/agconnect/model/TokenResponse.java b/src/main/java/io/syslogic/agconnect/model/TokenResponse.java index 84954d3..4f278b9 100644 --- a/src/main/java/io/syslogic/agconnect/model/TokenResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/TokenResponse.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class TokenResponse { @SerializedName("access_token") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadChunkedRequest.java b/src/main/java/io/syslogic/agconnect/model/UploadChunkedRequest.java index b854d7c..a4670ed 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadChunkedRequest.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadChunkedRequest.java @@ -5,7 +5,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadChunkedRequest { } diff --git a/src/main/java/io/syslogic/agconnect/model/UploadChunkedResponse.java b/src/main/java/io/syslogic/agconnect/model/UploadChunkedResponse.java index 52231ed..38647d1 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadChunkedResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadChunkedResponse.java @@ -5,7 +5,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadChunkedResponse { } diff --git a/src/main/java/io/syslogic/agconnect/model/UploadFileItem.java b/src/main/java/io/syslogic/agconnect/model/UploadFileItem.java index ca1c6a7..409e83e 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadFileItem.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadFileItem.java @@ -9,7 +9,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadFileItem { @SerializedName("fileDestUlr") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadFileResponse.java b/src/main/java/io/syslogic/agconnect/model/UploadFileResponse.java index d8385af..4c392b2 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadFileResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadFileResponse.java @@ -9,7 +9,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadFileResponse { @SerializedName("ifSuccess") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadResponse.java b/src/main/java/io/syslogic/agconnect/model/UploadResponse.java index 64fbf7f..42354cf 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadResponse.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadResponse { @SerializedName("resultCode") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadResponseWrap.java b/src/main/java/io/syslogic/agconnect/model/UploadResponseWrap.java index d4a257c..fb5992e 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadResponseWrap.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadResponseWrap.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadResponseWrap { @SerializedName("resultCode") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadUrlRequest.java b/src/main/java/io/syslogic/agconnect/model/UploadUrlRequest.java index f14c309..48ec5f8 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadUrlRequest.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadUrlRequest.java @@ -7,7 +7,7 @@ * * @author Martin Zeitler */ -@SuppressWarnings({"unused", "FieldMayBeFinal"}) +@SuppressWarnings({"FieldMayBeFinal"}) public class UploadUrlRequest { @SerializedName("appId") diff --git a/src/main/java/io/syslogic/agconnect/model/UploadUrlResponse.java b/src/main/java/io/syslogic/agconnect/model/UploadUrlResponse.java index 89501a7..43ca8ff 100644 --- a/src/main/java/io/syslogic/agconnect/model/UploadUrlResponse.java +++ b/src/main/java/io/syslogic/agconnect/model/UploadUrlResponse.java @@ -7,7 +7,6 @@ * * @author Martin Zeitler */ -@SuppressWarnings("unused") public class UploadUrlResponse { @SerializedName("ret")