diff --git a/android/README.txt b/android/README.txt index 503078325194f0cd4d85be26b8b5ce983ff29aa1..fe84055d1a2e98bb4a70cee5fd7e17825a26e367 100644 --- a/android/README.txt +++ b/android/README.txt @@ -49,4 +49,5 @@ ant reinstall # Now click on the I2P icon on your phone! #other helpful commands -../../android-sdk-linux_86/tools/adb shell +../../android-sdk-linux_86/platform-tools/adb shell +../../android-sdk-linux_86/platform-tools/adb pull /some/file/on/emulator some-local-dir/ diff --git a/android/build.xml b/android/build.xml index dc09f5e11d1d8be5a9b1e399c47c8c2cc325b783..9b09ecee6e1407a5997261630afebf4231eaae72 100644 --- a/android/build.xml +++ b/android/build.xml @@ -127,10 +127,6 @@ <arg value="jni/build.sh" /> </exec> <copy file="jni/libjbigi.so" todir="${native.libs.dir}/armeabi" /> - <exec executable="chmod" osfamily="unix" failonerror="true"> - <arg value="+x" /> - <arg value="${native.libs.dir}/armeabi/libjbigi.so" /> - </exec> </target> <!-- install now does both --> diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index 57517aec472e3303d104361d4b097d3ee767d3f5..27d555af42eb5ef930909548ced7156b4f74f613 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -16,6 +16,7 @@ import java.math.BigInteger; import java.net.URL; import java.security.SecureRandom; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Random; @@ -138,6 +139,7 @@ public class NativeBigInteger extends BigInteger { private static final boolean _isLinux = System.getProperty("os.name").toLowerCase().contains("linux"); private static final boolean _isFreebsd = System.getProperty("os.name").toLowerCase().contains("freebsd"); private static final boolean _isSunos = System.getProperty("os.name").toLowerCase().contains("sunos"); + private static final boolean _isAndroid = System.getProperty("java.vendor").contains("Android"); /* * This isn't always correct. @@ -498,6 +500,17 @@ public class NativeBigInteger extends BigInteger { System.loadLibrary(name); return true; } catch (UnsatisfiedLinkError ule) { + if (_isAndroid) { + // temp debug + warn("jbigi loadLibrary() fail", ule); + try { + System.load("/data/data/net.i2p.router/lib/libjbigi.so"); + return true; + } catch (Throwable t) { + warn("jbigi load() fail", t); + } + warn("Is the file there? " + (new File("/data/data/net.i2p.router/lib/libjbigi.so")).exists()); + } return false; } } @@ -581,6 +594,8 @@ public class NativeBigInteger extends BigInteger { * @since 0.8.7 */ private static List<String> getResourceList() { + if (_isAndroid) + return Collections.EMPTY_LIST; List<String> rv = new ArrayList(8); String primary = getMiddleName2(true); if (primary != null) {