在 APK 文件中嵌入登录详细信息,每个用户都不同(或其他选项?) [英] Embed login details in APK file, different for each user (or other options?)

查看:15
本文介绍了在 APK 文件中嵌入登录详细信息,每个用户都不同(或其他选项?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们被要求为一家拥有现有网站和现有用户的公司在 Android 上创建瘦 Web 客户端.

We've been asked to create a thin web client on Android for a company with an existing web site, existing users.

他们想向用户发送彩信,为每个用户提供自己的下载 URL.此 URL 将指向专门为该用户创建的 Android apk 文件 - 它将包含该用户的登录名和网站密码.

They want to send an mms to their users, giving each user their own download URL. This URL will point to an Android apk file that has been created specifically for that user - it will include that user's login, and password, to the website.

即APK 文件将嵌入登录详细信息.

这将在 J2ME 中通过将信息存储在 JDK 文件中来完成.

This would be done in J2ME by storing info in the JDK file.

我可以在How to update resources file in apk<上看到一个类似的问题/a> - 但没有完全回答.

I can see a simlar question on How to update resources file in apk - but not fully answered.

所以:

  1. 有没有办法将资产"存储在 apk 文件中,该文件将是一个文本文件,并且可以通过解压缩、编辑、重新压缩 apk 文件来轻松编辑?(看起来答案是否定的)

  1. is there a way to store an "asset" in the apk file that will be a text file, and easily editable by unzipping, editing, rezipping the apk file? (looks like answer is no)

您是否知道任何类似的问题,或者是否曾开发过类似的应用程序?

do you know of any similar problems, or have worked on similar apps?

是否有关于如何最好地完成此应用程序的建议?在自动化级别上嵌入任何类型的客户信息都会引起兴趣...

is there advice on how best to accomplish this application? Any sort of embedding of customer info on an automated level would be of interest...

最好的选择是将应用程序设置为使用 Ant 脚本构建,并让客户端实际自定义源代码并为每个用户构建一个新应用程序?(这有一个缺点,即客户端获取源代码,我们宁愿没有)

would the best option be to set the app to build with an Ant script, and have the client actually customize the source code and build a new app per user? (this has the con that the client gets the source code, which we'd rather not have)

我扫描了带有 apk 标签的问题,但似乎找不到解决方案.

I have scanned apk tagged questions and can't seem to find a solution to this.

非常感谢,理查德

推荐答案

我想如果您使用 assets 文件夹,您可以将它放入 apk(或替换那里的虚拟文件).

I guess you could put it into the apk (or replace a dummy file there) if you use the assets folder for it.

您可以通过文件名而不是资源 ID 很容易地获取数据:getResources().getAssets().open(fileName)

You can obtain the data by filename instead resource-id quite easy: getResources().getAssets().open(fileName)

问候,奥利弗

这篇关于在 APK 文件中嵌入登录详细信息,每个用户都不同(或其他选项?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