Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit a39fd72

Browse files
author
Rodrigo Copetti
committed
Rebased to 7.0.3
1 parent 12c029b commit a39fd72

File tree

18 files changed

+739
-603
lines changed

18 files changed

+739
-603
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ podfile: Example/Podfile
88
# - pod install --project-directory=Example
99

1010
#script:
11-
#- set -o pipefail && xcodebuild test -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -destination 'platform=iOS Simulator,name=iPhone 6' ONLY_ACTIVE_ARCH=NO | xcpretty
11+
#- set -o pipefail && xcodebuild test -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -destination 'platform=iOS Simulator,name=iPhone 7' ONLY_ACTIVE_ARCH=NO | xcpretty
1212
#- pod lib lint
1313

1414
script:
15-
- xcodebuild -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -sdk iphonesimulator build test -destination 'platform=iOS Simulator,name=iPhone 6' | xcpretty -c && exit ${PIPESTATUS[0]}
15+
- xcodebuild -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -sdk iphonesimulator build test -destination 'platform=iOS Simulator,name=iPhone 7' | xcpretty -c && exit ${PIPESTATUS[0]}
1616
- pod lib lint --allow-warnings
1717

1818
notifications:

EncryptedDATAStack.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'EncryptedDATAStack'
11-
s.version = '2.0.0'
11+
s.version = '7.0.3'
1212
s.summary = 'Set up your encrypted database with only 1 line of code!'
1313

1414
s.description = <<-DESC
15-
Build your encrypted database with only 1 line of code. An extension of DATAStack with support of Encryption.
15+
Build your encrypted database with only 1 line of code. Fork of DATAStack with support for Encryption.
1616
DESC
1717

1818
s.homepage = 'https://github.com/flipacholas/EncryptedDATAStack'
1919
s.license = { :type => 'MIT', :file => 'LICENSE' }
20-
s.author = { 'Rodrigo Copetti' => 'flipacholas@gmail.com' }
20+
s.author = { 'Rodrigo Copetti' => 'rodrigo.copetti@outlook.com' }
2121
s.source = { :git => 'https://github.com/flipacholas/EncryptedDATAStack.git', :tag => s.version.to_s }
2222
s.social_media_url = 'https://twitter.com/flipacholas'
2323

2424
s.ios.deployment_target = '8.0'
2525
s.source_files = 'EncryptedDATAStack/Classes/**/*'
26-
26+
2727
# s.resource_bundles = {
2828
# 'EncryptedDATAStack' => ['EncryptedDATAStack/Assets/*.png']
2929
# }

EncryptedDATAStack/Classes/DATAStack.swift

Lines changed: 0 additions & 489 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@import EncryptedCoreData;
22

3-
FOUNDATION_EXPORT double DATAStackVersionNumber;
4-
FOUNDATION_EXPORT const unsigned char DATAStackVersionString[];
3+
FOUNDATION_EXPORT double EncryptedDATAStackVersionNumber;
4+
FOUNDATION_EXPORT const unsigned char EncryptedDATAStackVersionString[];

EncryptedDATAStack/Classes/EncryptedDATAStack.swift

100644100755
Lines changed: 477 additions & 33 deletions
Large diffs are not rendered by default.

Example/.DS_Store

-6 KB
Binary file not shown.

