Skip to content

Commit

Permalink
Merge pull request #20 from vineetchoudhary/development
Browse files Browse the repository at this point in the history
Issues fix
  • Loading branch information
vineetchoudhary authored Dec 23, 2016
2 parents 355c4a4 + 86b9167 commit 9c89406
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions AppBox/Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
+ (void)shutdownSystem;
+ (NSString*)generateUUID;
+ (NSArray *)getAllTeamId;
+ (void)removeAllStoredCredentials;
+ (BOOL) isValidEmail:(NSString *)checkString;
+ (NSURL *)getFileDirectoryForFilePath:(NSURL *)filePath;
+ (NSModalResponse)showAlertWithTitle:(NSString *)title andMessage:(NSString *)message;
Expand Down
33 changes: 33 additions & 0 deletions AppBox/Common/Common.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,37 @@ + (NSArray *)getAllTeamId{
return plainCertifcates;
}

#pragma mark - Remove All Cache, Cookies and Credentials
+ (void)removeAllStoredCredentials{
// Delete any cached URLrequests!
NSURLCache *sharedCache = [NSURLCache sharedURLCache];
[sharedCache removeAllCachedResponses];

// Also delete all stored cookies!
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSArray *cookies = [cookieStorage cookies];
id cookie;
for (cookie in cookies) {
[cookieStorage deleteCookie:cookie];
}

NSDictionary *credentialsDict = [[NSURLCredentialStorage sharedCredentialStorage] allCredentials];
if ([credentialsDict count] > 0) {
// the credentialsDict has NSURLProtectionSpace objs as keys and dicts of userName => NSURLCredential
NSEnumerator *protectionSpaceEnumerator = [credentialsDict keyEnumerator];
id urlProtectionSpace;
// iterate over all NSURLProtectionSpaces
while (urlProtectionSpace = [protectionSpaceEnumerator nextObject]) {
NSEnumerator *userNameEnumerator = [[credentialsDict objectForKey:urlProtectionSpace] keyEnumerator];
id userName;
// iterate over all usernames for this protectionspace, which are the keys for the actual NSURLCredentials
while (userName = [userNameEnumerator nextObject]) {
NSURLCredential *cred = [[credentialsDict objectForKey:urlProtectionSpace] objectForKey:userName];
//NSLog(@"credentials to be removed: %@", cred);
[[NSURLCredentialStorage sharedCredentialStorage] removeCredential:cred forProtectionSpace:urlProtectionSpace];
}
}
}
}

@end
2 changes: 1 addition & 1 deletion AppBox/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.6</string>
<string>0.9.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
4 changes: 2 additions & 2 deletions AppBox/ViewController/HomeViewController/HomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ - (void)getIPAInfoFromLocalURL:(NSURL *)ipaFileURL{
__block NSString *payloadEntry;
__block NSString *infoPlistPath;
[SSZipArchive unzipFileAtPath:fromPath toDestination:NSTemporaryDirectory() overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
if ([[entry.lastPathComponent substringFromIndex:(entry.lastPathComponent.length-4)].lowercaseString isEqualToString: @".app"]) {
if ((entry.lastPathComponent.length > 4) && [[entry.lastPathComponent substringFromIndex:(entry.lastPathComponent.length-4)].lowercaseString isEqualToString: @".app"]) {
payloadEntry = entry;
}
NSString *mainInfoPlistPath = [NSString stringWithFormat:@"%@Info.plist",payloadEntry].lowercaseString;
Expand Down Expand Up @@ -732,6 +732,7 @@ -(void)updateViewState{

#pragma mark - MailDelegate -
-(void)mailViewLoadedWithWebView:(WebView *)webView{

}

-(void)mailSentWithWebView:(WebView *)webView{
Expand Down Expand Up @@ -768,7 +769,6 @@ -(void)enableMailField:(BOOL)enable{
//Just for confirm changes
[self textFieldMailValueChanged:textFieldEmail];
[self textFieldDevMessageValueChanged:textFieldMessage];

}

#pragma mark - TabView Delegate
Expand Down
6 changes: 6 additions & 0 deletions AppBox/ViewController/MailViewController/MailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)
return sender;
}

- (void)webViewClose:(WebView *)sender{
[[sender mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:abMailerBaseURL]]];
sender.shouldCloseWithWindow = NO;
}


#pragma mark - Actions
- (IBAction)reloadButtonTapped:(NSButton *)sender {
[[AppDelegate appDelegate] addSessionLog:@"User Reloaded Current Request!!!"];
Expand Down

0 comments on commit 9c89406

Please sign in to comment.