aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.xml54
-rw-r--r--default.properties3
-rw-r--r--proguard.cfg43
-rw-r--r--proguard.flags9
4 files changed, 52 insertions, 57 deletions
diff --git a/build.xml b/build.xml
index 9de0ea8..18fdb4b 100644
--- a/build.xml
+++ b/build.xml
@@ -43,9 +43,6 @@
<!-- Begin custom ConnectBot stuff -->
- <property name="proguard.out.dir" value="${out.dir}/proguard.out"/>
- <property name="out.dex.input.absolute.dir" value="${proguard.out.dir}"/>
-
<!-- Output directory for .po files. -->
<property name="locale.dir" value="locale" />
@@ -56,48 +53,7 @@
<property name="launchpad.export.file" value="launchpad-export.tar.gz"/>
<property name="launchpad.import.file" value="launchpad-import.tar.gz"/>
- <target name="check-proguard">
- <available file="tools/proguard.jar" property="have.proguard"/>
- </target>
-
- <target name="proguard" depends="check-proguard">
- <fail unless="have.proguard">You requested ProGuard, but you don't have the JAR available! See README</fail>
- </target>
-
- <target name="-pre-build" depends="create-out-dir, link-out-dir, update-version"/>
-
- <target name="-post-compile" depends="proguard-execute"/>
-
- <target name="remove-out-symlink">
- <symlink action="delete" link="${proguard.out.dir}" failonerror="false"/>
- </target>
-
- <target name="check-out-exists" depends="remove-out-symlink">
- <available file="${proguard.out.dir}" property="proguard.out.is.dir"/>
- </target>
-
- <target name="delete-out-dir" depends="check-out-exists" if="proguard.out.is.dir">
- <delete dir="${proguard.out.dir}"/>
- </target>
-
- <target name="create-out-dir" depends="delete-out-dir" if="have.proguard">
- <mkdir dir="${proguard.out.dir}"/>
- </target>
-
- <target name="link-out-dir" depends="delete-out-dir" unless="have.proguard">
- <symlink link="${proguard.out.dir}" resource="${out.classes.dir}"/>
- </target>
-
- <target name="proguard-execute" if="have.proguard">
- <mkdir dir="${out.dex.input.absolute.dir}"/>
- <taskdef resource="proguard/ant/task.properties"
- classpath="tools/proguard.jar" />
- <proguard configuration="proguard.flags" printusage="${out.dir}/proguard.usage">
- <injar path="${out.classes.dir}"/>
- <outjar path="${proguard.out.dir}"/>
- <libraryjar path="${android.jar}"/>
- </proguard>
- </target>
+ <target name="-pre-build" depends="update-version"/>
<target name="help">
<!-- displays starts at col 13
@@ -115,9 +71,11 @@
<echo> signatures must match.</echo>
<echo> uninstall: Uninstalls the application from a running emulator or</echo>
<echo> device.</echo>
- <echo> proguard: use before build statements like "debug" and "release"</echo>
- <echo> to enable proguard dead code removal. NOTE: You must</echo>
- <echo> have tools/proguard.jar available. See the README.</echo>
+ <echo> translations-import: Import translations from a Launchpad-style</echo>
+ <echo> Rosetta translation.</echo>
+ <echo> translations-export: Export translations to a Launchpad-style</echo>
+ <echo> Rosetta translation.</echo>
+
</target>
<target name="update-version" description="Updates the Version.java file with current Git revision">
diff --git a/default.properties b/default.properties
index af73ae7..b2733ee 100644
--- a/default.properties
+++ b/default.properties
@@ -12,3 +12,6 @@ split.density=false
# Project target.
target=android-11
+
+# Proguard config
+proguard.config=proguard.cfg
diff --git a/proguard.cfg b/proguard.cfg
new file mode 100644
index 0000000..c7562fc
--- /dev/null
+++ b/proguard.cfg
@@ -0,0 +1,43 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
+
+-keep class org.connectbot.**
+-keep public class com.trilead.ssh2.compression.*
+-keep public class com.trilead.ssh2.crypto.*
diff --git a/proguard.flags b/proguard.flags
deleted file mode 100644
index 7b840ae..0000000
--- a/proguard.flags
+++ /dev/null
@@ -1,9 +0,0 @@
--dontskipnonpubliclibraryclasses
--dontobfuscate
--dontoptimize
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Service
--keep class org.connectbot.**
--keep public class com.trilead.ssh2.compression.*
--keep public class com.trilead.ssh2.crypto.*