@capgo/capacitor-updater 5.3.46 → 5.3.48
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/CapacitorUpdater.java +2 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +3 -5
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +1 -1
- package/package.json +1 -1
|
@@ -488,9 +488,10 @@ public class CapacitorUpdater {
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
private String getChecksum(File file) throws IOException {
|
|
491
|
+
final int BUFFER_SIZE = 1024 * 1024 * 5; // 5 MB buffer size
|
|
491
492
|
CRC32 crc = new CRC32();
|
|
492
493
|
try (FileInputStream fis = new FileInputStream(file)) {
|
|
493
|
-
byte[] buffer = new byte[
|
|
494
|
+
byte[] buffer = new byte[BUFFER_SIZE];
|
|
494
495
|
int length;
|
|
495
496
|
while ((length = fis.read(buffer)) != -1) {
|
|
496
497
|
crc.update(buffer, 0, length);
|
|
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "5.3.
|
|
58
|
+
private final String PLUGIN_VERSION = "5.3.48";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -334,13 +334,13 @@ extension CustomError: LocalizedError {
|
|
|
334
334
|
private func getChecksum(filePath: URL) -> String {
|
|
335
335
|
let bufferSize = 1024 * 1024 * 5 // 5 MB
|
|
336
336
|
var checksum = uLong(0)
|
|
337
|
-
|
|
337
|
+
|
|
338
338
|
do {
|
|
339
339
|
let fileHandle = try FileHandle(forReadingFrom: filePath)
|
|
340
340
|
defer {
|
|
341
341
|
fileHandle.closeFile()
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
|
|
344
344
|
while autoreleasepool(invoking: {
|
|
345
345
|
let fileData = fileHandle.readData(ofLength: bufferSize)
|
|
346
346
|
if fileData.count > 0 {
|
|
@@ -352,7 +352,7 @@ extension CustomError: LocalizedError {
|
|
|
352
352
|
return false // End of file
|
|
353
353
|
}
|
|
354
354
|
}) {}
|
|
355
|
-
|
|
355
|
+
|
|
356
356
|
return String(format: "%08X", checksum).lowercased()
|
|
357
357
|
} catch {
|
|
358
358
|
print("\(self.TAG) Cannot get checksum: \(filePath.path)", error)
|
|
@@ -360,8 +360,6 @@ extension CustomError: LocalizedError {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
|
|
365
363
|
private func decryptFile(filePath: URL, sessionKey: String, version: String) throws {
|
|
366
364
|
if self.privateKey.isEmpty || sessionKey.isEmpty || sessionKey.components(separatedBy: ":").count != 2 {
|
|
367
365
|
print("\(self.TAG) Cannot found privateKey or sessionKey")
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
public var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "5.3.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.3.48"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|