Skip to content

Commit

Permalink
Stability fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hozuki committed Apr 17, 2020
1 parent 9ef4cbe commit 8ea33ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/jni/modules/kawashima/HcaCipherConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ void ApplyCipherConfigObject(JNIEnv *env, jobject config, HCA_CIPHER_CONFIG &cfg

{
auto cipherTypeClass = env->FindClass(jni::cgss_class_names::HcaCipherType_Path);
jni::checkClassInJava(env, cipherTypeClass, jni::cgss_class_names::HcaCipherType_Name);

auto valueMethodSignature = jni::signature::param_types >> jni::signature::return_type >> jni::signature::jint >> jni::signature::to_string;
auto valueMethodId = env->GetMethodID(cipherTypeClass, "value", valueMethodSignature.c_str());
jni::checkMethodInJava(env, valueMethodId, jni::cgss_class_names::HcaCipherType_Name, "value");

auto cipherTypeValue = env->CallIntMethod(cipherType, valueMethodId);

cfg.cipherType = static_cast<CGSS_HCA_CIPHER_TYPE>(cipherTypeValue);
Expand Down
3 changes: 3 additions & 0 deletions src/lib/jni/modules/kawashima/HcaDecoderConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ void ApplyDecoderConfigObject(JNIEnv *env, jobject config, HCA_DECODER_CONFIG &c

if (decodeFunc != nullptr) {
auto decodeFuncClass = env->FindClass(jni::cgss_class_names::HcaDecodeFunction_Path);
jni::checkClassInJava(env, decodeFuncClass, jni::cgss_class_names::HcaDecodeFunction_Name);

auto valueMethodSignature = jni::signature::param_types >> jni::signature::return_type >> jni::signature::jint >> jni::signature::to_string;
auto valueMethodId = env->GetMethodID(decodeFuncClass, "value", valueMethodSignature.c_str());
jni::checkMethodInJava(env, valueMethodId, jni::cgss_class_names::HcaDecodeFunction_Name, "value");

auto decodeFuncValue = env->CallIntMethod(decodeFunc, valueMethodId);

Expand Down

0 comments on commit 8ea33ad

Please sign in to comment.