Netbeans 移动性中的特权操作

发布于 2024-08-10 22:30:56 字数 200 浏览 5 评论 0原文

我正在编写一个 Java ME 应用程序,它将使用特权操作(例如消息传递)。默认情况下,系统会提示用户确认每个操作,但我想将其作为后台服务运行。

文档说要在 jad 文件中请求许可,我已经这样做了,并假设它可以在设备上运行。不过,我想首先在 Netbeans 移动模拟器上测试一下。

我尝试将应用程序签名为“受信任”,但我的模拟执行仍然提示用户授予许可。

I'm writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background service.

Documentation says to request permission in the jad file, I have done so and presume it will work on a device. However I would like to test this on the Netbeans mobility emulator first.

I tried signing the app as "trusted" but my emulated execution still prompts the user for permission.

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

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

发布评论

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

评论(1

窝囊感情。 2024-08-17 22:30:56

MIDP 安全模型需要分两部分进行解释:

电话(或模拟器)包含安全策略。
安全策略由多个域组成。
每个域定义功能组和根证书。
功能组决定哪些保护选项(始终自动同意、始终用户同意、用户一次同意...)在受保护的 API(即消息传递)的域中可用。

适用于您的 MIDlet 的域取决于哪个根证书信任您为 MIDlet 签名所使用的证书。

您的问题是,您认为您的 MIDlet 所属域中所需的 API 的保护选项与模拟器安全策略中实际定义的内容不匹配。

编辑:

基于 WTK 的模拟器的操作方法:

${netbeans_installation_folder}\mobility8\WTK2.5.2\j2mewtk_template\appdb\ 中有 3 个 _policy.txt* 文件文件夹。

它们各自包含“别名”定义列表和“域”定义列表。

使每个域具有与“最大”域相同的内容。

此后,您的模拟器将不再请求任何用户权限

如果您已经使用过 Netbeans 中包含的模拟器,则可能需要对 ${netbeans_installation_folder}\mobility8\WTK2.5.2\appdb\ 文件夹进行相同的更改。

The MIDP security model needs to be explained in 2 parts:

The phone (or the emulator) contains a security policy.
The security policy is made of several domains.
each domain defines function groups and root certificates.
a function group decides which protection options (auto agree always, user agree always, user agree once...) are available in the domain for which protected API (i.e. messaging).

The domain that applies to your MIDlet depends on which of the root certificates trusts the certificate you signed your MIDlet with.

Your problem is that there is a mismatch between what you think the protection options should be for the API you want in the domain you think your MIDlet belongs too and what is actually defined in the emulator security policy.

EDIT:

how-to for WTK-based emulators:

There are 3 _policy.txt* files in the ${netbeans_installation_folder}\mobility8\WTK2.5.2\j2mewtk_template\appdb\ folder.

They each contain a list of "alias" definitions and a list of "domain" definitions.

Make every domain have the same content as the "maximum" domain.

After this, Your emulator will never again ask for any user permission.

If you have already used the emulator contained in Netbeans, you probably want to make the same changes to the ${netbeans_installation_folder}\mobility8\WTK2.5.2\appdb\ folder.

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