Skip to content
Snippets Groups Projects
Verified Commit f60edcd3 authored by Sebastian's avatar Sebastian
Browse files

Delete tor binaries instead of just overwriting them

parent 07c10717
No related branches found
No related tags found
1 merge request!2Add support for macOS
......@@ -229,6 +229,10 @@ abstract class AbstractTorWrapper implements EventHandler, TorWrapper {
LOG.info("Installing Tor binary for " + architecture);
}
File torFile = getTorExecutableFile();
// Important: delete file here and with other binaries below to prevent
// problems on macOS in case the file signature changed.
//noinspection ResultOfMethodCallIgnored
torFile.delete();
extract(getExecutableInputStream("tor"), torFile);
if (!torFile.setExecutable(true, true)) throw new IOException();
}
......@@ -238,6 +242,8 @@ abstract class AbstractTorWrapper implements EventHandler, TorWrapper {
LOG.info("Installing libevent binary for " + architecture);
}
File libEventFile = getLibEventFile();
//noinspection ResultOfMethodCallIgnored
libEventFile.delete();
extract(getExecutableInputStream("libevent-2.1.7.dylib"), libEventFile);
}
......@@ -246,6 +252,8 @@ abstract class AbstractTorWrapper implements EventHandler, TorWrapper {
LOG.info("Installing obfs4proxy binary for " + architecture);
}
File obfs4File = getObfs4ExecutableFile();
//noinspection ResultOfMethodCallIgnored
obfs4File.delete();
extract(getExecutableInputStream("obfs4proxy"), obfs4File);
if (!obfs4File.setExecutable(true, true)) throw new IOException();
}
......@@ -255,6 +263,8 @@ abstract class AbstractTorWrapper implements EventHandler, TorWrapper {
LOG.info("Installing snowflake binary for " + architecture);
}
File snowflakeFile = getSnowflakeExecutableFile();
//noinspection ResultOfMethodCallIgnored
snowflakeFile.delete();
extract(getExecutableInputStream("snowflake"), snowflakeFile);
if (!snowflakeFile.setExecutable(true, true)) throw new IOException();
}
......
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