Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Update theos version, work with Xcode SDK over theos headers, resolve…
Browse files Browse the repository at this point in the history
… deprecations
  • Loading branch information
davidjb committed Feb 1, 2016
1 parent ff790f5 commit 35b47ce
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export THEOS=$(pwd)/modules/theos
export PATH=$(pwd)/modules/ldid/out:$PATH

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "modules/theos"]
path = modules/theos
url = https://github.com/rpetrich/theos.git
[submodule "modules/ldid"]
path = modules/ldid
url = https://github.com/davidjb/ldid.git
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARCHS=armv7 armv7s
ARCHS=armv7 armv7s arm64
TARGET=iphone:latest
CFLAGS=-fobjc-arc -I modules/Valet -I modules/Valet/Valet -I modules/Valet/Other

include $(THEOS)/makefiles/common.mk

APPLICATION_NAME = pass
pass_FILES = main.m passwordstoreApplication.mm PasswordsViewController.mm PassEntry.mm PassDataController.mm PassEntryViewController.mm modules/Valet/Valet/VALValet.m modules/Valet/Valet/VALSecureEnclaveValet.m
pass_FRAMEWORKS = UIKit CoreGraphics Security
pass_CFLAGS=-fobjc-arc -I modules/Valet -I modules/Valet/Valet -I modules/Valet/Other

TARGET_CODESIGN_FLAGS = -Sent.xml

include modules/theos/makefiles/common.mk
include $(THEOS_MAKE_PATH)/application.mk

build-install: clean package install
Expand Down
73 changes: 73 additions & 0 deletions NSTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* NSTask.h
Copyright (c) 1996-2007, Apple Inc. All rights reserved.
*/

#import <Foundation/NSObject.h>

@class NSString, NSArray, NSDictionary;

@interface NSTask : NSObject

// Create an NSTask which can be run at a later time
// An NSTask can only be run once. Subsequent attempts to
// run an NSTask will raise.
// Upon task death a notification will be sent
// { Name = NSTaskDidTerminateNotification; object = task; }
//

- (instancetype)init;

// set parameters
// these methods can only be done before a launch
- (void)setLaunchPath:(NSString *)path;
- (void)setArguments:(NSArray *)arguments;
- (void)setEnvironment:(NSDictionary *)dict;
// if not set, use current
- (void)setCurrentDirectoryPath:(NSString *)path;
// if not set, use current

// set standard I/O channels; may be either an NSFileHandle or an NSPipe
- (void)setStandardInput:(id)input;
- (void)setStandardOutput:(id)output;
- (void)setStandardError:(id)error;

// get parameters
- (NSString *)launchPath;
- (NSArray *)arguments;
- (NSDictionary *)environment;
- (NSString *)currentDirectoryPath;

// get standard I/O channels; could be either an NSFileHandle or an NSPipe
- (id)standardInput;
- (id)standardOutput;
- (id)standardError;

// actions
- (void)launch;

- (void)interrupt; // Not always possible. Sends SIGINT.
- (void)terminate; // Not always possible. Sends SIGTERM.

- (BOOL)suspend;
- (BOOL)resume;

// status
- (int)processIdentifier;
- (BOOL)isRunning;

- (int)terminationStatus;

@end

@interface NSTask (NSTaskConveniences)

+ (NSTask *)launchedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments;
// convenience; create and launch

- (void)waitUntilExit;
// poll the runLoop in defaultMode until task completes

@end

FOUNDATION_EXPORT NSString * const NSTaskDidTerminateNotification;

2 changes: 1 addition & 1 deletion PassEntry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Please see COPYING for more information
*/
#import "PassEntry.h"
#import <Foundation/NSTask.h>
#import "NSTask.h"

@implementation PassEntry

Expand Down
2 changes: 1 addition & 1 deletion PassEntryViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)viewDidLoad {
// self.title = NSLocalizedString(@"Passwords", @"Password title");
self.backgroundTaskIdentifier = 0;

self.keychain = [[VALSecureEnclaveValet alloc] initWithIdentifier:@"Pass"];
self.keychain = [[VALSecureEnclaveValet alloc] initWithIdentifier:@"Pass" accessControl:VALAccessControlUserPresence];
self.useTouchID = [[self.keychain class] supportsSecureEnclaveKeychainItems];
self.pasteboard = [UIPasteboard generalPasteboard];

Expand Down
2 changes: 1 addition & 1 deletion PasswordsViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)viewDidLoad {

- (void)clearPassphrase {
// TODO Refactor into shared function
VALSecureEnclaveValet *keychain = [[VALSecureEnclaveValet alloc] initWithIdentifier:@"Pass"];
VALSecureEnclaveValet *keychain = [[VALSecureEnclaveValet alloc] initWithIdentifier:@"Pass" accessControl:VALAccessControlUserPresence];
[keychain removeObjectForKey:@"gpg-passphrase-touchid"];

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Keychain cleared" message:@"Passphrase has been removed from the keychain" preferredStyle:UIAlertControllerStyleAlert];
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ Building
```
git clone --recursive https://github.com/davidjb/pass-ios.git
cd pass-ios
# ldid compilation only required first time
cd modules/ldid
./make.sh
cd ../..
source .env
make
make package
Expand Down
1 change: 1 addition & 0 deletions modules/ldid
Submodule ldid added at b6a526

0 comments on commit 35b47ce

Please sign in to comment.