Skip to content
Guest Big Announcement

Featured Replies

Good day, there is a line "#define string @"iosgods"  "
Next in the code is the checking of this string if the text entered matches, then run the application, I have a question that you need to replace the "#define string @"iosgods" " that would have entered text checked out the document for example iosgods.com/text.txt?

  • Author
14 hours ago, Ted2 said:

Your support topic is very vague & I'm sure that's why no one has responded.

Please explain more and add pictures if possible.

#import "vm_writeData.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


#define string @"text"




UIAlertView *alert;
%hook AppController

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


 NSString *vActivateStr = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.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 {

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


}

%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];



}




%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/text.txt"];
            [data writeToFile:directoryStr atomically:YES];  //write plist

            exit(0);
        }

}



%end

Whether it is possible to make so that at start not the text which is specified in "#define string @"text"", And checked from the document for example which is on "iosgods.com/check.txt"

Archived

This topic is now archived and is closed to further replies.

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.