mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Feat: add retransform-class example with build/run scripts and docs
This commit is contained in:
1 parent
57405e810c
commit
b08656daa6
14 files changed
+340
-4
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
public class target {
|
||||
public static void say() {
|
||||
System.out.println("Hello!");
|
||||
//// RETRANSFORM HERE
|
||||
System.out.println("Retransformed!");
|
||||
//// RETRANSFORM HERE
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
|
||||
try {
|
||||
while (true) {
|
||||
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
|
||||
say();
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user