将访问密钥和机密导入 Android 设备

发布于 2024-10-24 05:58:39 字数 381 浏览 4 评论 0原文

我有一款应用可以将您喜欢的内容保存到 Google Storage for Developers。当然,假设您有一个帐户和关联的访问密钥。他们基于网络的密钥管理工具允许您创建密钥和相关的秘密。我的问题是关于用户如何最轻松地将它们安装在我的应用程序副本中,从而允许他们使用云存储。

密钥是 20 个字符的字母数字字符串,关联的秘密是 40 个字符的 Base-64 编码字符串。用户手动输入这些显然是不切实际的。对我来说,跨活动进行剪切和粘贴似乎很尴尬。您如何建议将两个字符串从网页获取到两个活动 EditText 字段 - 或者到我可以读取然后处理的 tmp 文件 - 或者?

谢谢。

I've got an app that can save stuff you like to Google Storage for Developers. Assuming, of course, that you have an account and associated access keys. Their web based key management tool allows you to create keys and associated secrets. My question is regarding how a user can most easily install these in their copy of my app, allowing them to use the cloud storage.

A key is a 20 character alphanumeric string, and an associated secret is a 40 character Base-64 encoded string. It is clearly impractical for the user to enter these manually. Cut and paste across activities seems way awkward to me. How do you suggest getting two strings from a web page to two activity EditText fields - or to a tmp file I can read and then dispose - or ??

thanks.

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

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

发布评论

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

评论(3

时光沙漏 2024-10-31 05:58:40

如果您有权访问网页,则存在这些值,您可以下载它、解析并获取这些值。

If you have access to a web page, there are these values are residing, you can download it, parse, and get these values.

陪我终i 2024-10-31 05:58:40

由于 Google 似乎没有提供专门用于获取密钥的 API,因此您最好的选择可能是使用 HTTP GET 来提取包含密钥和秘密密钥的网页。

如果您需要通过 Google 进行身份验证才能执行此操作(大概您必须这样做),您可以使用 SignPost 处理 OAuth 并发出安全的 HTTP 请求。拉出页面后,解析 HttpResponse 内容并将密钥存储在文本文件或 SharedPreferences 文件中。

Since it doesn't look like Google provides an API specifically for getting keys, your best bet would probably be to use an HTTP GET to pull the web page containing the keys and secret keys.

If you need to be authenticated with Google to do this (presumably you'd have to be), you could use SignPost to handle OAuth and make secure HTTP requests. After you pull the page, parse through the HttpResponse content and store the keys in a text file or a SharedPreferences file.

意中人 2024-10-31 05:58:39

最好的方法是使用 Google 的 API

The best way to go about it would be the API from Google

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