diff --git a/briar-android/AndroidManifest.xml b/briar-android/AndroidManifest.xml index febeef7f8..f6f22fe2f 100644 --- a/briar-android/AndroidManifest.xml +++ b/briar-android/AndroidManifest.xml @@ -7,7 +7,6 @@ diff --git a/briar-android/assets/tor-pie.zip b/briar-android/assets/tor-pie.zip new file mode 100644 index 000000000..72bad14dd Binary files /dev/null and b/briar-android/assets/tor-pie.zip differ diff --git a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java index 9ea97b558..4aa1b43e6 100644 --- a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java +++ b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java @@ -226,7 +226,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { copy(in, out); // Make the Tor binary executable if(!setExecutable(torFile)) { - LOG.warning("Could not make Tor executable"); + LOG.warning("Could not make Tor binary executable"); return false; } return true; @@ -266,14 +266,23 @@ class TorPlugin implements DuplexPlugin, EventHandler { } private InputStream getTorInputStream() throws IOException { - InputStream in = appContext.getResources().getAssets().open("tor.zip"); + String filename; + if(Build.VERSION.SDK_INT >= 16) { + LOG.info("Installing PIE Tor binary"); + filename = "tor-pie.zip"; + } else { + LOG.info("Installing non-PIE Tor binary"); + filename = "tor.zip"; + } + InputStream in = appContext.getResources().getAssets().open(filename); ZipInputStream zin = new ZipInputStream(in); if(zin.getNextEntry() == null) throw new IOException(); return zin; } private InputStream getGeoIpInputStream() throws IOException { - InputStream in = appContext.getResources().getAssets().open("geoip.zip"); + String filename = "geoip.zip"; + InputStream in = appContext.getResources().getAssets().open(filename); ZipInputStream zin = new ZipInputStream(in); if(zin.getNextEntry() == null) throw new IOException(); return zin;