Skip to content

Commit 1272215

Browse files
committed
OSX installer updates
1 parent 196c6af commit 1272215

45 files changed

Lines changed: 853 additions & 892 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎osx/Helper/Info.plist‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleName</key>
1010
<string>Helper</string>
1111
<key>CFBundleVersion</key>
12-
<string>55</string>
12+
<string>56</string>
1313
<key>CFBundleShortVersionString</key>
1414
<string>1.0.15</string>
1515
<key>SMAuthorizedClients</key>

‎osx/Helper/KBHelper.m‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ - (void)handleRequestWithMethod:(NSString *)method params:(NSArray *)params mess
4848
}
4949

5050
- (NSString *)checkKextID:(NSString *)kextID {
51-
NSString * const fuse2KextID = @"com.github.osxfuse.filesystems.osxfusefs";
51+
NSString * const kbfuseKextID = @"com.github.kbfuse.filesystems.kbfuse";
5252
NSString * const fuse3KextID = @"com.github.osxfuse.filesystems.osxfuse";
53+
if ([kextID isEqualToString:kbfuseKextID]) return kbfuseKextID;
5354
if ([kextID isEqualToString:fuse3KextID]) return fuse3KextID;
54-
if ([kextID isEqualToString:fuse2KextID]) return fuse2KextID;
5555
return nil;
5656
}
5757

‎osx/Helper/KBHelperTest.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@implementation KBHelperTest
1414

1515
- (void)testKextUnload:(void (^)(NSError *error, id value))completion {
16-
NSString *kextID = @"com.github.osxfuse.filesystems.osxfuse";
16+
NSString *kextID = @"com.github.kbfuse.filesystems.kbfuse";
1717
KBHelper *helper = [[KBHelper alloc] init];
1818
[helper handleRequestWithMethod:@"kext_unload" params:@[@{@"kextID": kextID}] messageId:@(1) completion:completion];
1919
}

‎osx/Helper/uninstall_helper‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22

3-
/bin/rm /Library/PrivilegedHelperTools/keybase.Helper
4-
/bin/launchctl unload /Library/LaunchDaemons/keybase.Helper.plist
5-
/bin/rm /Library/LaunchDaemons/keybase.Helper.plist
3+
sudo /bin/launchctl unload /Library/LaunchDaemons/keybase.Helper.plist
4+
sudo /bin/rm /Library/LaunchDaemons/keybase.Helper.plist
5+
sudo /bin/rm /Library/PrivilegedHelperTools/keybase.Helper

‎osx/KBKit/KBKit.xcodeproj/project.pbxproj‎

Lines changed: 24 additions & 40 deletions
Large diffs are not rendered by default.

‎osx/KBKit/KBKit/App/KBApp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
- (void)open;
3737

38+
- (void)openControlPanel;
39+
3840
- (NSWindow *)mainWindow;
3941

4042
- (KBService *)service;

‎osx/KBKit/KBKit/App/KBApp.m‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ - (void)selectEnv:(void (^)(KBEnvironment *env))completion {
113113
[window center];
114114
[window makeKeyAndOrderFront:nil];
115115
}
116-
117-
//#ifdef DEBUG
118-
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
119-
// envSelectView.onSelect([KBEnvironment env:KBEnvManual]);
120-
// });
121-
//#endif
122116
}
123117

