MCPcopy Create free account
hub / github.com/cinit/TMoe / getMethodFromCache

Method getMethodFromCache

app/src/main/java/cc/ioctl/tmoe/util/dex/DexKit.java:124–144  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 6

logiMethod · 0.95
getMethodInstanceMethod · 0.95
getHostClassLoaderMethod · 0.95
logeMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected