@xiaov
I follow your instructions, but when it will be made to a deb file, says error like this:
- %hook does not make sense inside a block.
(my tweak.xm)
#import "vm_writeData.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define string @"xiaov"
UIAlertView *a;
%hook AppDelegatePlus
- (char)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 {
NSString *vActivateStr = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/xiaov.txt"];
vActivateStr= [NSString stringWithContentsOfFile:vActivateStr encoding:NSUTF8StringEncoding error:nil];
if ([vActivateStr isEqualToString:string])
{
[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(ActivateSuccess) userInfo:nil repeats:NO];
return %orig;
}
else
{
[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(ActivateFailed) userInfo:nil repeats:NO];
return %orig;
}
}
%new -(void)ActivateSuccess {
%hook PGNativeAdvModel
-(bool) isVipAd {
If(hackResult == 1) {
return TRUE;
} else {
return FALSE;
}
}
-(void) setIsVipAd:(bool)arg1 {
If(hackResult == 1) {
arg1 = TRUE;
} else {
arg1 = FALSE;
}
}
%end
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"IOSGODS" message: @"Activated Success" delegate:self cancelButtonTitle:@"ok" otherButtonTitles: nil];
[alert show];
[alert release];
}
%new -(void)ActivateFailed {
//Added what you want to do when the code is entered wrong
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"IOSGODS" message:@"Please enter your password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles: @"Login", nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
[alert release];
}
%new - (void)alertView:alert clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0) {
//set action for close button when pressed//
}
if (buttonIndex == 1) {
//set action for button one pressed//
NSString *passwordStr = [alert textFieldAtIndex:0].text;
NSData *data = [passwordStr dataUsingEncoding:NSUTF8StringEncoding];
NSString *directoryStr = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/xiaov.txt"];
[data writeToFile:directoryStr atomically:YES]; //write plist
exit(0);
}
}
%end
- hope can u correction my tweak.xm
- thank in advance