Embed libcrypto.1.0.0.dylib which been depand by ss-local.

This commit is contained in:
Charlie Qiu
2016-06-11 00:44:52 +08:00
parent 197e5eb47e
commit 98689a83aa
5 changed files with 17 additions and 4 deletions

View File

@ -40,6 +40,7 @@
9B3FFF4C1D09D8F70019A709 /* install_helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4B1D09D8F70019A709 /* install_helper.sh */; }; 9B3FFF4C1D09D8F70019A709 /* install_helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4B1D09D8F70019A709 /* install_helper.sh */; };
9B3FFF4F1D09D9D50019A709 /* ProxyConfHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */; }; 9B3FFF4F1D09D9D50019A709 /* ProxyConfHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */; };
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF441D09CD3B0019A709 /* proxy_conf_helper */; }; 9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF441D09CD3B0019A709 /* proxy_conf_helper */; };
9BE8FBBF1D0B211600CAFD01 /* libcrypto.1.0.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */; };
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */; }; 9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */; };
9BEEF06A1D04D4D500FC52B3 /* start_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0661D04CE8D00FC52B3 /* start_ss_local.sh */; }; 9BEEF06A1D04D4D500FC52B3 /* start_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0661D04CE8D00FC52B3 /* start_ss_local.sh */; };
9BEEF06B1D04D4D500FC52B3 /* stop_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0671D04CE9A00FC52B3 /* stop_ss_local.sh */; }; 9BEEF06B1D04D4D500FC52B3 /* stop_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0671D04CE9A00FC52B3 /* stop_ss_local.sh */; };
@ -148,6 +149,7 @@
9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyConfHelper.m; sourceTree = "<group>"; }; 9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyConfHelper.m; sourceTree = "<group>"; };
9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = proxy_conf_helper_version.h; sourceTree = "<group>"; }; 9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = proxy_conf_helper_version.h; sourceTree = "<group>"; };
9B3FFF511D09DBA20019A709 /* ShadowsocksX-NG-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ShadowsocksX-NG-Bridging-Header.h"; sourceTree = "<group>"; }; 9B3FFF511D09DBA20019A709 /* ShadowsocksX-NG-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ShadowsocksX-NG-Bridging-Header.h"; sourceTree = "<group>"; };
9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.1.0.0.dylib; sourceTree = "<group>"; };
9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = install_ss_local.sh; sourceTree = "<group>"; }; 9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = install_ss_local.sh; sourceTree = "<group>"; };
9BEEF0661D04CE8D00FC52B3 /* start_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = start_ss_local.sh; sourceTree = "<group>"; }; 9BEEF0661D04CE8D00FC52B3 /* start_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = start_ss_local.sh; sourceTree = "<group>"; };
9BEEF0671D04CE9A00FC52B3 /* stop_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = stop_ss_local.sh; sourceTree = "<group>"; }; 9BEEF0671D04CE9A00FC52B3 /* stop_ss_local.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = stop_ss_local.sh; sourceTree = "<group>"; };
@ -217,6 +219,7 @@
9B07EFB01D048E900052D9DF /* Support Files */ = { 9B07EFB01D048E900052D9DF /* Support Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */,
9B172A6C1D0ADDDD00B87B9A /* Localizable.strings */, 9B172A6C1D0ADDDD00B87B9A /* Localizable.strings */,
9B3FFF4B1D09D8F70019A709 /* install_helper.sh */, 9B3FFF4B1D09D8F70019A709 /* install_helper.sh */,
9B3FFF351D08CF110019A709 /* jquery.min.js */, 9B3FFF351D08CF110019A709 /* jquery.min.js */,
@ -480,6 +483,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9BE8FBBF1D0B211600CAFD01 /* libcrypto.1.0.0.dylib in Resources */,
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */, 9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */,
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */, 9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */,
9B172A6A1D0ADDDD00B87B9A /* Localizable.strings in Resources */, 9B172A6A1D0ADDDD00B87B9A /* Localizable.strings in Resources */,
@ -878,6 +882,7 @@
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/system", "$(SDKROOT)/usr/lib/system",
"$(PROJECT_DIR)/ShadowsocksX-NG",
); );
MACOSX_DEPLOYMENT_TARGET = 10.10; MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG"; PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG";
@ -903,6 +908,7 @@
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/system", "$(SDKROOT)/usr/lib/system",
"$(PROJECT_DIR)/ShadowsocksX-NG",
); );
MACOSX_DEPLOYMENT_TARGET = 10.10; MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG"; PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG";

