2004/01/27 05:12:03
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 08:05:25 +0000 (08:05 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 08:05:25 +0000 (08:05 +0000)
darcs-hash:20040130080525-2ba56-f0327d3795bb654139d4f9c23647d5bc757874e2.gz

Makefile
Makefile.upstream
jode.conf [new file with mode: 0644]
src/org/xwt/util/Queue.java
upstream/jode-1.1.1/patches/javadep.patch [new file with mode: 0644]
upstream/jode-1.1.1/patches/object.has.no.superiface.patch [new file with mode: 0644]

index 92d7a4e..c6d0d76 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,13 @@ Solaris:  ; make gcj platform=Solaris link_flags="-lX11 -lXext -lpthread"
 Win32:    ; make gcj platform=Win32   link_flags="-Wl,--subsystem,windows -lcomdlg32"
 Darwin:   ; make gcj platform=Darwin  link_flags="$(darwin_linker_flags)"
 
+foo: .compile
+       rm -rf build/class/*
+       make oldcompile
+       make .install_jode-1.1.1_java target=java
+       cd build; jar xvf ../upstream/install/share/java/libgcj-3.3.jar java/lang/Object.class
+       java -cp upstream/java-getopt-1.0.9:upstream/jode-1.1.1/build-java jode.obfuscator.Main jode.conf
+
 darwin_libdir       := upstream/install/powerpc-apple-darwin/lib
 darwin_linker_flags := -Wl,-dylib_file,/usr/lib/libSystem.B.dylib:$(darwin_libdir)/libSystem.B.dylib
 darwin_linker_flags += -Wl,-dylib_file,/usr/lib/system/libmathCommon.A.dylib:$(darwin_libdir)/libmathCommon.A.dylib
index f0406e5..69cad46 100644 (file)
@@ -16,6 +16,8 @@ url_jpeg-6b            := http://www.ijg.org/files/jpegsrc.v6b.tar.gz
 url_jikes-1.18         := http://dist.xwt.org/jikes-1.18.tgz
 url_libmspack-20030726 := http://www.kyz.uklinux.net/downloads/libmspack-20030726.tar.gz
 url_vera-1.10          := http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf-bitstream-vera-1.10.tar.gz
+url_jode-1.1.1         := http://umn.dl.sourceforge.net/sourceforge/jode/jode-1.1.1.tar.gz
+url_java-getopt-1.0.9  := ftp://ftp.urbanophile.com/pub/arenn/software/sources/java-getopt-1.0.9.tar.gz
 
 .install_binutils-2.13.2.1_powerpc-apple-darwin: .vendor
        rm -rf upstream/darwin-linker/src
@@ -72,6 +74,16 @@ configure_gcc-3.3_i686-pc-mingw32       += --enable-threads=win32 --enable-hash-
 configure_gcc-3.3_i686-pc-linux-gnu     += --enable-threads=posix --enable-hash-synchronization
 configure_gcc-3.3_sparc-sun-solaris2.7  += --enable-threads=posix --disable-hash-synchronization --disable-multilib
 
+.install_jode-1.1.1_java: .download_java-getopt-1.0.9
+
+configure_jode-1.1.1_java               := --with-java=$(JAVA_HOME)/bin/java --with-javac=$(JAVA_HOME)/bin/javac
+ifeq ($(shell uname),Darwin)
+environment_jode-1.1.1_java             := CLASSLIB=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/classes.jar
+else
+environment_jode-1.1.1_java             := CLASSLIB=${JAVA_HOME}/jre/lib/rt.jar
+endif
+environment_jode-1.1.1_java             += CLASSPATH=${CLASSPATH}:$(shell pwd)/upstream/java-getopt-1.0.9/
+
 # libjpeg's configury doesn't obey --target
 environment_jpeg-6b_$(target)           += PATH=$(shell pwd)/upstream/install/$(target)/bin:$$PATH
 environment_jpeg-6b_$(target)           += CC=$(shell pwd)/upstream/install/bin/$(target)-gcc
diff --git a/jode.conf b/jode.conf
new file mode 100644 (file)
index 0000000..edf2497
--- /dev/null
+++ b/jode.conf
@@ -0,0 +1,31 @@
+classpath = "build/","upstream/install/share/java/libgcj-3.3.jar","build/class"
+dest = "out"
+strip = "unreach","lvt"
+#,"inner"
+
+#renamer = new UniqueRenamer
+
+load = new WildCard { value = "org.xwt.*" },
+       new WildCard { value = "gnu.*" },
+       new WildCard { value = "org.bouncycastle.*" },
+       new WildCard { value = "edu.*" },
+       new WildCard { value = "java.*" }
+
+preserve = new WildCard { value = "org.xwt.Main" },
+           new WildCard { value = "org.xwt.plat.Linux" }
+
+#           new MultiIdentifierMatcher { 
+#               and = new WildCard { value = "org.myorg.publiclib.*" },
+#                   new ModifierMatcher { access = "PUBLIC" }
+#         }
+
+analyzer = new ConstantAnalyzer
+
+# The LocalOptimizer will reorder local variables to use fewer slots.
+# It may still have some bugs, so remove it if your applet doesn't
+# work (and send me the class).
+# The RemovePopAnalyzer will remove instructions that were optimized
+# away by the ConstantAnalyzer and LocalOptimizer.
+#post = new RemovePopAnalyzer
+
+
index 05a9073..7d74b9c 100644 (file)
@@ -70,16 +70,8 @@ public class Queue {
         <tt>block</tt> is true and the queue is empty. */
     public synchronized Object remove(boolean block) {
 
-        while (size == 0) {
-            if (!block) return null;
-            try {
-                wait();
-            } catch (InterruptedException e) {
-            } catch (Exception e) {
-                if (Log.on) Log.info(this, "exception in Queue.wait(); this should never happen");
-                if (Log.on) Log.info(this, e);
-            }
-        }
+                try { wait(); } catch (InterruptedException e) {  }
+        if (!block) return null;
         
         Object ret = vec[first];
         first++;
diff --git a/upstream/jode-1.1.1/patches/javadep.patch b/upstream/jode-1.1.1/patches/javadep.patch
new file mode 100644 (file)
index 0000000..3a386da
--- /dev/null
@@ -0,0 +1,13 @@
+--- src/javaDependencies.pl.in Mon Jan 26 20:17:37 2004
++++ src/javaDependencies.pl.in Mon Jan 26 20:17:54 2004
+@@ -85,8 +85,8 @@
+       my ($magic, $minor, $major) = unpack("Nnn", $buff);
+       die "Wrong magic $magic" if $magic != 0xcafebabe;
+-      die "Wrong minor $minor" if $minor > 3;
+-      die "Wrong minor $major" if $major != 45;
++#     die "Wrong minor $minor" if $minor > 3;
++#     die "Wrong minor $major" if $major != 45;
+       
+       readInBuff 2 or die "Can't read cpool length";
+       
diff --git a/upstream/jode-1.1.1/patches/object.has.no.superiface.patch b/upstream/jode-1.1.1/patches/object.has.no.superiface.patch
new file mode 100644 (file)
index 0000000..797d290
--- /dev/null
@@ -0,0 +1,10 @@
+--- jode/obfuscator/ClassIdentifier.java.in    Sun Aug 12 11:24:14 2001
++++ jode/obfuscator/ClassIdentifier.java.in    Mon Jan 26 19:08:36 2004
+@@ -478,6 +478,7 @@
+       ClassIdentifier ancestor = this;
+       while(true) {
+           addIfaces(newIfaces, ancestor);
++            if (ancestor.superName == null) break;
+           ClassIdentifier superident 
+               = Main.getClassBundle().getClassIdentifier(ancestor.superName);
+           if (superident == null || superident.isReachable())