Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AppBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@
LD_DYLIB_INSTALL_NAME = "";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 3.0.1;
MARKETING_VERSION = 3.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.developerinsider.AppBox;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)";
Expand Down Expand Up @@ -1299,7 +1299,7 @@
LD_DYLIB_INSTALL_NAME = "";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 3.0.1;
MARKETING_VERSION = 3.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.developerinsider.AppBox;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)";
Expand Down
2 changes: 2 additions & 0 deletions AppBox/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
@property (nonatomic) BOOL isInternetConnected;
@property (nonatomic, weak) IBOutlet NSMenuItem *dropboxLogoutButton;
@property (nonatomic, weak) IBOutlet NSMenuItem *dropboxSpaceButton;
@property (nonatomic, weak) IBOutlet NSMenuItem *dropboxAccountButton;
@property (nonatomic, weak) IBOutlet NSMenuItem *dropboxNameButton;

@end

10 changes: 5 additions & 5 deletions AppBox/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ -(void)openFileWithPath:(NSString *)filePath{
}
}

#pragma mark - Default Application
//MARK: - Default Application
-(BOOL)setAppBoxAsDefualt{
OSStatus returnStatus = LSSetDefaultRoleHandlerForContentType(CFSTR("com.apple.iTunes.ipa"), kLSRolesAll, (__bridge CFStringRef) [[NSBundle mainBundle] bundleIdentifier]);
if (returnStatus != 0) {
Expand All @@ -99,7 +99,7 @@ -(BOOL)setAppBoxAsDefualt{
return YES;
}

#pragma mark - AppDelegate Helper
//MARK: - AppDelegate Helper

+(AppDelegate *)appDelegate{
return ((AppDelegate *)[[NSApplication sharedApplication] delegate]);
Expand Down Expand Up @@ -154,12 +154,12 @@ -(void)handleIPAAtPath:(NSString *)ipaPath {
}
}

#pragma mark - Notification Center Delegate
//MARK: - Notification Center Delegate
-(void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification {
[center removeDeliveredNotification:notification];
}

#pragma mark - Core Data stack
//MARK: - Core Data stack

@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
@synthesize managedObjectModel = _managedObjectModel;
Expand Down Expand Up @@ -251,7 +251,7 @@ - (NSManagedObjectContext *)managedObjectContext {
return _managedObjectContext;
}

#pragma mark - Core Data Saving and Undo support
//MARK: - Core Data Saving and Undo support

- (void)saveCoreDataChanges{
// Performs the save action for the application, which is to send the save: message to the application's managed object context. Any encountered errors are presented to the user.
Expand Down
4 changes: 2 additions & 2 deletions AppBox/Common/CIProjectBuilder/CIProjectBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ @implementation CIProjectBuilder{

}

#pragma mark - IPA
//MARK: - IPA
+ (XCProject *)xcProjectWithIPAPath:(NSString *)ipaPath {
XCProject *project = [[XCProject alloc] initEmpty];
project.ipaFullPath = [NSURL fileURLWithPath:ipaPath];
Expand All @@ -44,7 +44,7 @@ + (XCProject *)xcProjectWithIPAPath:(NSString *)ipaPath {
}


#pragma mark - Common Arguments
//MARK: - Common Arguments
+(void)setCommonArgumentsToProject:(XCProject *)project {
NSArray *arguments = [[NSProcessInfo processInfo] arguments];
[ABLog log:@"All Command Line Arguments = %@",arguments];
Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/Common.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ +(NSError *)errorWithDesc:(NSString *)error andCode:(NSInteger)code{
return [NSError errorWithDomain:NSCocoaErrorDomain code:code userInfo:errorInfo];
}

#pragma mark - Notifications
//MARK: - Notifications
+ (NSModalResponse)showAlertWithTitle:(NSString *)title andMessage:(NSString *)message{
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"ALERT -\nTitle - %@ Message - %@", title, message]];
NSAlert *alert = [[NSAlert alloc] init];
Expand Down
6 changes: 3 additions & 3 deletions AppBox/Common/KeychainHandler/KeychainHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@implementation KeychainHandler

#pragma mark - ITC Accounts
//MARK: - ITC Accounts
+ (NSArray *)getAllITCAccounts {
NSMutableArray *filteredITCAccounts = [[NSMutableArray alloc] init];
// NSArray *itcAccounts = [SAMKeychain accountsForService:abiTunesConnectService];
Expand All @@ -24,7 +24,7 @@ + (NSArray *)getAllITCAccounts {
return filteredITCAccounts;
}

#pragma mark - Keychain
//MARK: - Keychain

+(NSString *)errorMessageForStatus:(OSStatus)status {
CFStringRef errorMessage = SecCopyErrorMessageString(status, NULL);
Expand All @@ -33,7 +33,7 @@ +(NSString *)errorMessageForStatus:(OSStatus)status {
}


#pragma mark - Remove All Cache, Cookies and Credentials
//MARK: - Remove All Cache, Cookies and Credentials
+ (void)removeAllStoredCredentials{
// Delete any cached URLrequests!
NSURLCache *sharedCache = [NSURLCache sharedURLCache];
Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/LogManager/ABLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@implementation ABLog

+(void)log:(NSString *)format, ...{
if (![UserData debugLog]) {
if ([UserData debugLog]) {
va_list args;
va_start(args, format);
NSLogv(format, args);
Expand Down
4 changes: 2 additions & 2 deletions AppBox/Common/MailHandler/MailHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@implementation MailHandler

#pragma mark - Check Valid Email
//MARK: - Check Valid Email
+ (BOOL)isValidEmail:(NSString *)checkString{
NSString *stricterFilterString = @"^[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}$";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", stricterFilterString];
Expand All @@ -27,7 +27,7 @@ + (void)showInvalidEmailAddressAlert{
[Common showAlertWithTitle:@"Invalid email address" andMessage:@"The email address entered was invalid. Please reenter it (Example: username@example.com).\n\nFor multiple email please enter like (username@example.com,username2@example.com,username@example2.com)."];
}

#pragma mark - Parse customised message with project details
//MARK: - Parse customised message with project details
+ (NSString *)parseMessage:(NSString *)message forProject:(XCProject *)project {
NSString *messageCopy = message.copy;
messageCopy = [messageCopy stringByReplacingOccurrencesOfString:@"{BUILD_NAME}" withString:project.name];
Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/UpdateHandler/UpdateHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@implementation UpdateHandler

#pragma mark - Check for update
//MARK: - Check for update

+ (void)showUpdateAlertWithUpdateURL:(NSURL *)url{
NSAlert *alert = [[NSAlert alloc] init];
Expand Down
3 changes: 2 additions & 1 deletion AppBox/Common/UploadManager/UploadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef void(^CompletionBlock)(void);
- (void)uploadIPAFile:(NSURL *)ipaFileURL;
- (void)uploadIPAFileWithoutUnzip:(NSURL *)ipaURL;

- (void)deleteBuildFromDropbox;
- (void)deleteBuildFromDashboard;
- (void)deleteBuildFromDropboxAndDashboard;

@end
54 changes: 37 additions & 17 deletions AppBox/Common/UploadManager/UploadManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ - (instancetype)init {

- (void)createNewWorkingDirectory {
workingDirectory = [NSTemporaryDirectory() stringByAppendingPathComponent: [[NSUUID UUID] UUIDString]];
[ABLog log:@"New temporaray working directory %@", workingDirectory];
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:workingDirectory withIntermediateDirectories:YES attributes:nil error:&error];
if (error == nil) {
[ABLog log:@"New temporaray working directory %@", workingDirectory];
} else {
[ABLog log:@"Unable to create temporary working directory %@", workingDirectory];
}
}

#pragma mark - UnZip IPA File
//MARK: - UnZip IPA File

-(void)uploadIPAFile:(NSURL *)ipaFileURL{
[ABLog log:@"Preparing to Upload IPA - %@", ipaFileURL];
Expand All @@ -66,9 +72,14 @@ -(void)uploadIPAFile:(NSURL *)ipaFileURL{

[ABLog log:@"Extracting Files to - %@", workingDirectory];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
[SSZipArchive unzipFileAtPath:ipaPath toDestination:workingDirectory overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
strongify(self);
[SSZipArchive unzipFileAtPath:ipaPath
toDestination:self->workingDirectory
overwrite:YES
password:nil
progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
dispatch_async(dispatch_get_main_queue(), ^{
strongify(self);

[self showStatus:@"Extracting files..." andShowProgressBar:YES withProgress:-1];

//Get payload entry
Expand All @@ -95,7 +106,7 @@ -(void)uploadIPAFile:(NSURL *)ipaFileURL{
NSString *mobileProvisionPath = [payloadEntry stringByAppendingPathComponent:@"embedded.mobileprovision"].lowercaseString;
if ([entry.lowercaseString isEqualToString:mobileProvisionPath]){
[ABLog log:@"Found mobileprovision at path = %@",mobileProvisionPath];
mobileProvisionPath = [workingDirectory stringByAppendingPathComponent: mobileProvisionPath];
mobileProvisionPath = [self->workingDirectory stringByAppendingPathComponent: mobileProvisionPath];
self.project.mobileProvision = [[MobileProvision alloc] initWithPath:mobileProvisionPath];
}
}
Expand All @@ -121,7 +132,7 @@ -(void)uploadIPAFile:(NSURL *)ipaFileURL{

//get info.plist
[ABLog log:@"Final Info.plist path = %@",infoPlistPath];
[self.project setIpaInfoPlist: [NSDictionary dictionaryWithContentsOfFile:[workingDirectory stringByAppendingPathComponent:infoPlistPath]]];
[self.project setIpaInfoPlist: [NSDictionary dictionaryWithContentsOfFile:[self->workingDirectory stringByAppendingPathComponent:infoPlistPath]]];

//show error if info.plist is nil or invalid
if (![self.project isValidProjectInfoPlist]) {
Expand Down Expand Up @@ -182,7 +193,7 @@ -(void)uploadIPAFileWithoutUnzip:(NSURL *)ipaURL{
}


#pragma mark - UNIQUE Link Handlers
//MARK: - UNIQUE Link Handlers
-(void)handleAfterUniqueJsonMetaDataLoaded{
if(self.project.uniqueLinkJsonMetaData){
NSURL *path = [NSURL fileURLWithPath:[workingDirectory stringByAppendingPathComponent:FILE_NAME_UNIQUE_JSON]];
Expand Down Expand Up @@ -305,7 +316,10 @@ -(void)updateUniquLinkDictinory:(NSMutableDictionary *)dictUniqueLink{
if (obj.length > 30) {
NSString *modifiedProvisioning = [obj stringByReplacingCharactersInRange:NSMakeRange(10, 20) withString:@"....."];
[modifiedProvisionedDevices addObject:modifiedProvisioning];
}
} else if (obj.length > 20) {
NSString *modifiedProvisioning = [obj stringByReplacingCharactersInRange:NSMakeRange(8, 5) withString:@"....."];
[modifiedProvisionedDevices addObject:modifiedProvisioning];
}
}];
if (self.project.mobileProvision.provisionedDevices) {
[mobileProvision setObject:modifiedProvisionedDevices forKey:@"devicesudid"];
Expand Down Expand Up @@ -349,7 +363,7 @@ -(void)uploadUniqueLinkJsonFile{
[self dbUploadFile:path.resourceSpecifier to:self.project.dbAppInfoJSONFullPath.absoluteString mode:mode];
}

#pragma mark - Update AppInfo.JSON file
//MARK: - Update AppInfo.JSON file
-(void)loadAppInfoMetaData{
weakify(self);
DBFILESListRevisionsMode *revisionMode = [[DBFILESListRevisionsMode alloc] initWithPath];
Expand All @@ -367,7 +381,7 @@ -(void)loadAppInfoMetaData{

}

#pragma mark - Upload Files
//MARK: - Upload Files

-(void)dbUploadFile:(NSString *)file to:(NSString *)path mode:(DBFILESWriteMode *)mode{
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Uploading - %@", file.lastPathComponent]];
Expand Down Expand Up @@ -517,7 +531,7 @@ -(void)uploadNextChunk{
}
}

#pragma mark - Upload File Helper
//MARK: - Upload File Helper
//Helper to Handle Chunk Upload Error
-(void)handleChunkUploadWithRouteError:(DBFILESUploadSessionAppendError * _Nullable)routeError
finishError:(DBFILESUploadSessionFinishError * _Nullable)finishError
Expand Down Expand Up @@ -569,7 +583,7 @@ -(void)updateProgressBytesWritten:(int64_t)bytesWritten totalBytesWritten:(int64
[self showStatus:status andShowProgressBar:YES withProgress:progress/100];
}

#pragma mark - Dropbox Create/Get Shared Link
//MARK: - Dropbox Create/Get Shared Link
-(void)dbCreateSharedURLForFile:(NSString *)file{
weakify(self);
[[[DBClientsManager authorizedClient].sharingRoutes createSharedLinkWithSettings:file]
Expand Down Expand Up @@ -700,7 +714,7 @@ -(void)handleSharedURLResult:(NSString *)url{
}
}

#pragma mark - Create ShortSharable URL
//MARK: - Create ShortSharable URL
-(void)createUniqueShortSharableUrl{
//Create Short URL
weakify(self);
Expand All @@ -727,8 +741,9 @@ -(void)createAndUploadJsonWithURL:(NSURL *)shareURL{
});
}

#pragma mark - Delete Files
-(void)deleteBuildFromDropbox{
//MARK: - Delete Files
-(void)deleteBuildFromDropboxAndDashboard {
[self createNewWorkingDirectory];
[self showStatus:@"Deleting..." andShowProgressBar:YES withProgress:-1];
if (self.project.isKeepSameLinkEnabled) {
[self deleteBuildDetailsFromAppInfoJSON];
Expand All @@ -737,7 +752,12 @@ -(void)deleteBuildFromDropbox{
}
}

-(void)deleteBuildFolder{
-(void)deleteBuildFromDashboard {
[self showStatus:@"Deleting..." andShowProgressBar:YES withProgress:-1];
self.completionBlock();
}

-(void)deleteBuildFolder {
weakify(self);
[[[[DBClientsManager authorizedClient] filesRoutes] delete_V2:self.project.dbDirectory.absoluteString] setResponseBlock:^(DBFILESDeleteResult * _Nullable result, DBFILESDeleteError * _Nullable routeError, DBRequestError * _Nullable networkError) {
strongify(self);
Expand Down Expand Up @@ -771,7 +791,7 @@ -(void)deleteBuildDetailsFromAppInfoJSON{
[self loadAppInfoMetaData];
}

#pragma mark - Show Status
//MARK: - Show Status
-(void)showStatus:(NSString *)status andShowProgressBar:(BOOL)showProgressBar withProgress:(double)progress{
//log status in session log
[ABLog log:@"%@",status];
Expand Down
19 changes: 12 additions & 7 deletions AppBox/Common/UserManager/UserData.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@

@interface UserData : NSObject

// User status
//MARK: - Logged In User
+(BOOL)isLoggedIn;
+(NSString *)loggedInUserEmail;
+(void)setLoggedInUserEmail:(NSString *)userEmail;
+(NSString *)loggedInUserDisplayName;
+(void)setLoggedInUserDisplayName:(NSString *)loggedInUserDisplayName;

// Dropbox Used and Available Space
+(NSNumber *)dropboxUsedSpace;
+(NSNumber *)dropboxAvailableSpace;
+(void)setDropboxUsedSpace:(NSNumber *)usedSpace;
+(void)setDropboxAvailableSpace:(NSNumber *)availableSpace;

// MARK: - Preferences...
// Default emails and message
+(NSString *)userEmail;
+(void)setUserEmail:(NSString *)userEmail;
Expand All @@ -28,12 +39,6 @@
+(void)setUserHangoutChatWebHook:(NSString *)slackChannel;
+(NSString *)userMicrosoftTeamWebHook;
+(void)setUserMicrosoftTeamWebHook:(NSString *)slackChannel;

// Dropbox Used and Available Space
+(NSNumber *)dropboxUsedSpace;
+(NSNumber *)dropboxAvailableSpace;
+(void)setDropboxUsedSpace:(NSNumber *)usedSpace;
+(void)setDropboxAvailableSpace:(NSNumber *)availableSpace;

//AppBox Installation page settings
+(BOOL)downloadIPAEnable;
Expand Down
Loading