netbeans移动性中的特权操作 [英] Privileged operations in netbeans mobility

查看:160
本文介绍了netbeans移动性中的特权操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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.

我尝试将应用程序签名为受信任但我的模拟执行仍然会提示用户许可。 / p>

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

推荐答案

MIDP安全模型需要分为两部分来解释:

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

手机(或模拟器)包含安全策略。

安全策略由多个域组成。

每个域定义功能组和根证书。

a函数组决定哪些保护选项(始终自动同意,用户始终同意,用户同意一次......)在受保护API(即消息传递)的域中可用。

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).

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

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

您的问题是两者之间存在不匹配您认为保护选项应该是您想要的域中的API你的MIDlet也属于nk以及模拟器安全策略中实际定义的内容。

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.

编辑:

如何 - 对于基于WTK的仿真器:

how-to for WTK-based emulators:

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

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.

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

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.

这篇关于netbeans移动性中的特权操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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