Is it possible to access Dalvik VM from native code

后端 未结 1 1370
清歌不尽
清歌不尽 2021-01-24 02:06

I\'d like to be able to target the Dalvik VM using native code in Android. This means using native classes that are listed in platform/dalvik under android sources repositories.

相关标签:
1条回答
  • 2021-01-24 02:41

    You can use JNI FindClass() to find any private class of the framework, and find and call its methods the usual JNI way. But dvmLockObject() is not a method of Sync class. It is part of the dalvik native libraries. You can call it as a usual C function from your code. You will link to libdvm.so, as to any other system library.

    But I don't know what useful purpose there can be in calling this function.

    0 讨论(0)
提交回复
热议问题