]> git.saurik.com Git - cydia.git/commitdiff
Support cydia.setToken(null).
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 14:40:22 +0000 (06:40 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:10 +0000 (02:41 -0800)
MobileCydia.mm

index 6d697a0608dd5f6a41715102790f5a9fada1033d..73c639f54d74dd1a58153722233d098377a68edf 100644 (file)
@@ -1040,7 +1040,7 @@ static const char *Machine_ = NULL;
 static NSString *System_ = nil;
 static NSString *SerialNumber_ = nil;
 static NSString *ChipID_ = nil;
-static NSString *Token_ = nil;
+static _H<NSString> Token_;
 static NSString *UniqueID_ = nil;
 static NSString *PLMN_ = nil;
 static NSString *Build_ = nil;
@@ -4215,11 +4215,13 @@ static NSString *Warning_;
 }
 
 - (void) _setToken:(NSString *)token {
-    if (Token_ != nil)
-        [Token_ release];
-    Token_ = [token retain];
+    Token_ = token;
+
+    if (token == nil)
+        [Metadata_ removeObjectForKey:@"Token"];
+    else
+        [Metadata_ setObject:Token_ forKey:@"Token"];
 
-    [Metadata_ setObject:Token_ forKey:@"Token"];
     Changed_ = true;
 }