@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.
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +6 -4
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +6 -4
- package/package.json +1 -1
|
@@ -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.
|
|
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
|
|
361
|
-
* Returns
|
|
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
|
|
375
|
-
return cleanedKey.length() >=
|
|
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.
|
|
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
|
|
282
|
-
/// Returns
|
|
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
|
|
297
|
-
return String(cleanedKey.prefix(
|
|
298
|
+
// Return first 20 characters of the base64-encoded key
|
|
299
|
+
return String(cleanedKey.prefix(20))
|
|
298
300
|
}
|
|
299
301
|
}
|