View File

@ -125,6 +125,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
ProxyConfHelper.install() ProxyConfHelper.install()
applyConfig() applyConfig()
SyncSSLocal()
} }
func applicationWillTerminate(aNotification: NSNotification) { func applicationWillTerminate(aNotification: NSNotification) {

View File

@ -21,7 +21,8 @@ func getFileSHA1Sum(filepath: String) -> String {
return "" return ""
} }
// Ref: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
// Genarate the mac launch agent service plist
func generateSSLocalLauchAgentPlist() -> Bool { func generateSSLocalLauchAgentPlist() -> Bool {
let sslocalPath = NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local" let sslocalPath = NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local"
let logFilePath = NSHomeDirectory() + "/Library/Logs/ss-local.log" let logFilePath = NSHomeDirectory() + "/Library/Logs/ss-local.log"
@ -42,13 +43,15 @@ func generateSSLocalLauchAgentPlist() -> Bool {
} }
} }
// For a complete listing of the keys, see the launchd.plist manual page.
let dict: NSMutableDictionary = [ let dict: NSMutableDictionary = [
"Label": "com.qiuyuzhou.shadowsocksX-NE.local", "Label": "com.qiuyuzhou.shadowsocksX-NE.local",
"WorkingDirectory": NSHomeDirectory() + APP_SUPPORT_DIR, "WorkingDirectory": NSHomeDirectory() + APP_SUPPORT_DIR,
"KeepAlive": true, "KeepAlive": true,
"StandardOutPath": logFilePath, "StandardOutPath": logFilePath,
"StandardErrorPath": logFilePath, "StandardErrorPath": logFilePath,
"ProgramArguments": arguments "ProgramArguments": arguments,
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": NSHomeDirectory() + APP_SUPPORT_DIR]
] ]
dict.writeToFile(plistFilepath, atomically: true) dict.writeToFile(plistFilepath, atomically: true)
let Sha1Sum = getFileSHA1Sum(plistFilepath) let Sha1Sum = getFileSHA1Sum(plistFilepath)
@ -98,7 +101,9 @@ func StopSSLocal() {
func InstallSSLocal() { func InstallSSLocal() {
let fileMgr = NSFileManager.defaultManager() let fileMgr = NSFileManager.defaultManager()
let homeDir = NSHomeDirectory() let homeDir = NSHomeDirectory()
if !fileMgr.fileExistsAtPath(homeDir+APP_SUPPORT_DIR+SS_LOCAL_VERSION+"/ss-local") { let appSupportDir = homeDir+APP_SUPPORT_DIR
if !fileMgr.fileExistsAtPath(appSupportDir + SS_LOCAL_VERSION + "/ss-local")
|| !fileMgr.fileExistsAtPath(appSupportDir + "libcrypto.1.0.0.dylib") {
let bundle = NSBundle.mainBundle() let bundle = NSBundle.mainBundle()
let installerPath = bundle.pathForResource("install_ss_local.sh", ofType: nil) let installerPath = bundle.pathForResource("install_ss_local.sh", ofType: nil)
let task = NSTask.launchedTaskWithLaunchPath(installerPath!, arguments: [""]) let task = NSTask.launchedTaskWithLaunchPath(installerPath!, arguments: [""])

View File

@ -12,6 +12,7 @@ mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local-2.4.6"
cp -f ss-local "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local-2.4.6/" cp -f ss-local "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local-2.4.6/"
rm -f "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local" rm -f "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local"
ln -s "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local-2.4.6/ss-local" "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local" ln -s "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local-2.4.6/ss-local" "$HOME/Library/Application Support/ShadowsocksX-NE/ss-local"
#cp -f "com.qiuyuzhou.shadowsocksX-NE.local.plist" "$HOME/Library/LaunchAgents/"
cp -f libcrypto.1.0.0.dylib "$HOME/Library/Application Support/ShadowsocksX-NE/"
echo done echo done

Binary file not shown.