diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1cd395df9818027cd862459026e0d99056af2566..62961158f06d54a6f1ced95dc7e3c47f46e936a1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.i2p.android.router" - android.versionCode="4719034" - android.versionName="0.9.0-27_b59-API8" + android.versionCode="4719040" + android.versionName="0.9.0-28_b1-API8" android:installLocation="preferExternal" > <uses-permission android:name="android.permission.INTERNET" /> diff --git a/ant.properties b/ant.properties index eb3aeb5e7ea14e1f3285ac50613d12ce5e54d9b7..0d53db12619969fd9d3fbbc8896ddb7bea90358f 100644 --- a/ant.properties +++ b/ant.properties @@ -1,4 +1,5 @@ application-package=net.i2p.router key.store=${user.home}/.android/${application-package}.keystore key.alias=${application-package} +android.library.reference.1=./routerjars key.store.password=android diff --git a/custom_rules.xml b/custom_rules.xml index 894d7773bd96808d6f33630b8fbb2e12cc3c11ca..aaa3ee70d00c58061f5fec0787fc7127079d2eb4 100644 --- a/custom_rules.xml +++ b/custom_rules.xml @@ -37,7 +37,6 @@ <property name="version.name" value="${my.version.name}" /> <echo message="version.code '${version.code}', 'version.name '${version.name}', '${my.version.name}'" /> - <!-- ================================================================================ New I2P rules @@ -60,81 +59,22 @@ <delete dir="${out.absolute.dir}/classes/net" verbose="${verbose}" /> </target> - <target name="-pre-compile" depends="buildrouter" /> - - <target name="-post-compile" depends="hackcleanup, jbigi" /> +<!-- + <target name="-pre-compile" depends="jbigi, buildrouter" /> + <target name="-post-compile" depends="hackcleanup" /> +--> <!-- Creates the output directories if they don't exist yet. --> <target name="-dirs"> <echo>Creating output directories if needed...</echo> <mkdir dir="${resource.absolute.dir}" /> - <mkdir dir="${external.libs.absolute.dir}" /> <mkdir dir="${gen.absolute.dir}" /> <mkdir dir="${out.absolute.dir}" /> <mkdir dir="${out.classes.absolute.dir}" /> </target> - <!-- new rules --> - - - - <target name="buildrouter" depends="-dirs" > - <!-- build router and core --> - <ant dir="${i2pbase}" > - <target name="buildRouter" /> - <target name="buildI2PTunnel" /> - <target name="buildAddressbook" /> - </ant> - - <!-- router --> - <copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" /> - - <!-- core --> - - <!-- org.bouncycastle.crypto already in android - but we need a little trickery because our HMac is incompatible... - and the libs aren't in the SDK to compile against??? --> - <jar destfile="${jar.libs.dir}/crypto.jar" > - <zipfileset src="${i2pbase}/build/i2p.jar" > - <include name="org/bouncycastle/crypto/Digest.class" /> - <include name="org/bouncycastle/crypto/Mac.class" /> - <include name="org/bouncycastle/crypto/digests/GeneralDigest.class" /> - <include name="org/bouncycastle/crypto/digests/MD5Digest.class" /> - </zipfileset > - </jar> - - <!-- lots of unneeded stuff could be deleted here --> - <jar destfile="${jar.libs.dir}/i2p.jar" > - <zipfileset src="${i2pbase}/build/i2p.jar" > - <exclude name="net/i2p/util/LogWriter.class" /> - <exclude name="net/i2p/util/SecureDirectory.class" /> - <exclude name="net/i2p/util/SecureFile.class" /> - <exclude name="net/i2p/util/SecureFileOutputStream.class" /> - <exclude name="org/bouncycastle/crypto/Digest.class" /> - <exclude name="org/bouncycastle/crypto/Mac.class" /> - <exclude name="org/bouncycastle/crypto/digests/GeneralDigest.class" /> - <exclude name="org/bouncycastle/crypto/digests/MD5Digest.class" /> - </zipfileset > - </jar> - - <!-- i2ptunnel --> - <copy file="${i2pbase}/apps/ministreaming/java/build/mstreaming.jar" todir="${jar.libs.dir}" /> - <copy file="${i2pbase}/apps/streaming/java/build/streaming.jar" todir="${jar.libs.dir}" /> - <jar destfile="${jar.libs.dir}/i2ptunnel.jar" > - <zipfileset src="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" > - <exclude name="net/i2p/i2ptunnel/I2PTunnelGUI.class" /> - </zipfileset > - </jar> - - <!-- addressbook - make a jar, it's a war in the i2p distro --> - <jar destfile="${jar.libs.dir}/addressbook.jar" - basedir="${i2pbase}/apps/addressbook/build" - excludes="net/i2p/addressbook/Servlet.class" /> - - </target> - <!-- some resources --> <target name="copy-i2p-resources" depends="-dirs" > <copy file="LICENSE.txt" tofile="res/raw/license_app_txt" /> @@ -157,7 +97,6 @@ <copy file="${i2pbase}/licenses/LICENSE-GPLv3.txt" tofile="res/raw/license_gplv3_txt" /> <copy file="${i2pbase}/licenses/LICENSE-LGPLv3.txt" tofile="res/raw/license_lgplv3_txt" /> <copy file="${i2pbase}/licenses/LICENSE-Addressbook.txt" tofile="res/raw/license_addressbook_txt" /> - <delete file="res/raw/certificates_zip" /> <zip update="true" destfile="res/raw/certificates_zip"> <fileset dir="${i2pbase}/installer/resources/certificates/" /> @@ -165,20 +104,6 @@ </target> - <target name="hackcleanup"> - <delete file="${jar.libs.dir}/crypto.jar" /> - </target> - - <target name="jbigi" > - <exec executable="sh" osfamily="unix" failonerror="true"> - <arg value="-c" /> - <arg value="jni/build.sh ${i2pbase}" /> - </exec> - <copy file="jni/libjbigi.so" todir="${native.libs.absolute.dir}/armeabi" /> - </target> - - - <!-- install now does both --> <target name="reinstall" depends="install" /> @@ -203,7 +128,7 @@ <delete file="res/raw/license_gplv2_txt" /> <delete file="res/raw/license_gplv3_txt" /> <delete file="res/raw/license_lgplv3_txt" /> - <delete dir="jni/build/" verbose="${verbose}" /> + <delete file="res/raw/certificates_zip" /> <delete file="scripts/build.number" verbose="${verbose}" /> <delete file="scripts/version.properties" verbose="${verbose}" /> </target> @@ -302,40 +227,5 @@ <echo message="Release file copied to I2PAndroid-${my.version.name}.apk" /> </target> - <!-- - override this because the ant task com.android.ant.AaptExecLoopTask has issues: - a) it uses version.code which main_rules sets to "" and - b) it can't set versionName via the aapt task, have to use the aapt command line - We can't use this in the newer SDK, and since properties are - immutable, we don't need to do this. The trick is to call the target earlier, - _BEFORE_ the template is loaded. - --> - <!-- - - <target name="-package-resources"> - <echo>Packaging resources</echo> - <property name="dash" value="-" /> - <property name="dashdash" value="${dash}${dash}" /> - <exec executable="${aapt}" failonerror="true" > - <arg value="package" /> - <arg value="${dashdash}version-code" /> - <arg value="${my.version.code}" /> - <arg value="${dashdash}version-name" /> - <arg value="${my.version.name}" /> - <arg value="-f" /> - <arg value="-m" /> - <arg value="-M" /> - <arg value="AndroidManifest.xml" /> - <arg value="-I" /> - <arg value="${android.jar}" /> - <arg value="-S" /> - <arg value="${resource.absolute.dir}" /> - <arg value="-J" /> - <arg value="${gen.absolute.dir}" /> - <arg value="-F" /> - <arg value="${out.absolute.dir}/${resource.package.file.name}" /> - </exec> - </target> - --> </project> diff --git a/jni/libjbigi.so b/jni/libjbigi.so deleted file mode 100755 index c9282a25bbd610ab0c5dd5dc95e65f4c20e750ca..0000000000000000000000000000000000000000 Binary files a/jni/libjbigi.so and /dev/null differ diff --git a/routerjars/AndroidManifest.xml b/routerjars/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..c0c558d683a402f3cba692867d885240fe06be4d --- /dev/null +++ b/routerjars/AndroidManifest.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="net.i2p.android.router.guts" + android.versionCode="" + android.versionName="" + android:installLocation="preferExternal" + > + + <uses-sdk android:minSdkVersion="8" /> + +</manifest> diff --git a/routerjars/ant.properties b/routerjars/ant.properties new file mode 100644 index 0000000000000000000000000000000000000000..a6b2a81d5fedf89b8aa1ad5864738c52d3cf1ad8 --- /dev/null +++ b/routerjars/ant.properties @@ -0,0 +1,21 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked into Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + +key.alias=${application-package} +application-package=net.i2p.router.guts +key.store.password=android +key.store=${user.home}/.android/${application-package}.keystore diff --git a/routerjars/build.xml b/routerjars/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..b8b474b47be19ef91157ba2516df734904d07505 --- /dev/null +++ b/routerjars/build.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="I2PAndroid" default="help"> + + <!-- The local.properties file is created and updated by the 'android' tool. + It contains the path to the SDK. It should *NOT* be checked into + Version Control Systems. --> + <property file="local.properties" /> + + <!-- The ant.properties file can be created by you. It is only edited by the + 'android' tool to add properties to it. + This is the place to change some Ant specific build properties. + Here are some properties you may want to change/update: + + source.dir + The name of the source directory. Default is 'src'. + out.dir + The name of the output directory. Default is 'bin'. + + For other overridable properties, look at the beginning of the rules + files in the SDK, at tools/ant/build.xml + + Properties related to the SDK location or the project target should + be updated using the 'android' tool with the 'update' action. + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. + + --> + <property file="ant.properties" /> + + <!-- The project.properties file is created and updated by the 'android' + tool, as well as ADT. + + This contains project specific properties such as project target, and library + dependencies. Lower level build properties are stored in ant.properties + (or in .classpath for Eclipse projects). + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. --> + <loadproperties srcFile="project.properties" /> + + <!-- quick check on sdk.dir --> + <fail + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" + unless="sdk.dir" + /> + + <!-- + Import per project custom build rules if present at the root of the project. + This is the place to put custom intermediary targets such as: + -pre-build + -pre-compile + -post-compile (This is typically used for code obfuscation. + Compiled code location: ${out.classes.absolute.dir} + If this is not done in place, override ${out.dex.input.absolute.dir}) + -post-package + -post-build + -pre-clean + --> + <import file="custom_rules.xml" optional="true" /> + + <!-- Import the actual build file. + + To customize existing targets, there are two options: + - Customize only one target: + - copy/paste the target into this file, *before* the + <import> task. + - customize it to your needs. + - Customize the whole content of build.xml + - copy/paste the content of the rules files (minus the top node) + into this file, replacing the <import> task. + - customize to your needs. + + *********************** + ****** IMPORTANT ****** + *********************** + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, + in order to avoid having your file be overridden by tools such as "android update project" + --> + <!-- version-tag: 1 --> + <import file="${sdk.dir}/tools/ant/build.xml" /> + +</project> diff --git a/routerjars/custom_rules.xml b/routerjars/custom_rules.xml new file mode 100644 index 0000000000000000000000000000000000000000..f62ef8c337d50c91223b1fd052d472e00dab223d --- /dev/null +++ b/routerjars/custom_rules.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="routerjars"> + + <!-- override with i2psrc=path/to/source in local.properties --> + <property name="i2psrc" value="../../i2p.i2p" /> + <property name="i2pbase" location="${i2psrc}" /> + <available file="${i2psrc}" property="i2p.present" /> + <fail message="I2P source directory ${i2psrc} was not found. Install it there or set i2psrc=/path/to/source in local.properties" > + <condition> + <not> + <isset property="i2p.present" /> + </not> + </condition> + </fail> + <echo message="Using I2P source at ${i2pbase}" /> + + <target name="-pre-compile" depends="jbigi, buildrouter" /> + + + <!-- + Creates the output directories if they don't exist yet. + --> + <target name="-dirs"> + <echo>Creating output directories if needed...</echo> + <mkdir dir="${resource.absolute.dir}" /> + <mkdir dir="${gen.absolute.dir}" /> + <mkdir dir="${out.absolute.dir}" /> + <mkdir dir="${out.classes.absolute.dir}" /> + </target> + + <!-- new rules --> + + <target name="buildrouter" depends="-dirs" > + <!-- build router and core --> + <ant dir="${i2pbase}" > + <target name="buildRouter" /> + <target name="buildI2PTunnel" /> + <target name="buildAddressbook" /> + </ant> + + <!-- router --> + <copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" /> + + <!-- core --> + + <!-- lots of unneeded stuff could be deleted here --> + <jar destfile="${jar.libs.dir}/i2p.jar" > + <zipfileset src="${i2pbase}/build/i2p.jar" > + <exclude name="net/i2p/util/LogWriter.class" /> + <exclude name="net/i2p/util/SecureDirectory.class" /> + <exclude name="net/i2p/util/SecureFile.class" /> + <exclude name="net/i2p/util/SecureFileOutputStream.class" /> + <exclude name="org/bouncycastle/crypto/Digest.class" /> + <exclude name="org/bouncycastle/crypto/Mac.class" /> + <exclude name="org/bouncycastle/crypto/digests/GeneralDigest.class" /> + <exclude name="org/bouncycastle/crypto/digests/MD5Digest.class" /> + </zipfileset > + </jar> + + <!-- i2ptunnel --> + <copy file="${i2pbase}/apps/ministreaming/java/build/mstreaming.jar" todir="${jar.libs.dir}" /> + <copy file="${i2pbase}/apps/streaming/java/build/streaming.jar" todir="${jar.libs.dir}" /> + <jar destfile="${jar.libs.dir}/i2ptunnel.jar" > + <zipfileset src="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" > + <exclude name="net/i2p/i2ptunnel/I2PTunnelGUI.class" /> + </zipfileset > + </jar> + + <!-- addressbook - make a jar, it's a war in the i2p distro --> + <jar destfile="${jar.libs.dir}/addressbook.jar" + basedir="${i2pbase}/apps/addressbook/build" + excludes="net/i2p/addressbook/Servlet.class" /> + + </target> + + <target name="jbigi" > + <exec executable="sh" osfamily="unix" failonerror="true"> + <arg value="-c" /> + <arg value="jni/build.sh ${i2pbase}" /> + </exec> + <copy file="jni/libjbigi.so" todir="${jar.libs.dir}/armeabi" /> + </target> + + <target name="distclean" depends="clean"> + <delete dir="${jar.libs.dir}" verbose="${verbose}" /> + <delete dir="jni/build/" verbose="${verbose}" /> + </target> + +</project> diff --git a/jni/build.sh b/routerjars/jni/build.sh similarity index 99% rename from jni/build.sh rename to routerjars/jni/build.sh index 3c2cf654b8f4874bcbaf981902dcd362291af328..8319fc0ec5913420ec95b974a6aa49bd705f7c08 100755 --- a/jni/build.sh +++ b/routerjars/jni/build.sh @@ -25,7 +25,7 @@ then exit 0 fi -I2PBASE=${1:-../../i2p.i2p} +I2PBASE=${1:-../../../i2p.i2p} # # Wrong again. We want to be able to not have to update this script # every time a new NDK comes out. We solve this by using readlink with diff --git a/routerjars/proguard-project.txt b/routerjars/proguard-project.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2fe1559a217865a5454add526dcc446f892385b --- /dev/null +++ b/routerjars/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/routerjars/project.properties b/routerjars/project.properties new file mode 100644 index 0000000000000000000000000000000000000000..c006f0a1c8529cdaafd39511688e95094a9f0f4e --- /dev/null +++ b/routerjars/project.properties @@ -0,0 +1,12 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 +android.library=true diff --git a/routerjars/src/README.txt b/routerjars/src/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..3852f5431b2ad811667cded9f7e8e6df1106d293 --- /dev/null +++ b/routerjars/src/README.txt @@ -0,0 +1 @@ +This directory is intentionally blank.