Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt Universal Binary: Support both Intel and ARM Macs #1360

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 29 additions & 36 deletions Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions ShadowsocksX-NG.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
9B5AA0AC209C43C200E8B659 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 9B5AA0AB209C43C200E8B659 /* Credits.rtf */; };
9B5D132A2154A62600F99F03 /* install_kcptun.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9B5D13272154A50700F99F03 /* install_kcptun.sh */; };
9B6BF9541E27B2570061B9A7 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B6BF9531E27B2570061B9A7 /* ServiceManagement.framework */; };
9B7297E7214D69C300FD24AA /* libmbedcrypto.2.12.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 9B7297E5214D68F800FD24AA /* libmbedcrypto.2.12.0.dylib */; };
9B7297E7214D69C300FD24AA /* libmbedcrypto.2.25.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 9B7297E5214D68F800FD24AA /* libmbedcrypto.2.25.0.dylib */; };
9B7297EA214D7C6B00FD24AA /* ShareServerProfilesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7297E8214D7C6B00FD24AA /* ShareServerProfilesWindowController.swift */; };
9B7297EC214DA88A00FD24AA /* ShareServerProfilesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9B7297EE214DA88A00FD24AA /* ShareServerProfilesWindowController.xib */; };
9B72FB62232782A300C6AAAE /* ImportWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B72FB60232782A300C6AAAE /* ImportWindowController.swift */; };
Expand Down Expand Up @@ -86,6 +86,7 @@
9BEEF0751D04EF3E00FC52B3 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEEF0731D04EF3E00FC52B3 /* PreferencesWindowController.swift */; };
9BEEF0781D04FE8A00FC52B3 /* LaunchAgentUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEEF0771D04FE8A00FC52B3 /* LaunchAgentUtils.swift */; };
B5A2AB04221A72EC003F77B7 /* install_v2ray_plugin.sh in Resources */ = {isa = PBXBuildFile; fileRef = B5A2AB02221A72EC003F77B7 /* install_v2ray_plugin.sh */; };
BB57CC36258FA0F000D7AA1A /* libpcreposix.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = BB57CC34258FA0F000D7AA1A /* libpcreposix.0.dylib */; };
C6D429931DA75988002A5711 /* install_privoxy.sh in Resources */ = {isa = PBXBuildFile; fileRef = C6D4298E1DA75988002A5711 /* install_privoxy.sh */; };
C6D429941DA75988002A5711 /* privoxy in Resources */ = {isa = PBXBuildFile; fileRef = C6D4298F1DA75988002A5711 /* privoxy */; };
C6D429961DA75988002A5711 /* start_privoxy.sh in Resources */ = {isa = PBXBuildFile; fileRef = C6D429911DA75988002A5711 /* start_privoxy.sh */; };
Expand Down Expand Up @@ -205,7 +206,7 @@
9B5AA0AB209C43C200E8B659 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
9B5D13272154A50700F99F03 /* install_kcptun.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = install_kcptun.sh; sourceTree = "<group>"; };
9B6BF9531E27B2570061B9A7 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
9B7297E5214D68F800FD24AA /* libmbedcrypto.2.12.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libmbedcrypto.2.12.0.dylib; sourceTree = "<group>"; };
9B7297E5214D68F800FD24AA /* libmbedcrypto.2.25.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libmbedcrypto.2.25.0.dylib; sourceTree = "<group>"; };
9B7297E8214D7C6B00FD24AA /* ShareServerProfilesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareServerProfilesWindowController.swift; sourceTree = "<group>"; };
9B7297ED214DA88A00FD24AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ShareServerProfilesWindowController.xib; sourceTree = "<group>"; };
9B7297F0214DA89000FD24AA /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ShareServerProfilesWindowController.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -255,6 +256,7 @@
9BEEF0771D04FE8A00FC52B3 /* LaunchAgentUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchAgentUtils.swift; sourceTree = "<group>"; };
B4E6A97CA843F3943524B686 /* Pods-proxy_conf_helper.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-proxy_conf_helper.debug.xcconfig"; path = "Pods/Target Support Files/Pods-proxy_conf_helper/Pods-proxy_conf_helper.debug.xcconfig"; sourceTree = "<group>"; };
B5A2AB02221A72EC003F77B7 /* install_v2ray_plugin.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = install_v2ray_plugin.sh; sourceTree = "<group>"; };
BB57CC34258FA0F000D7AA1A /* libpcreposix.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpcreposix.0.dylib; path = "ShadowsocksX-NG/privoxy/libpcreposix.0.dylib"; sourceTree = "<group>"; };
C6D4298E1DA75988002A5711 /* install_privoxy.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = install_privoxy.sh; sourceTree = "<group>"; };
C6D4298F1DA75988002A5711 /* privoxy */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = privoxy; sourceTree = "<group>"; };
C6D429911DA75988002A5711 /* start_privoxy.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = start_privoxy.sh; sourceTree = "<group>"; };
Expand Down Expand Up @@ -345,6 +347,7 @@
9B0BFFDC1D0460A70040E62B = {
isa = PBXGroup;
children = (
BB57CC34258FA0F000D7AA1A /* libpcreposix.0.dylib */,
9B5831FA1E73098F009D5B7D /* README.md */,
9B172A601D0ADA5B00B87B9A /* genstrings.py */,
9B9F13A11E8A282C00DE4794 /* LaunchHelper.xcodeproj */,
Expand Down Expand Up @@ -446,7 +449,7 @@
9B5AA0A9209C41EC00E8B659 /* ss-local */ = {
isa = PBXGroup;
children = (
9B7297E5214D68F800FD24AA /* libmbedcrypto.2.12.0.dylib */,
9B7297E5214D68F800FD24AA /* libmbedcrypto.2.25.0.dylib */,
9B3F7BF71E82BF2D00C68B75 /* libev.4.dylib */,
9B5AA09F209C100C00E8B659 /* libsodium.23.dylib */,
9B5AA0A2209C103900E8B659 /* libcares.2.dylib */,
Expand Down Expand Up @@ -668,8 +671,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BB57CC36258FA0F000D7AA1A /* libpcreposix.0.dylib in Resources */,
9B5D132A2154A62600F99F03 /* install_kcptun.sh in Resources */,
9B7297E7214D69C300FD24AA /* libmbedcrypto.2.12.0.dylib in Resources */,
9B7297E7214D69C300FD24AA /* libmbedcrypto.2.25.0.dylib in Resources */,
9BCB1D6C20A15B0E005BABE7 /* libsodium.23.dylib in Resources */,
9BCB1D6D20A15B0E005BABE7 /* libcares.2.dylib in Resources */,
9BBE7B751F508A0E00E8FFE5 /* fix_dir_owner.sh in Resources */,
Expand Down
8 changes: 7 additions & 1 deletion ShadowsocksX-NG/LaunchAgentUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,19 @@ func generatePrivoxyLauchAgentPlist() -> Bool {

let arguments = [privoxyPath, "--no-daemon", "privoxy.config"]

let dyld_library_paths = [
NSHomeDirectory() + APP_SUPPORT_DIR + "ss-local-latest/",
NSHomeDirectory() + APP_SUPPORT_DIR + "privoxy-latest/",
]

// For a complete listing of the keys, see the launchd.plist manual page.
let dict: NSMutableDictionary = [
"Label": "com.qiuyuzhou.shadowsocksX-NG.http",
"WorkingDirectory": NSHomeDirectory() + APP_SUPPORT_DIR,
"StandardOutPath": logFilePath,
"StandardErrorPath": logFilePath,
"ProgramArguments": arguments
"ProgramArguments": arguments,
"EnvironmentVariables": ["DYLD_LIBRARY_PATH": dyld_library_paths.joined(separator: ":")]
]
dict.write(toFile: plistFilepath, atomically: true)
let Sha1Sum = getFileSHA1Sum(plistFilepath)
Expand Down
18 changes: 14 additions & 4 deletions ShadowsocksX-NG/privoxy/install_privoxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@

cd "$(dirname "${BASH_SOURCE[0]}")"

privoxyVersion=3.0.26.static
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy-$privoxyVersion"
cp -f privoxy "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy-$privoxyVersion/"
privoxyVersion=3.0.29
targetDir="$HOME/Library/Application Support/ShadowsocksX-NG/privoxy-$privoxyVersion"
latestDir="$HOME/Library/Application Support/ShadowsocksX-NG/privoxy-latest"

mkdir -p "$targetDir"
cp -f privoxy "$targetDir"

# libpcreposix
cp -f libpcreposix.0.dylib "$targetDir"

rm -f "$latestDir"
ln -s "$targetDir" "$latestDir"

rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy"
ln -s "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy-$privoxyVersion/privoxy" "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy"
ln -s "$targetDir/privoxy" "$HOME/Library/Application Support/ShadowsocksX-NG/privoxy"

echo done
Binary file added ShadowsocksX-NG/privoxy/libpcreposix.0.dylib
Binary file not shown.
Binary file modified ShadowsocksX-NG/privoxy/privoxy
Binary file not shown.
15 changes: 7 additions & 8 deletions ShadowsocksX-NG/ss-local/install_ss_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@
cd "$(dirname "${BASH_SOURCE[0]}")"

NGDir="$HOME/Library/Application Support/ShadowsocksX-NG"
TargetDir="$NGDir/ss-local-3.2.5"
TargetDir="$NGDir/ss-local-3.3.5"
LatestTargetDir="$NGDir/ss-local-latest"

echo ngdir: ${NGDir}

# 3.2.5 https://bintray.com/homebrew/bottles/shadowsocks-libev/
# 3.3.5 https://bintray.com/homebrew/bottles/shadowsocks-libev/
mkdir -p "$TargetDir"
cp -f ss-local "$TargetDir"
rm -f "$LatestTargetDir"
ln -s "$TargetDir" "$LatestTargetDir"

cp -f libev.4.dylib "$TargetDir"

# 2.8.0 https://bintray.com/homebrew/bottles/mbedtls
cp -f libmbedcrypto.2.12.0.dylib "$TargetDir"
ln -sfh "$TargetDir/libmbedcrypto.2.12.0.dylib" "$TargetDir/libmbedcrypto.2.dylib"
ln -sfh "$TargetDir/libmbedcrypto.2.12.0.dylib" "$TargetDir/libmbedcrypto.3.dylib"
# 2.25.0 https://bintray.com/homebrew/bottles/mbedtls
cp -f libmbedcrypto.2.25.0.dylib "$TargetDir"
ln -sfh "$TargetDir/libmbedcrypto.2.25.0.dylib" "$TargetDir/libmbedcrypto.6.dylib"

# 8.42 https://bintray.com/homebrew/bottles/pcre
# 8.44 https://bintray.com/homebrew/bottles/pcre
cp -f libpcre.1.dylib "$TargetDir"

# 1.0.18 https://bintray.com/homebrew/bottles/libsodium
Expand All @@ -37,7 +36,7 @@ ln -sfh "$TargetDir/libsodium.23.dylib" "$TargetDir/libsodium.dylib"

#cp -f libudns.0.dylib "$TargetDir"

# 1.15.0 https://bintray.com/homebrew/bottles/c-ares
# 1.17.1 https://bintray.com/homebrew/bottles/c-ares
cp -f libcares.2.dylib "$TargetDir"
ln -sfh "$TargetDir/libcares.2.dylib" "$TargetDir/libcares.dylib"

Expand Down
Binary file modified ShadowsocksX-NG/ss-local/libcares.2.dylib
Binary file not shown.
Binary file modified ShadowsocksX-NG/ss-local/libev.4.dylib
Binary file not shown.
Binary file removed ShadowsocksX-NG/ss-local/libmbedcrypto.2.12.0.dylib
Binary file not shown.
Binary file not shown.
Binary file modified ShadowsocksX-NG/ss-local/libpcre.1.dylib
Binary file not shown.
Binary file modified ShadowsocksX-NG/ss-local/libsodium.23.dylib
Binary file not shown.
Binary file modified ShadowsocksX-NG/ss-local/ss-local
Binary file not shown.