gpt4 book ai didi

java - 在 Android 应用程序中存储 MongoDB 数据库凭据

转载 作者:行者123 更新时间:2023-12-04 10:37:49 25 4
gpt4 key购买 nike

我开发了一个 android 应用程序,它直接与 MongoDB 交互以插入和获取数据。

我将凭据存储在我在应用程序中读取的 android 应用程序的配置文件中。

mongoDBConnection:
credentials:
username: "test"
password: "test"

database: "admin"
connectionString: "mongodb://localhost:27017"

该应用程序安装在手机上时按预期工作,我担心的是,如果我发布该应用程序,任何人都可以反编译该应用程序并取回凭据吗?

为了解决这个问题,Android 应用程序可以与后端进行交互,后端将请求路由到 mongoDB,并且 Monogo 凭据存储在该后端中。

我想在实现后端之前获取有关是否需要后端的输入,或者 android 应用程序本身是否有任何方法可以存储凭据,以便在反编译时不会暴露?

最佳答案

if I ship the app can anyone decompile the app and retrieve the credentials back?



是的。

is there any way in android app itself to store the credentials such that it does not get exposed when decompiled?



不,这是不可能的。您可以混淆它们以使其更难,但如果应用程序具有它们,则不可能阻止足够熟练/坚定的攻击者检索它们。

To solve the issue, the android app can interact with a backend which will route requests to mongoDB and monogo credential are stored in that backend.



这是唯一的方法,也是正确的解决方案。

关于java - 在 Android 应用程序中存储 MongoDB 数据库凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60085261/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com