English 中文(简体)
Privileged operations in netbeans mobility
原标题:

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.

最佳回答

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}mobility8WTK2.5.2j2mewtk_templateappdb 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}mobility8WTK2.5.2appdb folder.

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签