When calling JNI's GetMethodID function to obtain a jmethodID, you need to pass in a method name and method signature. The method name is the method name defined in Java. The format of the method signature is: (parameter parameter type list) return value.
1. Basic type signature
| Java | Native | Signature |
| byte | jbyte | B |
| char | jchar | C |
| double | jdouble | D |
| float | jfloat | F |
| int | jint | I |
| short | jshort | S |
| long | jlong | J |
| boolean | jboolean | Z |
| void | void | V |
2. Conversion of reference data type.
| Java | Native | Signature |
| All objects | jobject | L+classname +; |
| Class | jclass | Ljava/lang/Class; |
| String | jstring | Ljava/lang/String; |
| Throwable | jthrowable | Ljava/lang/Throwable; |
| Object[] | jobjectArray | [L+classname +; |
| byte[] | jbyteArray | [B |
| char[] | jcharArray | [C |
| double[] | jdoubleArray | [D |
| float[] | jfloatArray | [F |
| int[] | jintArray | [I |
| short[] | jshortArrsy | [S |
| long[] | jlongArray | [J |
| boolean[] | jbooleanArray | [Z |
Get signature method:
1. Spelling yourself
For example:
Method: int (int param);
Signature: (I)I
Second, the command line generation
1. Use javac to generate a class file corresponding to the java file;
2. Use the javap -s -p command to obtain the corresponding signature information, as shown in the figure:

The format of the method signature is:(parameter parameter type list) return value。 In the parameter list, the reference type starts with L, followed by the full path name of the class (you need to re...
Idle: ...
2.4.3 JNI Method Signature Rules With the correspondence between data types, JNI can correctly identify and convert Java types. How does JNI recognize Java? Java support method overloading, it is impo...
JNI verifies application signature Principle: Obtain the current signature information and whether it is consistent with the expected signature information. If it is consistent, it will pass, otherwis...
In JNI development, we often encounter the use of GetStaticMethodID method to obtain java method to achieve the purpose of calling. This method has three parameters. The first parameter is the class t...
Reference article: http://blog.csdn.net/venusic/article/details/52347316/ http://blog.csdn.net/lzj_lzj2014/article/details/73872670 Use C key data to save increasing decipherment difficulty code show ...
Recently, some knowledge about the Java JNI interface about method registration and signature, and summarized here. When using the JNI interface, we first need to declare the Java method as Native: an...
JNI gets the signature of apk MD5 jclass tem_class; jmethodID tem_method; jclass class_context = env->GetObjectClass(context); // PackageInfo localPackageInfo = context.getPackageManager() // .getP...
Get the application using Android JNI signature. Gets generated on the basis of their signature password, which prevents others decompile your own source code to query password. Source Code: https://g...
Generate java method of JNI signature javap -p -s org.jemen.test.Test signature: Class Description 'L' at the beginning and end of the character of ';' must be; Descriptor array, the beginning of the ...