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

Method hasClassInDex

app/src/main/java/cc/ioctl/tmoe/util/dex/DexFlow.java:338–352  ·  view source on GitHub ↗
(byte[] dex, String clz)

Source from the content-addressed store, hash-verified

336 //};
337
338 public static boolean hasClassInDex(byte[] dex, String clz) {
339 if (!clz.endsWith(";")) {
340 clz = "L" + clz.replace('.', '/') + ";";
341 }
342 int classDefsSize = readLe32(dex, 0x60);
343 int classDefsOff = readLe32(dex, 0x64);
344 for (int cn = 0; cn < classDefsSize; cn++) {
345 int classIdx = readLe32(dex, classDefsOff + cn * 32);
346 String c = readType(dex, classIdx);
347 if (clz.equals(c)) {
348 return true;
349 }
350 }
351 return false;
352 }
353
354 /**
355 * @param buf the byte array containing the whole dex file

Callers 1

getClassDeclaringDexMethod · 0.95

Calls 3

readLe32Method · 0.95
readTypeMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected