From 4d4eb2c48b156b7e5590f28507564333ee7c4b2f Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sun, 3 Jul 2011 16:36:32 +0000
Subject: [PATCH] - Build, versioning, and release note cleanups in preparation
 for release

---
 build.properties         |  1 +
 build.xml                | 41 +++++++++++++++++++++++++++++++++++-----
 res/raw/releasenotes_txt |  4 +++-
 scripts/setversion.sh    | 11 ++++++-----
 4 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/build.properties b/build.properties
index f620cd2fd..eb3aeb5e7 100644
--- a/build.properties
+++ b/build.properties
@@ -1,3 +1,4 @@
 application-package=net.i2p.router
 key.store=${user.home}/.android/${application-package}.keystore
 key.alias=${application-package}
+key.store.password=android
diff --git a/build.xml b/build.xml
index 639fe1989..38bc7e5bb 100644
--- a/build.xml
+++ b/build.xml
@@ -224,7 +224,7 @@
     <!-- just to make it easier -->
     <target name="create-signing-keys" >
         <echo message="key store is ${key.store}" />
-        <echo message="key store password is android" />
+        <echo message="key store password is ${key.store.password}" />
         <echo message="key alias is ${key.alias}" />
         <input message="Enter common name for new key (your name): " addproperty="release.cn" />
         <fail message="You must enter a name" >
@@ -253,7 +253,7 @@
             <arg value="-keysize" />
             <arg value="4096" />
             <arg value="-storepass" />
-            <arg value="android" />
+            <arg value="${key.store.password}" />
             <arg value="-dname" />
             <arg value="cn=${release.cn}, ou=Apps, o=I2P, c=DE" />
         </exec>
@@ -268,17 +268,48 @@
         </exec>
     </target>
 
-    <target name="hint" >
-        <echo message="key store password is android" />
+    <target name="verifyKeystore" >
+        <available file="${key.store}" property="keystore.present" />
+        <fail message="You must first create a keystore and keys with 'ant create-signing-keys'" >
+            <condition>
+                <not>
+                    <isset property="keystore.present" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="verifyWorkspace" >
+        <echo message="Everything is checked in, right? Let's be sure:" />
+        <exec executable="mtn" failonerror="true">
+            <arg value="st" />
+        </exec>
+        <echo message="If there are any modified files above, stop now!" />
+        <echo message="(except AndroidManifest.xml)" />
     </target>
 
-    <target name="verify" depends="hint, release" >
+    <target name="verify" depends="verifyKeystore, verifyWorkspace, release" >
         <exec executable="jarsigner" osfamily="unix" failonerror="true">
             <arg value="-verify" />
             <arg value="-verbose" />
             <arg value="-certs" />
             <arg value="${out.release.file}" />
         </exec>
+        <echo message="" />
+        <echo message="Release file is ${out.release.file}" />
+        <echo message="Android version name: ${my.version.name}" />
+        <echo message="Android version code: ${my.version.code}" />
+        <echo message="File size:" />
+        <exec executable="ls" failonerror="true">
+            <arg value="-l" />
+            <arg value="${out.release.file}" />
+        </exec>
+        <echo message="SHA256 sum:" />
+        <exec executable="sha256sum" failonerror="true">
+            <arg value="${out.release.file}" />
+        </exec>
+        <echo message="Don't forget to mtn ci AndroidManifest.xml" />
+        <echo message="Don't forget to mtn tag w: android-${my.version.name}" />
     </target>
 
     <!--
diff --git a/res/raw/releasenotes_txt b/res/raw/releasenotes_txt
index a6a21179c..b26e981f1 100644
--- a/res/raw/releasenotes_txt
+++ b/res/raw/releasenotes_txt
@@ -1,5 +1,7 @@
 ******* Please read all of the following *******
 
+This is the first alpha release of the I2P Android app.
+
 WARNING - This is ALPHA SOFTWARE. It may crash your phone. Do not rely upon it for strong anonymity. Tunnels may be as short as one hop. There may be serious security holes in the app.
 
 Minimum Android OS is 2.2 (API 8). The app is only tested on the Motorola Droid. It uses a lot of RAM. You need at least 256 MB of RAM. 512 should be much better.
@@ -18,7 +20,7 @@ NTP is disabled. If you have cell service, your phone or tablet should have the
 
 The app will work best when you are not changing IPs. If you are moving around, changing WIFI nodes, or switching between mobile and WIFI networks, it won't work well.
 
-There is no method to configure anything in the app.
+There is not yet any method to configure anything in the app.
 
 
 Embedded web browser
diff --git a/scripts/setversion.sh b/scripts/setversion.sh
index 51b5ff7bd..cfad5783a 100755
--- a/scripts/setversion.sh
+++ b/scripts/setversion.sh
@@ -34,19 +34,20 @@ VERSIONSTRING="${CORE}-${ROUTERBUILD}_b$(($ANDROIDBUILD % 512))-API$SDK"
 # MAJOR	 	4 bits 0-15
 # MINOR 	8 bits 0-255
 # RELEASE	8 bits 0-255
-# ROUTERBUILD	8 bits 0-255
-# ANDROIDBUILD	3 bits 0-7
+# ROUTERBUILD	7 bits 0-127
+# ANDROIDBUILD	4 bits 0-15
 #
-# Note that ANDROIDBUILD is modded % 8, it will wrap,
+# Note that ANDROIDBUILD is modded % 16, it will wrap,
 # beware of that if you release multiple builds using the
 # same ROUTERBUILD, or clear it if you update ROUTERBUILD
+# Subtract 1 from ANDROIDBUILD since it starts at 1 after distclean.
 #
 VERSIONINT=$(( \
 		(($MAJOR % 16) << 27) + \
 		(($MINOR % 256) << 19) + \
 		(($RELEASE % 256) << 11) + \
-		(($ROUTERBUILD % 256) << 3) + \
-		 ($ANDROIDBUILD % 8) \
+		(($ROUTERBUILD % 128) << 4) + \
+		(($ANDROIDBUILD - 1) % 16) \
 	      ))
 
 echo "Android version: '$VERSIONSTRING' (${VERSIONINT})"
-- 
GitLab