diff --git a/src/main/java/io/zhile/research/ja/netfilter/Initializer.java b/src/main/java/io/zhile/research/ja/netfilter/Initializer.java index ef05c04..b5c46c2 100644 --- a/src/main/java/io/zhile/research/ja/netfilter/Initializer.java +++ b/src/main/java/io/zhile/research/ja/netfilter/Initializer.java @@ -8,7 +8,6 @@ import io.zhile.research.ja.netfilter.plugin.PluginManager; import java.io.File; import java.lang.instrument.Instrumentation; -import java.lang.instrument.UnmodifiableClassException; public class Initializer { public static void init(String args, Instrumentation inst, File currentDirectory) { @@ -30,10 +29,15 @@ public class Initializer { inst.addTransformer(Dispatcher.getInstance(), true); for (Class c : inst.getAllLoadedClasses()) { + String name = c.getName(); + if (name.startsWith("java.lang.invoke.LambdaForm$") || '[' == name.charAt(0)) { + continue; + } + try { inst.retransformClasses(c); - } catch (UnmodifiableClassException e) { - // ok, ok. just ignore + } catch (Throwable e) { + DebugInfo.output("Retransform class failed: " + name); } } } diff --git a/src/main/java/io/zhile/research/ja/netfilter/Launcher.java b/src/main/java/io/zhile/research/ja/netfilter/Launcher.java index 3729d5f..3a64f73 100644 --- a/src/main/java/io/zhile/research/ja/netfilter/Launcher.java +++ b/src/main/java/io/zhile/research/ja/netfilter/Launcher.java @@ -9,6 +9,8 @@ import java.net.URL; import java.util.jar.JarFile; public class Launcher { + private static final String VERSION = "v1.1.3"; + public static void main(String[] args) { printUsage(); } @@ -39,6 +41,8 @@ public class Launcher { private static void printUsage() { String content = "\n ============================================================================ \n" + "\n" + + " ja-netfilter-" + VERSION + + "\n\n" + " A javaagent lib for network filter :)\n" + "\n" + " https://github.com/pengzhile/ja-netfilter\n" +