diff --git a/Classes/VoiceBase/MGMInstance.h b/Classes/VoiceBase/MGMInstance.h index aa2aef2..698cb70 100644 --- a/Classes/VoiceBase/MGMInstance.h +++ b/Classes/VoiceBase/MGMInstance.h @@ -82,6 +82,7 @@ extern NSString * const MGMUCVoicemail; int webLoginTries; BOOL loggedIn; NSMutableDictionary *verificationParameters; + NSURL *verificationURL; NSString *XPCURL; NSString *XPCCD; diff --git a/Classes/VoiceBase/MGMInstance.m b/Classes/VoiceBase/MGMInstance.m index 83d064c..220378d 100644 --- a/Classes/VoiceBase/MGMInstance.m +++ b/Classes/VoiceBase/MGMInstance.m @@ -30,7 +30,6 @@ NSString * const MGMVoiceBaseCopyright = @"Copyright (c) 2011 Mr. Gecko's Media NSString * const MGMVoiceIndexURL = @"https://www.google.com/voice/"; NSString * const MGMLoginURL = @"https://accounts.google.com/ServiceLoginAuth"; -NSString * const MGMLoginVerifyURL = @"https://www.google.com/accounts/SmsAuth?persistent=yes"; NSString * const MGMXPCPath = @"/voice/xpc/?xpc=%7B%22cn%22%3A%22i70avDIMsA%22%2C%22tp%22%3Anull%2C%22pru%22%3A%22https%3A%2F%2Fwww.google.com%2Fvoice%2Fxpc%2Frelay%22%2C%22ppu%22%3A%22https%3A%2F%2Fwww.google.com%2Fvoice%2Fxpc%2Fblank%2F%22%2C%22lpu%22%3A%22https%3A%2F%2Fclients4.google.com%2Fvoice%2Fxpc%2Fblank%2F%22%7D"; NSString * const MGMCheckPath = @"/voice/xpc/checkMessages?r=%@"; NSString * const MGMCreditURL = @"https://www.google.com/voice/settings/billingcredit/"; @@ -240,44 +239,87 @@ const BOOL MGMInstanceInvisible = YES; } else if ([returnedString containsString:@"verification code"]) { [verificationParameters release]; verificationParameters = [NSMutableDictionary new]; - [verificationParameters setObject:@"yes" forKey:@"PersistentCookie"]; - NSString *nameValue = @"name=\"%@\""; - NSString *valueStart = @"value=\""; - NSString *valueEnd = @"\""; - NSString *valueStartQ = @"value='"; - NSString *valueEndQ = @"'"; - NSArray *names = [NSArray arrayWithObjects:@"timeStmp", @"secTok", @"smsToken", @"email", nil]; - for (int i=0; i<[names count]; i++) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - NSString *nameString = [NSString stringWithFormat:nameValue, [names objectAtIndex:i]]; - NSRange range = [returnedString rangeOfString:nameString]; - if (range.location==NSNotFound) { - nameString = [nameString replace:@"\"" with:@"'"]; - range = [returnedString rangeOfString:nameString]; - } - if (range.location==NSNotFound) { - NSLog(@"Unable to find %@", [names objectAtIndex:i]); + + NSRange formRange = [returnedString rangeOfString:@"