如何保护React Native中的密钥库密码?

发布于 2025-02-05 12:26:23 字数 70 浏览 2 评论 0原文

谁能帮助我将Keystone密码存储在React Native中。我如何确定它的安全?如何保护其免受反向工程的侵害,还是安全?

can anyone help me with storing the keystone password in react native. How can I be sure that its safe? how to protect it from reverse engineering or is it safe?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我不吻晚风 2025-02-12 12:26:24

您可以将密码存储在签名属性文件中,该文件未投入使用Git Repo。 中读取文件中的密码,

// Load keystore
def keystorePropertiesFile = rootProject.file("signing.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

signingConfigs {
    release {
      storeFile file(keystoreProperties['storeFile'])
      storePassword keystoreProperties['storePassword']
      keyAlias keystoreProperties['keyAlias']
      keyPassword keystoreProperties['keyPassword']
    }
    ...

然后,您可以从android/app/build.gradle signing.properties示例

storeFile=/home/userName/Workspace/repoName/android/keystores/qa.keystore
storePassword=-----------------------
keyPassword=-----------------------
keyAlias=-----------------------

示例我将我的signing.properties文件放入我的react-native repo中的android文件夹中

添加以下行到您的.gitignore

android/signing.properties

You can store the password in a signing properties file which is not committed to your git repo. Then you can read the password from the file as below in android/app/build.gradle

// Load keystore
def keystorePropertiesFile = rootProject.file("signing.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

signingConfigs {
    release {
      storeFile file(keystoreProperties['storeFile'])
      storePassword keystoreProperties['storePassword']
      keyAlias keystoreProperties['keyAlias']
      keyPassword keystoreProperties['keyPassword']
    }
    ...

signing.properties example

storeFile=/home/userName/Workspace/repoName/android/keystores/qa.keystore
storePassword=-----------------------
keyPassword=-----------------------
keyAlias=-----------------------

I place my signing.properties file in android folder within my react-native repo

add the following line to your .gitignore

android/signing.properties
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文