Example/EncryptedDATAStack.xcodeproj/project.pbxproj

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@
228228
TargetAttributes = {
229229
607FACCF1AFB9204008FA782 = {
230230
CreatedOnToolsVersion = 6.3.1;
231+
DevelopmentTeam = MT49Z4H3J6;
231232
LastSwiftMigration = 0800;
232233
};
233234
607FACE41AFB9204008FA782 = {
@@ -282,9 +283,18 @@
282283
files = (
283284
);
284285
inputPaths = (
286+
"${SRCROOT}/Pods/Target Support Files/Pods-EncryptedDATAStack_Example/Pods-EncryptedDATAStack_Example-frameworks.sh",
287+
"${BUILT_PRODUCTS_DIR}/DATASource/DATASource.framework",
288+
"${BUILT_PRODUCTS_DIR}/EncryptedCoreData/EncryptedCoreData.framework",
289+
"${BUILT_PRODUCTS_DIR}/EncryptedDATAStack/EncryptedDATAStack.framework",
290+
"${BUILT_PRODUCTS_DIR}/SQLCipher/SQLCipher.framework",
285291
);
286292
name = "[CP] Embed Pods Frameworks";
287293
outputPaths = (
294+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DATASource.framework",
295+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EncryptedCoreData.framework",
296+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EncryptedDATAStack.framework",
297+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLCipher.framework",
288298
);
289299
runOnlyForDeploymentPostprocessing = 0;
290300
shellPath = /bin/sh;
@@ -327,13 +337,16 @@
327337
files = (
328338
);
329339
inputPaths = (
340+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
341+
"${PODS_ROOT}/Manifest.lock",
330342
);
331343
name = "[CP] Check Pods Manifest.lock";
332344
outputPaths = (
345+
"$(DERIVED_FILE_DIR)/Pods-EncryptedDATAStack_Example-checkManifestLockResult.txt",
333346
);
334347
runOnlyForDeploymentPostprocessing = 0;
335348
shellPath = /bin/sh;
336-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
349+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
337350
showEnvVarsInLog = 0;
338351
};
339352
DDB2CA4D8D16A1178B9C88EB /* [CP] Check Pods Manifest.lock */ = {
@@ -342,13 +355,16 @@
342355
files = (
343356
);
344357
inputPaths = (
358+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
359+
"${PODS_ROOT}/Manifest.lock",
345360
);
346361
name = "[CP] Check Pods Manifest.lock";
347362
outputPaths = (
363+
"$(DERIVED_FILE_DIR)/Pods-EncryptedDATAStack_Tests-checkManifestLockResult.txt",
348364
);
349365
runOnlyForDeploymentPostprocessing = 0;
350366
shellPath = /bin/sh;
351-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
367+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
352368
showEnvVarsInLog = 0;
353369
};
354370
E27E22FDEAD1DF50B59E4C46 /* [CP] Embed Pods Frameworks */ = {
@@ -505,10 +521,11 @@
505521
buildSettings = {
506522
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
507523
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
524+
DEVELOPMENT_TEAM = MT49Z4H3J6;
508525
INFOPLIST_FILE = EncryptedDATAStack/Info.plist;
509526
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
510527
MODULE_NAME = ExampleApp;
511-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
528+
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2";
512529
PRODUCT_NAME = "$(TARGET_NAME)";
513530
SWIFT_VERSION = 3.0;
514531
};
@@ -520,10 +537,11 @@
520537
buildSettings = {
521538
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
522539
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
540+
DEVELOPMENT_TEAM = MT49Z4H3J6;
523541
INFOPLIST_FILE = EncryptedDATAStack/Info.plist;
524542
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
525543
MODULE_NAME = ExampleApp;
526-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
544+
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2";
527545
PRODUCT_NAME = "$(TARGET_NAME)";
528546
SWIFT_VERSION = 3.0;
529547
};

Example/EncryptedDATAStack.xcodeproj/xcshareddata/xcschemes/EncryptedDATAStack-Example.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4344
shouldUseLaunchSchemeArgsEnv = "YES">
4445
<Testables>
4546
<TestableReference
@@ -69,6 +70,7 @@
6970
buildConfiguration = "Debug"
7071
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7172
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
7274
launchStyle = "0"
7375
useCustomWorkingDirectory = "NO"
7476
ignoresPersistentStateOnLaunch = "NO"

Example/EncryptedDATAStack/.DS_Store

-6 KB
Binary file not shown.
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import UIKit
2-
import CoreData
32
import EncryptedDATAStack
43

54
@UIApplicationMain
@@ -9,21 +8,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
98
let window = UIWindow(frame: UIScreen.main.bounds)
109

1110
return window
12-
}()
11+
}()
1312

1413
var dataStack: EncryptedDATAStack = {
15-
let dataStack = EncryptedDATAStack(modelName: "DemoSwift", hashKey: "grampaPass")
14+
let dataStack = EncryptedDATAStack(passphraseKey:"randomPassj", modelName: "DemoSwift")
1615

1716
return dataStack
18-
}()
17+
}()
1918

2019
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
2120
if let window = self.window {
2221
let viewController = ViewController(dataStack: self.dataStack)
2322
window.rootViewController = UINavigationController(rootViewController: viewController)
2423
window.makeKeyAndVisible()
2524
}
26-
25+
2726
return true
2827
}
2928
}

Example/EncryptedDATAStack/DemoSwift.xcdatamodeld/.xccurrentversion

100644100755
File mode changed.

Example/EncryptedDATAStack/DemoSwift.xcdatamodeld/DemoSwift.xcdatamodel/contents

100644100755
File mode changed.

Example/EncryptedDATAStack/ViewController.swift

100644100755
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
import UIKit
2-
import DATASource
32
import EncryptedDATAStack
3+
import DATASource
44

