Skip to content

Commit

Permalink
Merge pull request #492 from Cap-go/revert_checksum_changes
Browse files Browse the repository at this point in the history
Revert checksum changes
  • Loading branch information
riderx authored Dec 5, 2024
2 parents 9c9107b + 87b06d1 commit ca88a11
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ extension CustomError: LocalizedError {
let finalPath = tempDataPath.deletingLastPathComponent().appendingPathComponent("\(id)")
do {
var checksumDecrypted = checksum
if !self.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
if !self.hasOldPrivateKeyPropertyInConfig {
try self.decryptFileV2(filePath: tempDataPath, sessionKey: sessionKey, version: version)
} else {
try self.decryptFile(filePath: tempDataPath, sessionKey: sessionKey, version: version)
Expand Down
4 changes: 2 additions & 2 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
DispatchQueue.global(qos: .background).async {
do {
let next = try self.implementation.download(url: url!, version: version, sessionKey: sessionKey)
if !self.implementation.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
if !self.implementation.hasOldPrivateKeyPropertyInConfig {
checksum = try self.implementation.decryptChecksum(checksum: checksum, version: version)
}
if (checksum != "" || self.implementation.publicKey != "") && next.getChecksum() != checksum {
Expand Down Expand Up @@ -775,7 +775,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
self.endBackGroundTaskWithNotif(msg: "Latest version is in error state. Aborting update.", latestVersionName: latestVersionName, current: current)
return
}
if !self.implementation.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
if !self.implementation.hasOldPrivateKeyPropertyInConfig {
res.checksum = try self.implementation.decryptChecksum(checksum: res.checksum, version: latestVersionName)
}
if res.checksum != "" && next.getChecksum() != res.checksum && res.manifest == nil {
Expand Down

0 comments on commit ca88a11

Please sign in to comment.