如何在 Android 应用代码中使用由 PHP 创建的托管 URL(API)进行加密

huangapple go评论46阅读模式
英文:

How to encrypt hosting URL (API) which created in php using in android app code

问题

抱歉,由于您要求只返回翻译好的部分,我将只提供翻译后的内容:

我想要加密存储在 Android APK 中的文本文件中的纯文本 URL。我目前将我的 URL 保存为文件中的字符串。通过这些 URL,我正在从 MySQL 数据库中加载数据。结构如下:

String url = "http://faazani.com"/api

然而,我希望在使用这些 URL 时对其进行加密。如果有人从 APK 文件中提取这些 URL,他们将会知道我们托管 API 的位置。我希望保密这一点。

因为这对我来说是一个严重的问题,我会非常感谢任何帮助。

英文:

I want to encrypt plain text URLs in a text file which is embedded in an Android APK. I am currently saving my URLs in as Strings in that file. With these URLs I am loading data from a MySQL database. The structure is as follows:

String url="http://faazani.com"/api

However, I want to encrypt the URL while using it. If someone extracted these URLs from the APK file, they would know where we host the API. I want to keep this a secret.

As this is a serious issue for me, I'd appreciate any help.

答案1

得分: 1

很少有理由为 Android 应用加密 URL。

任何人都可以对您的应用进行反编译,查看您是如何解密它的,如果他们愿意的话,这只是您的担忧之一,因为任何人通常都可以设置调试代理,监视从您的应用程序发出并返回到您的服务器的流量,并查看 URL。

您的 Web API 需要具有安全控制,如果某人仅知道您的 URL 就会导致安全问题,那么与 Android 应用无关,您已经出现了问题。

英文:

There's very little reason to encrypt a URL for an Android App

Anyone can decompile your app and see what you're doing to decrypt it, if they wanted, which is the least of your worries, since anyone can usually setup a debugging proxy and watch the traffic from your app go to your server and back, and see the URL.

Your web API needs to have security controls, if someone simply knowing your URL is a concern for security, you've already got problems, independent of the android app.

huangapple
  • 本文由 发表于 2020年10月20日 20:06:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/64444809.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定