@capgo/capacitor-updater 4.14.17 → 4.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,6 +11,7 @@ import android.os.Bundle;
|
|
|
11
11
|
import android.util.Base64;
|
|
12
12
|
import android.util.Log;
|
|
13
13
|
import com.android.volley.BuildConfig;
|
|
14
|
+
import com.android.volley.DefaultRetryPolicy;
|
|
14
15
|
import com.android.volley.NetworkResponse;
|
|
15
16
|
import com.android.volley.Request;
|
|
16
17
|
import com.android.volley.RequestQueue;
|
|
@@ -63,7 +64,8 @@ public class CapacitorUpdater {
|
|
|
63
64
|
private static final String bundleDirectory = "versions";
|
|
64
65
|
|
|
65
66
|
public static final String TAG = "Capacitor-updater";
|
|
66
|
-
public static final String pluginVersion = "4.
|
|
67
|
+
public static final String pluginVersion = "4.15.1";
|
|
68
|
+
public static final int timeout = 20;
|
|
67
69
|
|
|
68
70
|
public SharedPreferences.Editor editor;
|
|
69
71
|
public SharedPreferences prefs;
|
|
@@ -755,6 +757,13 @@ public class CapacitorUpdater {
|
|
|
755
757
|
}
|
|
756
758
|
}
|
|
757
759
|
);
|
|
760
|
+
request.setRetryPolicy(
|
|
761
|
+
new DefaultRetryPolicy(
|
|
762
|
+
this.timeout,
|
|
763
|
+
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
|
|
764
|
+
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
|
|
765
|
+
)
|
|
766
|
+
);
|
|
758
767
|
this.requestQueue.add(request);
|
|
759
768
|
}
|
|
760
769
|
|
|
@@ -820,6 +829,13 @@ public class CapacitorUpdater {
|
|
|
820
829
|
}
|
|
821
830
|
}
|
|
822
831
|
);
|
|
832
|
+
request.setRetryPolicy(
|
|
833
|
+
new DefaultRetryPolicy(
|
|
834
|
+
this.timeout,
|
|
835
|
+
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
|
|
836
|
+
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
|
|
837
|
+
)
|
|
838
|
+
);
|
|
823
839
|
this.requestQueue.add(request);
|
|
824
840
|
}
|
|
825
841
|
|
|
@@ -880,6 +896,13 @@ public class CapacitorUpdater {
|
|
|
880
896
|
}
|
|
881
897
|
}
|
|
882
898
|
);
|
|
899
|
+
request.setRetryPolicy(
|
|
900
|
+
new DefaultRetryPolicy(
|
|
901
|
+
this.timeout,
|
|
902
|
+
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
|
|
903
|
+
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
|
|
904
|
+
)
|
|
905
|
+
);
|
|
883
906
|
this.requestQueue.add(request);
|
|
884
907
|
}
|
|
885
908
|
|
|
@@ -918,6 +941,13 @@ public class CapacitorUpdater {
|
|
|
918
941
|
}
|
|
919
942
|
}
|
|
920
943
|
);
|
|
944
|
+
request.setRetryPolicy(
|
|
945
|
+
new DefaultRetryPolicy(
|
|
946
|
+
this.timeout,
|
|
947
|
+
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
|
|
948
|
+
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
|
|
949
|
+
)
|
|
950
|
+
);
|
|
921
951
|
this.requestQueue.add(request);
|
|
922
952
|
}
|
|
923
953
|
|
|
@@ -229,6 +229,7 @@ extension CustomError: LocalizedError {
|
|
|
229
229
|
public let CAP_SERVER_PATH: String = "serverBasePath"
|
|
230
230
|
public var customId: String = ""
|
|
231
231
|
public let pluginVersion: String = "4.13.4"
|
|
232
|
+
public let timeout: Double = 20
|
|
232
233
|
public var statsUrl: String = ""
|
|
233
234
|
public var channelUrl: String = ""
|
|
234
235
|
public var appId: String = ""
|
|
@@ -393,7 +394,7 @@ extension CustomError: LocalizedError {
|
|
|
393
394
|
let latest: AppVersion = AppVersion()
|
|
394
395
|
let parameters: InfoObject = self.createInfoObject()
|
|
395
396
|
print("\(self.TAG) Auto-update parameters: \(parameters)")
|
|
396
|
-
let request = AF.request(url, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default)
|
|
397
|
+
let request = AF.request(url, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default, requestModifier: { $0.timeoutInterval = self.timeout })
|
|
397
398
|
|
|
398
399
|
request.validate().responseDecodable(of: AppVersionDec.self) { response in
|
|
399
400
|
switch response.result {
|
|
@@ -630,7 +631,7 @@ extension CustomError: LocalizedError {
|
|
|
630
631
|
var parameters: InfoObject = self.createInfoObject()
|
|
631
632
|
parameters.channel = channel
|
|
632
633
|
|
|
633
|
-
let request = AF.request(self.channelUrl, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default)
|
|
634
|
+
let request = AF.request(self.channelUrl, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default, requestModifier: { $0.timeoutInterval = self.timeout })
|
|
634
635
|
|
|
635
636
|
request.validate().responseDecodable(of: SetChannelDec.self) { response in
|
|
636
637
|
switch response.result {
|
|
@@ -665,7 +666,7 @@ extension CustomError: LocalizedError {
|
|
|
665
666
|
}
|
|
666
667
|
let semaphore: DispatchSemaphore = DispatchSemaphore(value: 0)
|
|
667
668
|
let parameters: InfoObject = self.createInfoObject()
|
|
668
|
-
let request = AF.request(self.channelUrl, method: .put, parameters: parameters, encoder: JSONParameterEncoder.default)
|
|
669
|
+
let request = AF.request(self.channelUrl, method: .put, parameters: parameters, encoder: JSONParameterEncoder.default, requestModifier: { $0.timeoutInterval = self.timeout })
|
|
669
670
|
|
|
670
671
|
request.validate().responseDecodable(of: GetChannelDec.self) { response in
|
|
671
672
|
switch response.result {
|
|
@@ -703,7 +704,7 @@ extension CustomError: LocalizedError {
|
|
|
703
704
|
var parameters: InfoObject = self.createInfoObject()
|
|
704
705
|
parameters.action = action
|
|
705
706
|
DispatchQueue.global(qos: .background).async {
|
|
706
|
-
let request = AF.request(self.statsUrl, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default)
|
|
707
|
+
let request = AF.request(self.statsUrl, method: .post, parameters: parameters, encoder: JSONParameterEncoder.default, requestModifier: { $0.timeoutInterval = self.timeout })
|
|
707
708
|
request.responseData { response in
|
|
708
709
|
switch response.result {
|
|
709
710
|
case .success:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"packageManager": "pnpm@7.
|
|
3
|
+
"version": "4.15.1",
|
|
4
|
+
"packageManager": "pnpm@7.21.0",
|
|
5
5
|
"license": "LGPL-3.0-only",
|
|
6
6
|
"description": "Live update for capacitor apps",
|
|
7
7
|
"main": "dist/plugin.cjs.js",
|