This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 84638 - update ProGuard library to the latest stable version
Summary: update ProGuard library to the latest stable version
Status: REOPENED
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 5.x
Hardware: Other Windows XP
: P2 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-11 18:21 UTC by jdl
Modified: 2013-03-05 12:35 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jdl 2006-09-11 18:21:20 UTC
I just upgraded to NB 5.5 beta 2 from 4.1. However, unless I turn Obfuscating
OFF, I get a preverify error:

Created dir: F:\Netbeans 5.5
projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified
Preverifying 22 file(s) into F:\Netbeans 5.5
projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified directory.
Error preverifying class h
    VERIFIER ERROR h.a(Ljava/lang/String;)Ljava/lang/String;:
Wrong return type in function
F:\Netbeans 5.5 projects\MM_midp1_0\nbproject\build-impl.xml:269:
Preverification failed with error code 1.
BUILD FAILED (total time: 8 seconds)

Yet, the same EXACT code without Obfuscation preverifies with no problem:

pre-preverify:
preverify:
Created dir: F:\Netbeans 5.5
projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified
Preverifying 23 file(s) into F:\Netbeans 5.5
projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified directory.
post-preverify:
create-jad:
add-configuration:
add-profile:
set-keystore-password:
set-alias-password:
pre-jar:
jar:
Building jar: F:\Netbeans 5.5
projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jar
Updating application descriptor: F:\Netbeans 5.5
projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jad
Generated "F:\Netbeans 5.5
projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jar" is 62297 bytes.
post-jar:
rebuild:
BUILD SUCCESSFUL (total time: 4 seconds)

I thought this error was supposed to be fixed with the change in the code doing
the preverifying?

This is a high priority issue for me because I need to use a version of NB that
allows me to add lines to the code that's automatically generated by the visual
designer and I also need to obfuscate my code.

BTW, when I put the obfuscator on level 1, I get a different error which I don't
know how to resolve:
Error: You have to specify '-keep' options for the shrinking step.
F:\Netbeans 5.5 projects\MM_midp1_0\nbproject\build-impl.xml:260: Obfuscation
failed with error code 1.
BUILD FAILED (total time: 6 seconds)

Thanks,
Jade
Comment 1 Martin Ryzl 2006-09-11 19:31:29 UTC
Level 1 represents empty settings and it is only supposed to be used with custom
settings - see the Level description. See http://proguard.sourceforge.net/ for
detailed documentation of ProGuard obfuscator.

Obfuscation may change application classes to make them smaller. It is possible
that obfuscation level is too high and classes are unusable (for instance public
method obfuscated, etc). NetBeans 5.5 uses ProGuard 3.5 but latest version is
3.7. Many problems have been fixed since then.

I suggest few things:
1. download newer (actually older might help as well) version of proguard and
try it. Simply replace
{install_dir}/mobility7.3/external/proguard.jar by lib/proguard.jar which is
uncluded in ProGuard download zip. Do it on your own risk.
2. try to identify the construction which causes the problem and look at the
code. It may be the case of adding extra arguments to ProGuard or it may be a bug.

I'm closing the bug as INVALID. If a bug will be added in ProGuard, we should
create a new issue - RFE to upgrade ProGuard.
If a proguard argument can be found that the obfuscation will work with the
application and current version proguard, please reopen this bug.

Feel free to use this issue or users@mobility.netbeans.org to further discuss
this particular problem with obfuscation.

Comment 2 Martin Ryzl 2006-09-11 19:55:29 UTC
This might also solve the problem - add it to Additional obfuscation settings.
-printmapping
  "Specifies to print the mapping from old names to new names for classes and  
  class members that have been renamed."
-dontusemixedcaseclassnames
  "Specifies not to generate mixed-case class names while obfuscating. By
default, obfuscated class names can contain a mix of upper-case characters and
lower-case characters. This creates perfectly acceptable and usable jars. Only
if a jar is unpacked on a platform with a case-insensitive filing system (say,
Windows), the unpacking tool may let similarly named class files overwrite each
other. Code that self-destructs when it's unpacked! Developers who really want
to unpack their jars on Windows can use this option to switch off this behavior.
Note that the obfuscated jars will become larger as a result. Only applicable
when obfuscating."
Comment 3 jdl 2006-09-11 21:39:10 UTC
Thanks for the detailed instructions. I'm downloading a later version of
ProGuard now. BTW, do you know which version of ProGuard was used in NB 4.1? 

That was the last time that I was able to use successfully preverify my
obfuscated code. When I tried upgrading to NB 5.0, I ran into this issue. I
reported it then and I was told to try a later version of ProGuard--which I
didn't have a chance to do.
Comment 4 jdl 2006-09-11 22:37:32 UTC
I downloaded ProGuard 3.7 beta 2 and it worked great the first time. Will you
please create a new issue - RFE to upgrade ProGuard? 

Thanks,
Jade
Comment 5 Adam Sotona 2006-09-12 09:10:04 UTC
in NetBeans 4.1 there was ProGuard version 3.2

in NetBeans 5.0 and 5.5 beta and 5.5 beta2 it was version 3.3 (we did not use
version 3.4 because of some major issues)

in NetBeans 5.5 it is version 3.5

and we are going to continue updating ProGuard this way
Comment 6 Petr Suchomel 2006-09-12 15:39:26 UTC
I also notified ProGuard owner about this issue to give us more clarification on
how and when bug was fixed.
Comment 8 Adam Sotona 2007-05-21 14:02:38 UTC
done
Comment 9 Lukas Hasik 2007-10-05 10:45:59 UTC
v
Comment 10 Lukas Hasik 2007-10-09 11:14:29 UTC
v
Comment 11 abanchev 2013-03-05 12:35:45 UTC
The current version that is installed automatically is 4.4, and the newest stable one is 4.8 (with 4.9b2 available also)