views:

47

answers:

1

I was trying to obfuscate SWT code using Retroguard, but after obfuscation, I can't start the jar it has created. Please advise. Thanks.

C:\Documents and Settings\zzz\My Documents>java -jar retroguard.jar swt-orig.j
ar

C:\Documents and Settings\zzz\My Documents>java -jar out.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.eclipse.swt.inter
nal.win32.OS.GetVersionExW(Lorg/eclipse/swt/internal/win32/ar;)Z
        at org.eclipse.swt.internal.win32.OS.GetVersionExW(Native Method)
        at org.eclipse.swt.internal.win32.OS.<clinit>(Unknown Source)
        at i.z.<clinit>(Unknown Source)
        at Main.main(Unknown Source)
A: 

Looks like a problem with the DLL containing SWT native methods. Was it packed into swt-orig.jar? Perhaps Retroguard removed or altered it?

You may also wish to read about the limitations of obfuscation and about alternative ways to protect your code in my article Protect Your Java Code - Through Obfuscators And Beyond.

Dmitry Leskov
I think the SWT dll was packed into jar file, because I was able to run it by usingjava -jar swt-orig.jar
janetsmith
Okay, can you check that to make sure and if yes, find out whether is it still present in out.jar?
Dmitry Leskov