Android JNI string encryption/decryption
问题 I am trying to do aes encryption/decryption in native code C. Encryption does work but when I try to decrypt the string. It doesn't end up as original string. Here is the JNI method which does encrypt/decrpt based on mode param: jbyteArray Java_com_example_hellojni_HelloJni_encrypt( JNIEnv* env, jobject this, jbyteArray srcData, jint mode) { // get length of bytes int srcLen=(*env)->GetArrayLength(env,srcData); //convert jbyteArray to byte [] jbyte data[srcLen]; (*env)->GetByteArrayRegion(env