hook LicensingFacade

This commit is contained in:
novice.li
2024-04-01 22:07:03 +08:00
parent b10cceebf8
commit 292e1b8d88
3 changed files with 54 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
package com.novitechie;
import java.util.Calendar;
import java.util.Date;
public class StackTraceRule {
public static boolean check() {
RuntimeException e = new RuntimeException();
@@ -10,4 +13,16 @@ public class StackTraceRule {
}
return false;
}
public static Date hook() {
RuntimeException e = new RuntimeException();
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
if (stackTraceElement.getFileName() == null) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, 180);
return calendar.getTime();
}
}
return null;
}
}