Skip to content

Commit 9c89406

Browse files
Merge pull request #20 from vineetchoudhary/development
Issues fix
2 parents 355c4a4 + 86b9167 commit 9c89406

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

AppBox/Common/Common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
+ (void)shutdownSystem;
1515
+ (NSString*)generateUUID;
1616
+ (NSArray *)getAllTeamId;
17+
+ (void)removeAllStoredCredentials;
1718
+ (BOOL) isValidEmail:(NSString *)checkString;
1819
+ (NSURL *)getFileDirectoryForFilePath:(NSURL *)filePath;
1920
+ (NSModalResponse)showAlertWithTitle:(NSString *)title andMessage:(NSString *)message;

AppBox/Common/Common.m

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,37 @@ + (NSArray *)getAllTeamId{
129129
return plainCertifcates;
130130
}
131131

132+
#pragma mark - Remove All Cache, Cookies and Credentials
133+
+ (void)removeAllStoredCredentials{
134+
// Delete any cached URLrequests!
135+
NSURLCache *sharedCache = [NSURLCache sharedURLCache];
136+
[sharedCache removeAllCachedResponses];
137+
138+
// Also delete all stored cookies!
139+
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
140+
NSArray *cookies = [cookieStorage cookies];
141+
id cookie;
142+
for (cookie in cookies) {
143+
[cookieStorage deleteCookie:cookie];
144+
}
145+
146+
NSDictionary *credentialsDict = [[NSURLCredentialStorage sharedCredentialStorage] allCredentials];
147+
if ([credentialsDict count] > 0) {
148+
// the credentialsDict has NSURLProtectionSpace objs as keys and dicts of userName => NSURLCredential
149+
NSEnumerator *protectionSpaceEnumerator = [credentialsDict keyEnumerator];
150+
id urlProtectionSpace;
151+
// iterate over all NSURLProtectionSpaces
152+
while (urlProtectionSpace = [protectionSpaceEnumerator nextObject]) {
153+
NSEnumerator *userNameEnumerator = [[credentialsDict objectForKey:urlProtectionSpace] keyEnumerator];
154+
id userName;
155+
// iterate over all usernames for this protectionspace, which are the keys for the actual NSURLCredentials
156+
while (userName = [userNameEnumerator nextObject]) {
157+
NSURLCredential *cred = [[credentialsDict objectForKey:urlProtectionSpace] objectForKey:userName];
158+
//NSLog(@"credentials to be removed: %@", cred);
159+
[[NSURLCredentialStorage sharedCredentialStorage] removeCredential:cred forProtectionSpace:urlProtectionSpace];
160+
}
161+
}
162+
}
163+
}
164+
132165
@end

AppBox/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.9.6</string>
20+
<string>0.9.7</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>

AppBox/ViewController/HomeViewController/HomeViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ - (void)getIPAInfoFromLocalURL:(NSURL *)ipaFileURL{
343343
__block NSString *payloadEntry;
344344
__block NSString *infoPlistPath;
345345
[SSZipArchive unzipFileAtPath:fromPath toDestination:NSTemporaryDirectory() overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
346-
if ([[entry.lastPathComponent substringFromIndex:(entry.lastPathComponent.length-4)].lowercaseString isEqualToString: @".app"]) {
346+
if ((entry.lastPathComponent.length > 4) && [[entry.lastPathComponent substringFromIndex:(entry.lastPathComponent.length-4)].lowercaseString isEqualToString: @".app"]) {
347347
payloadEntry = entry;
348348
}
349349
NSString *mainInfoPlistPath = [NSString stringWithFormat:@"%@Info.plist",payloadEntry].lowercaseString;
@@ -732,6 +732,7 @@ -(void)updateViewState{
732732

733733
#pragma mark - MailDelegate -
734734
-(void)mailViewLoadedWithWebView:(WebView *)webView{
735+
735736
}
736737

737738
-(void)mailSentWithWebView:(WebView *)webView{
@@ -768,7 +769,6 @@ -(void)enableMailField:(BOOL)enable{
768769
//Just for confirm changes
769770
[self textFieldMailValueChanged:textFieldEmail];
770771
[self textFieldDevMessageValueChanged:textFieldMessage];
771-
772772
}
773773

774774
#pragma mark - TabView Delegate

AppBox/ViewController/MailViewController/MailViewController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)
6666
return sender;
6767
}
6868

69+
- (void)webViewClose:(WebView *)sender{
70+
[[sender mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:abMailerBaseURL]]];
71+
sender.shouldCloseWithWindow = NO;
72+
}
73+
74+
6975
#pragma mark - Actions
7076
- (IBAction)reloadButtonTapped:(NSButton *)sender {
7177
[[AppDelegate appDelegate] addSessionLog:@"User Reloaded Current Request!!!"];

0 commit comments

Comments
 (0)