(byte[] dex, String clz)
| 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 |
no test coverage detected