Extracts obfs-local 0.0.2
This commit is contained in:
@ -82,6 +82,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
InstallSSLocal()
|
||||
InstallKcptunClient()
|
||||
InstallPrivoxy()
|
||||
InstallSimpleObfs()
|
||||
// Prepare defaults
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.register(defaults: [
|
||||
|
@ -11,6 +11,7 @@ import Foundation
|
||||
let SS_LOCAL_VERSION = "3.0.5"
|
||||
let KCPTUN_CLIENT_VERSION = "20170322"
|
||||
let PRIVOXY_VERSION = "3.0.26.static"
|
||||
let SIMPLE_OBFS_VERSION = "0.0.2"
|
||||
let APP_SUPPORT_DIR = "/Library/Application Support/ShadowsocksX-NG/"
|
||||
let LAUNCH_AGENT_DIR = "/Library/LaunchAgents/"
|
||||
let LAUNCH_AGENT_CONF_SSLOCAL_NAME = "com.qiuyuzhou.shadowsocksX-NG.local.plist"
|
||||
@ -180,6 +181,27 @@ func SyncSSLocal() {
|
||||
SyncKcptun()
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: simple-obfs
|
||||
|
||||
func InstallSimpleObfs() {
|
||||
let fileMgr = FileManager.default
|
||||
let homeDir = NSHomeDirectory()
|
||||
let appSupportDir = homeDir + APP_SUPPORT_DIR
|
||||
if !fileMgr.fileExists(atPath: appSupportDir + "simple-obfs-\(SIMPLE_OBFS_VERSION)/obfs-local")
|
||||
|| !fileMgr.fileExists(atPath: appSupportDir + "plugins/obfs-local") {
|
||||
let bundle = Bundle.main
|
||||
let installerPath = bundle.path(forResource: "install_simple_obfs.sh", ofType: nil)
|
||||
let task = Process.launchedProcess(launchPath: "/bin/sh", arguments: [installerPath!])
|
||||
task.waitUntilExit()
|
||||
if task.terminationStatus == 0 {
|
||||
NSLog("Install simple-obfs succeeded.")
|
||||
} else {
|
||||
NSLog("Install simple-obfs failed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: privoxy
|
||||
|
||||
|
19
ShadowsocksX-NG/simple-obfs/install_simple_obfs.sh
Normal file
19
ShadowsocksX-NG/simple-obfs/install_simple_obfs.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
FILE_DIR=`dirname "${BASH_SOURCE[0]}"`
|
||||
cd "$FILE_DIR"
|
||||
|
||||
NGDir="$HOME/Library/Application Support/ShadowsocksX-NG"
|
||||
TargetDir="$NGDir/simple-obfs-0.0.2"
|
||||
PluginDir="$NGDir/plugins"
|
||||
|
||||
echo ngdir: ${NGDir}
|
||||
|
||||
mkdir -p "$TargetDir"
|
||||
mkdir -p "$PluginDir"
|
||||
|
||||
cp -f obfs-local "$TargetDir"
|
||||
|
||||
ln -sfh "$TargetDir/obfs-local" "$PluginDir"
|
||||
|
||||
echo done
|
BIN
ShadowsocksX-NG/simple-obfs/obfs-local
Executable file
BIN
ShadowsocksX-NG/simple-obfs/obfs-local
Executable file
Binary file not shown.
Reference in New Issue
Block a user