Upgrade ss-local to version 3.0.5

This commit is contained in:
Qiu Yuzhou
2017-03-22 22:36:05 +08:00
parent f61c0e5a0a
commit 74f1515f5f
11 changed files with 56 additions and 20 deletions

View File

@ -8,7 +8,7 @@
import Foundation
let SS_LOCAL_VERSION = "2.5.6"
let SS_LOCAL_VERSION = "3.0.5"
let KCPTUN_CLIENT_VERSION = "20170117"
let PRIVOXY_VERSION = "3.0.26.static"
let APP_SUPPORT_DIR = "/Library/Application Support/ShadowsocksX-NG/"
@ -31,7 +31,7 @@ func getFileSHA1Sum(_ filepath: String) -> String {
// MARK: sslocal
func generateSSLocalLauchAgentPlist() -> Bool {
let sslocalPath = NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local"
let sslocalPath = NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local-latest/ss-local"
let logFilePath = NSHomeDirectory() + "/Library/Logs/ss-local.log"
let launchAgentDirPath = NSHomeDirectory() + LAUNCH_AGENT_DIR
let plistFilepath = launchAgentDirPath + LAUNCH_AGENT_CONF_SSLOCAL_NAME
@ -64,7 +64,7 @@ func generateSSLocalLauchAgentPlist() -> Bool {
"StandardOutPath": logFilePath,
"StandardErrorPath": logFilePath,
"ProgramArguments": arguments,
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": NSHomeDirectory() + APP_SUPPORT_DIR]
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local-latest/"]
]
dict.write(toFile: plistFilepath, atomically: true)
let Sha1Sum = getFileSHA1Sum(plistFilepath)
@ -103,9 +103,7 @@ func InstallSSLocal() {
let fileMgr = FileManager.default
let homeDir = NSHomeDirectory()
let appSupportDir = homeDir+APP_SUPPORT_DIR
if !fileMgr.fileExists(atPath: appSupportDir + "ss-local-\(SS_LOCAL_VERSION)/ss-local")
|| !fileMgr.fileExists(atPath: appSupportDir + "libcrypto.1.0.0.dylib")
|| !fileMgr.fileExists(atPath: appSupportDir + "libpcre.1.dylib") {
if !fileMgr.fileExists(atPath: appSupportDir + "ss-local-\(SS_LOCAL_VERSION)/ss-local") {
let bundle = Bundle.main
let installerPath = bundle.path(forResource: "install_ss_local.sh", ofType: nil)
let task = Process.launchedProcess(launchPath: installerPath!, arguments: [""])

View File

@ -162,7 +162,9 @@ class ServerProfile: NSObject, NSCopying {
conf["local_port"] = NSNumber(value: UInt16(defaults.integer(forKey: "LocalSocks5.ListenPort")) as UInt16)
conf["local_address"] = defaults.string(forKey: "LocalSocks5.ListenAddress") as AnyObject?
conf["timeout"] = NSNumber(value: UInt32(defaults.integer(forKey: "LocalSocks5.Timeout")) as UInt32)
conf["auth"] = NSNumber(value: ota as Bool)
if ota {
conf["auth"] = NSNumber(value: ota as Bool)
}
if enabledKcptun {
let localHost = defaults.string(forKey: "Kcptun.LocalHost")

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# install_ss_local.sh
# ShadowsocksX-NG
@ -8,14 +8,30 @@
cd `dirname "${BASH_SOURCE[0]}"`
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-2.5.6"
cp -f ss-local "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-2.5.6/"
rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local"
ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-2.5.6/ss-local" "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local"
cp -f libcrypto.1.0.0.dylib "$HOME/Library/Application Support/ShadowsocksX-NG/"
cp -f libpcre.1.dylib "$HOME/Library/Application Support/ShadowsocksX-NG/"
rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.dylib"
ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.1.dylib" "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.dylib"
NGDir="$HOME/Library/Application Support/ShadowsocksX-NG"
TargetDir="$NGDir/ss-local-3.0.5"
LatestTargetDir="$NGDir/ss-local-latest"
echo ngdir: ${NGDir}
mkdir -p "$TargetDir"
cp -f ss-local "$TargetDir"
rm -f "$LatestTargetDir"
ln -s "$TargetDir" "$LatestTargetDir"
#ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-3.0.5/" "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-latest/"
#rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local"
#ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-2.5.6/ss-local" "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local"
cp -f libev.4.dylib "$TargetDir"
cp -f libmbedcrypto.2.4.2.dylib "$TargetDir"
cp -f libpcre.1.dylib "$TargetDir"
cp -f libsodium.18.dylib "$TargetDir"
cp -f libudns.0.dylib "$TargetDir"
#cp -f libcrypto.1.0.0.dylib "$HOME/Library/Application Support/ShadowsocksX-NG/"
#cp -f libpcre.1.dylib "$HOME/Library/Application Support/ShadowsocksX-NG/"
#rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.dylib"
#ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.1.dylib" "$HOME/Library/Application Support/ShadowsocksX-NG/libpcre.dylib"
echo done

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.