Jump to content

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


159 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
  • 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