Today I am going to post about Proguard, an obfuscator for Java. A lot of you probably have heard of it and use it with your j2me applications. But for those of you who haven’t heard of it, I advise you to take a look at this article which will help you with any new projects with Cinterion (TC65, XT65) or MTX terminals.

 

Using an obfuscator with our j2me applications is interesting, more interesting than being able to “obfuscate the code”, as it reduces the total “.jar” file size generated. Never forget (although sometimes some of us seem to do so ;) ) that we’re not programming a Core2Duo processor,rather we are programming devices with very limited RAM and FLASH memory. For example, an MT65 GPRS modem has 400Kb RAM memory and 1.7Mb FLASH memory. Using an obfuscator will make the most of the precious FLASH memory, and especially the RAM memory in our modems.

 

To give us an idea, the new MTXTunnelv5.0 firmware that comes out soon (this month) takes up around 130Kb without obfuscating and 80Kb obfuscating. You can see that the reduction is quite significant.

 

What do you have to do to use an obfuscator?

 

Well first of all you need to download it.

 

With eMule?

 

No, it’s free.

 

Where is it?

You will find it here: http://sourceforge.net/projects/proguard/files/

Download it and unzip it inside the Eclipse folder i.e. within:

c:\Eclipse\proguard4.5.1\

Then go to Window > Preferences > J2ME > Packaging > Obfuscation and select the suitable PATH like you can see in the following screen:

proguard-1

Once you have done this you can “compile” your file obfuscating it. Instead of making a “Create Package”, to do this we make a “Create Obfuscated Package”.

Yes it worked, but there was an error.

This is because you need to specify a complete path to a JDK and you probably have a JRE. Change it, to do this go to Window > Preferences > Java > Installed JREs and select the appropriate JDK directory. In my case:

proguard-1

I hope that you find it useful. Now I’m going to go to sleep as I have to gain some strength for tomorrow, I’m trembling with fear as tomorrow my son celebrates his fifth birthday and Sonia has invited her friends round. At first it was 2 or 3 friends, then it was 5 or 6, then 7 or 8 and today I was told it was a whopping 12 or 13. Also I expressed my happiness with the tea that she has prepared. There are no ham sandwiches no, but she has prepared an endless number of rolls filled with lotsssss of chocolate (Think of my sofas, the walls…) Anyway I think that I will stay on the top floor of my house (where my computers are) ensuring that no brats get into the restricted area. :)

 


Post relacionados:

  1. J2ME File Compression in Siemens TC65 GPRS Modems With lots of GPRS modem applications, data needs to be...
  2. Ram and Flash Memory in TC65 and XT65 modems Recently I have been asked a lot about the RAM...
  3. Java FTP example for Cinterion GPRS modems TC65 and XT65 You will possibly at some point have to make a...
  4. J2ME File Compression in Siemens TC65 GPRS Modems – II A few weeks ago  I posted about J2ME file compression in Cinterion TC65 and...
  5. Adding Data to Files from Java with Siemens-Cinterion Modems On several occasions I have been asked how to add...








Tags: , ,
4 Responses to “Using an Obfuscator with J2ME. Proguard.”
  1. Jose says:

    Y en Netbeans 6.9 que pasos seguirías?

  2. Álvaro says:

    Hola Jose,

    La imagen primera, ¿no se corresponde con lo que escribes no?:”Después ves a Window > Preferences > J2ME > Packaging > Obfuscation y selecciona el PATH adecuado tal y como puedes ver en la pantalla siguiente.”

    Esque estoy intentando hacerlo pero no se que path es el adecuado, ¿me puedes ayudar?.

    Muchas gracias de antemano por todo tu ayuda.

    Saludos.

  3. blogElectronica says:

    Hola Álvaro, sí corresponde,

    pues es el directorio donde tengas instalado el JDK. Tendrás que buscarlo en tu PC, en el mío es C:\Archivos de programa\Java\jdk1.5.0_15

    Salu2!!!

  4.  
Leave a Reply

Puedes publicar un comentario aquí si quieres, pero te recomiendo que uses el nuevo foroElectronica.com para introducir comentarios. Te contestaré más rápido. Recuerda que debes registrarte si no lo estás para publicar un comentario.