×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Need help with signing a midlet: something is wrong

    Hello, I really need help.

    I bought a Thawte Java Code Signing certificate (primarily to facilitate Connector.http API, which is restricted on some phones). I tested the signed midlet on 3 brand new devices, by installing it OTA (using JAD-JAR pair). The results are quite depressing.

    Nokia6301 fails (with code "909 Application authentication failure"), Motorola MOT-E8 fails (909 Application authentication failure) and SonyEricsson TM506 fails (905 Attribute Mismatch). All 3 devices are from T-Mobile USA.

    I know that both Nokia6301 and SE TM506 have Thawte Code Signing certificate installed (checked by going to "Security" section) and active. The time is current on these phones.

    I have tested my certificate by signing an applet (using command line tools) - it works fine, showing me the company info, etc, in the browser when I launch the applet. I used NetBeans 6.0 IDE to sign the midlet (I also tried command line tools with the same result). There are no warnings or errors during the signing.

    The SonyEricsson phone actually has a certificate "review" in the browser. I can see the certificate details, including the "fingerprint code" (it matches what I can print with keytool -v -list command). Still, I get 905 Error when it's done downloading the JAR file.

    The Nokia6301 shows "Certificate not on phone or SIM" message. Which is different from SonyEricsson TM506 behavior.

    The midlet installs successfully on both phones if I don't sign it. But it is untrusted then.

    Here's the JAD (midlet/website names are modified):

    MIDlet-1: MyApp,/icons/icon29.png,MainClass
    MIDlet-Certificate-1-1: MIIDKzCC...
    MIDlet-Certificate-1-2: MIIDTjCC...
    MIDlet-Certificate-1-3: MIIDJzCC...
    MIDlet-Data-Size: 500
    MIDlet-Description: MyApp - light
    MIDlet-Icon: /icons/icon29.png
    MIDlet-Info-URL: http://mywebsite.net
    MIDlet-Install-Notify: http://www.mywebsite.net/notify.php?action=I
    MIDlet-Jar-RSA-SHA1: d9eD/K+OGO7EfQCgv...
    MIDlet-Jar-Size: 112513
    MIDlet-Jar-URL: http://mywebsite.net/bin/MyApp.jar
    MIDlet-Name: MyApp
    MIDlet-Permissions: javax.microedition.io.Connector.http
    MIDlet-Vendor: mywebsite.net
    MIDlet-Version: 1.8.3
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0

    What is it I am doing wrong? I tried removing Java obfuscation, removing optimization, setting the Securiy Domain to "trusted" in NetBeans IDE, all in vain. Exactly the same error.

    I would greatly appreciate your help.
    Yuriy
    Last edited by Yuriy; 2008-11-29 at 07:37.

  2. #2
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Need help with signing a midlet: something is wrong

    I took this from the JSR118 specification:

    If the mandatory attributes in the descriptor "MIDlet-Name", "MIDlet-Version", and
    "MIDlet-Vendor" do not match those in the JAR manifest, the device MUST return Status Code

    If the MIDlet suite is trusted, then the values in the application descriptor for MIDlet-* attributes
    MUST be identical to the corresponding attribute values in the Manifest. If not, the device MUST
    return Status Code 905 in the Status Report.
    Check that out and try again
    :Ruben

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: Need help with signing a midlet: something is wrong

    I checked the manifest file, all these attributes are matching exactly to what's in JAD. I am not editing them manually or anything like this, I just let NetBeans do the job. Both manifest and JAD/JAR have the same timestamp. I tried removing spaces in the Midlet-Description (see how it shows "MyApp - light" in my post), thinking it might be spaces. No, no luck. The NetBeasns is placing manifest file under /build sub-directory of the project. The JAD/JAR are outputed in /dist sub-directory. But I am guessing it's how it is supposed to be. I did not have any of those 909/905 codes prior to signing (and I've been distributing the midlet OTA for quite some time now, unsigned).

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Location
    Ahmedabad
    Posts
    254

    Re: Need help with signing a midlet: something is wrong

    Hi,

    First of all make sure the handsets your are testing has Thawte root certificate. If it doesn't then you won't be able to install the midlet. Whichever certificate you purchase will only work if the handset has the root certificate for that.

    Hope this may help you.
    Sunil
    Mobile Application Developer

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: Need help with signing a midlet: something is wrong

    Yes, they have them, it's in my original post:

    I know that both Nokia6301 and SE TM506 have Thawte Code Signing certificate installed (checked by going to "Security" section) and active. The time is current on these phones.

  6. #6
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Need help with signing a midlet: something is wrong

    One more thing

    Check that

    Code:
    MIDlet-Jar-Size: 112513
    is really addressing the right size of the jar file .
    :Ruben

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: Need help with signing a midlet: something is wrong

    Yes, checked a number of times. It's actual file size, not "size on disk". Checked also MIME types for JAR/JAD on the server, tried both wap and html pages to get the application from. I now ran out of things to try.

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: Need help with signing a midlet: something is wrong

    Okay, I managed to narrow it down.

    It has something to do with MIDlet-Install-Notify property.

    When I remove this property (using NetBeans IDE) it works. The signed midlet installs and it's given the "trusted" level. I am using the SonyEricsson phone (this is the only one I have immediate access to). I still have to try it on Nokia to be sure.

    That said, I have no clue why MIDlet-Install-Notify would cause this. Here's my "original property":

    http://www.mywebsite.net/notify.php?...=I&key=Regular

    It worked fine when unsigned midlets, the notify.php script just shoots me an email when someone installs the app, that's it. No other output (like echo commands or anything).

    The reason I tried removing MIDlet-Install-Notify was it contained those equal signs ('=') in the URL. And the signature lines in JAD also end up in equal signs (I guess it's a convention). So I tried it, not really expecting it would change anything.

    After I found it, I also tried removing the equal signs from the URL but keeping the MIDlet-Install-Notify, like this:

    http://www.mywebsite.net/notify.php

    But it still fails then.

    Now as I have some clue about what's causing the error, can someone tell me why MIDlet-Install-Notify is conflicting with signing the midlet?

    Yuriy

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: Need help with signing a midlet: something is wrong

    I have an update.

    I tested the signed midlet (the one that installs on SonyEricsson TM506 with no problems now) on Nokia 6301 and Motorola ROKR E8, both from T-Mobile USA. It failed to install on both phones.

    The new signed midlet does not have MIDlet-Install-Notify property now, so I cannot give you the exact error codes.

    On Nokia 6301, it says "Certificate not on phone or sim". By checking the Security/Certificates section on this phone, I can see that Thawte Code Signing is present. So the message about missing certificate does not seem to be truthful. Nokia, can you explain it?

    On ROKR E8, it says plainly that it cannot find the matching certificate (even though prior to downloading, my certificate details can be seen). I don't know much about this phone, and don't know where to look for certificates to verify. Motorola is half dead anyway.

Similar Threads

  1. Midlet signing w/ Netbeans
    By browndrf in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2007-12-15, 23:53
  2. Signing Midlet & Permissions problems!
    By Wijnbo in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2007-05-14, 21:49
  3. Clarification regarding signing of a Midlet
    By venkata in forum Mobile Java General
    Replies: 7
    Last Post: 2007-03-29, 19:35
  4. plz help me be clear about signing midlet
    By pom_cc in forum Mobile Java General
    Replies: 5
    Last Post: 2006-12-12, 01:51
  5. MIDlet Signing (URGENT -- PLEASE HELP ME NOKIA EXPERTS)
    By earamsey in forum Mobile Java General
    Replies: 0
    Last Post: 2004-10-25, 23:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •