summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2019-06-17 23:51:56 +0300
committerEvgeny Zinoviev <me@ch1p.io>2019-06-17 23:52:07 +0300
commit7398de21ae4f749c7ecc731f546c02837cb4b57b (patch)
treeeff9faefffb66cbf7d020422093d820970c8528c
parentd3c5951bb4552185b5a0766a38cc30ffbf857036 (diff)
spoof isValid and numberOfDaysLeftInTrialMode
-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