我有一个使用J2ME发送SMS的应用程序,我生成一个JAR文件和一个签名的JAD文件,我可以使用JAR文件安装和运行我的应用程序,但是我得到了“不受信任的midlet”消息,我可以' t发送短信,当我尝试时,我得到这个例外:wma : open denied
。
当我尝试使用JAD文件安装应用程序时,我收到错误消息“身份验证失败”,此文件是使用netbeans创建的,这是它的内容:
MIDlet-1: smsapp,/res/smsapp.png,ptfs.smsapp
MIDlet-Certificate-1-1: MIIBmzCCAQSgAwIBAgIET6fZJzANBgkqh.....
MIDlet-Jar-RSA-SHA1: Pd68O3nDyskfRQHeAo......
MIDlet-Jar-Size: 765890
MIDlet-Jar-URL: smsapp.jar
MIDlet-Name: smsapp
MIDlet-Permissions: javax.wireless.messaging.sms.send
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
这是我发送短信的代码:
MessageConnection mc;
String addr = "sms://6666";
try{
mc = (MessageConnection)Connector.open(addr);
}catch(Exception e){
return;
}
try{
TextMessage textmessage = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE);
textmessage.setAddress(addr);
textmessage.setPayloadText(smsContent.getText());
mc.send(textmessage);
}catch(Exception e){
return;
}
try{
if(mc != null)
mc.close();
}catch(Exception e){
}
我正在使用LG VU手机。
答案 0 :(得分:2)
使用免费服务@ http://www.j2start.com/p/sign-your-midlet.html,而不是使用NetBeans对其进行签名,您可以使用手机接受的证书对其进行签名。
答案 1 :(得分:1)
我一直说,有人请拍James Gosling! 无论如何,远离那个,我遇到了很多这些问题,遗憾的是从来没有一个简单的方法可以解决。
真正的MIDlet通常会有3-4个证书。您的只有1.在早期版本的Symbian上存在一个已知问题,允许您在手机上安装自己的定制证书,但如果您的目标是真实设备,则应该避免这种情况。 N / B:在签名时,请确保摆脱第4张证书,因为这会使旧手机型号瘫痪。 P / S:同样使用一组反复试验,一些请求的权限应该标记为“可选”。
以下是一个工作签名JAD文件的示例,以指导您。
MIDlet-1: MetaDataControl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ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
MIDlet-Jar-RSA-SHA1: g06Q83fr8h4hhqazd3jOThNORFlhWVo3lu+VzRv8aaEtQrMYkvZXR6fsKyNm7yR5+XaLYQ03F9yDMCOu2ZdAyScwmfzmnhtMLzT9cKJ8rq8hvYH4K9Q9j0iTUijnUJ7mEpWbJTYVQ858Ln6yyJerwk8hKAi++tsdlMwLv3gmq3W/QrnEDmT8vexBtBjhWOJTxkaNp89vb9gfa3bCg4pOYsEYoOLrHglXBkt0dy/IEnkxpUaCihBf7S+rUaZo0Y+Q8/qqadRl8khkzhpDyONSXzT4QKogA3nC0nAh4wKh3DTgxeSzZax57+QESCAfRaDExH2Oksu+ULVpgckoq+7Kmw==
MIDlet-Jar-Size: 9772
MIDlet-Jar-URL: SoundByte.jar
MIDlet-Name: SoundByte
MIDlet-Permissions: javax.microedition.io.Connector.comm, javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write, javax.microedition.media.control.RecordControl
MIDlet-Permissions-Opt: javax.microedition.content.ContentHandler
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0