mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
parent
329a3fd267
commit
99ba92e755
@ -48,15 +48,15 @@
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s)
|
||||
return false;
|
||||
var v_server = document.getElementById('cbid.shadowsocksr.' + sid + '.server');
|
||||
var v_port = document.getElementById('cbid.shadowsocksr.' + sid + '.server_port');
|
||||
var v_protocol = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol');
|
||||
var v_method = document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method');
|
||||
var v_obfs = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs');
|
||||
var v_password = document.getElementById('cbid.shadowsocksr.' + sid + '.password');
|
||||
var v_obfs_param = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param');
|
||||
var v_protocol_param = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param');
|
||||
var v_alias = document.getElementById('cbid.shadowsocksr.' + sid + '.alias');
|
||||
var v_server = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server');
|
||||
var v_port = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port');
|
||||
var v_protocol = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol');
|
||||
var v_method = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method');
|
||||
var v_obfs = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs');
|
||||
var v_password = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password');
|
||||
var v_obfs_param = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs_param');
|
||||
var v_protocol_param = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol_param');
|
||||
var v_alias = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias');
|
||||
|
||||
var ssr_str = v_server.value + ":" +
|
||||
v_port.value + ":" +
|
||||
@ -108,8 +108,8 @@
|
||||
if (ssu[0] == "ssr") {
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ssr";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "ssr";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
@ -127,18 +127,18 @@
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm[2];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol').value = ssm[3];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method').value = ssm[4];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs').value = ssm[5];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = b64decsafe(ssm[6]);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param').value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param').value = dictvalue(pdict, 'protoparam');
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = ssm[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = ssm[2];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol').value = ssm[3];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method').value = ssm[4];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs').value = ssm[5];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = b64decsafe(ssm[6]);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs_param').value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol_param').value = dictvalue(pdict, 'protoparam');
|
||||
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0)
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = b64decutf8safe(rem);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = b64decutf8safe(rem);
|
||||
|
||||
s.innerHTML = "<font color='green'>导入ShadowsocksR配置信息成功</font>";
|
||||
return false;
|
||||
@ -153,19 +153,19 @@
|
||||
var sstr = b64decsafe(url0);
|
||||
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = part1[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = part1[0];
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
|
||||
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
|
||||
@ -181,18 +181,18 @@
|
||||
var sstr = b64decsafe(url0);
|
||||
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "trojan";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "trojan";
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
|
||||
s.innerHTML = "<font color='green'>导入Trojan配置信息成功</font>";
|
||||
@ -200,25 +200,25 @@
|
||||
} else if (ssu[0] == "vmess") {
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "v2ray";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "v2ray";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = JSON.parse(sstr);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = ssm.ps;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm.add;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm.port;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alter_id').value = ssm.aid;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = ssm.ps;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = ssm.add;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = ssm.port;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alter_id').value = ssm.aid;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
|
||||
if(ssm.tls == "tls"){
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.insecure').checked = true;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.insecure').checked = true;
|
||||
}
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.transport').dispatchEvent(event);
|
||||
|
||||
switch(ssm.net){
|
||||
case "tcp":
|
||||
@ -228,8 +228,8 @@
|
||||
break;
|
||||
|
||||
case "ws":
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_host').value = ssm.host;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_path').value = ssm.path;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.ws_host').value = ssm.host;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.ws_path').value = ssm.path;
|
||||
break;
|
||||
|
||||
case "h2":
|
||||
|
@ -47,15 +47,15 @@
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s)
|
||||
return false;
|
||||
var v_server = document.getElementById('cbid.shadowsocksr.' + sid + '.server');
|
||||
var v_port = document.getElementById('cbid.shadowsocksr.' + sid + '.server_port');
|
||||
var v_protocol = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol');
|
||||
var v_method = document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method');
|
||||
var v_obfs = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs');
|
||||
var v_password = document.getElementById('cbid.shadowsocksr.' + sid + '.password');
|
||||
var v_obfs_param = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param');
|
||||
var v_protocol_param = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param');
|
||||
var v_alias = document.getElementById('cbid.shadowsocksr.' + sid + '.alias');
|
||||
var v_server = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server');
|
||||
var v_port = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port');
|
||||
var v_protocol = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol');
|
||||
var v_method = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method');
|
||||
var v_obfs = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs');
|
||||
var v_password = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password');
|
||||
var v_obfs_param = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs_param');
|
||||
var v_protocol_param = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol_param');
|
||||
var v_alias = document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias');
|
||||
var ssr_str = v_server.value + ":" +
|
||||
v_port.value + ":" +
|
||||
v_protocol.value + ":" +
|
||||
@ -104,8 +104,8 @@
|
||||
if (ssu[0] == "ssr") {
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ssr";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "ssr";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
@ -123,17 +123,17 @@
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm[2];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol').value = ssm[3];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method').value = ssm[4];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs').value = ssm[5];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = b64decsafe(ssm[6]);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param').value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param').value = dictvalue(pdict, 'protoparam');
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = ssm[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = ssm[2];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol').value = ssm[3];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method').value = ssm[4];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs').value = ssm[5];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = b64decsafe(ssm[6]);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.obfs_param').value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.protocol_param').value = dictvalue(pdict, 'protoparam');
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0)
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = b64decutf8safe(rem);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = b64decutf8safe(rem);
|
||||
s.innerHTML = "<font color='green'>导入ShadowsocksR配置信息成功</font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "ss") {
|
||||
@ -169,35 +169,35 @@
|
||||
method = userInfo.substr(0, userInfoSplitIndex);
|
||||
password = userInfo.substr(userInfoSplitIndex + 1);
|
||||
}
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = server;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = port;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = password || "";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = method || "";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.plugin').value = plugin || "";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.plugin_opts').value = pluginOpts || "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = server;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = port;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = password || "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = method || "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.plugin').value = plugin || "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.plugin_opts').value = pluginOpts || "";
|
||||
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "ss";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = part1[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.plugin').value = "";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.plugin_opts').value = "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = part1[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.plugin').value = "";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.plugin_opts').value = "";
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
|
||||
}
|
||||
@ -213,8 +213,8 @@
|
||||
}
|
||||
var sstr = url0;
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "trojan";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "trojan";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var password = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
@ -230,63 +230,63 @@
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = serverPart[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = port;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = password;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').dispatchEvent(event);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls_host').value = queryParam.peer || '';
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.insecure').checked = queryParam.allowInsecure === '1';
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = serverPart[0];
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = port;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.password').value = password;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls_host').value = queryParam.peer || '';
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.insecure').checked = queryParam.allowInsecure === '1';
|
||||
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Trojan配置信息成功</font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "vmess") {
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "v2ray";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').value = "v2ray";
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = JSON.parse(sstr);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = ssm.ps;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm.add;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm.port;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alter_id').value = ssm.aid;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alias').value = ssm.ps;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server').value = ssm.add;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.server_port').value = ssm.port;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.alter_id').value = ssm.aid;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.transport').dispatchEvent(event);
|
||||
if (ssm.net == "tcp") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.http_host').value = ssm.host;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.http_path').value = ssm.path;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.http_host').value = ssm.host;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.http_path').value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "ws") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_host').value = ssm.host;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_path').value = ssm.path;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.ws_host').value = ssm.host;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.ws_path').value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "h2") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.h2_host').value = ssm.host;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.h2_path').value = ssm.path;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.h2_host').value = ssm.host;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.h2_path').value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "quic") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.quic_security').value = ssm.securty;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.quic_key').value = ssm.key;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.quic_security').value = ssm.securty;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.quic_key').value = ssm.key;
|
||||
}
|
||||
if (ssm.net == "kcp") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.kcp_guise').value = ssm.type;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.kcp_guise').value = ssm.type;
|
||||
}
|
||||
if (ssm.tls == "tls") {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').dispatchEvent(event);
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls_host').value = ssm.host;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls').checked = true;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.tls_host').value = ssm.host;
|
||||
}
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.mux').checked = true;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.mux').dispatchEvent(event);
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.mux').checked = true;
|
||||
document.getElementById('widget.cbid.shadowsocksr.' + sid + '.mux').dispatchEvent(event);
|
||||
s.innerHTML = "<font color='green'>导入V2ray配置信息成功</font>";
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user