Full Code of gch1p/sketchtrial for AI

master 6deef065b386 cached
4 files
2.6 KB
738 tokens
1 requests
Download .txt
Repository: gch1p/sketchtrial
Branch: master
Commit: 6deef065b386
Files: 4
Total size: 2.6 KB

Directory structure:
gitextract_541eknhc/

├── Makefile
├── README.md
├── sketch.sh
└── sketchtrial.m

================================================
FILE CONTENTS
================================================

================================================
FILE: Makefile
================================================
CFLAGS = -dynamiclib -framework AppKit -framework Foundation

all:
	$(CC) $(CFLAGS) sketchtrial.m -o libsketchtrial.dylib

clean:
	rm -rf *.o libsketchtrial.dylib


================================================
FILE: README.md
================================================
# sketchtrial

This is a shared library that spoofs some ObjC method calls to disable Sketch license verification.

Tested on Sketch 58.

Make sure to disable SIP (`csrutil disable` from Recovery), for more information see below.

## Building
```
git clone https://github.com/gch1p/sketchtrial
cd sketchtrial
make
```

## Launching Sketch
You can use `sketch.sh`, it's a wrapper script that sets necessary environment variables to insert the lib and launches Sketch (it assumes that Sketch.app installed to /Applications, edit the script if it differs for you).

## Important
This hack doesn't work on systems with SIP (System Integrity Protection) enabled, and it's enabled by default since El Capitan. It can be easily disabled from Recovery Mode but it's another layer of security which is always good to have so disabling it permanently is not the wisest idea. I'll implement some solution to bypass this restriction when I have time.


================================================
FILE: sketch.sh
================================================
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export DYLD_INSERT_LIBRARIES=$DIR/libsketchtrial.dylib
/Applications/Sketch.app/Contents/MacOS/Sketch


================================================
FILE: sketchtrial.m
================================================
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
#include <AppKit/AppKit.h>


//
// BCRegularLicense
//

@interface BCRegularLicensePatched : NSObject
- (bool)isExpired;
- (bool)isValid;
@end

@interface BCLicenseManagerPatched : NSObject
- (long long)numberOfDaysLeftInTrialMode;
@end

@implementation BCRegularLicensePatched

+ (void)load {
    Class origClass = NSClassFromString(@"BCRegularLicense");
    
    method_exchangeImplementations(
        class_getInstanceMethod(origClass, @selector(isExpired)),
        class_getInstanceMethod(NSClassFromString(@"BCRegularLicensePatched"), @selector(isExpired))
    );

    method_exchangeImplementations(
        class_getInstanceMethod(origClass, @selector(isValid)),
        class_getInstanceMethod(NSClassFromString(@"BCRegularLicensePatched"), @selector(isValid))
    );
}

- (bool)isExpired {
    return false;
}

- (bool)isValid {
    return true;
}

@end


//
// BCLicenseManager
//

@implementation BCLicenseManagerPatched

+ (void)load {
    Class origClass = NSClassFromString(@"BCLicenseManager");

    method_exchangeImplementations(
        class_getInstanceMethod(origClass, @selector(numberOfDaysLeftInTrialMode)),
        class_getInstanceMethod(NSClassFromString(@"BCLicenseManagerPatched"), @selector(numberOfDaysLeftInTrialMode))
    );
}

- (long long)numberOfDaysLeftInTrialMode {
    return 9000;
}

@end
Download .txt
gitextract_541eknhc/

├── Makefile
├── README.md
├── sketch.sh
└── sketchtrial.m
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3K chars).
[
  {
    "path": "Makefile",
    "chars": 163,
    "preview": "CFLAGS = -dynamiclib -framework AppKit -framework Foundation\n\nall:\n\t$(CC) $(CFLAGS) sketchtrial.m -o libsketchtrial.dyli"
  },
  {
    "path": "README.md",
    "chars": 939,
    "preview": "# sketchtrial\n\nThis is a shared library that spoofs some ObjC method calls to disable Sketch license verification.\n\nTest"
  },
  {
    "path": "sketch.sh",
    "chars": 186,
    "preview": "#!/bin/bash\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" >/dev/null 2>&1 && pwd )\"\nexport DYLD_INSERT_LIBRARIES=$DIR/li"
  },
  {
    "path": "sketchtrial.m",
    "chars": 1389,
    "preview": "#import <objc/runtime.h>\n#import <Foundation/Foundation.h>\n#include <AppKit/AppKit.h>\n\n\n//\n// BCRegularLicense\n//\n\n@inte"
  }
]

About this extraction

This page contains the full source code of the gch1p/sketchtrial GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (2.6 KB), approximately 738 tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!