前段时间升级全家桶 (喜新厌旧
), 发现新版之后官方总算出了杀手锏用以反制 “欢乐重置“. 为了 “欢乐永驻” 和 “学习交流”, 简单记录下核心摘要
旧版 (2021.3-)
agent
终更
plugin
IDE Eval Reset (洁癖)
终更 (长时间不打开, 也会尴尬)
新版 (2021.3+)
agent
FineAgent (懒人)
终更 (被反制只是时间问题)
最优
License Name
使用 ja-netfilter 及 ja-netfilter-mymap-plugin 插件, 自由定制
# ...
[MyMap]
EQUAL,licenseeName->自己的名字
EQUAL,gracePeriodDays->100000
EQUAL,paidUpTo->5000-12-31
洁癖者适用
ja-netfilter-mymap-plugin
ja-netfilter 官方 暂时 未内置 mymap 插件, 于是从 其他渠道 下载了
mymap-v1.0.1.jar
秉着谨慎原则 (怕被挂马) 反编译之, 并发布到 github 也许有人用得到
反编译
借助 IntelliJ IDEA
自带插件 Java Decompiler
完成
mkdir -p ~/mymap
~/Library/Java/JavaVirtualMachines/openjdk-17.0.1/Contents/Home/bin/java -cp /Applications/IntelliJ\ IDEA.app/Contents/plugins/java-decompiler/lib/java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true mymap-v1.0.1.jar ~/mymap
注意 JDK 的版本问题即可, 若会产生以下类似错误 就是 JDK 版本不对所致:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
我本机 默认 java 为 jdk 8, 而 mymap-v1.0.1.jar 需要 jdk 11 才能正确反编译, 所以我本机需要使用 自带的 jdk 11 的环境执行命令
重新构建
直接基于官方脚手架工程 ja-netfilter-sample-plugin 之上进行简单的微调即可
- 解决 javac 编译依赖缺失问题
默认情况下,
javac
不会从rt.jar
中读取类。它从一个符号文件中读取,该文件只包含标准API和一些内部API。可使用-XDignore.symbol.file=true
参数解决
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
<fork>true</fork>
</configuration>
</plugin>
编译产物选择使用
./target/mymap-v1.0.1-jar-with-dependencies.jar
即可