Skip to content

Commit b6b6594

Browse files
authored
Merge pull request #45 from AginSquash/dev
Fixed blur when minimizing the app immediately after a successful FaceID
2 parents 49254be + b8e66ba commit b6b6594

File tree

8 files changed

+117
-17
lines changed

8 files changed

+117
-17
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
### Two-factor authentication app for iOS and macOS
55

66
[![Latest Release](https://img.shields.io/github/v/release/AginSquash/open2fa)](https://github.com/AginSquash/open2fa/releases)
7-
![Platform](https://img.shields.io/badge/iOS-14.0%2B-orange)
8-
![Platform](https://img.shields.io/badge/macOS-11.0%2B-orange)
7+
![Platform](https://img.shields.io/badge/iOS-15.0%2B-orange)
8+
![Platform](https://img.shields.io/badge/macOS-12.0%2B-orange)
99

1010
Open2FA is a simple, open source two-factor authentication application written using SwiftUI. Two-step verification helps you protect your accounts, even if attackers have your password.
1111

@@ -15,6 +15,8 @@ Open2FA is a simple, open source two-factor authentication application written u
1515
- Import and export encrypted file with codes 📲
1616
- You can store data as in iCloud and synchronize between devices, or store everything locally on your device 👩‍💻
1717

18+
[<img src="screenshots/appstore-badge.png" height="50">](https://apps.apple.com/ru/app/open2fa/id6497407368)
19+
1820
### Screenshots
1921
<img src="https://github.com/AginSquash/open2fa/blob/master/screenshots/screenshot1_0.95.png?raw=true" width="250" alt="Screenshot of the Login screen" /> &nbsp;
2022
<img src="https://github.com/AginSquash/open2fa/blob/master/screenshots/screenshot2_1.2.1.png?raw=true" width="250" alt="Screenshot of the token list" /> &nbsp;

open2fa.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
CD104A312499897F005A8E47 /* PreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD104A302499897F005A8E47 /* PreferencesView.swift */; };
1313
CD188EBF2BD88CB00029D7E0 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = CD188EBE2BD88CB00029D7E0 /* KeychainAccess */; };
1414
CD20FCD224D0F18D008F5E6A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CD20FCD424D0F18D008F5E6A /* Localizable.strings */; };
15+
CD43DA6E2BEA8D3C00381372 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = CD43DA6D2BEA8D3C00381372 /* PrivacyInfo.xcprivacy */; };
1516
CD58E2E127885ADF00D9047E /* EditCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD58E2E027885ADF00D9047E /* EditCodeView.swift */; };
1617
CD58E2E327885EA900D9047E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD58E2E227885EA900D9047E /* XCTest.framework */; };
1718
CD5ADD692BDC5352004956F8 /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5ADD682BDC5352004956F8 /* LoginViewModel.swift */; };
@@ -53,14 +54,14 @@
5354
CDE763092BD9A02F00234D18 /* tmp_core2fa.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDE763082BD9A02F00234D18 /* tmp_core2fa.swift */; };
5455
CDEA8B262547243B006DA70A /* O2FADocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDEA8B252547243B006DA70A /* O2FADocument.swift */; };
5556
CDEADD9B2BE637D600917B88 /* BiometricAuthService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDEADD9A2BE637D600917B88 /* BiometricAuthService.swift */; };
56-
CDEADD9E2BE9AB1F00917B88 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = CDEADD9D2BE9AB1F00917B88 /* PrivacyInfo.xcprivacy */; };
5757
/* End PBXBuildFile section */
5858

