@capgo/capacitor-updater 4.3.5 → 4.3.7

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.3.5";
48
+ public static final String pluginVersion = "4.3.7";
49
49
 
50
50
  public SharedPreferences.Editor editor;
51
51
  public SharedPreferences prefs;
@@ -286,7 +286,7 @@ public class CapacitorUpdater {
286
286
  private boolean bundleExists(final String id) {
287
287
  final File bundle = this.getBundleDirectory(id);
288
288
  final BundleInfo bundleInfo = this.getBundleInfo(id);
289
- if (bundle == null || !bundle.exists() || !bundleInfo.isDeleted()) {
289
+ if (bundle == null || !bundle.exists() || bundleInfo.isDeleted()) {
290
290
  return false;
291
291
  }
292
292
  return new File(bundle.getPath(), "/index.html").exists();
@@ -134,7 +134,7 @@ extension CustomError: LocalizedError {
134
134
 
135
135
  private let versionName = Bundle.main.versionName ?? ""
136
136
  private let versionCode = Bundle.main.versionCode ?? ""
137
- private let versionOs = ProcessInfo().operatingSystemVersion.getFullVersion()
137
+ private let versionOs = UIDevice.current.systemVersion
138
138
  private let documentsDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
139
139
  private let libraryDir = FileManager.default.urls(for: .libraryDirectory, in: .userDomainMask).first!
140
140
  private let bundleDirectoryHot = "versions"
@@ -146,7 +146,7 @@ extension CustomError: LocalizedError {
146
146
 
147
147
  public let TAG = "✨ Capacitor-updater:"
148
148
  public let CAP_SERVER_PATH = "serverBasePath"
149
- public let pluginVersion = "4.3.5"
149
+ public let pluginVersion = "4.3.7"
150
150
  public var statsUrl = ""
151
151
  public var appId = ""
152
152
  public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
@@ -403,10 +403,10 @@ extension CustomError: LocalizedError {
403
403
  if bundleExists(id: id) {
404
404
  self.setCurrentBundle(bundle: self.getBundleDirectory(id: id).path)
405
405
  self.setBundleStatus(id: id, status: BundleStatus.PENDING)
406
- sendStats(action: "set", versionName: newBundle.getVersionName())
406
+ self.sendStats(action: "set", versionName: newBundle.getVersionName())
407
407
  return true
408
408
  }
409
- sendStats(action: "set_fail", versionName: newBundle.getVersionName())
409
+ self.sendStats(action: "set_fail", versionName: newBundle.getVersionName())
410
410
  return false
411
411
  }
412
412
 
@@ -428,7 +428,7 @@ extension CustomError: LocalizedError {
428
428
  self.setFallbackBundle(fallback: Optional<BundleInfo>.none)
429
429
  _ = self.setNextBundle(next: Optional<String>.none)
430
430
  if !isInternal {
431
- sendStats(action: "reset", versionName: self.getCurrentBundle().getVersionName())
431
+ self.sendStats(action: "reset", versionName: self.getCurrentBundle().getVersionName())
432
432
  }
433
433
  }
434
434
 
@@ -453,7 +453,9 @@ extension CustomError: LocalizedError {
453
453
  }
454
454
 
455
455
  func sendStats(action: String, versionName: String) {
456
- if self.statsUrl == "" { return }
456
+ if self.statsUrl == "" {
457
+ return
458
+ }
457
459
  let parameters: [String: String] = [
458
460
  "platform": "ios",
459
461
  "action": action,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.3.5",
3
+ "version": "4.3.7",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",