From c6db44ace76c06db31728015099eb80a72a79450 Mon Sep 17 00:00:00 2001 From: Evgeny Morozov Date: Fri, 24 Feb 2017 20:16:11 +0300 Subject: [PATCH] Move repository to a private directory --- pass/Helpers/Globals.swift | 3 ++- pass/Models/PasswordStore.swift | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pass/Helpers/Globals.swift b/pass/Helpers/Globals.swift index 0363c94..4b90f25 100644 --- a/pass/Helpers/Globals.swift +++ b/pass/Helpers/Globals.swift @@ -11,13 +11,14 @@ import UIKit class Globals { static let documentPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]; + static let libraryPath = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true)[0]; static let pgpPublicKeyPath = "\(documentPath)/gpg_key.pub" static let pgpPrivateKeyPath = "\(documentPath)/gpg_key" static let sshPublicKeyURL = URL(fileURLWithPath: "\(documentPath)/ssh_key.pub") static let sshPrivateKeyURL = URL(fileURLWithPath: "\(documentPath)/ssh_key") - static let repositoryPath = "\(documentPath)/password-store" + static let repositoryPath = "\(libraryPath)/password-store" static var passcodeConfiguration = PasscodeLockConfiguration() static let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String diff --git a/pass/Models/PasswordStore.swift b/pass/Models/PasswordStore.swift index 9047ce5..53cbc99 100644 --- a/pass/Models/PasswordStore.swift +++ b/pass/Models/PasswordStore.swift @@ -96,8 +96,8 @@ struct GitCredential { class PasswordStore { static let shared = PasswordStore() - let storeURL = URL(fileURLWithPath: "\(Globals.documentPath)/password-store") - let tempStoreURL = URL(fileURLWithPath: "\(Globals.documentPath)/password-store-temp") + let storeURL = URL(fileURLWithPath: "\(Globals.repositoryPath)") + let tempStoreURL = URL(fileURLWithPath: "\(Globals.repositoryPath)-temp") var storeRepository: GTRepository? var gitCredential: GitCredential?