Skip to content

Commit e177e31

Browse files
authored
Merge pull request #286 from mattrubin/develop
Release Authenticator 2.0.5
2 parents 03564a9 + 40a5a17 commit e177e31

37 files changed

+152
-67
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ language: objective-c
55
xcode_workspace: Authenticator.xcworkspace
66
xcode_scheme: Authenticator
77

8-
osx_image: xcode9.3
8+
osx_image: xcode10
99

1010
env:
1111
- RUNTIME="iOS 9.0" DEVICE="iPhone 4s"
1212
- RUNTIME="iOS 9.3" DEVICE="iPhone 6s"
1313
- RUNTIME="iOS 10.0" DEVICE="iPhone SE"
1414
- RUNTIME="iOS 10.3" DEVICE="iPhone 7 Plus"
15-
- RUNTIME="iOS 11.0" DEVICE="iPhone X"
15+
- RUNTIME="iOS 11.0" DEVICE="iPhone 8"
16+
- RUNTIME="iOS 11.4" DEVICE="iPhone X"
17+
- RUNTIME="iOS 12.0" DEVICE="iPhone XS Max"
1618

1719
install:
1820
- git submodule update --init --recursive

Authenticator.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
8B2B8AE1118BA49F00437315 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
108108
8BF5147F118799AE005C936F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
109109
C910ADC01BF0315A00C988F5 /* TokenList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenList.swift; sourceTree = "<group>"; };
110+
C91CDAEE214EEA82006488F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
111+
C91CDAFD214EF044006488F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
110112
C9204A841E886A3500998D3E /* Acknowledgements.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Acknowledgements.html; sourceTree = "<group>"; };
111113
C92708AB19CFB0750033128B /* TokenListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenListViewController.swift; sourceTree = "<group>"; };
112114
C931A5FC1BFF6F9D00706A1C /* .hound.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .hound.yml; sourceTree = "<group>"; };
@@ -421,6 +423,7 @@
421423
C9906A331812522100BAEF53 /* AuthenticatorTests */ = {
422424
isa = PBXGroup;
423425
children = (
426+
C91CDAEE214EEA82006488F7 /* Info.plist */,
424427
C983AB73197F98FC00975003 /* OTPAuthenticatorTests.m */,
425428
C9A1C1CD1E6CDBFB009E65D6 /* RootTests.swift */,
426429
CCC409751DB28BFE000A050D /* TableDiffTests.swift */,
@@ -448,6 +451,7 @@
448451
C9A262CE1E170BD4004E6CEB /* AuthenticatorScreenshots */ = {
449452
isa = PBXGroup;
450453
children = (
454+
C91CDAFD214EF044006488F7 /* Info.plist */,
451455
C9A262CF1E170BD4004E6CEB /* AuthenticatorScreenshots.swift */,
452456
C9A262D71E170E3A004E6CEB /* SnapshotHelper.swift */,
453457
);
@@ -570,7 +574,7 @@
570574
attributes = {
571575
CLASSPREFIX = OTP;
572576
LastSwiftMigration = 0700;
573-
LastSwiftUpdateCheck = 0820;
577+
LastSwiftUpdateCheck = 1000;
574578
LastUpgradeCheck = 0930;
575579
ORGANIZATIONNAME = "Matt Rubin";
576580
TargetAttributes = {
@@ -805,6 +809,7 @@
805809
baseConfigurationReference = C944A5731A7F772600E08B1E /* iOS-Application.xcconfig */;
806810
buildSettings = {
807811
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Authenticator.app/Authenticator";
812+
INFOPLIST_FILE = AuthenticatorTests/Info.plist;
808813
PRODUCT_NAME = "$(TARGET_NAME)";
809814
TEST_HOST = "$(BUNDLE_LOADER)";
810815
};
@@ -815,6 +820,7 @@
815820
baseConfigurationReference = C944A5731A7F772600E08B1E /* iOS-Application.xcconfig */;
816821
buildSettings = {
817822
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Authenticator.app/Authenticator";
823+
INFOPLIST_FILE = AuthenticatorTests/Info.plist;
818824
PRODUCT_NAME = "$(TARGET_NAME)";
819825
TEST_HOST = "$(BUNDLE_LOADER)";
820826
};
@@ -824,6 +830,7 @@
824830
isa = XCBuildConfiguration;
825831
baseConfigurationReference = C944A5731A7F772600E08B1E /* iOS-Application.xcconfig */;
826832
buildSettings = {
833+
INFOPLIST_FILE = AuthenticatorScreenshots/Info.plist;
827834
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
828835
PRODUCT_BUNDLE_IDENTIFIER = me.mattrubin.authenticator.screenshots;
829836
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -835,6 +842,7 @@
835842
isa = XCBuildConfiguration;
836843
baseConfigurationReference = C944A5731A7F772600E08B1E /* iOS-Application.xcconfig */;
837844
buildSettings = {
845+
INFOPLIST_FILE = AuthenticatorScreenshots/Info.plist;
838846
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
839847
PRODUCT_BUNDLE_IDENTIFIER = me.mattrubin.authenticator.screenshots;
840848
PRODUCT_NAME = "$(TARGET_NAME)";

Authenticator.xcodeproj/xcshareddata/xcschemes/Authenticator Demo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Authenticator.xcodeproj/xcshareddata/xcschemes/Authenticator.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Authenticator/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.0.4</string>
20+
<string>2.0.5</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>

Authenticator/Source/AppController.swift

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AppController.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2016-2017 Authenticator authors
5+
// Copyright (c) 2016-2018 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -148,12 +148,7 @@ class AppController {
148148
}
149149

150150
case let .deletePersistentToken(persistentToken, failure):
151-
do {
152-
try store.deletePersistentToken(persistentToken)
153-
updateView()
154-
} catch {
155-
handleEvent(failure(error))
156-
}
151+
confirmDeletion(of: persistentToken, failure: failure)
157152

158153
case let .showErrorMessage(message):
159154
SVProgressHUD.showError(withStatus: message)
@@ -205,6 +200,44 @@ class AppController {
205200
func addTokenFromURL(_ token: Token) {
206201
handleAction(.addTokenFromURL(token))
207202
}
203+
204+
private func confirmDeletion(of persistentToken: PersistentToken, failure: @escaping (Error) -> Root.Event) {
205+
let messagePrefix = persistentToken.token.displayName.map({ "The token “\($0)" }) ?? "The unnamed token"
206+
let message = messagePrefix + " will be permanently deleted from this device."
207+
208+
let alert = UIAlertController(title: "Delete Token?", message: message, preferredStyle: .alert)
209+
alert.addAction(UIAlertAction(title: "Delete", style: .destructive, handler: { [weak self] _ in
210+
self?.permanentlyDelete(persistentToken, failure: failure)
211+
}))
212+
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
213+
214+
let presenter = topViewController(presentedFrom: rootViewController)
215+
presenter.present(alert, animated: true)
216+
}
217+
218+
private func permanentlyDelete(_ persistentToken: PersistentToken, failure: @escaping (Error) -> Root.Event) {
219+
do {
220+
try store.deletePersistentToken(persistentToken)
221+
updateView()
222+
} catch {
223+
handleEvent(failure(error))
224+
}
225+
}
226+
}
227+
228+
private extension Token {
229+
var displayName: String? {
230+
switch (!name.isEmpty, !issuer.isEmpty) {
231+
case (true, true):
232+
return "\(issuer): \(name)"
233+
case (true, false):
234+
return name
235+
case (false, true):
236+
return issuer
237+
case (false, false):
238+
return nil
239+
}
240+
}
208241
}
209242

210243
private extension DisplayTime {

AuthenticatorScreenshots/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>0</string>
21+
</dict>
22+
</plist>

AuthenticatorTests/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>0</string>
21+
</dict>
22+
</plist>

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to the project will be documented in this file.
44
[Authenticator]: https://github.com/mattrubin/Authenticator
55

66

7+
## [2.0.5] - 2018-09-17
8+
- Added an alert to ask the user for confirmation before permanently deleting a token.
9+
([#217](https://github.com/mattrubin/Authenticator/pull/217))
10+
11+
712
## [2.0.4] - 2018-04-29
813
- Fixed a crash on launch for some users, caused by deserialization errors when loading persistent tokens from the keychain.
914
([#277](https://github.com/mattrubin/Authenticator/issues/277))
@@ -107,7 +112,8 @@ For security reasons, tokens are stored only on one device, and are not included
107112
## [1.0] - 2013-11-25
108113

109114

110-
[Unreleased]: https://github.com/mattrubin/Authenticator/compare/2.0.4...HEAD
115+
[Unreleased]: https://github.com/mattrubin/Authenticator/compare/2.0.5...HEAD
116+
[2.0.5]: https://github.com/mattrubin/Authenticator/compare/2.0.4...2.0.5
111117
[2.0.4]: https://github.com/mattrubin/Authenticator/compare/2.0.3...2.0.4
112118
[2.0.3]: https://github.com/mattrubin/Authenticator/compare/2.0.2...2.0.3
113119
[2.0.2]: https://github.com/mattrubin/Authenticator/compare/2.0.1...2.0.2

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Configuration for Carthage (https://github.com/Carthage/Carthage)
22

3-
github "mattrubin/OneTimePassword" ~> 3.1.3
3+
github "mattrubin/OneTimePassword" ~> 3.1.4
44
github "SVProgressHUD/SVProgressHUD" ~> 2.0

0 commit comments

Comments
 (0)