Adobe AIR 系统范围的存储

发布于 2024-11-17 20:25:20 字数 529 浏览 0 评论 0原文

我正在开发一个 AIR 应用程序,该应用程序将有一个免费的基本版本和一个使用许可证密钥解锁的更高级的付费版本。理想情况下,一旦输入许可证密钥,我希望它能够为计算机的所有用户解锁应用程序。

但是,我无法找到合适的系统范围位置来存储许可证密钥文件。 File 类中的所有预配置位置(例如File.applicationStorageDirectory)都是用户特定的或只读的。

AIR 中是否有一个标准的系统范围位置可以存储此类内容?如果不是文件系统,也许是共享对象、SQLite 或加密的本地存储?如果做不到这一点,每个系统(Windows、Mac、Linux)上是否有我可以硬编码并保证所有用户可写的标准位置?由于无法访问任何环境变量,最后一个选项变得更加困难。

如果一切都失败了,我想我可以要求每个用户解锁该应用程序,但这听起来不像是让客户满意的秘诀(“你的意思是我必须购买两次才能让我的妻子使用它?我们只有一台电脑!”)。

(好吧,是的,如果是针对每个用户,我可能会让一把钥匙解锁应用程序 3 或 4 次,以示友善,但用户多次激活仍然不太方便)。

I'm working on an AIR app that will have a free basic version and a more advanced paid version that's unlocked with a license key. Ideally once a license key is entered I'd like it to unlock the application for all users of the computer.

However, I haven't been able to find a suitable system-wide location for storing the license key file. All of the preconfigured locations in the File class (e.g. File.applicationStorageDirectory) are either user-specific or read-only.

Is there a standard system-wide location in AIR where I can store things like this? If not the file system, maybe shared objects, or SQLite, or the encrypted local store? Failing that, are there standard locations on each system (Windows, Mac, Linux) that I could hardcode that are guaranteed to be writable by all users? The last option is made more difficult by the lack of access to any environment variables.

If all else fails I guess I could just require the application to be unlocked per-user, but that doesn't sound like a recipe for happy customers ("What do you mean I have to buy it twice for my wife to use it? We only have one computer!").

(Okay, yes, it it's per-user I'll probably let one key unlock the app 3 or 4 times to be nice about it, but it's still less convenient for the user to activate multiple times).

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

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

发布评论

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

评论(1

顾铮苏瑾 2024-11-24 20:25:20

您可以使用系统范围内且可写的文字路径选择自己的位置,例如:

//windows:
new File("C:\whatever ...");

//mac:
new File("/System/whatever ...");

flash.fileSystem.File(IE:File.desktopDirectory)为开发人员提供了便利,因为这些目录很常见,但在不同平台上有所不同每个系统,但您不限于使用它们。

但是,您必须了解这些目录并将其硬编码到您的代码中,这可能很危险,因为这些目录可能不存在于用户计算机上,或者他们可能需要管理权限才能写入这些目录等。

我建议您只需每次安装应用程序时,将密钥存储在 File.applicationStorageDirectory 中,但可能会在每个购买的密钥中包含一个用户限制书面许可证。

如今,使用许可密钥,您的目标只能是让诚实的客户保持诚实,而不是阻止黑客的努力。对于 ActionScript 3.0 / AIR 来说尤其如此,因为代码将被公开(除非您使用像 SecureSWF< /a>)

如果您想简化销售过程,还可以使用 Adobe InMarket 应用。

出于好奇,如果您不介意详细说明的话,您在做什么?

you can choose your own location using literal paths that could be system wide and writable, for example:

//windows:
new File("C:\whatever ...");

//mac:
new File("/System/whatever ...");

the available directories in flash.fileSystem.File (IE: File.desktopDirectory) are conveniences for developers since these directories are common to use and different on each system, but you are not limited to using them.

you will, however, have to know of and hardcode these directories into your code, which could be dangerous since these directories may not exist on the users computer or they may need administrative privileges to write to these directories, etc.

i suggest that you simply store the key in the File.applicationStorageDirectory for each install of your application, but perhaps include a user-limit written license with each purchased key.

with licensing keys these days your goal can only be to keep honest customers honest, not thwart the efforts of hackers. this is especially true with ActionScript 3.0 / AIR, since the code is going to be exposed (unless you are using an obfuscater like SecureSWF)

there's also the Adobe InMarket if you want to simplify the process of selling your application.

out of curiosity, what are you working on, if you don't mind elaborating.

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