Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PLIST_PATH @"/var/mobile/Library/Preferences/com.i0stweak3r.faketwitterfollowers.plist"
- static NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:PLIST_PATH];
- %hook T1ProfileUserInfoView
- -(void) setFollowerCount:(id)arg1 {
- NSString *textV = [prefs objectForKey:@"text"];
- BOOL Enabled = [[prefs objectForKey:@"enabled"] boolValue];
- /**
- If the string is not a valid number, then myNumber will be nil. If it is a valid number, then you now have all of the NSNumber goodness to figure out what kind of number it actually is.
- **/
- if([textV isEqualToString:@""] || textV == nil || !Enabled)
- {
- return %orig;
- }
- else if (Enabled) {
- NSNumberFormatter *f = [[NSNumberFormatter alloc] init];
- f.numberStyle = NSNumberFormatterDecimalStyle;
- NSNumber *myNumber = [f numberFromString:textV];
- arg1 = myNumber;
- /*
- [NSNumber numberWithFloat: followers];
- not needed- used above code to ensure correct number format was passed.
- */
- return %orig(arg1);
- }
- }
- -(void) setFollowingCount:(id)arg1 {
- NSString *textV = [prefs objectForKey:@"text2"];
- BOOL Enabled = [[prefs objectForKey:@"enabled"] boolValue];
- /**
- If the string is not a valid number, then myNumber will be nil. If it is a valid number, then you now have all of the NSNumber goodness to figure out what kind of number it actually is.
- **/
- if([textV isEqualToString:@""] || textV == nil || !Enabled)
- {
- return %orig;
- }
- else if (Enabled) {
- NSNumberFormatter *f = [[NSNumberFormatter alloc] init];
- f.numberStyle = NSNumberFormatterDecimalStyle;
- NSNumber *myNumber = [f numberFromString:textV];
- arg1 = myNumber;
- return %orig(arg1);
- }
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement