@capgo/capacitor-updater 6.1.34 → 6.2.0
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.
|
@@ -53,7 +53,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
53
53
|
private static final String channelUrlDefault =
|
|
54
54
|
"https://api.capgo.app/channel_self";
|
|
55
55
|
|
|
56
|
-
private final String PLUGIN_VERSION = "6.
|
|
56
|
+
private final String PLUGIN_VERSION = "6.2.0";
|
|
57
57
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
58
58
|
|
|
59
59
|
private SharedPreferences.Editor editor;
|
|
@@ -1148,6 +1148,37 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
final String latestVersionName = res.getString("version");
|
|
1152
|
+
|
|
1153
|
+
if ("builtin".equals(latestVersionName)) {
|
|
1154
|
+
Log.i(CapacitorUpdater.TAG, "Latest version is builtin");
|
|
1155
|
+
if (CapacitorUpdaterPlugin.this.implementation.directUpdate) {
|
|
1156
|
+
Log.i(
|
|
1157
|
+
CapacitorUpdater.TAG,
|
|
1158
|
+
"Direct update to builtin version"
|
|
1159
|
+
);
|
|
1160
|
+
this._reset(false);
|
|
1161
|
+
CapacitorUpdaterPlugin.this.endBackGroundTaskWithNotif(
|
|
1162
|
+
"Updated to builtin version",
|
|
1163
|
+
latestVersionName,
|
|
1164
|
+
CapacitorUpdaterPlugin.this.implementation.getCurrentBundle(),
|
|
1165
|
+
false
|
|
1166
|
+
);
|
|
1167
|
+
} else {
|
|
1168
|
+
Log.i(CapacitorUpdater.TAG, "Setting next bundle to builtin");
|
|
1169
|
+
CapacitorUpdaterPlugin.this.implementation.setNextBundle(
|
|
1170
|
+
BundleInfo.ID_BUILTIN
|
|
1171
|
+
);
|
|
1172
|
+
CapacitorUpdaterPlugin.this.endBackGroundTaskWithNotif(
|
|
1173
|
+
"Next update will be to builtin version",
|
|
1174
|
+
latestVersionName,
|
|
1175
|
+
current,
|
|
1176
|
+
false
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1151
1182
|
if (
|
|
1152
1183
|
!res.has("url") ||
|
|
1153
1184
|
!CapacitorUpdaterPlugin.this.isValidURL(res.getString("url"))
|
|
@@ -1161,7 +1192,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
1161
1192
|
);
|
|
1162
1193
|
return;
|
|
1163
1194
|
}
|
|
1164
|
-
final String latestVersionName = res.getString("version");
|
|
1165
1195
|
|
|
1166
1196
|
if (
|
|
1167
1197
|
latestVersionName != null &&
|
|
@@ -16,7 +16,7 @@ import SwiftyRSA
|
|
|
16
16
|
@objc(CapacitorUpdaterPlugin)
|
|
17
17
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
18
18
|
public var implementation = CapacitorUpdater()
|
|
19
|
-
private let PLUGIN_VERSION: String = "6.
|
|
19
|
+
private let PLUGIN_VERSION: String = "6.2.0"
|
|
20
20
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
21
21
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
22
22
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|
|
@@ -696,6 +696,19 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
696
696
|
self.endBackGroundTaskWithNotif(msg: res.message ?? "", latestVersionName: res.version, current: current, error: true)
|
|
697
697
|
return
|
|
698
698
|
}
|
|
699
|
+
if res.version == "builtin" {
|
|
700
|
+
print("\(self.implementation.TAG) Latest version is builtin")
|
|
701
|
+
if self.directUpdate {
|
|
702
|
+
print("\(self.implementation.TAG) Direct update to builtin version")
|
|
703
|
+
_ = self._reset(toLastSuccessful: false)
|
|
704
|
+
self.endBackGroundTaskWithNotif(msg: "Updated to builtin version", latestVersionName: res.version, current: self.implementation.getCurrentBundle(), error: false)
|
|
705
|
+
} else {
|
|
706
|
+
print("\(self.implementation.TAG) Setting next bundle to builtin")
|
|
707
|
+
_ = self.implementation.setNextBundle(next: BundleInfo.ID_BUILTIN)
|
|
708
|
+
self.endBackGroundTaskWithNotif(msg: "Next update will be to builtin version", latestVersionName: res.version, current: current, error: false)
|
|
709
|
+
}
|
|
710
|
+
return
|
|
711
|
+
}
|
|
699
712
|
let sessionKey = res.sessionKey ?? ""
|
|
700
713
|
guard let downloadUrl = URL(string: res.url) else {
|
|
701
714
|
print("\(self.implementation.TAG) Error no url or wrong format")
|