55
class ViewController: UITableViewController {
66

77
var dataStack: EncryptedDATAStack
8-
8+
99
lazy var dataSource: DATASource = {
1010
let request: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "User")
1111
request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
12-
12+
1313
let dataSource = DATASource(tableView: self.tableView, cellIdentifier: "Cell", fetchRequest: request, mainContext: self.dataStack.mainContext, configuration: { cell, item, indexPath in
1414
if let name = item.value(forKey: "name") as? String, let createdDate = item.value(forKey: "createdDate") as? NSDate {
15-
cell.textLabel?.text = name + " - " + createdDate.description
15+
cell.textLabel?.text = name + " - " + createdDate.description
1616
}
1717
})
18-
18+
1919
return dataSource
2020
}()
21-
21+
2222
init(dataStack: EncryptedDATAStack) {
2323
self.dataStack = dataStack
24-
24+
2525
super.init(style: .plain)
2626
}
27-
27+
2828
required init?(coder aDecoder: NSCoder) {
2929
fatalError("init(coder:) has not been implemented")
3030
}
31-
31+
3232
override func viewDidLoad() {
3333
super.viewDidLoad()
34-
34+
3535
self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
3636
self.tableView.dataSource = self.dataSource
37-
37+
3838
let backgroundButton = UIBarButtonItem(title: "Background", style: .done, target: self, action: #selector(ViewController.createBackground))
3939
self.navigationItem.rightBarButtonItem = backgroundButton
40-
40+
4141
let mainButton = UIBarButtonItem(title: "Main", style: .done, target: self, action: #selector(ViewController.createMain))
4242
self.navigationItem.leftBarButtonItem = mainButton
4343
}
44-
44+
4545
func createBackground() {
4646
self.dataStack.performInNewBackgroundContext { backgroundContext in
4747
let entity = NSEntityDescription.entity(forEntityName: "User", in: backgroundContext)!
@@ -51,7 +51,7 @@ class ViewController: UITableViewController {
5151
try! backgroundContext.save()
5252
}
5353
}
54-
54+
5555
func createMain() {
5656
let entity = NSEntityDescription.entity(forEntityName: "User", in: self.dataStack.mainContext)!
5757
let object = NSManagedObject(entity: entity, insertInto: self.dataStack.mainContext)

Example/Podfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use_frameworks!
22

33
target 'EncryptedDATAStack_Example' do
44
pod 'EncryptedDATAStack', :path => '../'
5-
pod 'DATASource’, '~> 6.1.1'
5+
pod 'DATASource’, '~> 6.1.5'
6+
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'
67
78
target 'EncryptedDATAStack_Tests' do
89
inherit! :search_paths
910

1011
end
11-
end
12+
end

Example/Podfile.lock

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
2-
- DATASource (6.1.1)
2+
- DATASource (6.1.5)
33
- EncryptedCoreData (3.1):
44
- SQLCipher (~> 3.4.0)
5-
- EncryptedDATAStack (2.0.0):
5+
- EncryptedDATAStack (7.0.3):
66
- EncryptedCoreData (~> 3.1)
77
- SQLCipher (3.4.0):
88
- SQLCipher/standard (= 3.4.0)
@@ -11,19 +11,27 @@ PODS:
1111
- SQLCipher/common
1212

1313
DEPENDENCIES:
14-
- DATASource (~> 6.1.1)
14+
- DATASource (~> 6.1.5)
15+
- EncryptedCoreData (from `https://github.com/project-imas/encrypted-core-data.git`)
1516
- EncryptedDATAStack (from `../`)
1617

1718
EXTERNAL SOURCES:
19+
EncryptedCoreData:
20+
:git: https://github.com/project-imas/encrypted-core-data.git
1821
EncryptedDATAStack:
19-
:path: "../"
22+
:path: ../
23+
24+
CHECKOUT OPTIONS:
25+
EncryptedCoreData:
26+
:commit: b97ffaf2f19dad4d1558bc9b0668cc2e09d17347
27+
:git: https://github.com/project-imas/encrypted-core-data.git
2028

2129
SPEC CHECKSUMS:
22-
DATASource: fa895931841523f62c1378cbc53ef2de87e5cf30
30+
DATASource: 52b86cfff6c7ac3db45192c01f7839c7473576c3
2331
EncryptedCoreData: f6762fb05f88a52f36c5648659abc91b57f244b4
24-
EncryptedDATAStack: f1cf65d0122252f3ecfab981b15e28441cb27d40
32+
EncryptedDATAStack: 84897982fa1826a44a0306af5890cd786c43b4b1
2533
SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff
2634

27-
PODFILE CHECKSUM: 4300aa5ad2cff52737da731a243b640058555319
35+
PODFILE CHECKSUM: eb0fd5215d30babaff403c4078e4c632c9c0447c
2836

29-
COCOAPODS: 1.1.1
37+
COCOAPODS: 1.3.1

Example/Tests/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)