@capgo/capacitor-updater 6.14.14 → 6.14.15

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, sessionKey, publicKey);
197
+ downloadAndVerify(downloadUrl, targetFile, cacheFile, finalFileHash);
198
198
  }
199
199
 
200
200
  long completed = completedFiles.incrementAndGet();
@@ -229,9 +229,11 @@ public class DownloadService extends Worker {
229
229
  }
230
230
 
231
231
  if (hasError.get()) {
232
+ Log.e(TAG, "One or more files failed to download");
232
233
  throw new IOException("One or more files failed to download");
233
234
  }
234
235
  } catch (Exception e) {
236
+ Log.e(TAG, "Error in handleManifestDownload", e);
235
237
  throw new RuntimeException(e.getLocalizedMessage());
236
238
  }
237
239
  }
@@ -363,14 +365,7 @@ public class DownloadService extends Worker {
363
365
  }
364
366
  }
365
367
 
366
- private void downloadAndVerify(
367
- String downloadUrl,
368
- File targetFile,
369
- File cacheFile,
370
- String expectedHash,
371
- String sessionKey,
372
- String publicKey
373
- ) throws Exception {
368
+ private void downloadAndVerify(String downloadUrl, File targetFile, File cacheFile, String expectedHash) throws Exception {
374
369
  Log.d(TAG, "downloadAndVerify " + downloadUrl);
375
370
 
376
371
  Request request = new Request.Builder().url(downloadUrl).build();
@@ -398,14 +393,6 @@ public class DownloadService extends Worker {
398
393
  }
399
394
  }
400
395
 
401
- String decryptedExpectedHash = expectedHash;
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
- decryptedExpectedHash = CryptoCipherV2.decryptChecksum(decryptedExpectedHash, publicKey);
407
- }
408
-
409
396
  // Use new decompression method
410
397
  byte[] compressedData = Files.readAllBytes(compressedFile.toPath());
411
398
  byte[] decompressedData = decompressBrotli(compressedData, targetFile.getName());
@@ -416,7 +403,7 @@ public class DownloadService extends Worker {
416
403
  String calculatedHash = CryptoCipherV2.calcChecksum(targetFile);
417
404
 
418
405
  // Verify checksum
419
- if (calculatedHash.equals(decryptedExpectedHash)) {
406
+ if (calculatedHash.equals(expectedHash)) {
420
407
  // Only cache if checksum is correct
421
408
  copyFile(targetFile, cacheFile);
422
409
  } else {
@@ -427,7 +414,7 @@ public class DownloadService extends Worker {
427
414
  " " +
428
415
  targetFile.getName() +
429
416
  " expected: " +
430
- decryptedExpectedHash +
417
+ expectedHash +
431
418
  " calculated: " +
432
419
  calculatedHash
433
420
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "6.14.14",
3
+ "version": "6.14.15",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",