From 4e2640928f13417b29638879b9a9721539aed2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=CC=81a=20Rodri=CC=81guez?= Date: Fri, 12 Sep 2025 10:23:20 +0200 Subject: [PATCH 1/3] Support SPM --- Incremental Store/EncryptedStore.m | 1 + .../{ => include}/EncryptedStore.h | 1 + Package.swift | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+) rename Incremental Store/{ => include}/EncryptedStore.h (99%) create mode 100644 Package.swift diff --git a/Incremental Store/EncryptedStore.m b/Incremental Store/EncryptedStore.m index aa7a382..09b2ff4 100755 --- a/Incremental Store/EncryptedStore.m +++ b/Incremental Store/EncryptedStore.m @@ -12,6 +12,7 @@ #import #import "EncryptedStore.h" +#import typedef sqlite3_stmt sqlite3_statement; diff --git a/Incremental Store/EncryptedStore.h b/Incremental Store/include/EncryptedStore.h similarity index 99% rename from Incremental Store/EncryptedStore.h rename to Incremental Store/include/EncryptedStore.h index 81ec5a8..1b595bb 100755 --- a/Incremental Store/EncryptedStore.h +++ b/Incremental Store/include/EncryptedStore.h @@ -6,6 +6,7 @@ // #import +#import typedef struct _options { char * passphrase; diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..7af230d --- /dev/null +++ b/Package.swift @@ -0,0 +1,39 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "EncryptedCoreData", + platforms: [ + .iOS(.v15) + ], + products: [ + .library( + name: "EncryptedCoreData", + targets: ["EncryptedCoreData"] + ), + ], + dependencies: [ + .package( + url: "https://github.com/sqlcipher/SQLCipher.swift.git", + from: "4.10.0" + ) + ], + targets: [ + .target( + name: "EncryptedCoreData", + dependencies: [ + .product(name: "SQLCipher", package: "SQLCipher.swift") + ], + path: "Incremental Store", + sources: [ + "." + ], + publicHeadersPath: "include", + cSettings: [ + .define("SQLITE_HAS_CODEC"), + .define("SQLCIPHER_CRYPTO_CC"), + .headerSearchPath("include"), + ] + ), + ] +) From 15e731a4a92c6f180829476673823ba0c5bdd842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=CC=81a=20Rodri=CC=81guez?= Date: Fri, 12 Sep 2025 16:50:58 +0200 Subject: [PATCH 2/3] Add Package.resolved --- Package.resolved | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..81dd901 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "sqlcipher.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sqlcipher/SQLCipher.swift.git", + "state" : { + "revision" : "46e687b829dce3f9262e16e9f941a9e159136085", + "version" : "4.10.0" + } + } + ], + "version" : 2 +} From c15686408b49ce127ba01bb9173d270f2ade5234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=CC=81a=20Rodri=CC=81guez?= Date: Fri, 12 Sep 2025 16:52:44 +0200 Subject: [PATCH 3/3] Add changes that I had in my fork --- Incremental Store/EncryptedStore.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Incremental Store/EncryptedStore.m b/Incremental Store/EncryptedStore.m index 09b2ff4..5a22273 100755 --- a/Incremental Store/EncryptedStore.m +++ b/Incremental Store/EncryptedStore.m @@ -2924,7 +2924,7 @@ - (BOOL)hasTable:(BOOL *)hasTable withName:(NSString*)name error:(NSError **)err - (NSError *)databaseError { int code = sqlite3_errcode(database); - if (code) { + if (code && code != SQLITE_DONE && code != SQLITE_OK && code != SQLITE_ROW) { NSDictionary *userInfo = @{ EncryptedStoreErrorMessageKey : [NSString stringWithUTF8String:sqlite3_errmsg(database)] };