Add v2ray-plugin

Add [v2ray-plugin](https://github.com/shadowsocks/v2ray-plugin)
This commit is contained in:
Kebin Liu
2019-02-18 13:13:34 +08:00
parent 2099db774b
commit cf4f7a5dfc
5 changed files with 57 additions and 0 deletions

View File

@ -84,6 +84,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
InstallPrivoxy()
InstallSimpleObfs()
InstallKcptun()
InstallV2rayPlugin()
// Prepare defaults
let defaults = UserDefaults.standard

View File

@ -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

View 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"

Binary file not shown.