Signing BT747 for J2ME

  • Fernando Herrero Peletero

    I find "MIDlet jar signing (a tutorial)" in

    I'm signed BT_J2ME v0.2.22 and it's work on my Nokia N70.

    Get required software
       1. Java SDK (JDK) from Sun
       2. Java Wireless Toolkit (WTK) also from Sun (

    Create and import a new (test) certificate
       1. Create new certificate:
        keytool -genkey -alias BT_J2ME -keystore BT_J2ME -storepass onepass -keypass onepass -keyalg RSA -validity 3650
       2. Fill in all the prompts about location/company name etc:
           OU=MTK GPS Mouse Control,
           O=MTK Based GPS datalogger Management SW,
       3. See your new certificate:
        keytool -list -keystore BT_J2ME -storepass onepass
       4. Next you must export the certificate so you can import it to your phone:
        keytool -export -alias BT_J2ME -keystore BT_J2ME -storepass onepass -file BT_J2ME.crt

    Sign the application
       1. Sign the Application using jarsigner:
        jarsigner -keystore BT_J2ME -storepass onepass -signedjar BT_J2ME.jar BT_J2ME_0.2.22.jar BT_J2ME
       2. Now you have a signed jar you need to update the MIDlet-Jar-Size in your JAD
       3. Now add the certificate to the JAD using JadTool.jar from the WTK
        java -jar C:\WTK2.5.2_01\bin\JadTool.jar -addcert -alias BT_J2ME -storepass onepass -keystore BT_J2ME -inputjad BT_J2ME_0.2.22.jad -outputjad BT_J2ME.jad
       4. Now add the signature to the JAD again using JadTool.jar
        java -jar C:\WTK2.5.2_01\bin\JadTool.jar -addjarsig -alias BT_J2ME -jarfile BT_J2ME.jar -storepass onepass -keypass onepass -keystore BT_J2ME -inputjad BT_J2ME.jad -outputjad BT_J2ME.jad

    Installing the Certificate on the phone
       1. Import the certificate into your phone
       2. Once the certificate is installed it needs to be authorised for "Application Installation". I turned on everything but I think "Application Installation" is all you need

    The application is only trusted if it is installed using the JAD, the application will still install from the jar but it won’t be trusted.

    • Mario De Weerd

      Mario De Weerd - 2009-03-31

      What I'll do in one of theupcoming versions is add a signed version to the distribution.

      Personally, when I did some signing operations and used it on my Nokia6120, the certificat was not trusted by the phone and the app did not work.
      There was no way to install the certificate on the phone - only paying certificates work for code signing in my case.

      • Fernando Herrero Peletero

        Nokia 6120: S60 3rd Ed FP1
        Nokia N70: S60 2nd Ed FP3

        Process of installing the certificate (BT_J2ME.crt) on the N70:
        1. Is sent to the terminal through buetooth, IR ...
        2. Installing the certificate (Options -> Open)
        3. Prompted to save the certificate
        4. Warns that the certificate may not be safe
        5. Requests security settings: "Application Installation"

        In 6120 the process is not similar?

        • Fernando Herrero Peletero

          OK, I find this:

          Install Sef Sign certificate
          This only works on S60 2nd Edition phones. As installing MIDlet signing certificates after manufacturing is not allowed in MIDP spec, this behavior has been corrected for S60 3rd Edition devices.

          • Mario De Weerd

            Mario De Weerd - 2009-03-31

            Thanks for tracking that down precisely.


Log in to post a comment.