Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
fix up settings/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
btoews committed Aug 11, 2017
1 parent c5de693 commit 4615c8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions SoftU2FTool/CLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ class CLI {
return true
} else if args.contains(showTouchidFlag) {
showTouchid()
return true
} else if args.contains(enableTouchidFlag) {
enableTouchid()
return true
} else if args.contains(disableTouchidFlag) {
disableTouchid()
return true
}

return false
Expand Down Expand Up @@ -78,9 +81,9 @@ class CLI {

private func showTouchid() {
if Settings.touchidDisabled {
print("SEP storage is enabled")
print("TouchID is disabled")
} else {
print("SEP storage is disabled")
print("TouchID is enabled")
}
}

Expand All @@ -94,6 +97,6 @@ class CLI {

private func disableTouchid() {
Settings.disableTouchid()
print("TouchID is now disabled for")
print("TouchID is now disabled")
}
}
4 changes: 2 additions & 2 deletions SoftU2FTool/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class Settings {

static func enableTouchid() -> Bool {
if touchidAvailable {
UserDefaults.standard.set(true, forKey: touchidDisabledKey)
UserDefaults.standard.set(false, forKey: touchidDisabledKey)
return true
} else {
return false
}
}

static func disableTouchid() {
UserDefaults.standard.set(false, forKey: touchidDisabledKey)
UserDefaults.standard.set(true, forKey: touchidDisabledKey)
}

private static var touchidAvailable: Bool {
Expand Down

0 comments on commit 4615c8e

Please sign in to comment.