Jump to content

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


159 posts in this topic

Recommended Posts

Posted (edited)

@klashksa

I PM xiaov, got a reply and solved my problem,

This is xiaov gave me the solution, for my very suitable, provide you with reference:

Quote

 

remove %ctor 

and move your all writedata to inside gameActivatesuccess.

%new -(void)gameActivateSucess {

//alertcode blahh blahh (same with top)

 

//all the writedata here

if(getPrefBool(@"key") {

writedata...

}else {

 }

 

This is my New Tweak.xm :(Works fine on iOS9.x and later)

Spoiler

#import "writeData.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <substrate.h>

#define string @"iosgods_xiaov"
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.hack.gdjhtbhack.plist"

inline bool GetPrefBool(NSString *key) {
		return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}

UIAlertView *alert;
%hook AppDelegate

- (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(gameActivateSucess) userInfo:nil repeats:NO];     
	return %orig;
}
else
{
	[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(gameActivateFailed) userInfo:nil repeats:NO];     
	return %orig;
}
}


%new -(void)gameActivateSucess {

if(GetPrefBool(@"kCD"))
{
writeData(0x11A00C2, 0x00207047);
} else {
}

if(GetPrefBool(@"kMp"))
{
writeData(0x1571DE, 0x00207047);
} else {
}

UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"title" message: @"Activated Sucess" delegate:self cancelButtonTitle:@"ok" otherButtonTitles: nil];
[alert show];
[alert release];

}

%new -(void)gameActivateFailed {

alert = [[UIAlertView alloc] initWithTitle:@"Title" 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) {  

            
        }
        if (buttonIndex == 1) {  
        
            
           	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

 

Updated by Hackjoy
Posted

@Hackjoy Thank u pro it is worked fine On my device. But how can i add this code inside it ?

Because i'm always using this way 

%hook xxxxxx

-(void)xxxxx(bool)arg

{

arg = TRUE;

}

%end 

 

I didn't use this way never 

if(GetPrefBool(@"kMp"))
{
writeData(0x1571DE, 0x00207047);
} else {
}

I hope u understand me . Because i speak English a little  ? 

Posted
On 2/16/2018 at 5:34 PM, klashksa said:

@Hackjoy Thank u pro it is worked fine On my device. But how can i add this code inside it ?

Because i'm always using this way 

%hook xxxxxx

-(void)xxxxx(bool)arg

{

arg = TRUE;

}

%end 

 

I didn't use this way never 


if(GetPrefBool(@"kMp"))
{
writeData(0x1571DE, 0x00207047);
} else {
}

I hope u understand me . Because i speak English a little  ? 

Did you get you're answer yet?

Posted
On 2/17/2018 at 6:34 AM, klashksa said:

@Hackjoy Thank u pro it is worked fine On my device. But how can i add this code inside it ?

Because i'm always using this way 

%hook xxxxxx

-(void)xxxxx(bool)arg

{

arg = TRUE;

}

%end 

 

I didn't use this way never 


if(GetPrefBool(@"kMp"))
{
writeData(0x1571DE, 0x00207047);
} else {
}

I hope u understand me . Because i speak English a little  ? 

 

int hackResult = 0;

%hook AppDelegate

- (char)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 
{

use same code in my tut;

}

%new -(void)gameActivateSucess {

hackResult = 1;

}

%end

 

%hook xxxxxx

-(void)xxxxx(bool)arg

{

if(hackResult == 1) {

arg = TRUE;

} else {

arg = FALSE;

}

%end

On 4/5/2018 at 4:53 AM, Pradeep6868 said:

if you do please send me a pm because I also don't understand this.

check on top replied

  • Thanks 1

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