java - Given a class file, how to detect it uses JNI or not? -
i have java benchmarks class files.
i find benchmarks have jni calls.
i thought maybe can done bytecode level of javap -c
, not sure.
any ideas?
if you're allowed load class, can use reflection:
class<?> clazz = ... list<method> nativemethods = new arraylist<>(); (method m : clazz.getdelcaredmethods()) { if(modifier.isnative(m.getmodifiers())) { nativemethods.add(m); } }
Comments
Post a Comment