@Plugin(name="AnonymousClassPatch", description="Swap anonymous inner class names to avoid not compatible changes.", testedVersions="DCEVM") public class AnonymousClassPatchPlugin extends Object
| Constructor and Description |
|---|
AnonymousClassPatchPlugin() |
| Modifier and Type | Method and Description |
|---|---|
static CtClass |
patchAnonymousClass(ClassLoader classLoader,
ClassPool classPool,
String className,
Class original)
Replace an anonymous class with an compatible change (from another class according to state info).
|
static byte[] |
patchMainClass(String className,
ClassPool classPool,
CtClass ctClass,
ClassLoader classLoader,
ProtectionDomain protectionDomain)
If class contains anonymous classes, rename class references to compatible transition classes.
|
@OnClassLoadEvent(classNameRegexp=".*\\$\\d+", events=REDEFINE) public static CtClass patchAnonymousClass(ClassLoader classLoader, ClassPool classPool, String className, Class original) throws IOException, NotFoundException, CannotCompileException
@OnClassLoadEvent(classNameRegexp=".*", events=REDEFINE) public static byte[] patchMainClass(String className, ClassPool classPool, CtClass ctClass, ClassLoader classLoader, ProtectionDomain protectionDomain) throws IOException, CannotCompileException, NotFoundException
Copyright © 2018. All rights reserved.