Archived

This topic is now archived and is closed to further replies.

someone2

Obfuscation fails with WTK 2.1, and proguard on Windows 2000

Recommended Posts

Hello, I hope you are very fine... Just a small problem... my program runs and packages great. It is wokring very well, but when it comes to obfuscation... A strange problem happens...
Error preverifying class java.lang.a java/lang/ClassFormatException: java/lang/a

com.sun.kvem.ktools.ExecutionException: Preverifier returned 1

Build failed

com.sun.kvem.midletsuite.InvalidJadException: Reason = 31

The jar size value in the Application Descriptor does not match the real jar file size.
 
Why does this happen? I would be very grateful for a solution.. Thank you very much in advance...

Share this post


Link to post
Share on other sites
Your app consists of a .jar file and a .jad file. The jad file information includes, among other things, the size in bytes of the corresponding jar. However, obfuscators generally have the effect of reducing your jar size, and generally do not update your jar file to match.

Fortunately, the jad file is a plain text format. Locate the line "MIDlet-Jar-Size: XXXXX" and change the number to match the size of the jar post obfuscation.

Share this post


Link to post
Share on other sites
Hi..
Thanks for the reply..
But, this still wasn''t the problem..
I tried to obfuscate manually, and set the size in the jad file manually..

But, then i get the weird error message in the mobile phone.. "Cannot create class in system package"
What does this mean? Any help would be greatly appreciated..

Thank you very much..

Share this post


Link to post
Share on other sites
"Cannot create class in system package"
That error happens when your jar includes classes that are in the java.* or javax.* package hierarchies, or when you try to import classes from these packages that aren''t installed on the phone. It''s illegal to add classes to those packages, and no phone will let you do it.
It usually happens when people try to include APIs that are not installed on the phone, for example, trying to use MMAPI on phones that don''t support it.

shmoove

Share this post


Link to post
Share on other sites
Hello,
Thank you very much for the replies..
I tried to preverify the jar file after obfuscation..
But i get

Error preverifying class a
java/lang/ClassFormatException: a

Why would this happen? Is the problem with obfuscation or the preverification?

Thank you very much in advance for all your help

Share this post


Link to post
Share on other sites
Probably the obfuscation. "ClassFormatException" is thrown by the class loader when your data doesn''t represent a valid .class file.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thank you very much,
But how can i correct it? Is it a problem becuase wtk2.1 is using the wrong parameters when using Nokia 3510i MIDP SDK?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Thank you very much,
But how can i correct it? Is it a problem becuase wtk2.1 is using the wrong parameters when using Nokia 3510i MIDP SDK?



are you using Nokia specific classes from the sdk?

Share this post


Link to post
Share on other sites