<target name="optimize" unless="no-optimize">
<mkdir dir="optimized"/>
<property name="libraryjars.path" refid="android.target.classpath"/>
- <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+ <java jar="${proguard-jar}" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=48"/>
<arg value="-injars ${out-classes}"/>
<arg value="-outjars optimized"/>
<target name="optimize" unless="no-optimize">
<mkdir dir="optimized"/>
<property name="libraryjars.path" refid="android.target.classpath"/>
- <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+ <java jar="${proguard-jar}" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=48"/>
<arg value="-injars ${out-classes}"/>
<arg value="-outjars optimized"/>
-version=1.5
+version=1.6
+
+# Set to the location where ProGuard's proguard.jar file can be found
+#proguard-jar=
# If you are building the J2ME client:
#
-# Set this to a location where Sun's Wireless Toolkit, version 2.5.2 or later, has been installed
-# Location on Linux varies but is typically under /usr/local or /usr/lib
-# On Windows the default install directory is C:\WTK2.5.2
-# Mac users: there is no WTK for Mac at the moment. The installer for Linux may work on Intel-based
-# Macs (haven't tried it) but I believe the preverify binary will not run.
-#
-# If you are buildling the Android client or optimized Java client:
-# Just create a 'WTK' directory wherever you like and add its location here. Proguard's
-# proguard.jar will still be expected at this location as bin/proguard.jar for historical reasons.
+# Set this to a location where Sun's Java ME SDK, version 3.0 or later, has been installed.
+# You can use version 2.5.2 or perhaps earlier, but will need to modify javame/build.xml to
+# use different .jar paths.
# Uncomment or set appropriately:
-#WTK-home=C:\\WTK2.5.2
-WTK-home=/usr/local/WTK2.5.2
+#WTK-home=/Applications/Java_ME_SDK_3.0.app/Contents/Resources
# Set this to the location where you have installed RIM's BlackBerry JDE in order to
# create the 'rim' client. There is no Mac or Linux version, but, these platforms can still
# Uncomment and set appropriately
#BB-JDK-home=C:\\Program Files\\Research In Motion\\Blackberry JDE 4.3.0
-BB-JDK-home=/usr/local/bb-home
+#BB-JDK-home=/usr/local/bb-home
# Set this to the location where you installed the Android SDK.
#android-home=C:\\Program Files\\android-sdk-windows
-android-home=/usr/local/android
+#android-home=/usr/local/android
# Set this to the location of a Tomcat installation if you want to compile and run the zxing.org
# web site and web application
#tomcat-home=C:\\tomcat
-tomcat-home=/usr/local/tomcat
+#tomcat-home=/usr/local/tomcat
# Uncomment and set this variable if building the zxing.appspot.com subdirectory. It points to the
# location of the Google Web Toolkit (GWT) which can be downloaded here:
<pathelement location="zxingorg/src"/>
</sourcepath>
<classpath>
+ <!-- These are used with WTK 2.5.x -->
+ <!--
<pathelement location="${WTK-home}/lib/cldcapi11.jar"/>
<pathelement location="${WTK-home}/lib/midpapi20.jar"/>
<pathelement location="${WTK-home}/lib/mmapi.jar"/>
<pathelement location="${WTK-home}/lib/jsr234.jar"/>
+ -->
+ <pathelement location="${WTK-home}/lib/cldc_1.1.jar"/>
+ <pathelement location="${WTK-home}/lib/midp_2.0.jar"/>
+ <pathelement location="${WTK-home}/lib/jsr135_1.2.jar"/>
+ <pathelement location="${WTK-home}/lib/jsr234_1.0.jar"/>
<pathelement location="${android-home}/platforms/android-1.5/android.jar"/>
<pathelement location="${tomcat-home}/lib/servlet-api.jar"/>
<fileset dir="zxingorg/web/WEB-INF/lib">
<delete file="core.jar"/>
<mkdir dir="optimized"/>
- <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+ <java jar="${proguard-jar}" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=48"/>
<arg value="-injars build"/>
<arg value="-outjars optimized"/>
<path id="wtk-build-path">
<fileset dir="${WTK-home}/lib">
+ <!-- These are used with WTK 2.5.x -->
+ <!--
<include name="cldcapi11.jar"/>
<include name="midpapi20.jar"/>
<include name="mmapi.jar"/>
<include name="jsr234.jar"/>
<include name="satsa-apdu.jar"/>
+ -->
+ <include name="cldc_1.1.jar"/>
+ <include name="midp_2.0.jar"/>
+ <include name="jsr135_1.2.jar"/>
+ <include name="jsr234_1.0.jar"/>
</fileset>
<pathelement location="../core/core.jar"/>
</path>
<path id="javame-compile-bootclasspath">
<fileset dir="${WTK-home}/lib">
+ <!-- These are used with WTK 2.5.x -->
+ <!--
<include name="cldcapi11.jar"/>
<include name="midpapi20.jar"/>
+ -->
+ <include name="cldc_1.1.jar"/>
+ <include name="midp_2.0.jar"/>
</fileset>
</path>
<property name="javame-compile-bootclasspath-path" refid="javame-compile-bootclasspath"/>
</not>
</condition>
</fail>
- <fail message="Please put proguard.jar in 'bin' under the WTK install directory">
+ <fail message="Please set 'proguard.jar' in build.properties">
<condition>
<not>
- <available file="${WTK-home}/bin/proguard.jar" type="file"/>
+ <available file="${proguard-jar}" type="file"/>
</not>
</condition>
</fail>
<jar jarfile="BarcodeReader.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF"/>
<move file="BarcodeReader.jar" tofile="temp.jar"/>
- <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+ <java jar="${proguard-jar}" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=32"/>
<arg value="-injars temp.jar"/>
<arg value="-outjars BarcodeReader.jar"/>
+ <!-- These are used with WTK 2.5.x -->
+ <!--
<arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/midpapi20.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/mmapi.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/jsr234.jar"/>
+ -->
+ <arg value="-libraryjars ${WTK-home}/lib/cldc_1.1.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/midp_2.0.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/jsr135_1.2.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/jsr234_1.0.jar"/>
<arg value="-microedition"/>
<arg value="-keep public class com.google.zxing.client.j2me.ZXingMIDlet"/>
<arg value="-keep class com.google.zxing.client.j2me.AdvancedMultimediaManager"/>
<arg value="-keep class com.google.zxing.client.j2me.DefaultMultimediaManager"/>
<arg value="-keep class com.google.zxing.client.j2me.MultimediaManager"/>
- <arg value="-optimizationpasses 7"/>
+ <arg value="-optimizationpasses 5"/>
<arg value="-overloadaggressively"/>
<arg value="-allowaccessmodification"/>
<arg value="-verbose"/>
</target>
<target name="dump">
- <java jar="${WTK-home}/bin/proguard.jar" fork="true">
+ <java jar="${proguard-jar}" fork="true">
<arg value="-injars BarcodeReader.jar"/>
+ <!-- These are used with WTK 2.5.x -->
+ <!--
<arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/midpapi20.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/mmapi.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/jsr234.jar"/>
+ -->
+ <arg value="-libraryjars ${WTK-home}/lib/cldc_1.1.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/midp_2.0.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/jsr135_1.2.jar"/>
+ <arg value="-libraryjars ${WTK-home}/lib/jsr234_1.0.jar"/>
<arg value="-dontshrink"/>
<arg value="-dontobfuscate"/>
<arg value="-dontoptimize"/>
final class Menu extends List implements CommandListener {\r
\r
private final ZXingMIDlet zXingMIDlet;\r
- private Command cancelCommand;\r
- private Command barcodeCommand;\r
+ private final Command cancelCommand;\r
+ private final Command barcodeCommand;\r
\r
/**\r
* Creates a new Search List and initialises all components.\r
showOpenURL("Compose E-mail?", emailResult.getEmailAddress(), emailResult.getMailtoURI());\r
} else if (type.equals(ParsedResultType.SMS)) {\r
SMSParsedResult smsResult = (SMSParsedResult) result;\r
- showOpenURL("Compose SMS?", smsResult.getNumber(), smsResult.getSMSURI());\r
+ showOpenURL("Compose SMS?", smsResult.getNumbers()[0], smsResult.getSMSURI());\r
} else if (type.equals(ParsedResultType.PRODUCT)) {\r
ProductParsedResult productResult = (ProductParsedResult) result;\r
String uri = "http://www.upcdatabase.com/item.asp?upc=" + productResult.getNormalizedProductID();\r