@capgo/capacitor-updater 6.14.15 → 6.14.16
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.
|
@@ -194,7 +194,7 @@ public class DownloadService extends Worker {
|
|
|
194
194
|
copyFile(cacheFile, targetFile);
|
|
195
195
|
Log.d(TAG, "already cached " + fileName);
|
|
196
196
|
} else {
|
|
197
|
-
downloadAndVerify(downloadUrl, targetFile, cacheFile, finalFileHash);
|
|
197
|
+
downloadAndVerify(downloadUrl, targetFile, cacheFile, finalFileHash, sessionKey, publicKey);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
long completed = completedFiles.incrementAndGet();
|
|
@@ -365,7 +365,14 @@ public class DownloadService extends Worker {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
private void downloadAndVerify(
|
|
368
|
+
private void downloadAndVerify(
|
|
369
|
+
String downloadUrl,
|
|
370
|
+
File targetFile,
|
|
371
|
+
File cacheFile,
|
|
372
|
+
String expectedHash,
|
|
373
|
+
String sessionKey,
|
|
374
|
+
String publicKey
|
|
375
|
+
) throws Exception {
|
|
369
376
|
Log.d(TAG, "downloadAndVerify " + downloadUrl);
|
|
370
377
|
|
|
371
378
|
Request request = new Request.Builder().url(downloadUrl).build();
|
|
@@ -393,6 +400,11 @@ public class DownloadService extends Worker {
|
|
|
393
400
|
}
|
|
394
401
|
}
|
|
395
402
|
|
|
403
|
+
if (!publicKey.isEmpty() && sessionKey != null && !sessionKey.isEmpty()) {
|
|
404
|
+
Log.d(CapacitorUpdater.TAG + " DLSrv", "Decrypting file " + targetFile.getName());
|
|
405
|
+
CryptoCipherV2.decryptFile(compressedFile, publicKey, sessionKey);
|
|
406
|
+
}
|
|
407
|
+
|
|
396
408
|
// Use new decompression method
|
|
397
409
|
byte[] compressedData = Files.readAllBytes(compressedFile.toPath());
|
|
398
410
|
byte[] decompressedData = decompressBrotli(compressedData, targetFile.getName());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.16",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Live update for capacitor apps",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"CapgoCapacitorUpdater.podspec",
|
|
17
17
|
"Package.swift"
|
|
18
18
|
],
|
|
19
|
-
"author": "Martin Donadieu",
|
|
19
|
+
"author": "Martin Donadieu <martin@capgo.app>",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/Cap-go/capacitor-updater.git"
|