feat(脚本): 添加VLESS二维码

pull/534/merge
mack-a 2021-01-07 14:54:54 +08:00
parent 7eea1bcc16
commit 655bfc6c48
1 changed files with 15 additions and 12 deletions

View File

@ -2253,13 +2253,13 @@ defaultBase64Code(){
local add=$6 local add=$6
if [[ "${type}" = "vlesstcp" ]] if [[ "${type}" = "vlesstcp" ]]
then then
qrCodeBase64Default=`echo -n '{"port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":"/'${path}'","net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` echoContent yellow " ---> 通用格式(VLESS+TCP+TLS/XTLS)"
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` local VLESSID=`echo ${id}|awk -F "[\"]" '{print $2}'`
echo "通用vmess(VLESS+TCP+TLS)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf local VLESSEmail=`echo ${ps}|awk -F "[\"]" '{print $2}'`
echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echoContent green " vless://${VLESSID}@${host}:${port}?security=xtls&encryption=none&host=${host}&headerType=none&type=tcp&flow=xtls-rprx-splice#${VLESSEmail}\n"
echoContent yellow " ---> 通用json(VLESS+TCP+TLS)"
echoContent green ' {"port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n' echoContent yellow " ---> 二维码 VLESS(VLESS+TCP+TLS/XTLS)"
echoContent green ' V2Ray、Xray 目前无通用订阅需要手动配置VLESS TCP、XTLS和TCP大部分一样其余内容不变请注意手动输入的流控flow类型v2ray-core v4.32.1之后不支持XTLSXray-core支持建议使用Xray-core\n' echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3a%2f%2f${VLESSID}%40${host}%3a${port}%3fsecurity%3dxtls%26encryption%3dnone%26host%3d${host}%26headerType%3dnone%26type%3dtcp%26flow%3dxtls%2drprx%2dsplice%23${VLESSEmail}\n"
elif [[ "${type}" = "vmessws" ]] elif [[ "${type}" = "vmessws" ]]
then then
@ -2284,10 +2284,13 @@ defaultBase64Code(){
echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n" echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n"
elif [[ "${type}" = "vlessws" ]] elif [[ "${type}" = "vlessws" ]]
then then
qrCodeBase64Default=`echo -n '{"port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":"/'${path}'","net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` local VLESSID=`echo ${id}|awk -F "[\"]" '{print $2}'`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` local VLESSEmail=`echo ${ps}|awk -F "[\"]" '{print $2}'`
echoContent yellow " ---> 通用json(VLESS+WS+TLS)" echoContent yellow " ---> 通用格式(VLESS+WS+TLS)"
echoContent green ' {"port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":"/'${path}'","net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n' echoContent green " vless://${VLESSID}@${host}:${port}?path=%2f${path}&security=tls&encryption=none%26host=${host}&type=ws#${VLESSEmail}\n"
echoContent yellow " ---> 二维码 VLESS(VLESS+TCP+TLS/XTLS)"
echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3a%2f%2f${VLESSID}%40${host}%3a${port}%3fpath%3d%2f${path}%26security%3dtls%26encryption%3dnone%26host%3d${host}%26type%3dws%23${VLESSEmail}"
elif [[ "${type}" = "trojan" ]] elif [[ "${type}" = "trojan" ]]
then then
# URLEncode # URLEncode
@ -3305,7 +3308,7 @@ menu(){
cd cd
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.2.18" echoContent green "当前版本v2.2.19"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:七合一共存脚本" echoContent green "描述:七合一共存脚本"
echoContent red "==============================================================" echoContent red "=============================================================="