Nokia 6131 NFC and 6212 NFC crash and reset the phone

by adrian vintu 4/12/2010 7:15:00 PM

I found a very annoying "bug" on the Nokia 6212 NFC and Nokia 6131 NFC.

I was building an obfuscated MIDlet when all of a sudden it started crashing on the NFC phones mentioned above. The 6212 and 6131 were crashing before starting the application, so it got me thinking that it might be a verification issue.The crash was followed by a warm reset of the phone and after 4 consecutive crashes by a cold reset of the phone.

I tested in the emulator and everything was fine. I tested on other phones and again, no problem.

I tried to exclude classes from the build that I thought were not verified correctly but I had to give up because of the huge number of classes ~approx 500.

I removed the code requiring permissions and signed the MIDlet. Still no luck.

I started looking at the SVN, since I knew the application was previously working. I noticed something. The icon.png of the MIDlet used to be 24 bits of color and now it was 32 bits. Somebody has changed the icon. I knew the Nokia 6131 NFC and 6212 NFC don't support such a high image depth so I rolled back the icon to 24 bits. TADAAA, I was now able to successfully obfuscate and run the application on the NFC phones.

This has been a really annoying and difficult to spot bug.

Interesting facts:

1. The application did not crash when no obfuscation was used - this is incredible.

2. I noticed that the problem would not appear when installing from the memory card, only via Internet. This is really bizarre.

3. The SVN Diff shows now both icons as 32 bit but IrfanView says one of them is 24 bit.

4. In case you are wondering about the huge number of classes ~500 - the application is a framework that runs on J2ME native GUI, J2ME LWUIT, Android and can be adapted to run on the desktop too.


EDIT: I later found out some other issue. It seems too much Proguard obfuscation was removing too many classes and class names - this was because I was using Class.forName a lot. So I added to Proguard configuration the parent classes of the dynamically loaded classes and everything worked great afterward.

  1. -keepnames class *
  2. public class com.appname.views.contract.BaseViewModel
  3. public class * extends com.appname.views.contract.AbstractView
  4. public class * extends com.appname.controllers.contract.AbstractController

 

Below are the pictures of the tested Nokia 6131 NFC and 6212 NFC phones.

 


Related posts

Comments are closed

About Adrian Vintu

Adrian Vintu I am a computer software professional lately designing and programming .NET and Android applications.
Send mail

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008 - 2012

Sign in