summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-23 06:40:22 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:10 -0800
commit9737d93e40bfc503c704d12ed6752febc03a15ff (patch)
tree7e93e01816391e07ab6ec980589050ba1048e4d3
parent849cd6bf6c3a6bd758b47a2960bf5418de1e793a (diff)
Support cydia.setToken(null).
-rw-r--r--MobileCydia.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 6d697a0..73c639f 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -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;
}