Skip to content

Commit

Permalink
fix: native build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Nov 24, 2022
1 parent b07a0dc commit 05da8b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private String getChecksum(File file) throws IOException {
}

private void decodeFile(File file) throws IOException {
if (this.privateKey.equal("")) {
if (this.privateKey.equals("")) {
return;
}
try {
Expand Down
2 changes: 2 additions & 0 deletions ios/Plugin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework",
"${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyRSA/SwiftyRSA.framework",
"${BUILT_PRODUCTS_DIR}/Version/Version.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -295,6 +296,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyRSA.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Version.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
12 changes: 11 additions & 1 deletion ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ extension CustomError: LocalizedError {
"An unexpected error occurred.",
comment: "Unexpected Error"
)
case .cannotDecode:
return NSLocalizedString(
"Decoding the zip failed with this key",
comment: "Invalid private key"
)
case .cannotWrite:
return NSLocalizedString(
"Cannot write to the destination",
comment: "Invalid destination"
)
}
}
}
Expand Down Expand Up @@ -426,7 +436,7 @@ extension CustomError: LocalizedError {
self.notifyDownload(id, 71)
do {
checksum = self.getChecksum(filePath: fileURL)
decodeFile(filePath: fileURL)
try self.decodeFile(filePath: fileURL)
try self.saveDownloaded(sourceZip: fileURL, id: id, base: self.documentsDir.appendingPathComponent(self.bundleDirectoryHot))
self.notifyDownload(id, 85)
try self.saveDownloaded(sourceZip: fileURL, id: id, base: self.libraryDir.appendingPathComponent(self.bundleDirectory))
Expand Down

0 comments on commit 05da8b2

Please sign in to comment.