From 688ddff680814dccb71c435993786cefb92d39d1 Mon Sep 17 00:00:00 2001 From: DatLag Date: Mon, 9 Dec 2024 19:23:15 +0100 Subject: [PATCH] fix generated jni code --- .../datlag/sekret/gradle/generator/native/NativeJNIGenerator.kt | 2 +- .../datlag/sekret/gradle/generator/nonNative/JNIGenerator.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/native/NativeJNIGenerator.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/native/NativeJNIGenerator.kt index 5a62887..d6b9267 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/native/NativeJNIGenerator.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/native/NativeJNIGenerator.kt @@ -45,7 +45,7 @@ class NativeJNIGenerator( .addAnnotation(Utils.optInAnnotation(C.experimentalForeignApi, C.experimentalNativeApi)) .addAnnotation( AnnotationSpec.builder(C.cname) - .addMember("%S", "Java_${Utils.packageNameCSave(settings.packageName)}_Sekret__${key}Encrypted") + .addMember("%S", "Java_${Utils.packageNameCSave(settings.packageName)}_Sekret__1${key}Encrypted") .build() ) .addParameter("env", C.pointer.parameterizedBy(JNI.jniEnvVar(JNI_PACKAGE_NAME))) diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/nonNative/JNIGenerator.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/nonNative/JNIGenerator.kt index d9b81e5..4643dde 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/nonNative/JNIGenerator.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/nonNative/JNIGenerator.kt @@ -79,7 +79,7 @@ class JNIGenerator( .addAnnotation(JvmStatic::class) .addModifiers(KModifier.PRIVATE) .returns(Utils.encryptedSecret.copy(nullable = true)) - .addStatement("return _${key}Encrypted()?.let(%L)", Utils.encryptedSecret.member("invoke")) + .addStatement("return _${key}Encrypted()?.let(%L)", Utils.encryptedSecret.member("invoke").reference()) .build() ) }