Skip to content

Commit 2b7e9c4

Browse files
1.60.18
1 parent 573f864 commit 2b7e9c4

20 files changed

+312
-183
lines changed

AppPrivacyShieldMode.h

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ typedef NS_ENUM (NSInteger, AppPrivacyShieldMode) {
1414
kAppPrivacyShieldModeBlur,
1515
kAppPrivacyShieldModePixellate,
1616
kAppPrivacyShieldModeBlueScreen,
17+
kAppPrivacyShieldModeBlackScreen,
18+
kAppPrivacyShieldModeDarkLogo,
19+
kAppPrivacyShieldModeRed,
20+
kAppPrivacyShieldModeGreen,
21+
kAppPrivacyShieldModeLightLogo,
22+
kAppPrivacyShieldModeWhite,
1723
};
1824

1925
#endif /* AppPrivacyShieldMode_h */

DatabaseHomeView/AuditNavigationView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct AuditNavigationView: View {
7272
swlog("🐞 AuditNavigationView received databaseReloaded")
7373
model.objectWillChange.send()
7474
}
75-
.navigationTitle("quick_view_title_audit_issues_title")
75+
.navigationTitle("browse_vc_action_audit")
7676
.toolbar {
7777
ToolbarItem(placement: .topBarLeading) {
7878
HStack {
@@ -94,7 +94,7 @@ struct AuditNavigationView: View {
9494
.foregroundColor(noIssues ? .blue : .orange)
9595
.font(.subheadline)
9696

97-
Text("quick_view_title_audit_issues_title")
97+
Text("browse_vc_action_audit")
9898
.lineLimit(1)
9999
.font(.headline)
100100
}

DatabaseHomeView/OtherViewsView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct OtherViewsView: View {
2525
if auditModel.isEnabled {
2626
let issueCount = model.database.auditIssueEntryCount
2727
NavigationCapsule(model: model,
28-
title: issueCount == 0 ? "browse_vc_action_audit" : "quick_view_title_audit_issues_title",
28+
title: "browse_vc_action_audit",
2929
image: "checkmark.shield.fill",
3030
count: issueCount == 0 ? "" : String(issueCount),
3131
imageBackgroundColor: issueCount == 0 ? .green : .orange,

StrongBox/AppDelegate.m

+73-25
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
@interface AppDelegate ()
4646

4747
@property AppLockViewController* lockScreenVc;
48-
@property UIImageView* privacyScreen;
48+
@property UIView* privacyScreen;
4949
@property NSInteger privacyScreenPresentationIdentifier;
5050

5151
@property (nonatomic, strong) NSDate *appLockEnteredBackgroundAtTime;
@@ -342,48 +342,96 @@ - (void)installTopLevelExceptionHandlers {
342342

343343
- (void)showPrivacyShieldView {
344344
slog(@"showPrivacyShieldView - [%@]", self.privacyScreen);
345-
345+
346346
if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeNone ) {
347347
return;
348348
}
349+
350+
if ( self.privacyScreen ) {
351+
slog(@"Privacy Screen Already in Place... NOP");
352+
self.privacyScreenPresentationIdentifier++;
353+
return;
354+
}
355+
356+
if ( self.lockScreenVc != nil ) {
357+
slog(@"Lock Screen is up, privacy screen inappropriate, likely initial launch and switch back...");
358+
return;
359+
}
360+
361+
self.privacyScreen = [self createPrivacyScreenView];
362+
self.privacyScreenPresentationIdentifier++;
363+
364+
[self.window addSubview:self.privacyScreen];
365+
}
349366

367+
- (UIView*)createPrivacyScreenView {
368+
UIImageView* tmp = [[UIImageView alloc] init];
369+
tmp.frame = self.window.frame;
350370
UIImage* cover = nil;
371+
351372
if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeBlur ) {
352373
UIImage* screenshot = [self screenShot];
353374
cover = [self blur:screenshot];
375+
tmp.contentMode = UIViewContentModeScaleToFill;
354376
}
355377
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModePixellate ) {
356378
UIImage* screenshot = [self screenShot];
357379
cover = [self pixellate:screenshot];
380+
tmp.contentMode = UIViewContentModeScaleToFill;
381+
}
382+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeBlueScreen ) {
383+
tmp.backgroundColor = UIColor.systemBlueColor;
358384
}
385+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeBlackScreen ) {
386+
tmp.backgroundColor = UIColor.blackColor;
387+
}
388+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeDarkLogo ) {
389+
cover = [self createPrivacyShieldLogo];
359390

360-
UIImageView* tmp = [[UIImageView alloc] init];
361-
tmp.frame = self.window.frame;
362-
tmp.contentMode = UIViewContentModeScaleToFill;
363-
tmp.backgroundColor = UIColor.systemBlueColor;
364-
365-
if ( !self.privacyScreen ) {
366-
if ( self.lockScreenVc != nil ) {
367-
slog(@"Lock Screen is up, privacy screen inappropriate, likely initial launch and switch back...");
368-
return;
369-
}
370-
else {
371-
slog(@"No Lock Screen up [%@]", cover);
372-
}
391+
tmp.backgroundColor = [UIColor colorWithWhite:0.075 alpha:1.0];
392+
tmp.contentMode = UIViewContentModeCenter;
393+
tmp.tintColor = [UIColor colorWithWhite:0.15 alpha:1.0];
394+
}
395+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeRed ) {
396+
tmp.backgroundColor = UIColor.systemRedColor;
397+
}
398+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeGreen ) {
399+
tmp.backgroundColor = UIColor.systemGreenColor;
400+
}
401+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeLightLogo ) {
402+
cover = [self createPrivacyShieldLogo];
373403

374-
self.privacyScreen = tmp;
375-
self.privacyScreenPresentationIdentifier++;
376-
377-
[self.window addSubview:self.privacyScreen];
378-
379-
if ( cover ) {
380-
self.privacyScreen.image = cover;
381-
}
404+
tmp.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
405+
tmp.contentMode = UIViewContentModeCenter;
406+
tmp.tintColor = UIColor.systemGrayColor;
407+
}
408+
else if ( AppPreferences.sharedInstance.appPrivacyShieldMode == kAppPrivacyShieldModeWhite ) {
409+
tmp.backgroundColor = UIColor.whiteColor;
382410
}
383411
else {
384-
slog(@"Privacy Screen Already in Place... NOP");
385-
self.privacyScreenPresentationIdentifier++;
412+
slog(@"🔴 Unknown privacy shield mode!");
413+
}
414+
415+
if ( cover ) {
416+
tmp.image = cover;
386417
}
418+
419+
return tmp;
420+
}
421+
422+
- (UIImage*)createPrivacyShieldLogo {
423+
UIImage* cover = [UIImage imageNamed:@"AppIcon-2019-Glyph-Shadow"];
424+
425+
CGFloat divisor = cover.size.width / 128;
426+
427+
CGSize newSize = CGSizeMake(cover.size.width / divisor, cover.size.height / divisor);
428+
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:newSize];
429+
UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext*_Nonnull myContext) {
430+
[cover drawInRect:(CGRect) {.origin = CGPointZero, .size = newSize}];
431+
}];
432+
cover = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
433+
434+
return cover;
387435
}
388436

389437
- (void)hidePrivacyShield:(NSInteger)identifier {

StrongBox/AppPreferences.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ - (void)setDuplicateItemEditAfterwards:(BOOL)duplicateItemEditAfterwards {
585585
}
586586

587587
- (BOOL)exportItemsPreserveTimestamps {
588-
return [self getBool:kExportItemsPreserveTimestamps];
588+
return [self getBool:kExportItemsPreserveTimestamps fallback:YES];
589589
}
590590

591591
- (void)setExportItemsPreserveTimestamps:(BOOL)exportItemsPreserveTimestamps {

StrongBox/BrowseSafeView.m

-7
Original file line numberDiff line numberDiff line change
@@ -1775,17 +1775,10 @@ - (void)refreshNavBarTitle {
17751775
title = NSLocalizedString(@"quick_view_title_expired_and_expiring", @"Expired & Expiring");
17761776
image = [UIImage systemImageNamed:@"calendar" withConfiguration:[UIImageSymbolConfiguration configurationWithScale:UIImageSymbolScaleDefault]];
17771777
}
1778-
1779-
1780-
1781-
17821778
else {
17831779
slog(@"🔴 Could not refreshNavBarTitle - unknown view type");
17841780
}
17851781

1786-
1787-
1788-
17891782
UIView* view = [MMcGSwiftUtils navTitleWithImageAndTextWithTitleText:title
17901783
image:image
17911784
tint:tint];

StrongBox/ConfigureTabsViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class ConfigureTabsViewController: UITableViewController, UIAdaptivePresentation
253253
case .expiredAndExpiring:
254254
return NSLocalizedString("quick_view_title_expired_and_expiring", comment: "Expired & Expiring")
255255
case .auditIssues:
256-
return NSLocalizedString("quick_view_title_audit_issues_title", comment: "Audit Issues")
256+
return NSLocalizedString("browse_vc_action_audit", comment: "Audit")
257257
@unknown default:
258258
return "🔴 UNKNOWN"
259259
}

StrongBox/HardwareKeySettingsView.swift

+60-49
Original file line numberDiff line numberDiff line change
@@ -89,61 +89,68 @@ struct HardwareKeySettingsView: View {
8989
}
9090

9191
var body: some View {
92-
Form {
93-
Section {
94-
Toggle("setting_response_caching_title", isOn: $keyCachingEnabled.onChange { _ in notifySettingChanged() })
95-
.toggleStyle(.switch)
96-
97-
Picker("setting_cache_response_for_period_of_time", selection: $cacheChallengeDurationSecs.onChange { _ in notifySettingChanged() }) {
98-
ForEach(challengeDurationIntervals, id: \.self) {
99-
Text(titleForCacheDuration(interval: $0))
92+
VStack(spacing: 20) {
93+
Form {
94+
Section {
95+
Toggle("setting_response_caching_title", isOn: $keyCachingEnabled.onChange { _ in notifySettingChanged() })
96+
.toggleStyle(.switch)
97+
98+
Picker("setting_cache_response_for_period_of_time", selection: $cacheChallengeDurationSecs.onChange { _ in notifySettingChanged() }) {
99+
ForEach(challengeDurationIntervals, id: \.self) {
100+
Text(titleForCacheDuration(interval: $0))
101+
}
100102
}
103+
.disabled(!keyCachingEnabled)
104+
} header: {
105+
Text("challenge_response_caching_header")
106+
#if os(macOS)
107+
.font(.headline)
108+
#endif
109+
} footer: {
110+
Text("challenge_response_caching_footer")
111+
#if os(macOS)
112+
.font(.subheadline)
113+
.foregroundStyle(.secondary)
114+
#endif
101115
}
102-
.disabled(!keyCachingEnabled)
103-
} header: {
104-
Text("challenge_response_caching_header")
105-
#if os(macOS)
106-
.font(.headline)
107-
#endif
108-
} footer: {
109-
Text("challenge_response_caching_footer")
116+
110117
#if os(macOS)
111-
.font(.subheadline)
112-
.foregroundStyle(.secondary)
118+
Spacer()
119+
Divider()
120+
Spacer()
113121
#endif
114-
}
115122

116-
#if os(macOS)
117-
Spacer()
118-
Divider()
119-
Spacer()
120-
#endif
121-
122-
Section {
123-
Picker("refresh_challenge_interval", selection: $challengeRefreshIntervalSecs.onChange { _ in notifySettingChanged() }) {
124-
ForEach(challengeRefreshIntervals, id: \.self) {
125-
Text(titleForChallengeRefreshInterval(interval: $0))
123+
Section {
124+
Picker("refresh_challenge_interval", selection: $challengeRefreshIntervalSecs.onChange { _ in notifySettingChanged() }) {
125+
ForEach(challengeRefreshIntervals, id: \.self) {
126+
Text(titleForChallengeRefreshInterval(interval: $0))
127+
}
126128
}
127-
}
128129

129-
Toggle("autofill_refresh_challenge_suppressed", isOn: $autoFillRefreshSuppressed.onChange { _ in notifySettingChanged() })
130-
.toggleStyle(.switch)
131-
} header: {
132-
Text("challenge_refreshing_header")
133-
#if os(macOS)
134-
.font(.headline)
135-
#endif
136-
} footer: {
137-
Text("challenge_refreshing_footer")
138-
#if os(macOS)
139-
.font(.subheadline)
140-
.foregroundStyle(.secondary)
141-
#endif
130+
Toggle("autofill_refresh_challenge_suppressed", isOn: $autoFillRefreshSuppressed.onChange { _ in notifySettingChanged() })
131+
.toggleStyle(.switch)
132+
} header: {
133+
Text("challenge_refreshing_header")
134+
#if os(macOS)
135+
.font(.headline)
136+
#endif
137+
} footer: {
138+
Text("challenge_refreshing_footer")
139+
#if os(macOS)
140+
.font(.subheadline)
141+
.foregroundStyle(.secondary)
142+
#endif
143+
}
142144
}
143145

144-
145-
146-
146+
#if os(macOS)
147+
Button {
148+
completion?()
149+
} label: {
150+
Text("generic_verb_close")
151+
}
152+
.keyboardShortcut(.defaultAction)
153+
#endif
147154
}
148155
.controlSize(.large)
149156
#if os(iOS)
@@ -160,14 +167,18 @@ struct HardwareKeySettingsView: View {
160167
}
161168
#endif
162169
#if os(macOS)
163-
.frame(minWidth: 200, minHeight: 200)
170+
164171
.scenePadding()
165172
#endif
166173
}
167174
}
168175

169176
#Preview {
170-
NavigationView {
177+
#if os(macOS)
171178
HardwareKeySettingsView()
172-
}
179+
#else
180+
NavigationView {
181+
HardwareKeySettingsView()
182+
}
183+
#endif
173184
}

StrongBox/OnboardingManager.m

+2
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,8 @@ - (BOOL)isUserNotificationsNotDetermined {
795795
return !model.metadata.hasOnboardedHardwareKeyCaching &&
796796
model.originalFormat == kKeePass4 &&
797797
model.ckfs.yubiKeyCR != nil &&
798+
model.metadata.nextGenPrimaryYubiKeyConfig &&
799+
model.metadata.nextGenPrimaryYubiKeyConfig.mode != kVirtual &&
798800
AppPreferences.sharedInstance.hardwareKeyCachingBeta &&
799801
!model.metadata.hardwareKeyCRCaching;
800802
};

0 commit comments

Comments
 (0)