124118
- (void)openWithEnvironment:(KBEnvironment *)environment {
@@ -130,11 +124,13 @@ - (void)openWithEnvironment:(KBEnvironment *)environment {
130124
// [componentsForControlPanel addObject:[[KBStyleGuideView alloc] init]];
131125
[_controlPanel addComponents:componentsForControlPanel];
132126

133-
[_controlPanel open:_appView];
134-
135127
[_appView openWithEnvironment:environment completion:^(NSError *error) {}];
136128
}
137129

130+
- (void)openControlPanel {
131+
[_controlPanel open:_appView];
132+
}
133+
138134
- (void)_test {
139135
KBRTestRequest *request = [[KBRTestRequest alloc] initWithClient:self.service.client];
140136
[self.service.client registerMethod:@"keybase.1.test.testCallback" sessionId:request.sessionId requestHandler:^(NSNumber *messageId, NSString *method, NSArray *params, MPRequestCompletion completion) {

‎osx/KBKit/KBKit/App/KBAppView.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121

2222
- (void)openWithEnvironment:(KBEnvironment *)environment completion:(KBCompletion)completion;
2323

24-
- (KBWindow *)openWindow;
24+
- (void)openWindow;
2525

2626
- (void)showLogin;
2727
- (void)logout:(BOOL)prompt;
2828

2929
- (void)showInProgress:(NSString *)title;
3030
- (void)checkStatus;
3131

32+
- (void)showInstallStatusView:(KBCompletion)completion;
33+
3234
- (NSString *)APIURLString:(NSString *)path;
3335

3436
@end

‎osx/KBKit/KBKit/App/KBAppView.m‎

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@
2626
#import "KBDebugViews.h"
2727
#import "KBAppProgressView.h"
2828
#import "KBSecretPromptView.h"
29-
#import "KBStatusView.h"
29+
#import "KBInstallStatusView.h"
3030
#import "KBAppDebug.h"
3131
#import "KBNotifications.h"
32-
#import "KBErrorStatusView.h"
32+
#import "KBStatusView.h"
33+
#import "KBTask.h"
34+
#import "KBWorkspace.h"
3335

3436
typedef NS_ENUM (NSInteger, KBAppViewMode) {
3537
KBAppViewModeInProgress = 1,
36-
KBAppViewModeError,
38+
KBAppViewModeStatus,
3739
KBAppViewModeInstaller,
3840
KBAppViewModeLogin,
3941
KBAppViewModeSignup,
@@ -46,7 +48,6 @@ @interface KBAppView () <KBAppToolbarDelegate, KBComponent, KBSignupViewDelegate
4648
@property (readonly) YOView *contentView;
4749

4850
@property KBAppProgressView *appProgressView;
49-
@property KBErrorStatusView *errorView;
5051

5152
@property KBUsersAppView *usersAppView;
5253
@property KBDevicesAppView *devicesAppView;
@@ -65,7 +66,6 @@ @interface KBAppView () <KBAppToolbarDelegate, KBComponent, KBSignupViewDelegate
6566
@property KBEnvironment *environment;
6667
@property KBRConfig *userConfig;
6768
@property KBRGetCurrentStatusRes *userStatus;
68-
6969
@end
7070

7171
#define TITLE_HEIGHT (32)
@@ -111,28 +111,14 @@ - (void)openWithEnvironment:(KBEnvironment *)environment completion:(KBCompletio
111111
NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
112112
DDLogInfo(@"Keybase.app Version: %@", info[@"CFBundleShortVersionString"]);
113113

114-
[self checkInstall:completion];
114+
[self install:completion];
115115
}
116116

117-
- (void)checkInstall:(KBCompletion)completion {
117+
- (void)install:(KBCompletion)completion {
118118
[self showInProgress:@"Loading"];
119119
KBInstaller *installer = [[KBInstaller alloc] init];
120-
[installer installStatusWithEnvironment:_environment completion:^(BOOL needsInstall, BOOL brewConflict) {
121-
if (brewConflict) {
122-
[self showBrewWarning:^{
123-
[self checkInstall:completion];
124-
}];
125-
return;
126-
}
127-
128-
[self showStatusView:self.environment completion:completion];
129-
/*
130-
if (needsInstall) {
131-
[self showStatusView:environment completion:completion];
132-
} else {
133-
[self connect:completion];
134-
}
135-
*/
120+
[installer installWithEnvironment:_environment force:NO completion:^() {
121+
[self showInstallStatusView:completion];
136122
}];
137123
}
138124

@@ -229,32 +215,40 @@ - (void)showInProgress:(NSString *)title {
229215
}
230216

231217
- (void)showErrorView:(NSString *)title error:(NSError *)error {
232-
if (_errorView || self.mode != KBAppViewModeError) {
233-
_errorView = [[KBErrorStatusView alloc] init];
234-
KBNavigationView *navigation = [[KBNavigationView alloc] initWithView:_errorView title:_title];
235-
[self setContentView:navigation mode:KBAppViewModeError];
236-
}
218+
KBStatusView *errorView = [[KBStatusView alloc] init];
219+
KBNavigationView *navigation = [[KBNavigationView alloc] initWithView:errorView title:_title];
220+
[self setContentView:navigation mode:KBAppViewModeStatus];
237221
GHWeakSelf gself = self;
238-
[_errorView setError:error title:title retry:^{
222+
[errorView setError:error title:title retry:^{
239223
[gself showConnect:^(NSError *error) {}];
240224
} close:^{
241-
[KBApp.app quitWithPrompt:NO sender:gself.errorView];
225+
[KBApp.app quitWithPrompt:NO sender:self];
242226
}];
243227
}
244228

245229
- (void)showBrewWarning:(dispatch_block_t)retry {
246-
KBErrorStatusView *view = [[KBErrorStatusView alloc] init];
230+
KBStatusView *view = [[KBStatusView alloc] init];
247231
view.insets = UIEdgeInsetsMake(100, 100, 100, 100);
248232
[view setText:@"We've detected that you already have Keybase installed via Homebrew." description:@"We recommend that you uninstall the Homebrew installation since running both at the same time can causes issues." title:@"Homebrew Install Found" retry:retry close:^{
249233
[KBApp.app quitWithPrompt:NO sender:self];
250234
}];
251235
KBNavigationView *navigation = [[KBNavigationView alloc] initWithView:view title:_title];
252-
[self setContentView:navigation mode:KBAppViewModeError];
236+
[self setContentView:navigation mode:KBAppViewModeStatus];
253237
}
254238

255-
- (void)showStatusView:(KBEnvironment *)environment completion:(KBCompletion)completion {
239+
- (void)showWelcome {
256240
KBStatusView *view = [[KBStatusView alloc] init];
257-
[view setEnvironment:environment];
241+
view.insets = UIEdgeInsetsMake(100, 100, 100, 100);
242+
[view setText:@"Thanks for installing Keybase." description:@"Cliche echo park synth, shoreditch crucifix church-key hoodie. Banh mi kitsch portland pitchfork iPhone mlkshk keffiyeh bitters stumptown polaroid listicle. Chambray ethical brunch, dreamcatcher lomo single-origin coffee yuccie irony beard. Microdosing knausgaard raw denim ethical fashion axe. Waistcoat cornhole brooklyn, truffaut bushwick meh keffiyeh. Blog schlitz next level banh mi, umami hella ugh tote bag paleo cliche lo-fi 8-bit ennui kinfolk. Shabby chic fap fixie keytar." title:@"Welcome to Keybase" retry:nil close:^{
243+
[self.window close];
244+
}];
245+
KBNavigationView *navigation = [[KBNavigationView alloc] initWithView:view title:_title];
246+
[self setContentView:navigation mode:KBAppViewModeStatus];
247+
}
248+
249+
- (void)showInstallStatusView:(KBCompletion)completion {
250+
KBInstallStatusView *view = [[KBInstallStatusView alloc] init];
251+
[view setEnvironment:self.environment];
258252
view.completion = ^() {
259253
[self showConnect:completion];
260254
};
@@ -381,6 +375,10 @@ - (void)setUserStatus:(KBRGetCurrentStatusRes *)userStatus userConfig:(KBRConfig
381375
// Don't change if we are in the installer
382376
if (_mode == KBAppViewModeInstaller) return;
383377

378+
[self showWelcome];
379+
return;
380+
381+
/*
384382
if (userStatus.loggedIn && userStatus.user) {
385383
// Show profile if logging in or we are already showing profile, refresh it
386384
if (_mode != KBAppViewModeMain || _toolbar.selectedItem == KBAppViewItemProfile) {
@@ -389,6 +387,7 @@ - (void)setUserStatus:(KBRGetCurrentStatusRes *)userStatus userConfig:(KBRConfig
389387
} else if (_mode != KBAppViewModeLogin || _mode != KBAppViewModeSignup) {
390388
[self showLogin];
391389
}
390+
*/
392391
}
393392

394393
- (void)signupViewDidSignup:(KBSignupView *)signupView {
@@ -462,24 +461,6 @@ - (void)appToolbar:(KBAppToolbar *)appToolbar didSelectItem:(KBAppViewItem)item
462461
}
463462
}
464463

465-
- (KBWindow *)createWindow {
466-
NSAssert(!self.superview, @"Already has superview");
467-
KBWindow *window = [KBWindow windowWithContentView:self size:CGSizeMake(800, 600) retain:YES];
468-
window.minSize = CGSizeMake(600, 600);
469-
//window.restorable = YES;
470-
//window.maxSize = CGSizeMake(600, 900);
471-
window.delegate = self; // Overrides default delegate
472-
window.titleVisibility = NO;
473-
window.styleMask = NSClosableWindowMask | NSFullSizeContentViewWindowMask | NSTitledWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask;
474-
475-
window.backgroundColor = KBAppearance.currentAppearance.secondaryBackgroundColor;
476-
window.restorable = YES;
477-
//window.restorationClass = self.class;
478-
//window.navigation.titleView = [KBTitleView titleViewWithTitle:@"Keybase" navigation:window.navigation];
479-
//[window setLevel:NSStatusWindowLevel];
480-
return window;
481-
}
482-
483464
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect {
484465
CGFloat sheetPosition = 0;
485466
if (_mode == KBAppViewModeMain) sheetPosition = 74;
@@ -488,17 +469,22 @@ - (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRec
488469
return rect;
489470
}
490471

472+
/*
491473
- (BOOL)windowShouldClose:(id)sender {
492474
[KBApp.app quitWithPrompt:YES sender:self];
493475
return NO;
494476
}
477+
*/
495478

496-
- (KBWindow *)openWindow {
497-
NSAssert(!self.window, @"Already has window");
498-
KBWindow *window = [self createWindow];
499-
[window center];
500-
[window makeKeyAndOrderFront:nil];
501-
return window;
479+
- (void)openWindow {
480+
if (self.window) {
481+
[NSApplication.sharedApplication activateIgnoringOtherApps:YES];
482+
[self.window orderFrontRegardless];
483+
} else {
484+
NSWindow *window = [KBWorkspace createMainWindow:self];
485+
[window center];
486+
[window makeKeyAndOrderFront:nil];
487+
}
502488
}
503489

504490
//- (void)encodeRestorableStateWithCoder:(NSCoder *)coder { }

‎osx/KBKit/KBKit/Component/KBFSConfig.h‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)