Skip to content
Guest Big Announcement

Tweak.xm:53:63: error: expected ';' after return statement

Featured Replies

Hey,

 

When I wanna compile my files to a .deb, I'm getting the error from the title.

Tweak.xm:53:63: error: expected ';' after return statement

Don't really get the prob, I just added a UI Alert from a post from this forum..

 

this is my tweak.xm:

#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(@"key1")) {
return 0;
}
return %orig;
}

%end

%hook State

-(int)setLevel {
if(GetPrefBool(@"key4")) {
return 270;
}
return %orig;
}

-(void)setHungry:(bool)argument {
if(GetPrefBool(@"key3")) {
argument = false;
}
return %orig
}

%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 

Anyone knows what's wrong with the code?

 

PS: yes, pou can be hacked using flex, but practice makes you better right? :p

Solved by Amuyea

  • Author

Speak English i dont undestand H@ck3r language. :)

If this is 'H@ck3r' language, then I don't wanna know what others speak... lol

  • Solution

#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

 

Updated by Amuyea

  • Author
#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 

Thanks, worked!

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.