#define PLIST_PATH @"/var/mobile/Library/Preferences/com.ted2.pou.plist"
inline bool GetPrefBool(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
%hook Coins
-(int)have {
if(GetPrefBool(@"key1")) {
return 987654321;
}
return %orig;
}
-(int)spent {
if(GetPrefBool(@"key2")) {
return 0;
}
return %orig;
}
-(int)cheated {
if(GetPrefBool(@"key3")) { // you had key1 so you put key1 again so it should be key3
return 0;
}
return %orig;
}
%end
%hook State
-(int)setLevel {
if(GetPrefBool(@"key4")) {
return 270;
}
return %orig;
}
-(void)setHungry:(bool)argument {
if(GetPrefBool(@"key5")) { // you had key3 so you put key3 again so it should be key5
argument = false;
}
return %orig; // you forgot ; here
}
%end
%hook AppDelegate
-(void)applicationDidBecomeActive:(id)arg {
UIAlertView *credits = [[UIAlertView alloc] initWithTitle:@"Pou Cheat."
message:@"Made by Ted2 from iOSGods"
delegate:self
cancelButtonTitle:@"Close Test Pop-Up"
otherButtonTitles:@"Visit us!", nil];
[credits show];
[credits release];
%orig();
}
%new
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSString *button = [alertView buttonTitleAtIndex:buttonIndex];
if([button isEqualToString:@"Visis the iOSGods Family!"])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
}
}
%end