Update shadowsocks.js, wintap.js

This commit is contained in:
Namhyeon Go 2020-07-29 11:23:28 +09:00
parent 741ff688bb
commit 97906e8296
2 changed files with 35 additions and 2 deletions

View File

@ -11,9 +11,9 @@ exports.require = global.require;
var arch = SYS.getArch();
if(arch.indexOf("64") > -1) {
exports.binPath = "bin/shadowsocks-lib-mingw-x86_64/ss-local";
exports.binPath = "bin/shadowsocks-lib-mingw-x86_64/ss-local.exe";
} else {
exports.binPath = "bin/shadowsocks-lib-mingw-x86/ss-local";
exports.binPath = "bin/shadowsocks-lib-mingw-x86/ss-local.exe";
}
exports.getRandomInt = function(min, max) {

33
lib/wintap.js Normal file
View File

@ -0,0 +1,33 @@
////////////////////////////////////////////////////////////////////////
// WindowsTAP API
////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
var SYS = require("lib/system");
exports.VERSIONINFO = "WindowsTAP Lib (wintap.js) version 0.1";
exports.global = global;
exports.require = global.require;
var arch = SYS.getArch();
if(arch.indexOf("64") > -1) {
exports.binPath = "bin/tap-windows-9.24.2/amd64/tapinstall.exe";
} else {
exports.binPath = "bin/tap-windows-9.24.2/i386/tapinstall.exe";
}
exports.install = function(inf, id) {
return SHELL.exec([exports.binPath, "install", inf, id]);
};
exports.update = function(inf, id) {
return SHELL.exec([exports.binPath, "update", inf, id]);
};
exports.query = function(id) {
return SHELL.exec([exports.binPath, "hwids", id]);
};
exports.remove = function(id) {
return SHELL.exec([exports.binPath, "remove", id]);
};