@capgo/capacitor-updater 4.4.11 → 4.5.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.
@@ -45,7 +45,7 @@ public class CapacitorUpdater {
45
45
  private static final String bundleDirectory = "versions";
46
46
 
47
47
  public static final String TAG = "Capacitor-updater";
48
- public static final String pluginVersion = "4.4.11";
48
+ public static final String pluginVersion = "4.5.0";
49
49
 
50
50
  public SharedPreferences.Editor editor;
51
51
  public SharedPreferences prefs;
@@ -603,7 +603,7 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
603
603
  Log.i(CapacitorUpdater.TAG, "message " + res.get("message"));
604
604
  if (res.has("major") && res.getBoolean("major") && res.has("version")) {
605
605
  final JSObject majorAvailable = new JSObject();
606
- majorAvailable.put("version", (String) res.get("version"));
606
+ majorAvailable.put("version", res.getString("version"));
607
607
  CapacitorUpdaterPlugin.this.notifyListeners("majorAvailable", majorAvailable);
608
608
  }
609
609
  final JSObject retNoNeed = new JSObject();
@@ -612,13 +612,13 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
612
612
  return;
613
613
  }
614
614
 
615
- if (!res.has("url") || !CapacitorUpdaterPlugin.this.isValidURL((String) res.get("url"))) {
615
+ if (!res.has("url") || !CapacitorUpdaterPlugin.this.isValidURL(res.getString("url"))) {
616
616
  Log.e(CapacitorUpdater.TAG, "Error no url or wrong format");
617
617
  final JSObject retNoNeed = new JSObject();
618
618
  retNoNeed.put("bundle", current.toJSON());
619
619
  CapacitorUpdaterPlugin.this.notifyListeners("noNeedUpdate", retNoNeed);
620
620
  }
621
- final String latestVersionName = (String) res.get("version");
621
+ final String latestVersionName = res.getString("version");
622
622
 
623
623
  if (
624
624
  latestVersionName != null &&
@@ -687,10 +687,10 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
687
687
  ". Update will occur next time app moves to background."
688
688
  );
689
689
 
690
- final String url = (String) res.get("url");
690
+ final String url = res.getString("url");
691
691
  final BundleInfo next =
692
692
  CapacitorUpdaterPlugin.this.implementation.download(url, latestVersionName);
693
- final String checksum = (String) res.get("checksum");
693
+ final String checksum = res.has("checksum") ? res.getString("checksum") : "";
694
694
  if (!checksum.equals("") && !next.getChecksum().equals(checksum)) {
695
695
  Log.e(
696
696
  CapacitorUpdater.TAG,
@@ -148,7 +148,7 @@ extension CustomError: LocalizedError {
148
148
 
149
149
  public let TAG = "✨ Capacitor-updater:"
150
150
  public let CAP_SERVER_PATH = "serverBasePath"
151
- public let pluginVersion = "4.4.11"
151
+ public let pluginVersion = "4.5.0"
152
152
  public var statsUrl = ""
153
153
  public var appId = ""
154
154
  public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.4.11",
3
+ "version": "4.5.0",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",