Jump to content

[Tut] How to make a simple license system for deb


160 posts in this topic

Recommended Posts

Posted (edited)

@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

Updated by zexmarshal

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines