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

Commit

Permalink
Rebased to 7.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Copetti committed Aug 27, 2017
1 parent 12c029b commit a39fd72
Show file tree
Hide file tree
Showing 18 changed files with 739 additions and 603 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ podfile: Example/Podfile
# - pod install --project-directory=Example

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

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

notifications:
Expand Down
8 changes: 4 additions & 4 deletions EncryptedDATAStack.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@

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

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

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

s.ios.deployment_target = '8.0'
s.source_files = 'EncryptedDATAStack/Classes/**/*'

# s.resource_bundles = {
# 'EncryptedDATAStack' => ['EncryptedDATAStack/Assets/*.png']
# }
Expand Down
489 changes: 0 additions & 489 deletions EncryptedDATAStack/Classes/DATAStack.swift

This file was deleted.

4 changes: 2 additions & 2 deletions EncryptedDATAStack/Classes/EncryptedDATAStack.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import EncryptedCoreData;

FOUNDATION_EXPORT double DATAStackVersionNumber;
FOUNDATION_EXPORT const unsigned char DATAStackVersionString[];
FOUNDATION_EXPORT double EncryptedDATAStackVersionNumber;
FOUNDATION_EXPORT const unsigned char EncryptedDATAStackVersionString[];
510 changes: 477 additions & 33 deletions EncryptedDATAStack/Classes/EncryptedDATAStack.swift
100644 → 100755

Large diffs are not rendered by default.

Binary file removed Example/.DS_Store
Binary file not shown.
26 changes: 22 additions & 4 deletions Example/EncryptedDATAStack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = MT49Z4H3J6;
LastSwiftMigration = 0800;
};
607FACE41AFB9204008FA782 = {
Expand Down Expand Up @@ -282,9 +283,18 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-EncryptedDATAStack_Example/Pods-EncryptedDATAStack_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/DATASource/DATASource.framework",
"${BUILT_PRODUCTS_DIR}/EncryptedCoreData/EncryptedCoreData.framework",
"${BUILT_PRODUCTS_DIR}/EncryptedDATAStack/EncryptedDATAStack.framework",
"${BUILT_PRODUCTS_DIR}/SQLCipher/SQLCipher.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DATASource.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EncryptedCoreData.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EncryptedDATAStack.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLCipher.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -327,13 +337,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-EncryptedDATAStack_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
showEnvVarsInLog = 0;
};
DDB2CA4D8D16A1178B9C88EB /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -342,13 +355,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-EncryptedDATAStack_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
showEnvVarsInLog = 0;
};
E27E22FDEAD1DF50B59E4C46 /* [CP] Embed Pods Frameworks */ = {
Expand Down Expand Up @@ -505,10 +521,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = MT49Z4H3J6;
INFOPLIST_FILE = EncryptedDATAStack/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
Expand All @@ -520,10 +537,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = MT49Z4H3J6;
INFOPLIST_FILE = EncryptedDATAStack/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -69,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Binary file removed Example/EncryptedDATAStack/.DS_Store
Binary file not shown.
9 changes: 4 additions & 5 deletions Example/EncryptedDATAStack/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import UIKit
import CoreData
import EncryptedDATAStack

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

return window
}()
}()

var dataStack: EncryptedDATAStack = {
let dataStack = EncryptedDATAStack(modelName: "DemoSwift", hashKey: "grampaPass")
let dataStack = EncryptedDATAStack(passphraseKey:"randomPassj", modelName: "DemoSwift")

return dataStack
}()
}()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if let window = self.window {
let viewController = ViewController(dataStack: self.dataStack)
window.rootViewController = UINavigationController(rootViewController: viewController)
window.makeKeyAndVisible()
}

return true
}
}
Empty file.
Empty file.
28 changes: 14 additions & 14 deletions Example/EncryptedDATAStack/ViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import UIKit
import DATASource
import EncryptedDATAStack
import DATASource

class ViewController: UITableViewController {

var dataStack: EncryptedDATAStack

lazy var dataSource: DATASource = {
let request: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "User")
request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]

let dataSource = DATASource(tableView: self.tableView, cellIdentifier: "Cell", fetchRequest: request, mainContext: self.dataStack.mainContext, configuration: { cell, item, indexPath in
if let name = item.value(forKey: "name") as? String, let createdDate = item.value(forKey: "createdDate") as? NSDate {
cell.textLabel?.text = name + " - " + createdDate.description
cell.textLabel?.text = name + " - " + createdDate.description
}
})

return dataSource
}()

init(dataStack: EncryptedDATAStack) {
self.dataStack = dataStack

super.init(style: .plain)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()

self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
self.tableView.dataSource = self.dataSource

let backgroundButton = UIBarButtonItem(title: "Background", style: .done, target: self, action: #selector(ViewController.createBackground))
self.navigationItem.rightBarButtonItem = backgroundButton

let mainButton = UIBarButtonItem(title: "Main", style: .done, target: self, action: #selector(ViewController.createMain))
self.navigationItem.leftBarButtonItem = mainButton
}

func createBackground() {
self.dataStack.performInNewBackgroundContext { backgroundContext in
let entity = NSEntityDescription.entity(forEntityName: "User", in: backgroundContext)!
Expand All @@ -51,7 +51,7 @@ class ViewController: UITableViewController {
try! backgroundContext.save()
}
}

func createMain() {
let entity = NSEntityDescription.entity(forEntityName: "User", in: self.dataStack.mainContext)!
let object = NSManagedObject(entity: entity, insertInto: self.dataStack.mainContext)
Expand Down
5 changes: 3 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ use_frameworks!

target 'EncryptedDATAStack_Example' do
pod 'EncryptedDATAStack', :path => '../'
pod 'DATASource’, '~> 6.1.1'
pod 'DATASource’, '~> 6.1.5'
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'
target 'EncryptedDATAStack_Tests' do
inherit! :search_paths

end
end
end
24 changes: 16 additions & 8 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- DATASource (6.1.1)
- DATASource (6.1.5)
- EncryptedCoreData (3.1):
- SQLCipher (~> 3.4.0)
- EncryptedDATAStack (2.0.0):
- EncryptedDATAStack (7.0.3):
- EncryptedCoreData (~> 3.1)
- SQLCipher (3.4.0):
- SQLCipher/standard (= 3.4.0)
Expand All @@ -11,19 +11,27 @@ PODS:
- SQLCipher/common

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

EXTERNAL SOURCES:
EncryptedCoreData:
:git: https://github.com/project-imas/encrypted-core-data.git
EncryptedDATAStack:
:path: "../"
:path: ../

CHECKOUT OPTIONS:
EncryptedCoreData:
:commit: b97ffaf2f19dad4d1558bc9b0668cc2e09d17347
:git: https://github.com/project-imas/encrypted-core-data.git

SPEC CHECKSUMS:
DATASource: fa895931841523f62c1378cbc53ef2de87e5cf30
DATASource: 52b86cfff6c7ac3db45192c01f7839c7473576c3
EncryptedCoreData: f6762fb05f88a52f36c5648659abc91b57f244b4
EncryptedDATAStack: f1cf65d0122252f3ecfab981b15e28441cb27d40
EncryptedDATAStack: 84897982fa1826a44a0306af5890cd786c43b4b1
SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff

PODFILE CHECKSUM: 4300aa5ad2cff52737da731a243b640058555319
PODFILE CHECKSUM: eb0fd5215d30babaff403c4078e4c632c9c0447c

COCOAPODS: 1.1.1
COCOAPODS: 1.3.1
Binary file removed Example/Tests/.DS_Store
Binary file not shown.
Loading

0 comments on commit a39fd72

Please sign in to comment.