From: Jay Freeman (saurik) Date: Wed, 23 Feb 2011 14:40:22 +0000 (-0800) Subject: Support cydia.setToken(null). X-Git-Tag: v1.1.0%b1~240 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/9737d93e40bfc503c704d12ed6752febc03a15ff?hp=849cd6bf6c3a6bd758b47a2960bf5418de1e793a Support cydia.setToken(null). --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 6d697a06..73c639f5 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 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; }