mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Use PIE Tor binary on API version 16+.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:targetSdkVersion="20"
|
||||
android:maxSdkVersion="20"
|
||||
/>
|
||||
|
||||
<uses-feature android:name="android.hardware.bluetooth" />
|
||||
|
||||
BIN
briar-android/assets/tor-pie.zip
Normal file
BIN
briar-android/assets/tor-pie.zip
Normal file
Binary file not shown.
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user