From bd74375bef2a618624c77d8be1bc0354460a502a Mon Sep 17 00:00:00 2001 From: Mason Le <43195241+masonle2x2@users.noreply.github.com> Date: Sat, 4 Nov 2023 13:35:35 +0700 Subject: [PATCH] fix: android build and types.ts --- android/build.gradle | 1 + src/util/common.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 7d07aae..a949b0b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -156,6 +156,7 @@ android { "**/libc++_shared.so", "**/libfbjni.so", "**/libreactnativejni.so", + "**/libcrypto.so", "**/libjsi.so", "**/libreact_nativemodule_core.so", "**/libturbomodulejsijni.so", diff --git a/src/util/common.js b/src/util/common.js index 4f26e10..f10366c 100644 --- a/src/util/common.js +++ b/src/util/common.js @@ -70,12 +70,20 @@ module.exports.genTSType = (allKeys) => { Object.keys(allKeys?.public ?? {}).forEach((key) => { result += `\n ${key}: string;`; }); - result += '\n [key: string]: string;\n};\n\n'; + if(!allKeys?.public) { + result += '\n [key: string]: string;\n};\n\n'; + } else { + result += '\n};\n\n'; + } result += 'export type KeyTurboSecuredType = {'; Object.keys(allKeys?.secure ?? {}).forEach((key) => { result += `\n ${key}: string;`; }); - result += '\n[key: string]: string;\n};\n'; + if(!allKeys?.secure) { + result += '\n [key: string]: string;\n};\n\n'; + } else { + result += '\n};\n\n'; + } fs.outputFileSync(path.join(SRC_PATH, 'type.ts'), result); };