Skip to content

Instantly share code, notes, and snippets.

@marcelbeumer
Created May 22, 2015 08:31
Show Gist options
  • Save marcelbeumer/9be5b3e9d70dc756776b to your computer and use it in GitHub Desktop.
Save marcelbeumer/9be5b3e9d70dc756776b to your computer and use it in GitHub Desktop.
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[self setDefaultWebViewUserAgent];
IOLSession *defaultSession = [IOLSession defaultSession];
NSString *multiIdentifier = [IOLWebView multiIdentifierStringWithSession:defaultSession];
NSString *XXXmultiIdentifier = @"{\"library\":{\"libVersion\":\"1.1.6\",\"configVersion\":\"2013093000\",\"offerIdentifier\":\"apptasty\"},\"client\":{\"uuids\":{\"advertisingIdentifier\":\"1d0da3eaab430551d5129539aefbd8e2\"},\"osIdentifier\":\"iOS\",\"osVersion\":\"8.3\",\"network\":\"2\",\"carrier\":\"o2-de\",\"screen\":{\"resolution\":\"320x568\",\"scale\":2},\"country\":\"NL\",\"language\":\"nl\",\"platform\":\"iPhone5,2\"}}";
NSData *multiIdentifierData = [multiIdentifier dataUsingEncoding:NSUTF8StringEncoding];
NSData *base64multiIdentifierData = [multiIdentifierData base64EncodedDataWithOptions:0];
NSString *multiIdentifierHash = [NSString stringWithUTF8String:[base64multiIdentifierData bytes]];
multiIdentifierHash = [multiIdentifierHash stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
multiIdentifierHash = [multiIdentifierHash stringByReplacingOccurrencesOfString:@"+" withString:@"-"];
// NSString *fooHash = @"foo";
// NSString *fooHash2 = @"foo";
//
// NSString *fooBar = @"e1wibGlicmFyeVwiOntcImxpYlZlcnNpb25cIjpcIjEuMS42XCIsXCJjb25maWdWZXJzaW9uXCI6XCIyMDEzMDkzMDAwXCIsXCJvZmZlcklkZW50aWZpZXJcIjpcImFwcHRhc3R5XCJ9LFwiY2xpZW50XCI6e1widXVpZHNcIjp7XCJhZHZlcnRpc2luZ0lkZW50aWZpZXJcIjpcIjFkMGRhM2VhYWI0MzA1NTFkNTEyOTUzOWFlZmJkOGUyXCJ9LFwib3NJZGVudGlmaWVyXCI6XCJpT1NcIixcIm9zVmVyc2lvblwiOlwiOC4zXCIsXCJuZXR3b3JrXCI6XCIyXCIsXCJjYXJyaWVyXCI6XCJvMi1kZVwiLFwic2NyZWVuXCI6e1wicmVzb2x1dGlvblwiOlwiMzIweDU2OFwiLFwic2NhbGVcIjoyfSxcImNvdW50cnlcIjpcIk5MXCIsXCJsYW5ndWFnZVwiOlwibmxcIixcInBsYXRmb3JtXCI6XCJpUGhvbmU1LDJcIn19";
//
// NSString *a = multiIdentifier;
// NSData *b = [multiIdentifier dataUsingEncoding:NSASCIIStringEncoding];
// NSString *c = [NSString stringWithUTF8String:[b bytes]];
//
// fooBar = [a stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//
// NSString *fooStr = @"foofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoofoofoofoo2222foofoofoofoofoofoo22foofoofoofoofoofoofoofoofoofoofoofoo";
//multiIdentifierHash = [multiIdentifierHash stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *fullURL = [NSString stringWithFormat:@"%@%@#%@", kURL, kENVELOPE, multiIdentifierHash];
NSURL *url = [NSURL URLWithString:fullURL];
NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
[[self.viewWeb scrollView] setBounces:NO];
self.viewWeb.delegate = self;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment