Skip to content
Snippets Groups Projects
Commit bd566fdb authored by akwizgran's avatar akwizgran
Browse files

Moved CPU architecture check from Tor plugin to plugin factory.

This allows us to avoid instantiating the plugin on unsupported
architectures.
parent 676ef951
No related branches found
No related tags found
No related merge requests found
......@@ -113,12 +113,6 @@ class TorPlugin implements DuplexPlugin, EventHandler {
}
public boolean start() throws IOException {
// Check that we have a Tor binary for this architecture
if(!Build.CPU_ABI.startsWith("armeabi")) {
if(LOG.isLoggable(INFO))
LOG.info("No Tor binary for this architecture");
return false;
}
// Try to connect to an existing Tor process if there is one
try {
controlSocket = new Socket("127.0.0.1", CONTROL_PORT);
......
......@@ -8,6 +8,7 @@ import net.sf.briar.api.plugins.duplex.DuplexPlugin;
import net.sf.briar.api.plugins.duplex.DuplexPluginCallback;
import net.sf.briar.api.plugins.duplex.DuplexPluginFactory;
import android.content.Context;
import android.os.Build;
public class TorPluginFactory implements DuplexPluginFactory {
......@@ -31,6 +32,8 @@ public class TorPluginFactory implements DuplexPluginFactory {
}
public DuplexPlugin createPlugin(DuplexPluginCallback callback) {
// Check that we have a Tor binary for this architecture
if(!Build.CPU_ABI.startsWith("armeabi")) return null;
return new TorPlugin(pluginExecutor,appContext, shutdownManager,
callback, MAX_FRAME_LENGTH, MAX_LATENCY, POLLING_INTERVAL);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment