Add v2ray-plugin
Add [v2ray-plugin](https://github.com/shadowsocks/v2ray-plugin)
This commit is contained in:
@ -84,6 +84,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
InstallPrivoxy()
|
||||
InstallSimpleObfs()
|
||||
InstallKcptun()
|
||||
InstallV2rayPlugin()
|
||||
|
||||
// Prepare defaults
|
||||
let defaults = UserDefaults.standard
|
||||
|
||||
@ -10,6 +10,7 @@ import Foundation
|
||||
|
||||
let SS_LOCAL_VERSION = "3.1.3"
|
||||
let KCPTUN_CLIENT_VERSION = "v20170718"
|
||||
let V2RAY_PLUGIN_VERSION = "master"
|
||||
let PRIVOXY_VERSION = "3.0.26.static"
|
||||
let SIMPLE_OBFS_VERSION = "0.0.5_1"
|
||||
let APP_SUPPORT_DIR = "/Library/Application Support/ShadowsocksX-NG/"
|
||||
@ -230,6 +231,26 @@ func InstallKcptun() {
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: v2ray-plugin
|
||||
|
||||
func InstallV2rayPlugin() {
|
||||
let fileMgr = FileManager.default
|
||||
let homeDir = NSHomeDirectory()
|
||||
let appSupportDir = homeDir+APP_SUPPORT_DIR
|
||||
if !fileMgr.fileExists(atPath: appSupportDir + "v2ray-plugin_\(V2RAY_PLUGIN_VERSION)/v2ray-plugin") {
|
||||
let bundle = Bundle.main
|
||||
let installerPath = bundle.path(forResource: "install_v2ray_plugin", ofType: "sh")
|
||||
let task = Process.launchedProcess(launchPath: "/bin/sh", arguments: [installerPath!])
|
||||
task.waitUntilExit()
|
||||
if task.terminationStatus == 0 {
|
||||
NSLog("Install v2ray-plugin succeeded.")
|
||||
} else {
|
||||
NSLog("Install v2ray-plugin failed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: privoxy
|
||||
|
||||
|
||||
19
ShadowsocksX-NG/v2ray-plugin/install_v2ray_plugin.sh
Normal file
19
ShadowsocksX-NG/v2ray-plugin/install_v2ray_plugin.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# install_v2ray_plugin.sh
|
||||
# ShadowsocksX-NG
|
||||
#
|
||||
# Created by lkebin on 2019/2/18.
|
||||
# Copyright © 2019 qiuyuzhou. All rights reserved.
|
||||
# https://github.com/shadowsocks/v2ray-plugin/tree/master
|
||||
|
||||
VERSION="master"
|
||||
|
||||
cd `dirname "${BASH_SOURCE[0]}"`
|
||||
|
||||
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/v2ray-plugin_$VERSION"
|
||||
cp -f v2ray-plugin "$HOME/Library/Application Support/ShadowsocksX-NG/v2ray-plugin_$VERSION/"
|
||||
|
||||
ln -sfh "$HOME/Library/Application Support/ShadowsocksX-NG/v2ray-plugin_$VERSION/v2ray-plugin" "$HOME/Library/Application Support/ShadowsocksX-NG/plugins/v2ray-plugin"
|
||||
|
||||
echo "install v2ray-plugin done"
|
||||
BIN
ShadowsocksX-NG/v2ray-plugin/v2ray-plugin
Executable file
BIN
ShadowsocksX-NG/v2ray-plugin/v2ray-plugin
Executable file
Binary file not shown.
Reference in New Issue
Block a user