summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sketchtrial.m49
1 files changed, 43 insertions, 6 deletions
diff --git a/sketchtrial.m b/sketchtrial.m
index 26875d6..78868ec 100644
--- a/sketchtrial.m
+++ b/sketchtrial.m
@@ -9,20 +9,57 @@
@interface BCRegularLicensePatched : NSObject
- (bool)isExpired;
+- (bool)isValid;
+@end
+
+@interface BCLicenseManagerPatched : NSObject
+- (long long)numberOfDaysLeftInTrialMode;
@end
@implementation BCRegularLicensePatched
-+(void)load {
-Class origClass = NSClassFromString(@"BCRegularLicense");
- Method origMethod = class_getInstanceMethod(origClass, @selector(isExpired));
- Method replMethod = class_getInstanceMethod(NSClassFromString(@"BCRegularLicensePatched"), @selector(isExpired));
++ (void)load {
+ Class origClass = NSClassFromString(@"BCRegularLicense");
- method_exchangeImplementations(origMethod, replMethod);
+ 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 {
+- (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