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 #import #include // // 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