diff --git a/native/android/app/src/cpp/AESCrypto.cpp b/native/android/app/src/cpp/AESCrypto.cpp --- a/native/android/app/src/cpp/AESCrypto.cpp +++ b/native/android/app/src/cpp/AESCrypto.cpp @@ -20,7 +20,7 @@ static const auto cls = javaClassStatic(); static auto method = - cls->template getStaticMethod)>( + cls->template getStaticMethod)>( "generateKey"); method(cls, byteBuffer); } @@ -34,9 +34,9 @@ JByteBuffer::wrapBytes(sealedData.data(), sealedData.size()); static const auto cls = javaClassStatic(); static auto method = cls->template getStaticMethod, - local_ref, - local_ref)>("encrypt"); + alias_ref, + alias_ref, + alias_ref)>("encrypt"); method(cls, keyBuffer, plaintextBuffer, sealedDataBuffer); } @@ -49,9 +49,9 @@ JByteBuffer::wrapBytes(plaintext.data(), plaintext.size()); static const auto cls = javaClassStatic(); static auto method = cls->template getStaticMethod, - local_ref, - local_ref)>("decrypt"); + alias_ref, + alias_ref, + alias_ref)>("decrypt"); method(cls, keyBuffer, sealedDataBuffer, plaintextBuffer); } }; diff --git a/native/android/app/src/cpp/CommMMKV.cpp b/native/android/app/src/cpp/CommMMKV.cpp --- a/native/android/app/src/cpp/CommMMKV.cpp +++ b/native/android/app/src/cpp/CommMMKV.cpp @@ -85,7 +85,7 @@ static void removeKeys(const std::vector &keys) { static const auto cls = javaClassStatic(); static auto method = - cls->getStaticMethod>)>( + cls->getStaticMethod>)>( "removeKeys"); local_ref> keysJava = @@ -130,7 +130,7 @@ setStringSet(std::string key, const std::vector &elements) { static const auto cls = javaClassStatic(); static auto method = cls->getStaticMethod>)>("setStringSet"); + std::string, alias_ref>)>("setStringSet"); local_ref> elementsJava = JArrayClass::newArray(elements.size());