Invokes the method through reflection. Other methods and fields are removed to prevent accidental execution. @param owner Decryption classnode @param min Decryption method @param args Decryption method args @return
(ClassNode owner, MethodInsnNode min, Object[] args)
| 34 | * @return |
| 35 | */ |
| 36 | public static Object getIsolatedReturn(ClassNode owner, MethodInsnNode min, Object[] args) { |
| 37 | if (owner == null) { |
| 38 | return null; |
| 39 | } |
| 40 | ClassNode isolated = new ClassNode(); |
| 41 | isolated.version = 52; |
| 42 | isolated.name = owner.name; |
| 43 | isolated.superName = "java/lang/Object"; |
| 44 | int i = 0; |
| 45 | for (MethodNode mn : owner.methods) { |
| 46 | if (mn.name.equals(min.name) && mn.desc.equals(min.desc)) { |
| 47 | isolated.methods.add(owner.methods.get(i)); |
| 48 | } |
| 49 | i++; |
| 50 | } |
| 51 | return get(isolated, min.name, min.desc, args); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Simulates a method call from a given method. All methods are removed except the proxy call and the decrypt call. |