Try to load the obfuscated method from deobfuscation cache. This method does not take much time and may be called in main thread. @param i the dex method index @return the target method descriptor, null if the target is not found.
(int i)
| 122 | * @return the target method descriptor, null if the target is not found. |
| 123 | */ |
| 124 | @Nullable |
| 125 | public static Method getMethodFromCache(int i) { |
| 126 | if (i / 10000 == 0) { |
| 127 | throw new IllegalStateException("Index " + i + " attempted to access method!"); |
| 128 | } |
| 129 | DexMethodDescriptor m = getMethodDescFromCache(i); |
| 130 | if (m == null) { |
| 131 | return null; |
| 132 | } |
| 133 | if (m.name.equals("<init>") || m.name.equals("<clinit>")) { |
| 134 | // TODO: support constructors |
| 135 | Utils.logi("getMethodFromCache(" + i + ") methodName == " + m.name + " , return null"); |
| 136 | return null; |
| 137 | } |
| 138 | try { |
| 139 | return m.getMethodInstance(Initiator.getHostClassLoader()); |
| 140 | } catch (NoSuchMethodException e) { |
| 141 | Utils.loge(e); |
| 142 | return null; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Run the dex deobfuscation. This method may take a long time and should only be called in background thread. |
nothing calls this directly
no test coverage detected