Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4efe301a4 | ||
|
|
9a82e617b3 | ||
|
|
2647279ff6 | ||
|
|
dae84c4a2e | ||
|
|
3b74543c51 | ||
|
|
1918c30bed | ||
|
|
bbeb6bb948 | ||
|
|
15b14d67db | ||
|
|
35c443d82d | ||
|
|
d950d4be3b | ||
|
|
d7aae64b5d | ||
|
|
f238bb723d | ||
|
|
b4da801bb0 | ||
|
|
ce7aa46af6 | ||
|
|
83c28692ad |
2
External/Pearl
vendored
2
External/Pearl
vendored
Submodule External/Pearl updated: 8b6e3481d7...790dc7a9a1
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password Algorithm Implementation</name>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password Android</name>
|
||||
@@ -105,13 +105,13 @@
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-algorithm</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-tests</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- EXTERNAL DEPENDENCIES -->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password CLI</name>
|
||||
@@ -85,7 +85,7 @@
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-algorithm</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password GUI</name>
|
||||
@@ -135,7 +135,7 @@
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-model</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- EXTERNAL DEPENDENCIES -->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password Site Model</name>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-algorithm</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- EXTERNAL DEPENDENCIES -->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>Master Password Test Suite</name>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword-algorithm</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TESTING -->
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<groupId>com.lyndir.masterpassword</groupId>
|
||||
<artifactId>masterpassword</artifactId>
|
||||
<version>2.4-java</version>
|
||||
<version>GIT-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
@@ -58,8 +58,4 @@
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<scm>
|
||||
<tag>2.4-java</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -179,7 +179,7 @@ NSOperationQueue *_mpwQueue = nil;
|
||||
return @"PIN";
|
||||
|
||||
case MPSiteTypeGeneratedName:
|
||||
return @"Login Name";
|
||||
return @"Name";
|
||||
|
||||
case MPSiteTypeGeneratedPhrase:
|
||||
return @"Phrase";
|
||||
@@ -281,7 +281,7 @@ NSOperationQueue *_mpwQueue = nil;
|
||||
|
||||
- (NSArray *)allTypes {
|
||||
|
||||
return [self allTypesStartingWith:MPSiteTypeGeneratedMaximum];
|
||||
return [self allTypesStartingWith:MPSiteTypeGeneratedPhrase];
|
||||
}
|
||||
|
||||
- (NSArray *)allTypesStartingWith:(MPSiteType)startingType {
|
||||
@@ -298,6 +298,10 @@ NSOperationQueue *_mpwQueue = nil;
|
||||
- (MPSiteType)nextType:(MPSiteType)type {
|
||||
|
||||
switch (type) {
|
||||
case MPSiteTypeGeneratedPhrase:
|
||||
return MPSiteTypeGeneratedName;
|
||||
case MPSiteTypeGeneratedName:
|
||||
return MPSiteTypeGeneratedMaximum;
|
||||
case MPSiteTypeGeneratedMaximum:
|
||||
return MPSiteTypeGeneratedLong;
|
||||
case MPSiteTypeGeneratedLong:
|
||||
@@ -313,7 +317,7 @@ NSOperationQueue *_mpwQueue = nil;
|
||||
case MPSiteTypeStoredPersonal:
|
||||
return MPSiteTypeStoredDevicePrivate;
|
||||
case MPSiteTypeStoredDevicePrivate:
|
||||
return MPSiteTypeGeneratedMaximum;
|
||||
return MPSiteTypeGeneratedPhrase;
|
||||
default:
|
||||
return MPSiteTypeGeneratedLong;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
- (void)resolveLoginUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
||||
- (void)resolvePasswordUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
||||
- (void)resolveSiteAnswerUsingKey:(MPKey *)key result:(void ( ^ )(NSString *))result;
|
||||
- (void)resolveAnswerUsingKey:(MPKey *)key forQuestion:(NSString *)question result:(void ( ^ )(NSString *))result;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -209,6 +209,14 @@
|
||||
[self.algorithm resolveAnswerForSite:self usingKey:key result:result];
|
||||
}
|
||||
|
||||
- (void)resolveAnswerUsingKey:(MPKey *)key forQuestion:(NSString *)question result:(void ( ^ )(NSString *))result {
|
||||
|
||||
MPSiteQuestionEntity *questionEntity = [MPSiteQuestionEntity new];
|
||||
questionEntity.site = self;
|
||||
questionEntity.keyword = question;
|
||||
[questionEntity resolveQuestionAnswerUsingKey:key result:result];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPGeneratedSiteEntity(MP)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
|
||||
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -102,8 +102,8 @@ from anywhere.</string>
|
||||
<constraint firstItem="C4d-ih-ARL" firstAttribute="top" secondItem="283" secondAttribute="bottom" constant="8" symbolic="YES" id="tqS-gV-jpd"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="508">
|
||||
<rect key="frame" x="766" y="8" width="214" height="25"/>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="508">
|
||||
<rect key="frame" x="858" y="8" width="122" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="122" id="509"/>
|
||||
</constraints>
|
||||
@@ -115,8 +115,8 @@ from anywhere.</string>
|
||||
<action selector="togglePreference:" target="-2" id="574"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="562">
|
||||
<rect key="frame" x="21" y="13" width="739" height="17"/>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="562">
|
||||
<rect key="frame" x="21" y="13" width="831" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="To begin: hold command, control and P (⌘⌃P) or access the ●●●| menu icon next to your clock." id="563">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *hidePasswordsItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *rememberPasswordItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *openAtLoginItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *showFullScreenItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *savePasswordItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *createUserItem;
|
||||
@property(nonatomic, weak) IBOutlet NSMenuItem *deleteUserItem;
|
||||
|
||||
@@ -335,11 +335,15 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
- (IBAction)togglePreference:(id)sender {
|
||||
|
||||
if (sender == self.hidePasswordsItem)
|
||||
[MPConfig get].hidePasswords = @(![[MPConfig get].hidePasswords boolValue]);
|
||||
[MPConfig get].hidePasswords = @(self.hidePasswordsItem.state != NSOnState);
|
||||
if (sender == self.rememberPasswordItem)
|
||||
[MPConfig get].rememberLogin = @(![[MPConfig get].rememberLogin boolValue]);
|
||||
[MPConfig get].rememberLogin = @(self.rememberPasswordItem.state != NSOnState);
|
||||
if (sender == self.openAtLoginItem)
|
||||
[self setLoginItemEnabled:self.openAtLoginItem.state != NSOnState];
|
||||
if (sender == self.showFullScreenItem) {
|
||||
[MPMacConfig get].fullScreen = @(self.showFullScreenItem.state != NSOnState);
|
||||
[NSApp updateWindows];
|
||||
}
|
||||
if (sender == self.savePasswordItem) {
|
||||
[MPMacAppDelegate managedObjectContextPerformBlockAndWait:^(NSManagedObjectContext *context) {
|
||||
MPUserEntity *activeUser = [[MPMacAppDelegate get] activeUserInContext:context];
|
||||
@@ -610,6 +614,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
|
||||
BOOL loginItemEnabled = [self loginItemEnabled];
|
||||
self.openAtLoginItem.state = loginItemEnabled? NSOnState: NSOffState;
|
||||
self.showFullScreenItem.state = [[MPMacConfig get].fullScreen boolValue]? NSOnState: NSOffState;
|
||||
self.initialWindowController.openAtLoginButton.state = loginItemEnabled? NSOnState: NSOffState;
|
||||
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
|
||||
|
||||
|
||||
9
MasterPassword/ObjC/Mac/MPMacApplication.h
Normal file
9
MasterPassword/ObjC/Mac/MPMacApplication.h
Normal file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Created by Maarten Billemont on 2016-04-30.
|
||||
// Copyright (c) 2016 Lyndir. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface MPMacApplication : NSApplication
|
||||
@end
|
||||
54
MasterPassword/ObjC/Mac/MPMacApplication.m
Normal file
54
MasterPassword/ObjC/Mac/MPMacApplication.m
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Created by Maarten Billemont on 2016-04-30.
|
||||
// Copyright (c) 2016 Lyndir. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPMacApplication.h"
|
||||
|
||||
@interface NSResponder (Editing)
|
||||
|
||||
- (void)undo:(id)sender;
|
||||
- (void)redo:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPMacApplication {
|
||||
}
|
||||
|
||||
- (void)sendEvent:(NSEvent *)event {
|
||||
|
||||
if ([event type] == NSKeyDown) {
|
||||
if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) == NSCommandKeyMask) {
|
||||
if ([[event charactersIgnoringModifiers] isEqualToString:@"x"]) {
|
||||
if ([self sendAction:@selector( cut: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
else if ([[event charactersIgnoringModifiers] isEqualToString:@"c"]) {
|
||||
if ([self sendAction:@selector( copy: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
else if ([[event charactersIgnoringModifiers] isEqualToString:@"v"]) {
|
||||
if ([self sendAction:@selector( paste: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
else if ([[event charactersIgnoringModifiers] isEqualToString:@"z"]) {
|
||||
if ([self sendAction:@selector( undo: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
else if ([[event charactersIgnoringModifiers] isEqualToString:@"a"]) {
|
||||
if ([self sendAction:@selector( selectAll: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) == (NSCommandKeyMask | NSShiftKeyMask)) {
|
||||
if ([[event charactersIgnoringModifiers] isEqualToString:@"Z"]) {
|
||||
if ([self sendAction:@selector( redo: ) to:nil from:self])
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[super sendEvent:event];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,5 +11,6 @@
|
||||
@interface MPMacConfig : MPConfig
|
||||
|
||||
@property(nonatomic, retain) NSString *usedUserName;
|
||||
@property(nonatomic, retain) NSNumber *fullScreen;
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
@implementation MPMacConfig
|
||||
|
||||
@dynamic usedUserName;
|
||||
@dynamic fullScreen;
|
||||
|
||||
- (id)init {
|
||||
|
||||
@@ -16,7 +17,8 @@
|
||||
return self;
|
||||
|
||||
[self.defaults registerDefaults:@{
|
||||
NSStringFromSelector( @selector(appleID) ) : @"510296984",
|
||||
NSStringFromSelector( @selector( appleID ) ) : @"510296984",
|
||||
NSStringFromSelector( @selector( fullScreen ) ) : @YES,
|
||||
}];
|
||||
|
||||
return self;
|
||||
|
||||
@@ -20,4 +20,5 @@
|
||||
|
||||
|
||||
@interface MPPasswordWindow : NSWindow
|
||||
|
||||
@end
|
||||
|
||||
@@ -18,21 +18,10 @@
|
||||
|
||||
#import "MPPasswordWindow.h"
|
||||
|
||||
|
||||
@implementation MPPasswordWindow
|
||||
|
||||
#pragma mark - Life
|
||||
|
||||
- (void)awakeFromNib {
|
||||
|
||||
[super awakeFromNib];
|
||||
|
||||
self.opaque = NO;
|
||||
self.backgroundColor = [NSColor clearColor];
|
||||
self.level = NSScreenSaverWindowLevel;
|
||||
self.alphaValue = 0;
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeKeyWindow {
|
||||
|
||||
return YES;
|
||||
@@ -40,6 +29,21 @@
|
||||
|
||||
#pragma mark - State
|
||||
|
||||
- (void)update {
|
||||
|
||||
if ([[MPMacConfig get].fullScreen boolValue]) {
|
||||
[self setLevel:NSScreenSaverWindowLevel];
|
||||
[self setFrame:self.screen.frame display:YES];
|
||||
}
|
||||
else if (self.level != NSNormalWindowLevel) {
|
||||
[self setLevel:NSNormalWindowLevel];
|
||||
[self setFrame:NSMakeRect( 0, 0, 640, 600) display:NO];
|
||||
[self center];
|
||||
}
|
||||
|
||||
[super update];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPSiteModel.h"
|
||||
#import "MPSitesTableView.h"
|
||||
#import "MPPasswordWindow.h"
|
||||
|
||||
@class MPMacAppDelegate;
|
||||
|
||||
@@ -33,7 +34,6 @@
|
||||
@property(nonatomic) BOOL newUser;
|
||||
|
||||
@property(nonatomic, weak) IBOutlet NSArrayController *sitesController;
|
||||
@property(nonatomic, weak) IBOutlet NSImageView *blurView;
|
||||
@property(nonatomic, weak) IBOutlet NSTextField *inputLabel;
|
||||
@property(nonatomic, weak) IBOutlet NSTextField *securePasswordField;
|
||||
@property(nonatomic, weak) IBOutlet NSTextField *revealPasswordField;
|
||||
@@ -45,6 +45,10 @@
|
||||
@property(nonatomic, strong) IBOutlet NSBox *passwordTypesBox;
|
||||
@property(nonatomic, weak) IBOutlet NSMatrix *passwordTypesMatrix;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet NSBox *securityQuestionsBox;
|
||||
@property(nonatomic, weak) IBOutlet NSTextField *securityQuestionField;
|
||||
@property(nonatomic, weak) IBOutlet NSTextField *securityAnswerField;
|
||||
|
||||
- (BOOL)handleCommand:(SEL)commandSelector;
|
||||
|
||||
@end
|
||||
|
||||
@@ -23,14 +23,6 @@
|
||||
#import "MPAppDelegate_Store.h"
|
||||
#import "MPAppDelegate_Key.h"
|
||||
|
||||
#define MPAlertIncorrectMP @"MPAlertIncorrectMP"
|
||||
#define MPAlertChangeMP @"MPAlertChangeMP"
|
||||
#define MPAlertCreateSite @"MPAlertCreateSite"
|
||||
#define MPAlertChangeType @"MPAlertChangeType"
|
||||
#define MPAlertChangeLogin @"MPAlertChangeLogin"
|
||||
#define MPAlertChangeContent @"MPAlertChangeContent"
|
||||
#define MPAlertDeleteSite @"MPAlertDeleteSite"
|
||||
|
||||
@interface MPPasswordWindowController()
|
||||
|
||||
@property(nonatomic, strong) CAGradientLayer *siteGradient;
|
||||
@@ -61,7 +53,7 @@
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidBecomeKeyNotification object:self.window
|
||||
queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
|
||||
prof_new( @"didBecomeKey" );
|
||||
[self fadeIn];
|
||||
[self.window makeKeyAndOrderFront:nil];
|
||||
prof_rewind( @"fadeIn" );
|
||||
[self updateUser];
|
||||
prof_finish( @"updateUser" );
|
||||
@@ -75,7 +67,7 @@
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillResignActiveNotification object:nil
|
||||
queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
|
||||
#ifndef DEBUG
|
||||
[self fadeOut];
|
||||
[self.window fadeOut];
|
||||
#endif
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPSignedInNotification object:nil
|
||||
@@ -193,8 +185,7 @@
|
||||
if (!success)
|
||||
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{
|
||||
NSLocalizedDescriptionKey : strf( @"Incorrect master password for user %@", userName )
|
||||
}]] beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertIncorrectMP];
|
||||
}]] beginSheetModalForWindow:self.window completionHandler:nil];
|
||||
} );
|
||||
}];
|
||||
}
|
||||
@@ -225,13 +216,96 @@
|
||||
[self replaceFonts:rowView];
|
||||
}
|
||||
|
||||
#pragma mark - NSAlert
|
||||
#pragma mark - State
|
||||
|
||||
- (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
|
||||
- (void)insertObject:(MPSiteModel *)model inSitesAtIndex:(NSUInteger)index {
|
||||
|
||||
if (contextInfo == MPAlertIncorrectMP)
|
||||
return;
|
||||
if (contextInfo == MPAlertChangeMP) {
|
||||
[self.sites insertObject:model atIndex:index];
|
||||
}
|
||||
|
||||
- (void)removeObjectFromSitesAtIndex:(NSUInteger)index {
|
||||
|
||||
[self.sites removeObjectAtIndex:index];
|
||||
}
|
||||
|
||||
- (MPSiteModel *)selectedSite {
|
||||
|
||||
return [self.sitesController.selectedObjects firstObject];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)settings:(id)sender {
|
||||
|
||||
[self.window close];
|
||||
[[MPMacAppDelegate get] showPopup:sender];
|
||||
}
|
||||
|
||||
- (IBAction)deleteSite:(id)sender {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Delete"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Delete Site?"];
|
||||
[alert setInformativeText:strf( @"Do you want to delete the site named:\n\n%@", self.selectedSite.name )];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Delete" button.
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
[context deleteObject:[self.selectedSite entityInContext:context]];
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)changeLogin:(id)sender {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Login Name"];
|
||||
[alert setInformativeText:strf( @"Enter the login name for: %@", self.selectedSite.name )];
|
||||
NSTextField *loginField = [[NSTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )];
|
||||
loginField.stringValue = self.selectedSite.loginName?: @"";
|
||||
[loginField selectText:self];
|
||||
[alert setAccessoryView:loginField];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Save" button.
|
||||
NSString *loginName = [(NSSecureTextField *)alert.accessoryView stringValue];
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
|
||||
entity.loginName = loginName;
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)resetMasterPassword:(id)sender {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Reset"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Reset My Master Password"];
|
||||
[alert setInformativeText:strf( @"This will allow you to change %@'s master password.\n\n"
|
||||
@"WARNING: All your site passwords will change. Do this only if you've forgotten your "
|
||||
@"master password and are fully prepared to change all your sites' passwords to the new ones.",
|
||||
[MPMacAppDelegate get].activeUserForMainThread.name )];
|
||||
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Reset" button.
|
||||
@@ -257,24 +331,66 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)changePassword:(id)sender {
|
||||
|
||||
if (!self.selectedSite.stored)
|
||||
return;
|
||||
}
|
||||
if (contextInfo == MPAlertCreateSite) {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Password"];
|
||||
[alert setInformativeText:strf( @"Enter the new password for: %@", self.selectedSite.name )];
|
||||
[alert setAccessoryView:[[NSSecureTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )]];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Create" button.
|
||||
[[MPMacAppDelegate get] addSiteNamed:[self.siteField stringValue] completion:
|
||||
^(MPSiteEntity *site, NSManagedObjectContext *context) {
|
||||
if (site)
|
||||
PearlMainQueue( ^{ [self updateSites]; } );
|
||||
}];
|
||||
// "Save" button.
|
||||
NSString *password = [(NSSecureTextField *)alert.accessoryView stringValue];
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
|
||||
[entity.algorithm savePassword:password toSite:entity usingKey:[MPMacAppDelegate get].key];
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)changeType:(id)sender {
|
||||
|
||||
MPSiteModel *site = self.selectedSite;
|
||||
NSArray *types = [site.algorithm allTypes];
|
||||
[self.passwordTypesMatrix renewRows:(NSInteger)[types count] columns:1];
|
||||
for (NSUInteger t = 0; t < [types count]; ++t) {
|
||||
MPSiteType type = (MPSiteType)[types[t] unsignedIntegerValue];
|
||||
NSString *title = [site.algorithm nameOfType:type];
|
||||
if (type & MPSiteTypeClassGenerated)
|
||||
title = strf( @"%@ – %@", [site.algorithm generatePasswordForSiteNamed:site.name ofType:type withCounter:site.counter
|
||||
usingKey:[MPMacAppDelegate get].key], title );
|
||||
|
||||
NSButtonCell *cell = [self.passwordTypesMatrix cellAtRow:(NSInteger)t column:0];
|
||||
cell.tag = type;
|
||||
cell.state = type == site.type? NSOnState: NSOffState;
|
||||
cell.title = title;
|
||||
}
|
||||
if (contextInfo == MPAlertChangeType) {
|
||||
|
||||
self.passwordTypesBox.title = strf( @"Choose a password type for %@:", site.name );
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Password Type"];
|
||||
[alert setAccessoryView:self.passwordTypesBox];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Save" button.
|
||||
@@ -292,166 +408,32 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (contextInfo == MPAlertChangeLogin) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Save" button.
|
||||
NSString *loginName = [(NSSecureTextField *)alert.accessoryView stringValue];
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
|
||||
entity.loginName = loginName;
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (contextInfo == MPAlertChangeContent) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Save" button.
|
||||
NSString *password = [(NSSecureTextField *)alert.accessoryView stringValue];
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
|
||||
[entity.algorithm savePassword:password toSite:entity usingKey:[MPMacAppDelegate get].key];
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (contextInfo == MPAlertDeleteSite) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Delete" button.
|
||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||
[context deleteObject:[self.selectedSite entityInContext:context]];
|
||||
[context saveToStore];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - State
|
||||
|
||||
- (void)insertObject:(MPSiteModel *)model inSitesAtIndex:(NSUInteger)index {
|
||||
|
||||
[self.sites insertObject:model atIndex:index];
|
||||
}
|
||||
|
||||
- (void)removeObjectFromSitesAtIndex:(NSUInteger)index {
|
||||
|
||||
[self.sites removeObjectAtIndex:index];
|
||||
}
|
||||
|
||||
- (MPSiteModel *)selectedSite {
|
||||
|
||||
return [self.sitesController.selectedObjects firstObject];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)settings:(id)sender {
|
||||
|
||||
[self fadeOut:NO];
|
||||
[[MPMacAppDelegate get] showPopup:sender];
|
||||
}
|
||||
|
||||
- (IBAction)deleteSite:(id)sender {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Delete"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Delete Site?"];
|
||||
[alert setInformativeText:strf( @"Do you want to delete the site named:\n\n%@", self.selectedSite.name )];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertDeleteSite];
|
||||
}
|
||||
|
||||
- (IBAction)changeLogin:(id)sender {
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Login Name"];
|
||||
[alert setInformativeText:strf( @"Enter the login name for: %@", self.selectedSite.name )];
|
||||
NSTextField *loginField = [[NSTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )];
|
||||
loginField.stringValue = self.selectedSite.loginName?: @"";
|
||||
[loginField selectText:self];
|
||||
[alert setAccessoryView:loginField];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertChangeLogin];
|
||||
}
|
||||
|
||||
- (IBAction)resetMasterPassword:(id)sender {
|
||||
|
||||
MPUserEntity *activeUser = [MPMacAppDelegate get].activeUserForMainThread;
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Reset"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Reset My Master Password"];
|
||||
[alert setInformativeText:strf( @"This will allow you to change %@'s master password.\n\n"
|
||||
@"WARNING: All your site passwords will change. Do this only if you've forgotten your "
|
||||
@"master password and are fully prepared to change all your sites' passwords to the new ones.", activeUser.name )];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertChangeMP];
|
||||
}
|
||||
|
||||
- (IBAction)changePassword:(id)sender {
|
||||
|
||||
if (!self.selectedSite.stored)
|
||||
return;
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Password"];
|
||||
[alert setInformativeText:strf( @"Enter the new password for: %@", self.selectedSite.name )];
|
||||
[alert setAccessoryView:[[NSSecureTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )]];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertChangeContent];
|
||||
}
|
||||
|
||||
- (IBAction)changeType:(id)sender {
|
||||
- (IBAction)securityQuestions:(id)sender {
|
||||
|
||||
MPSiteModel *site = self.selectedSite;
|
||||
NSArray *types = [site.algorithm allTypesStartingWith:MPSiteTypeGeneratedPIN];
|
||||
[self.passwordTypesMatrix renewRows:(NSInteger)[types count] columns:1];
|
||||
for (NSUInteger t = 0; t < [types count]; ++t) {
|
||||
MPSiteType type = (MPSiteType)[types[t] unsignedIntegerValue];
|
||||
NSString *title = [site.algorithm nameOfType:type];
|
||||
if (type & MPSiteTypeClassGenerated)
|
||||
title = [site.algorithm generatePasswordForSiteNamed:site.name ofType:type
|
||||
withCounter:site.counter
|
||||
usingKey:[MPMacAppDelegate get].key];
|
||||
|
||||
NSButtonCell *cell = [self.passwordTypesMatrix cellAtRow:(NSInteger)t column:0];
|
||||
cell.tag = type;
|
||||
cell.state = type == site.type? NSOnState: NSOffState;
|
||||
cell.title = title;
|
||||
}
|
||||
self.securityQuestionsBox.title = strf( @"Answer to security questions for %@:", site.name );
|
||||
|
||||
NSAlert *alert = [NSAlert new];
|
||||
[alert addButtonWithTitle:@"Save"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Change Password Type"];
|
||||
[alert setInformativeText:strf( @"Choose a new password type for: %@", site.name )];
|
||||
[alert setAccessoryView:self.passwordTypesBox];
|
||||
[alert addButtonWithTitle:@"Copy Answer"];
|
||||
[alert addButtonWithTitle:@"Close"];
|
||||
[alert setMessageText:@"Security Questions"];
|
||||
[alert setAccessoryView:self.securityQuestionsBox];
|
||||
[alert layout];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertChangeType];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Copy Answer" button.
|
||||
[self copyContent:self.securityAnswerField.stringValue];
|
||||
[self.window close];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
@@ -471,7 +453,7 @@
|
||||
return YES;
|
||||
}
|
||||
if (commandSelector == @selector( cancel: ) || commandSelector == @selector( cancelOperation: )) {
|
||||
[self fadeOut];
|
||||
[self.window close];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -491,8 +473,7 @@
|
||||
|
||||
// Performing action while content is available. Copy it.
|
||||
[self copyContent:self.shiftPressed? selectedSite.answer: selectedSite.content];
|
||||
|
||||
[self fadeOut];
|
||||
[self.window close];
|
||||
|
||||
NSUserNotification *notification = [NSUserNotification new];
|
||||
notification.title = @"Password Copied";
|
||||
@@ -602,6 +583,7 @@
|
||||
CGFloat gradientOpacity = selectedOffset / siteScrollView.bounds.size.height;
|
||||
self.siteGradient.colors = @[
|
||||
(__bridge id)[NSColor whiteColor].CGColor,
|
||||
(__bridge id)[NSColor colorWithDeviceWhite:1 alpha:1 - (1 - gradientOpacity) * 4 / 5].CGColor,
|
||||
(__bridge id)[NSColor colorWithDeviceWhite:1 alpha:gradientOpacity].CGColor
|
||||
];
|
||||
|
||||
@@ -617,8 +599,21 @@
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
[alert setMessageText:@"Create site?"];
|
||||
[alert setInformativeText:strf( @"Do you want to create a new site named:\n\n%@", siteName )];
|
||||
[alert beginSheetModalForWindow:self.window modalDelegate:self
|
||||
didEndSelector:@selector( alertDidEnd:returnCode:contextInfo: ) contextInfo:MPAlertCreateSite];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
switch (returnCode) {
|
||||
case NSAlertFirstButtonReturn: {
|
||||
// "Create" button.
|
||||
[[MPMacAppDelegate get] addSiteNamed:[self.siteField stringValue] completion:
|
||||
^(MPSiteEntity *site, NSManagedObjectContext *context) {
|
||||
if (site)
|
||||
PearlMainQueue( ^{ [self updateSites]; } );
|
||||
}];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}];
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -636,70 +631,4 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)fadeIn {
|
||||
|
||||
prof_new( @"fadeIn" );
|
||||
if ([self.window isOnActiveSpace] && self.window.alphaValue > FLT_EPSILON) {
|
||||
prof_finish( @"showing" );
|
||||
return;
|
||||
}
|
||||
|
||||
CGDirectDisplayID displayID = [self.window.screen.deviceDescription[@"NSScreenNumber"] unsignedIntValue];
|
||||
CGImageRef capturedImage = CGDisplayCreateImage( displayID );
|
||||
if (!capturedImage || CGImageGetWidth( capturedImage ) <= 1) {
|
||||
if (capturedImage)
|
||||
CFRelease( capturedImage );
|
||||
wrn( @"Failed to capture screen image for display: %d", displayID );
|
||||
prof_finish( @"capture failed" );
|
||||
return;
|
||||
}
|
||||
prof_rewind( @"capture" );
|
||||
|
||||
NSImage *screenImage = [[NSImage alloc] initWithCGImage:capturedImage size:NSMakeSize(
|
||||
CGImageGetWidth( capturedImage ) / self.window.backingScaleFactor,
|
||||
CGImageGetHeight( capturedImage ) / self.window.backingScaleFactor )];
|
||||
prof_rewind( @"screenImage" );
|
||||
|
||||
NSImage *smallImage = [[NSImage alloc] initWithSize:NSMakeSize(
|
||||
CGImageGetWidth( capturedImage ) / 20,
|
||||
CGImageGetHeight( capturedImage ) / 20 )];
|
||||
prof_rewind( @"smallImage" );
|
||||
CFRelease( capturedImage );
|
||||
[smallImage lockFocus];
|
||||
[screenImage drawInRect:(NSRect){ .origin = CGPointZero, .size = smallImage.size, }
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositeSourceOver
|
||||
fraction:1.0];
|
||||
[smallImage unlockFocus];
|
||||
prof_rewind( @"scale" );
|
||||
|
||||
self.blurView.image = smallImage;
|
||||
prof_rewind( @"blurView" );
|
||||
|
||||
[self.window setFrame:self.window.screen.frame display:YES];
|
||||
[NSAnimationContext currentContext].timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
|
||||
self.window.animator.alphaValue = 1.0;
|
||||
prof_finish( @"window setup" );
|
||||
}
|
||||
|
||||
- (void)fadeOut {
|
||||
|
||||
[self fadeOut:YES];
|
||||
}
|
||||
|
||||
- (void)fadeOut:(BOOL)hide {
|
||||
|
||||
if (![NSApp isActive] && self.window.alphaValue <= FLT_EPSILON)
|
||||
return;
|
||||
|
||||
[[NSAnimationContext currentContext] setCompletionHandler:^{
|
||||
[self close];
|
||||
|
||||
if (hide)
|
||||
[NSApp hide:self];
|
||||
}];
|
||||
[NSAnimationContext currentContext].timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
|
||||
[self.window animator].alphaValue = 0.0;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -168,6 +168,15 @@
|
||||
[self updateContent];
|
||||
}
|
||||
|
||||
- (void)setQuestion:(NSString *)question {
|
||||
|
||||
if ([question isEqualToString:_question])
|
||||
return;
|
||||
_question = question;
|
||||
|
||||
[self updateContent];
|
||||
}
|
||||
|
||||
- (BOOL)outdated {
|
||||
|
||||
return self.algorithmVersion < MPAlgorithmVersionCurrent;
|
||||
@@ -217,9 +226,8 @@
|
||||
[entity resolveLoginUsingKey:[MPAppDelegate_Shared get].key result:^(NSString *result) {
|
||||
[self updateLoginNameWithResult:result];
|
||||
}];
|
||||
[entity resolveSiteAnswerUsingKey:[MPAppDelegate_Shared get].key result:^(NSString *result) {
|
||||
[self updateAnswerWithResult:result];
|
||||
}];
|
||||
[self updateAnswerWithResult:[self.algorithm generateAnswerForSiteNamed:self.name onQuestion:self.question
|
||||
usingKey:[MPAppDelegate_Shared get].key]];
|
||||
}
|
||||
|
||||
- (void)updatePasswordWithResult:(NSString *)result {
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<string>MPMacApplication</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
93D390C676DF52DA7E459F19 /* MPPasswordWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39D9D0061FF1159998F06 /* MPPasswordWindow.m */; };
|
||||
93D391E61DC23E128DA4446C /* NSView+Traversing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D393EE88DE554BCCBC1C2D /* NSView+Traversing.h */; };
|
||||
93D392EC39DA43C46C692C12 /* NSDictionary+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */; };
|
||||
93D393A1646430FAAC73E7FE /* MPMacApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39F83DD151985F2C7345A /* MPMacApplication.m */; };
|
||||
93D394C4254EEB45FB335AFB /* MPSitesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39423D7BF4FD31FE6D27C /* MPSitesTableView.m */; };
|
||||
93D395E4830290EBB6E71F34 /* MPNoStateButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39538C4CEFF46DF379254 /* MPNoStateButton.m */; };
|
||||
93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */; };
|
||||
@@ -273,6 +274,7 @@
|
||||
93D39368EF3CBFEF2AFCA15A /* MPInitialWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPInitialWindowController.h; sourceTree = "<group>"; };
|
||||
93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Indexing.h"; sourceTree = "<group>"; };
|
||||
93D393EE88DE554BCCBC1C2D /* NSView+Traversing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSView+Traversing.h"; sourceTree = "<group>"; };
|
||||
93D3942099C9AD0374B5777D /* MPMacApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMacApplication.h; sourceTree = "<group>"; };
|
||||
93D39423D7BF4FD31FE6D27C /* MPSitesTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSitesTableView.m; sourceTree = "<group>"; };
|
||||
93D39538C4CEFF46DF379254 /* MPNoStateButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNoStateButton.m; sourceTree = "<group>"; };
|
||||
93D396D04E57792A54D437AC /* NSArray+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Indexing.h"; sourceTree = "<group>"; };
|
||||
@@ -283,6 +285,7 @@
|
||||
93D39D3CB30874147D9A9E1B /* MPInitialWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPInitialWindowController.m; sourceTree = "<group>"; };
|
||||
93D39D9D0061FF1159998F06 /* MPPasswordWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordWindow.m; sourceTree = "<group>"; };
|
||||
93D39E73BF5CBF8E5B005CD3 /* MPSiteModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSiteModel.m; sourceTree = "<group>"; };
|
||||
93D39F83DD151985F2C7345A /* MPMacApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPMacApplication.m; sourceTree = "<group>"; };
|
||||
DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MPInitialWindow.xib; sourceTree = "<group>"; };
|
||||
DA0933CB1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "shot-laptop-leaning-iphone.png"; sourceTree = "<group>"; };
|
||||
DA0933CF1747B91B00DE1CEF /* appstore.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = appstore.png; sourceTree = "<group>"; };
|
||||
@@ -1140,6 +1143,8 @@
|
||||
93D39E73BF5CBF8E5B005CD3 /* MPSiteModel.m */,
|
||||
93D39AC6360DDC16AEAA4119 /* MPSitesTableView.h */,
|
||||
93D39423D7BF4FD31FE6D27C /* MPSitesTableView.m */,
|
||||
93D39F83DD151985F2C7345A /* MPMacApplication.m */,
|
||||
93D3942099C9AD0374B5777D /* MPMacApplication.h */,
|
||||
);
|
||||
path = Mac;
|
||||
sourceTree = "<group>";
|
||||
@@ -2263,6 +2268,7 @@
|
||||
93D395E4830290EBB6E71F34 /* MPNoStateButton.m in Sources */,
|
||||
DA4DAE941A7D8117003E5423 /* MPAlgorithmV3.m in Sources */,
|
||||
DA4DAE951A7D8117003E5423 /* MPTypes.m in Sources */,
|
||||
93D393A1646430FAAC73E7FE /* MPMacApplication.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -2456,7 +2462,7 @@
|
||||
"$(inherit)",
|
||||
"\"$(SRCROOT)/../../../External\"/**",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
@@ -2546,7 +2552,7 @@
|
||||
"$(inherit)",
|
||||
"\"$(SRCROOT)/../../../External\"/**",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "${TARGET_NAME}";
|
||||
@@ -2569,14 +2575,15 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac,
|
||||
"\"$(SRCROOT)/../../../External/Mac\"",
|
||||
);
|
||||
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
INFOPLIST_FILE = "MasterPassword-Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac;
|
||||
PROVISIONING_PROFILE = "";
|
||||
@@ -2597,14 +2604,15 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac,
|
||||
"\"$(SRCROOT)/../../../External/Mac\"",
|
||||
);
|
||||
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
INFOPLIST_FILE = "MasterPassword-Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac;
|
||||
PROVISIONING_PROFILE = "";
|
||||
@@ -2728,7 +2736,7 @@
|
||||
"$(inherit)",
|
||||
"\"$(SRCROOT)/../../../External\"/**",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "${TARGET_NAME}";
|
||||
@@ -2751,14 +2759,15 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac,
|
||||
"\"$(SRCROOT)/../../../External/Mac\"",
|
||||
);
|
||||
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
INFOPLIST_FILE = "MasterPassword-Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac;
|
||||
PROVISIONING_PROFILE = "";
|
||||
@@ -2776,9 +2785,7 @@
|
||||
GCC_PREFIX_HEADER = "../Pearl/Pearl-Prefix.pch";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto\"",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -2858,9 +2865,7 @@
|
||||
GCC_PREFIX_HEADER = "../Pearl/Pearl-Prefix.pch";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto\"",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -2877,9 +2882,7 @@
|
||||
GCC_PREFIX_HEADER = "../Pearl/Pearl-Prefix.pch";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto\"",
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment version="1070" defaultVersion="1080" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@@ -11,7 +11,7 @@
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29"/>
|
||||
<customObject id="494" customClass="MPMacAppDelegate">
|
||||
<connections>
|
||||
@@ -22,6 +22,7 @@
|
||||
<outlet property="openAtLoginItem" destination="785" id="788"/>
|
||||
<outlet property="rememberPasswordItem" destination="744" id="750"/>
|
||||
<outlet property="savePasswordItem" destination="747" id="751"/>
|
||||
<outlet property="showFullScreenItem" destination="Rvo-MK-GgF" id="NYi-85-Yuc"/>
|
||||
<outlet property="showItem" destination="719" id="783"/>
|
||||
<outlet property="statusMenu" destination="716" id="731"/>
|
||||
<outlet property="usersItem" destination="755" id="762"/>
|
||||
@@ -71,6 +72,23 @@
|
||||
</attributedString>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Show Full Screen" id="Rvo-MK-GgF">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="togglePreference:" target="494" id="wfI-yQ-Kla"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Claim the entire screen while looking up passwords." enabled="NO" id="3k1-4V-IZ7">
|
||||
<attributedString key="attributedTitle">
|
||||
<fragment content="Always open Master Password at start-up.">
|
||||
<attributes>
|
||||
<font key="NSFont" size="12" name="Helvetica"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Passwords" id="9G7-17-PzY">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
|
||||
@@ -4225,7 +4225,6 @@
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
@@ -4325,7 +4324,6 @@
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
@@ -4341,7 +4339,6 @@
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../../External/Pearl/Pearl-Crypto/lib\"",
|
||||
"$(inherited)",
|
||||
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
||||
BIN
Site/2013-05/masterpassword-android-2.4-java.apk
Normal file
BIN
Site/2013-05/masterpassword-android-2.4-java.apk
Normal file
Binary file not shown.
@@ -1 +1 @@
|
||||
masterpassword-android-2.3.apk
|
||||
masterpassword-android-2.4-java.apk
|
||||
@@ -2,5 +2,5 @@
|
||||
set -e
|
||||
|
||||
cd "${BASH_SOURCE[0]%/*}"
|
||||
s3cmd sync --exclude '.git/**' --human-readable-sizes --no-preserve --acl-public --reduced-redundancy "${@:-.}" s3://masterpasswordapp.com/
|
||||
rsync -avPL --no-group "${@:-.}" satura.lyndir.com:/usr/local/www/masterpasswordapp.com/htdocs-secure/
|
||||
s3cmd sync --skip-existing --continue-put --stats --follow-symlinks --exclude '.git/**' --human-readable-sizes --no-preserve --acl-public --reduced-redundancy "${@:-.}" s3://masterpasswordapp.com/
|
||||
rsync -rvPLc --no-group "${@:-.}" satura.lyndir.com:/usr/local/www/masterpasswordapp.com/htdocs-secure/
|
||||
|
||||
@@ -8,9 +8,14 @@ if ((!window.crypto || !window.crypto.subtle) && window.SubtleCrypto)
|
||||
// https://code.google.com/p/crypto-js/
|
||||
if (!window.crypto || !window.crypto.subtle) {
|
||||
document.write("<script src=https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha256.js><\/script>");
|
||||
document.write("<script src=https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/pbkdf2.js><\/script>");
|
||||
document.write("<script src=https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/lib-typedarrays-min.js><\/script>");
|
||||
}
|
||||
|
||||
if (!Number.MAX_SAFE_INTEGER) {
|
||||
Number.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
|
||||
}
|
||||
|
||||
// If Typed Arrays are not supported we include the polyfill
|
||||
// https://github.com/inexorabletash/polyfill
|
||||
window.ArrayBuffer || document.write("<script src=js/typedarray-polyfill.js><\/script>");
|
||||
@@ -40,7 +45,7 @@ try {
|
||||
ES6 || document.write("<script src=js/mpw-js/traceur-runtime.js><\/script>");
|
||||
|
||||
// Include the scrypt implementation
|
||||
var SCRYPTASM_PATH = (window.location + '').replace(/[^/]*(#[^#]*)?$/, 'js/mpw-js/scrypt-asm.js');
|
||||
document.write("<script src=lib/" + esdir + "pbkdf2.js><\/script>");
|
||||
document.write("<script src=js/mpw-js/" + esdir + "scrypt.js?1><\/script>");
|
||||
|
||||
// Include the MPW class
|
||||
|
||||
Submodule Site/mpw-js/js/mpw-js updated: 9566261e5d...5972a1c80f
@@ -195,9 +195,9 @@ window.setImmediate || !function (global) {
|
||||
};
|
||||
}
|
||||
|
||||
// The worst fallback is setImmediate, although the delay is set to 0
|
||||
// in reality this should have a ~20ms delay, this is an important part
|
||||
// of the spec
|
||||
// The worst fallback is setTimeout, although the delay is set to 0,
|
||||
// in reality this should have a ~20ms delay as this is an important
|
||||
// part of the spec
|
||||
attachTo.setImmediate = (func, ...params) => global.setTimeout(func, 0, ...params);
|
||||
attachTo.clearImmediate = global.clearTimeout;
|
||||
|
||||
@@ -208,4 +208,4 @@ window.setImmediate || !function (global) {
|
||||
// the arguments
|
||||
arg || (attachTo.setImmediate = (func, ...params) => global.setTimeout(() => func(...params), 0));
|
||||
}, 0, true);
|
||||
}(this);
|
||||
}(this || window);
|
||||
|
||||
Reference in New Issue
Block a user