|
|
Classification: |
Java |
Category: |
J2ME MIDP 2.0 |
Created: |
11/09/2004 |
Modified: |
11/11/2004 |
Number: |
FAQ-1161 |
Platform: |
Symbian OS v7.0 |
|
Question: How can I change the MIDP 2.0 security policy for the Untrusted Protection Domain on the UIQ 2.1 Emulator?
Answer: The default MIDP 2.0 security policy that ships with the UIQ 2.1 Emulator is unusually restrictive with respect to the Untrusted
Protection Domain, only allowing http and https connections to be made. Attempts to use other network protocols from untrusted MIDlets will result
in a SecurityException being thrown. This can be very frustrating for developers.
Developers can change the security policy by editing the following file (for udeb) \epoc32\release\wins\udeb\z\system\data\MIDP2\security\policy\default.dpf
First save a copy of the original file, then under
domain: **UNTRUSTED**
add in the permission you require. For instance to allow client socket connections we would add the following line
allow: javax.microedition.io.Connector.socket
So the permissions for the untrusted protection domain would now look like this
domain: **UNTRUSTED**
allow: javax.microedition.io.Connector.http allow: javax.microedition.io.Connector.https allow: javax.microedition.io.Connector.socket
Note of course that the security policy on a real phone will be set by the manufacturer and is not modifiable by the user,
although generally the policy with respect to the Untrusted Domain can be expected to be less restrictive than the default UIQ 2.1 policy, usually allowing
network connectivity with explicity user permission.
|
|
|