5959
/* Begin PBXFileReference section */
6060
CD0EF0232BDD554800F4FEB1 /* UserDefaultsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsService.swift; sourceTree = "<group>"; };
6161
CD0EF0252BDD74CC00F4FEB1 /* CloudKitService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudKitService.swift; sourceTree = "<group>"; };
6262
CD104A302499897F005A8E47 /* PreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = "<group>"; };
6363
CD20FCD324D0F18D008F5E6A /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
64+
CD43DA6D2BEA8D3C00381372 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
6465
CD58E2E027885ADF00D9047E /* EditCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditCodeView.swift; sourceTree = "<group>"; };
6566
CD58E2E227885EA900D9047E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6667
CD5ADD682BDC5352004956F8 /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = "<group>"; };
@@ -101,7 +102,6 @@
101102
CDE763082BD9A02F00234D18 /* tmp_core2fa.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = tmp_core2fa.swift; sourceTree = "<group>"; };
102103
CDEA8B252547243B006DA70A /* O2FADocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = O2FADocument.swift; sourceTree = "<group>"; };
103104
CDEADD9A2BE637D600917B88 /* BiometricAuthService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricAuthService.swift; sourceTree = "<group>"; };
104-
CDEADD9D2BE9AB1F00917B88 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
105105
/* End PBXFileReference section */
106106

