3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 00:55:42 +02:00

Merge pull request from danteruiz/mac-launcher-bugs

Fixing mac luancher bugs.
This commit is contained in:
Shannon Romano 2019-06-06 15:07:07 -07:00 committed by GitHub
commit fae13682d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -7,7 +7,9 @@
- (void) confirmCredentials:(NSString*)username :(NSString*)password {
NSLog(@"web request started");
NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner", username, password];
NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner",
[username stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]],
[password stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]]];
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding];
NSString *postLength = [NSString stringWithFormat:@"%ld", (unsigned long)[postData length]];
@ -18,7 +20,6 @@
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
//NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
NSURLSession* session = [NSURLSession sharedSession];
NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {

View file

@ -41,6 +41,7 @@
[fileManager moveItemAtURL:location toURL:destinationURL error:&error];
Launcher* sharedLauncher = [Launcher sharedLauncher];
[sharedLauncher setDownloadFilename:destinationFileName];
NSString* appPath = [sharedLauncher getAppPath];
NSString* downloadFileName = [sharedLauncher getDownloadFilename];

View file

@ -12,7 +12,7 @@ static NSString* const organizationURL = @"https://s3.amazonaws.com/hifi-public/
self.username = aUsername;
const char *cKey = LAUNCHER_HMAC_SECRET;
const char *cData = [aOrganization cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [[aOrganization lowercaseString] cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)];
@ -33,7 +33,6 @@ static NSString* const organizationURL = @"https://s3.amazonaws.com/hifi-public/
[sharedLauncher setLoginErrorState: NONE];
return [sharedLauncher organizationRequestFinished:TRUE];
}
NSLog(@"FAAAAILLLLLLLEEEEEEEDDDDDD");
[sharedLauncher setLoginErrorState: ORGANIZATION];
return [sharedLauncher organizationRequestFinished:FALSE];
/*NSLog(@"URL: %@", [organizationURL stringByAppendingString:jsonFile]);