Frage

Im Versuch, ein Java-MIDlet mit proguard zu verschleiern. Es läuft ok auf dem PC, aber wenn ich es auf dem Handy laufen, das Programm öffnet, verbindet sich mit dem Server und dann gefriert. Wenn ich deaktivieren Verschleierung, läuft es ok wieder am Telefon. Ive tryed alle Verschleierungsstufen für Apps (7, 8 und 9 bei NetBeans), und keiner von ihnen scheint richtig zu arbeiten, und ich kann nicht für kommerzielle Verwendung ohne Verschleierung dieser App freigeben. Auch der Compiler wirft einige Warnungen:

Note: duplicate definition of library class [java.io.ByteArrayOutputStream]
Note: there were 14 duplicate class definitions.

Aber ich weiß nicht, ob dies wirklich das Problem ist. Hat jemand weiß, was ist falsch? Die obfuscator Argumente sind im Folgenden aufgeführt:

Obfuscator Arguments (7):
    -dontusemixedcaseclassnames
    -default package ''
    -keep public class ** {
        public *;
    }

Obfuscator Arguments (8): same as (7) plus -overloadaggressively.

Obfuscator Arguments (9): same as (8) but
    -keep public class ** extends javax.microedition.midlet.MIDlet {
        public *;
    }
instead.

Danke.

War es hilfreich?

Lösung

Obfuscation can break stuff. Without potted example code it's hard to say exactly what might be wrong. An example of something that could go wrong is if you load a class in your code by name - the obfuscated class will have a different name, and hence will not be found.

The messages you mention could be indicative of the problem - you must have those classes more than once on your path. Is that class you mention pertinent to the connection you're having problems with? Look closely at the jars in use and ensure the the right (and minimum) set of classes are being included in your application. ByteArrayOutputStream in the CLDC is not the same as in the desktop JDK.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top