107107
/* Begin PBXFrameworksBuildPhase section */
@@ -125,7 +125,6 @@
125125
CD87B4C3246F53B800E04D70 = {
126126
isa = PBXGroup;
127127
children = (
128-
CDEADD9D2BE9AB1F00917B88 /* PrivacyInfo.xcprivacy */,
129128
CD87B4CE246F53B800E04D70 /* open2fa */,
130129
CD87B4CD246F53B800E04D70 /* Products */,
131130
CDC636EF2471DC8400F10540 /* Frameworks */,
@@ -152,6 +151,7 @@
152151
CD6786FA24AB7F3C00422233 /* open2fa.entitlements */,
153152
CD87B4CF246F53B800E04D70 /* AppDelegate.swift */,
154153
CD87B4D1246F53B800E04D70 /* SceneDelegate.swift */,
154+
CD43DA6D2BEA8D3C00381372 /* PrivacyInfo.xcprivacy */,
155155
CD87B4D5246F53B900E04D70 /* Assets.xcassets */,
156156
CD87B4DA246F53B900E04D70 /* LaunchScreen.storyboard */,
157157
CD87B4DD246F53B900E04D70 /* Info.plist */,
@@ -330,7 +330,7 @@
330330
CD87B4DC246F53B900E04D70 /* LaunchScreen.storyboard in Resources */,
331331
CD20FCD224D0F18D008F5E6A /* Localizable.strings in Resources */,
332332
CD87B4D9246F53B900E04D70 /* Preview Assets.xcassets in Resources */,
333-
CDEADD9E2BE9AB1F00917B88 /* PrivacyInfo.xcprivacy in Resources */,
333+
CD43DA6E2BEA8D3C00381372 /* PrivacyInfo.xcprivacy in Resources */,
334334
CD87B4D6246F53B900E04D70 /* Assets.xcassets in Resources */,
335335
);
336336
runOnlyForDeploymentPostprocessing = 0;
@@ -534,7 +534,7 @@
534534
CODE_SIGN_ENTITLEMENTS = open2fa/open2fa.entitlements;
535535
CODE_SIGN_IDENTITY = "Apple Development";
536536
CODE_SIGN_STYLE = Automatic;
537-
CURRENT_PROJECT_VERSION = 5;
537+
CURRENT_PROJECT_VERSION = 9;
538538
DEVELOPMENT_ASSET_PATHS = "\"open2fa/Preview Content\"";
539539
DEVELOPMENT_TEAM = Z7788V56C7;
540540
ENABLE_PREVIEWS = YES;
@@ -547,7 +547,7 @@
547547
"$(inherited)",
548548
"@executable_path/Frameworks",
549549
);
550-
MARKETING_VERSION = 1.0.0;
550+
MARKETING_VERSION = 1.0.1;
551551
OTHER_LDFLAGS = (
552552
"-weak_framework",
553553
"\"XCTest\"",
@@ -570,7 +570,7 @@
570570
CODE_SIGN_ENTITLEMENTS = open2fa/open2fa.entitlements;
571571
CODE_SIGN_IDENTITY = "Apple Development";
572572
CODE_SIGN_STYLE = Automatic;
573-
CURRENT_PROJECT_VERSION = 5;
573+
CURRENT_PROJECT_VERSION = 9;
574574
DEVELOPMENT_ASSET_PATHS = "\"open2fa/Preview Content\"";
575575
DEVELOPMENT_TEAM = Z7788V56C7;
576576
ENABLE_PREVIEWS = YES;
@@ -583,7 +583,7 @@
583583
"$(inherited)",
584584
"@executable_path/Frameworks",
585585
);
586-
MARKETING_VERSION = 1.0.0;
586+
MARKETING_VERSION = 1.0.1;
587587
OTHER_LDFLAGS = (
588588
"-weak_framework",
589589
"\"XCTest\"",

open2fa.xcodeproj/xcuserdata/vladvrublevsky.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,99 @@
8484
landmarkType = "7">
8585
</BreakpointContent>
8686
</BreakpointProxy>
87+
<BreakpointProxy
88+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89+
<BreakpointContent
90+
uuid = "8F9B1614-9325-4478-A762-2F7474BE59BE"
91+
shouldBeEnabled = "Yes"
92+
ignoreCount = "0"
93+
continueAfterRunningActions = "No"
94+
filePath = "open2fa/Views/LoginView.swift"
95+
startingColumnNumber = "9223372036854775807"
96+
endingColumnNumber = "9223372036854775807"
97+
startingLineNumber = "144"
98+
endingLineNumber = "144"
99+
landmarkName = "getErrorAlert(_:)"
100+
landmarkType = "7">
101+
</BreakpointContent>
102+
</BreakpointProxy>
103+
<BreakpointProxy
104+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
105+
<BreakpointContent
106+
uuid = "810F0DED-652A-436D-AE13-50F4089EFB0A"
107+
shouldBeEnabled = "Yes"
108+
ignoreCount = "0"
109+
continueAfterRunningActions = "No"
110+
filePath = "open2fa/Views/LoginView.swift"
111+
startingColumnNumber = "9223372036854775807"
112+
endingColumnNumber = "9223372036854775807"
113+
startingLineNumber = "150"
114+
endingLineNumber = "150"
115+
landmarkName = "getErrorAlert(_:)"
116+
landmarkType = "7">
117+
<Locations>
118+
<Location
119+
uuid = "810F0DED-652A-436D-AE13-50F4089EFB0A - 3b5be2c83712a044"
120+
shouldBeEnabled = "Yes"
121+
ignoreCount = "0"
122+
continueAfterRunningActions = "No"
123+
symbolName = "open2fa.LoginView.getErrorAlert(open2fa.LoginViewModel.errorType) -&gt; SwiftUI.Alert"
124+
moduleName = "open2fa"
125+
usesParentBreakpointCondition = "Yes"
126+
urlString = "file:///Users/vladvrublevsky/Documents/Projects/open2fa/open2fa/open2fa/Views/LoginView.swift"
127+
startingColumnNumber = "9223372036854775807"
128+
endingColumnNumber = "9223372036854775807"
129+
startingLineNumber = "150"
130+
endingLineNumber = "150">
131+
</Location>
132+
<Location
133+
uuid = "810F0DED-652A-436D-AE13-50F4089EFB0A - 11ce511ffb63a0ba"
134+
shouldBeEnabled = "Yes"
135+
ignoreCount = "0"
136+
continueAfterRunningActions = "No"
137+
symbolName = "closure #1 () -&gt; () in open2fa.LoginView.getErrorAlert(open2fa.LoginViewModel.errorType) -&gt; SwiftUI.Alert"
138+
moduleName = "open2fa"
139+
usesParentBreakpointCondition = "Yes"
140+
urlString = "file:///Users/vladvrublevsky/Documents/Projects/open2fa/open2fa/open2fa/Views/LoginView.swift"
141+
startingColumnNumber = "9223372036854775807"
142+
endingColumnNumber = "9223372036854775807"
143+
startingLineNumber = "151"
144+
endingLineNumber = "151">
145+
</Location>
146+
</Locations>
147+
</BreakpointContent>
148+
</BreakpointProxy>
149+
<BreakpointProxy
150+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
151+
<BreakpointContent
152+
uuid = "9819010D-A56A-4907-8C6A-8EC14CF9A8CE"
153+
shouldBeEnabled = "No"
154+
ignoreCount = "0"
155+
continueAfterRunningActions = "No"
156+
filePath = "open2fa/ViewModels/Core2FA_ViewModel.swift"
157+
startingColumnNumber = "9223372036854775807"
158+
endingColumnNumber = "9223372036854775807"
159+
startingLineNumber = "247"
160+
endingLineNumber = "247"
161+
landmarkName = "willResignActiveNotification()"
162+
landmarkType = "7">
163+
</BreakpointContent>
164+
</BreakpointProxy>
165+
<BreakpointProxy
166+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
167+
<BreakpointContent
168+
uuid = "0767F14D-295A-45A6-A83B-C880B6AD17C5"
169+
shouldBeEnabled = "No"
170+
ignoreCount = "0"
171+
continueAfterRunningActions = "No"
172+
filePath = "open2fa/ViewModels/Core2FA_ViewModel.swift"
173+
startingColumnNumber = "9223372036854775807"
174+
endingColumnNumber = "9223372036854775807"
175+
startingLineNumber = "265"
176+
endingLineNumber = "265"
177+
landmarkName = "checkShouldPopView()"
178+
landmarkType = "7">
179+
</BreakpointContent>
180+
</BreakpointProxy>
87181
</Breakpoints>
88182
</Bucket>

open2fa/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>ITSAppUsesNonExemptEncryption</key>
6+
<false/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleDisplayName</key>
File renamed without changes.

open2fa/ViewModels/Core2FA_ViewModel.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Core2FA_ViewModel: ObservableObject {
1818

1919
@Published var codes: [AccountCurrentCode] = []
2020
@Published var timeRemaning: Int = 0
21-
@Published var isActive: Bool = true
21+
@Published var isActive: Bool = false
2222
@Published var progress: CGFloat = 1.0
2323

2424
private var accountsData = [AccountData]()
@@ -30,7 +30,7 @@ class Core2FA_ViewModel: ObservableObject {
3030
/// Crypto
3131
private var cryptoModule: CryptoService
3232

33-
private var willResignActiveDate: Date? = nil
33+
private var willResignActiveDate = Date()
3434
var viewDismissalModePublisher = PassthroughSubject<Bool, Never>()
3535
private var shouldPopView = false {
3636
didSet {
@@ -251,23 +251,24 @@ class Core2FA_ViewModel: ObservableObject {
251251
@objc func didBecomeActiveNotification() {
252252
syncTimer()
253253
checkShouldPopView()
254-
withAnimation(.easeInOut(duration: 0.2)) {
255-
self.isActive = true
256-
}
257254
}
258255

259256
private func checkShouldPopView() {
260-
guard let willResignActiveDate = willResignActiveDate else { return }
261-
if Date() > willResignActiveDate.addingTimeInterval(60.0) { //TODO: add config
257+
let deadline = willResignActiveDate.addingTimeInterval(60.0) //TODO: add config
258+
if Date() > deadline {
262259
BiometricAuthService.tryBiometricAuth { result in
263260
switch result {
264261
case .success(let isAuth):
265262
guard isAuth else { self.shouldPopView = true; return }
263+
// In case when user exit app on successful FaceID
264+
guard self.willResignActiveDate < deadline else { return }
266265
self.isActive = true
267266
default:
268267
self.shouldPopView = true
269268
}
270269
}
270+
} else {
271+
self.isActive = true
271272
}
272273
}
273274

open2fa/ViewModels/LoginViewModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class LoginViewModel: ObservableObject {
6060
self.core = nil
6161
guard let core = Core2FA_ViewModel(password: self.enteredPassword, saveKey: isEnablelocalKeychain) else { self.errorDiscription = .init(error: .passwordIncorrect); return }
6262
self.core = core
63+
self.core?.isActive = true
6364
self.enteredPassword = ""
6465

6566
if isFirstRun && isEnableCloudSync {

screenshots/appstore-badge.png

4.6 KB
Loading

0 commit comments

Comments
 (0)