当前页面: 开发资料首页 → J2ME 专题 → Signing a midlet suite的讨论稿[J2ME]
摘要: Signing a midlet suite的讨论稿[J2ME]
发起者:郑昀(zhengyun_ustc)
很多人都想知道怎么让自己的MIDlet访问网络啦、发送短信啦都能够不弹出烦人的警告框。
单纯回答说“你必须去Versign购买一个证书,或者找厂商签名”之类的话,也是让人不知道该如何具体操作的,还是懵懵懂懂的。
所以,下面我们试图聚合各位,一起参透这个话题:
如何签名?
找谁签名?
到底如何操作?
能不能自己给自己签名?
David Hayes在他的Blog中提到了一个办法,毫无疑问,他是试验成功了的。
他给出了一个《MIDlet jar signing (a tutorial) ,
http://www.spindriftpages.net/pebble/dave/2005/06/20/1119275880301.html 》,文后的评论中,他还补充说了“经过这样的签名后,你必须通过OTA方式或者其他方式,让手机安装签名后的JAD,而不是仅仅通过上传JAR来安装。只有通过JAD安装方式,这种签名才会奏效”。
不幸的是,我试验不出来。签名之后,JAD中倒是多了这么一段:
MIDlet-Certificate-1-1
MIDlet-Certificate-1-1: MIICTjCCAbcCBEQ06RcwDQYJKoZIhvcNAQEE。。。blabla
而且我的jar包中的MIMESMSSender.jar\META-INF文件夹下,也多了ZHENGYUN.RSA和ZHENGYUN.SF两个文件;MANIFEST.MF文件中也多了很多这样的东西:
MIDlet-Certificate-1-1
Name: res/icons/logo.png
SHA1-Digest: 7waVS61BFIfNrpz8/CeyuskUGuU=
Name: res/icons/exit.png
SHA1-Digest: L+8Kb/TeuRUpWsq5qrU9epu5Srw=
但是都没用。
有的网友说这个方法在手机上安装,遇到了“Authorisation Failed”错误提示,而David说
<table class="MsoNormalTable" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: auto auto auto 5.75pt; BORDER-LEFT: medium none; WIDTH: 94.9%; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid white .5pt; mso-yfti-tbllook: 480; mso-padding-alt: .7pt 5.75pt .7pt 5.75pt; mso-border-insideh: .5pt solid white; mso-border-insidev: .5pt solid white" cellspacing="0" cellpadding="0" width="94%" border="1"> <tr style="HEIGHT: 10.9pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"> <td style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.75pt; BORDER-TOP: white 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: #9faccb; PADDING-BOTTOM: 0.7pt; BORDER-LEFT: white 1pt solid; WIDTH: 405pt; PADDING-TOP: 0.7pt; BORDER-BOTTOM: white 1pt solid; HEIGHT: 10.9pt; mso-border-top-alt: solid white .5pt; mso-border-left-alt: solid white .5pt; mso-border-bottom-alt: solid white .5pt" valign="top" width="540">Authorisation Failed
I've seen Authorisation Failed a few times now. Typically rebooting the phone (and taking the battery out0 fixes it for me. I'ver heard that linebreaks in the permissions attribute in the Manifest can cause problems but it seems ok to me on 6680/6630/6230i(could be firmware dependent?). Maybe you should try a shorter permission string?
Other things I have heard cause problems MIDlet-Permissions contains permissions that the phone doesn't support?
。
请阅读
https://motocoder.custhelp.com/cgi-bin/motocoder.cfg/php/enduser/std_adp.php?p_faqid=442&p_created=1092167721 上的这段话,看来,如果想使用摩托罗拉的受限制API的话,那么就不能自己签名,只能和他们谈生意了。
<table class="MsoNormalTable" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: auto auto auto 5.75pt; BORDER-LEFT: medium none; WIDTH: 94.9%; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid white .5pt; mso-yfti-tbllook: 480; mso-padding-alt: .7pt 5.75pt .7pt 5.75pt; mso-border-insideh: .5pt solid white; mso-border-insidev: .5pt solid white" cellspacing="0" cellpadding="0" width="94%" border="1"> <tr style="HEIGHT: 10.9pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"> <td style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.75pt; BORDER-TOP: white 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: #9faccb; PADDING-BOTTOM: 0.7pt; BORDER-LEFT: white 1pt solid; WIDTH: 405pt; PADDING-TOP: 0.7pt; BORDER-BOTTOM: white 1pt solid; HEIGHT: 10.9pt; mso-border-top-alt: solid white .5pt; mso-border-left-alt: solid white .5pt; mso-border-bottom-alt: solid white .5pt" valign="top" width="540">论坛贴子之摘录
Signing a midlet suite
Question:
We have purchased a code signing certificate from verisign to sign our midlet.
However it does not appear to work.
The certificate we received back from verisign is a chain of certificates. Can you look at the certificate and tell me if it should work i.e. is the root CA for the cert on the phone. If I need to add additional 'Midlet-Certificate' entries in the jad can you please advise on what they should be.
Answer:
The issue is that you can not purchase a certificate through Verisign or any other Authority and sign the midlet yourself - it will not work.
You need to go through Motorola in order to get this done, but it will only be done if there is a business relationship with Motorola and your company.
也就是说,摩托罗拉的策略是,他的手机不允许你自己签名!而必须通过摩托罗拉自己来做。