Obtain the domain and method descriptor of NDK development, and develop ndk
In the two blogs: calling methods for NDK development and accessing domains for NDK development, we need a parameter called descriptor when obtaining the domain ID and method ID, in actual development, how do we know the descriptor of the domain or method we want to call?
A simple method is to use the javap Command provided by Java.
The Java class file disassembly program in the command line mode provided by JDK is called javap. This tool can extract the domain and method descriptor from the compiled file.
Usage:
On the cmd command line, first go to the main directory of the current project:
Javap operates on compiled Java class files. It has two parameters, indicating the location of the compiled class and the name of the Java class to be decompiled.-p indicates that all classes and members are displayed, -s indicates the output internal type signature. The format is as follows:
Javap-classpath bin/classes-p-s com. example. jni. MainActivity
The javap tool decomassembles the com. example. jni. MainActivty file and signs the output domain or method.
All the fields or method descriptors can be obtained in this simple way.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. I am very grateful if you have any mistakes.