Cleanup unneccessary print
This commit is contained in:
parent
653ce515ab
commit
b152d7e1e9
3 changed files with 10 additions and 27 deletions
|
|
@ -43,8 +43,6 @@ class CredentialProviderViewController: ASCredentialProviderViewController, UITa
|
||||||
prioritize the most relevant credentials in the list.
|
prioritize the most relevant credentials in the list.
|
||||||
*/
|
*/
|
||||||
override func prepareCredentialList(for serviceIdentifiers: [ASCredentialServiceIdentifier]) {
|
override func prepareCredentialList(for serviceIdentifiers: [ASCredentialServiceIdentifier]) {
|
||||||
print("prepareCredentialList")
|
|
||||||
|
|
||||||
// clean up the search bar
|
// clean up the search bar
|
||||||
guard serviceIdentifiers.count > 0 else {
|
guard serviceIdentifiers.count > 0 else {
|
||||||
searchBar.text = ""
|
searchBar.text = ""
|
||||||
|
|
|
||||||
|
|
@ -159,14 +159,14 @@ public class Password {
|
||||||
guard let secretString = getAdditionValue(withKey: "otp_secret"),
|
guard let secretString = getAdditionValue(withKey: "otp_secret"),
|
||||||
let secretData = MF_Base32Codec.data(fromBase32String: secretString),
|
let secretData = MF_Base32Codec.data(fromBase32String: secretString),
|
||||||
!secretData.isEmpty else {
|
!secretData.isEmpty else {
|
||||||
// print("Missing / Invalid otp secret")
|
// Missing / Invalid otp secret
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// get type
|
// get type
|
||||||
guard let type = getAdditionValue(withKey: "otp_type")?.lowercased(),
|
guard let type = getAdditionValue(withKey: "otp_type")?.lowercased(),
|
||||||
(type == "totp" || type == "hotp") else {
|
(type == "totp" || type == "hotp") else {
|
||||||
// print("Missing / Invalid otp type")
|
// Missing / Invalid otp type
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,8 +189,7 @@ public class Password {
|
||||||
// default: 6 digits, 30 seconds
|
// default: 6 digits, 30 seconds
|
||||||
guard let digits = Int(getAdditionValue(withKey: "otp_digits") ?? "6"),
|
guard let digits = Int(getAdditionValue(withKey: "otp_digits") ?? "6"),
|
||||||
let period = Double(getAdditionValue(withKey: "otp_period") ?? "30.0") else {
|
let period = Double(getAdditionValue(withKey: "otp_period") ?? "30.0") else {
|
||||||
let alertMessage = "Invalid otp_digits or otp_period."
|
// Invalid otp_digits or otp_period.
|
||||||
print(alertMessage)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let generator = Generator(
|
guard let generator = Generator(
|
||||||
|
|
@ -198,8 +197,7 @@ public class Password {
|
||||||
secret: secretData,
|
secret: secretData,
|
||||||
algorithm: algorithm,
|
algorithm: algorithm,
|
||||||
digits: digits) else {
|
digits: digits) else {
|
||||||
let alertMessage = "Invalid OTP generator parameters."
|
// Invalid OTP generator parameters.
|
||||||
print(alertMessage)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.otpToken = Token(name: self.name, issuer: "", generator: generator)
|
self.otpToken = Token(name: self.name, issuer: "", generator: generator)
|
||||||
|
|
@ -208,8 +206,7 @@ public class Password {
|
||||||
// default: 6 digits
|
// default: 6 digits
|
||||||
guard let digits = Int(getAdditionValue(withKey: "otp_digits") ?? "6"),
|
guard let digits = Int(getAdditionValue(withKey: "otp_digits") ?? "6"),
|
||||||
let counter = UInt64(getAdditionValue(withKey: "otp_counter") ?? "") else {
|
let counter = UInt64(getAdditionValue(withKey: "otp_counter") ?? "") else {
|
||||||
let alertMessage = "Invalid otp_digits or otp_counter."
|
// Invalid otp_digits or otp_counter.
|
||||||
print(alertMessage)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let generator = Generator(
|
guard let generator = Generator(
|
||||||
|
|
@ -217,8 +214,7 @@ public class Password {
|
||||||
secret: secretData,
|
secret: secretData,
|
||||||
algorithm: algorithm,
|
algorithm: algorithm,
|
||||||
digits: digits) else {
|
digits: digits) else {
|
||||||
let alertMessage = "Invalid OTP generator parameters."
|
// Invalid OTP generator parameters.
|
||||||
print(alertMessage)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.otpToken = Token(name: self.name, issuer: "", generator: generator)
|
self.otpToken = Token(name: self.name, issuer: "", generator: generator)
|
||||||
|
|
|
||||||
|
|
@ -115,10 +115,6 @@ public class PasswordStore {
|
||||||
|
|
||||||
private init() {
|
private init() {
|
||||||
// File migration to group
|
// File migration to group
|
||||||
print(Globals.documentPath)
|
|
||||||
print(Globals.libraryPath)
|
|
||||||
print(Globals.documentPathLegacy)
|
|
||||||
print(Globals.libraryPathLegacy)
|
|
||||||
migrateIfNeeded()
|
migrateIfNeeded()
|
||||||
backwardCompatibility()
|
backwardCompatibility()
|
||||||
|
|
||||||
|
|
@ -332,14 +328,10 @@ public class PasswordStore {
|
||||||
guard let storeRepository = storeRepository else {
|
guard let storeRepository = storeRepository else {
|
||||||
throw AppError.RepositoryNotSetError
|
throw AppError.RepositoryNotSetError
|
||||||
}
|
}
|
||||||
do {
|
let credentialProvider = try credential.credentialProvider(requestGitPassword: requestGitPassword)
|
||||||
let credentialProvider = try credential.credentialProvider(requestGitPassword: requestGitPassword)
|
let options = [GTRepositoryRemoteOptionsCredentialProvider: credentialProvider]
|
||||||
let options = [GTRepositoryRemoteOptionsCredentialProvider: credentialProvider]
|
let remote = try GTRemote(name: "origin", in: storeRepository)
|
||||||
let remote = try GTRemote(name: "origin", in: storeRepository)
|
try storeRepository.pull(storeRepository.currentBranch(), from: remote, withOptions: options, progress: transferProgressBlock)
|
||||||
try storeRepository.pull(storeRepository.currentBranch(), from: remote, withOptions: options, progress: transferProgressBlock)
|
|
||||||
} catch {
|
|
||||||
throw(error)
|
|
||||||
}
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
SharedDefaults[.lastSyncedTime] = Date()
|
SharedDefaults[.lastSyncedTime] = Date()
|
||||||
self.setAllSynced()
|
self.setAllSynced()
|
||||||
|
|
@ -602,7 +594,6 @@ public class PasswordStore {
|
||||||
previousPathLength = passwordURL.path.count
|
previousPathLength = passwordURL.path.count
|
||||||
}
|
}
|
||||||
paths.reverse()
|
paths.reverse()
|
||||||
print(paths)
|
|
||||||
var parentPasswordEntity: PasswordEntity? = nil
|
var parentPasswordEntity: PasswordEntity? = nil
|
||||||
for path in paths {
|
for path in paths {
|
||||||
let isDir = !path.hasSuffix(".gpg")
|
let isDir = !path.hasSuffix(".gpg")
|
||||||
|
|
@ -662,7 +653,6 @@ public class PasswordStore {
|
||||||
var newPasswordEntity: PasswordEntity? = passwordEntity
|
var newPasswordEntity: PasswordEntity? = passwordEntity
|
||||||
|
|
||||||
if password.changed&PasswordChange.content.rawValue != 0 {
|
if password.changed&PasswordChange.content.rawValue != 0 {
|
||||||
print("chagne content")
|
|
||||||
let saveURL = storeURL.appendingPathComponent(passwordEntity.getURL()!.path)
|
let saveURL = storeURL.appendingPathComponent(passwordEntity.getURL()!.path)
|
||||||
try self.encrypt(password: password).write(to: saveURL)
|
try self.encrypt(password: password).write(to: saveURL)
|
||||||
try gitAdd(path: passwordEntity.getURL()!.path)
|
try gitAdd(path: passwordEntity.getURL()!.path)
|
||||||
|
|
@ -672,7 +662,6 @@ public class PasswordStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
if password.changed&PasswordChange.path.rawValue != 0 {
|
if password.changed&PasswordChange.path.rawValue != 0 {
|
||||||
print("change path")
|
|
||||||
let deletedFileURL = passwordEntity.getURL()!
|
let deletedFileURL = passwordEntity.getURL()!
|
||||||
// add
|
// add
|
||||||
try createDirectoryTree(at: password.url)
|
try createDirectoryTree(at: password.url)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue