@capgo/capacitor-updater 8.40.7 → 8.40.8

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.
@@ -85,7 +85,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
85
85
  private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
86
86
  private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
87
87
 
88
- private final String pluginVersion = "8.40.7";
88
+ private final String pluginVersion = "8.40.8";
89
89
  private static final String DELAY_CONDITION_PREFERENCES = "";
90
90
 
91
91
  private SharedPreferences.Editor editor;
@@ -357,8 +357,10 @@ public class CryptoCipher {
357
357
  }
358
358
 
359
359
  /**
360
- * Get first 4 characters of the public key for identification.
361
- * Returns 4-character string or empty string if key is invalid/empty.
360
+ * Get first 20 characters of the public key for identification.
361
+ * Returns 20-character string or empty string if key is invalid/empty.
362
+ * The first 12 chars are always "MIIBCgKCAQEA" for RSA 2048-bit keys,
363
+ * so the unique part starts at character 13.
362
364
  */
363
365
  public static String calcKeyId(String publicKey) {
364
366
  if (publicKey == null || publicKey.isEmpty()) {
@@ -371,7 +373,7 @@ public class CryptoCipher {
371
373
  .replace("-----BEGINRSAPUBLICKEY-----", "")
372
374
  .replace("-----ENDRSAPUBLICKEY-----", "");
373
375
 
374
- // Return first 4 characters of the base64-encoded key
375
- return cleanedKey.length() >= 4 ? cleanedKey.substring(0, 4) : cleanedKey;
376
+ // Return first 20 characters of the base64-encoded key
377
+ return cleanedKey.length() >= 20 ? cleanedKey.substring(0, 20) : cleanedKey;
376
378
  }
377
379
  }
@@ -60,7 +60,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
60
60
  CAPPluginMethod(name: "completeFlexibleUpdate", returnType: CAPPluginReturnPromise)
61
61
  ]
62
62
  public var implementation = CapgoUpdater()
63
- private let pluginVersion: String = "8.40.7"
63
+ private let pluginVersion: String = "8.40.8"
64
64
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
65
65
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
66
66
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -278,8 +278,10 @@ public struct CryptoCipher {
278
278
  }
279
279
  }
280
280
 
281
- /// Get first 4 characters of the public key for identification
282
- /// Returns 4-character string or empty string if key is invalid/empty
281
+ /// Get first 20 characters of the public key for identification
282
+ /// Returns 20-character string or empty string if key is invalid/empty
283
+ /// The first 12 chars are always "MIIBCgKCAQEA" for RSA 2048-bit keys,
284
+ /// so the unique part starts at character 13
283
285
  public static func calcKeyId(publicKey: String) -> String {
284
286
  if publicKey.isEmpty {
285
287
  return ""
@@ -293,7 +295,7 @@ public struct CryptoCipher {
293
295
  .replacingOccurrences(of: "\r", with: "")
294
296
  .replacingOccurrences(of: " ", with: "")
295
297
 
296
- // Return first 4 characters of the base64-encoded key
297
- return String(cleanedKey.prefix(4))
298
+ // Return first 20 characters of the base64-encoded key
299
+ return String(cleanedKey.prefix(20))
298
300
  }
299
301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "8.40.7",
3
+ "version": "8.40.8",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",