WIP: macos support

This commit is contained in:
Sebastian Kürten
2022-01-05 00:32:57 +01:00
parent 3dbf327937
commit b5283146b1
10 changed files with 150743 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ class UnixTorPlugin extends JavaTorPlugin {
private interface CLibrary extends Library {
CLibrary INSTANCE = Native.loadLibrary("c", CLibrary.class);
CLibrary INSTANCE = Native.load("c", CLibrary.class);
int getpid();
}

View File

@@ -27,6 +27,7 @@ import javax.net.SocketFactory;
import static java.util.logging.Level.INFO;
import static org.briarproject.bramble.util.OsUtils.isLinux;
import static org.briarproject.bramble.util.OsUtils.isMac;
@Immutable
@NotNullByDefault
@@ -57,14 +58,18 @@ public class UnixTorPluginFactory extends TorPluginFactory {
@Nullable
@Override
String getArchitectureForTorBinary() {
if (!isLinux()) return null;
if (!isLinux() && !isMac()) return null;
String arch = System.getProperty("os.arch");
if (LOG.isLoggable(INFO)) {
LOG.info("System's os.arch is " + arch);
}
if (arch.equals("amd64")) return "x86_64";
else if (arch.equals("aarch64")) return "aarch64";
else if (arch.equals("arm")) return "armhf";
if (isLinux()) {
if (arch.equals("amd64")) return "x86_64";
else if (arch.equals("aarch64")) return "aarch64";
else if (arch.equals("arm")) return "armhf";
} else if (isMac()) {
if (arch.equals("aarch64")) return "aarch64";
}
return null;
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.