Skip to content

Commit

Permalink
V4.2 修复文件拖拽解析节点后空白的BUG!
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMRLL committed Oct 15, 2021
1 parent 8c062fc commit 828c30e
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

WinXray V4.1 增加CTRL+C/CTRL+V/CTRL+A/DELETE 快捷键操作!增加多选下批量复制及生成二维码!现在支持了文件解析节点(文件拖拽进入软件即可)!
WinXray V4.2 修复文件拖拽解析节点后空白的BUG!

导语:
请用官网地址下载:https://www.winxray.com
另外推荐全协议机场:[速蛙云VPN](https://ads.iuvpn.com)
推荐全协议机场[速蛙云VPN](https://ads.iuvpn.com)

![xray](./screenshots/Xray.png)

Expand Down
2 changes: 1 addition & 1 deletion default.aproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="WinXray" libEmbed="true" icon="\forms\ico\app.ico" ui="win" output="WinXray.exe" CompanyName="WinXray" FileDescription="网络代理通用客户端" LegalCopyright="Copyright (C) WinXray" ProductName="WinXray" InternalName="WinXray" FileVersion="4.1" ProductVersion="4.1" publishDir="\WinXray" dstrip="false" local="false" ignored="false">
<project ver="10" name="WinXray" libEmbed="true" icon="\forms\ico\app.ico" ui="win" output="WinXray.exe" CompanyName="WinXray" FileDescription="网络代理通用客户端" LegalCopyright="Copyright (C) WinXray" ProductName="WinXray" InternalName="WinXray" FileVersion="4.2" ProductVersion="4.2" publishDir="\WinXray" dstrip="false" local="false" ignored="false">
<file name="main" path="main.aardio"/>
<folder name="窗体" path="forms" comment="" embed="true" local="false" ignored="false">
<folder name="ico" path="forms\ico" comment="forms\ico" local="false" embed="false" ignored="false">
Expand Down
17 changes: 8 additions & 9 deletions forms/main/xray.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -1040,15 +1040,14 @@ frmXray.onDropFiles = function(files){
if(str){
str = ..string.trim(str,'"\'\t\r\n ');

var impoutbounds = xray.outbounds.importFromString(str);
if(#impoutbounds){
..table.append(config.proxy.outbounds,impoutbounds);
publish("uiCommand.OutboundsChange","obadd",#impoutbounds);
publish("uiCommand.restartCore","change");
publish("outbounds.updateConfigJson");
frmXray.msgOk("已成功导入" + #impoutbounds + "个节点",1200);
return;
}
var outbounds = xray.outbounds.importFromString(str);
if(#outbounds){
..table.append(config.proxy.outbounds,outbounds);
publish("uiCommand.restartxrayCore");
publish("outbounds.updateConfigJson");
frmXray.msgOk("已成功导入" + #outbounds + "个服务器",1200);
return;
}
}
}
frmXray.msgFrown('未能在文件中导入节点!');
Expand Down
113 changes: 110 additions & 3 deletions lib/xray/outbounds.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ var _subscriptionResponseCache = {
importFromString = function(str,subscribeUrl){
if(!str){ return; }
str = ..string.trim(str);

var jsonData;
if(..string.match(str,"%\[\]") || (
..string.match(str,"%\{\}") && !..string.match(str,"%\{\}.+%\{\}")
Expand Down Expand Up @@ -371,8 +371,8 @@ importFromString = function(str,subscribeUrl){
if(..string.match(str,"^\s*[\w=+/-_]+\s*$")){
str = ..crypt.decodeBin(str);
if(!str) return;
}
}
var outbounds = ..table.array();
for(line in ..string.lines(str) ){
if(#outbounds>=1500){
Expand Down Expand Up @@ -1200,10 +1200,117 @@ var currentActiveOutbound = ..globalActiveOutbound;
..publish("uiCommand.print","已自动刷新" + count + "个订阅服务器。")
} )

/*importFromClash = function(str,node){
if(node){
var start = false;var strTemp="";
var levelTable = ..table.array();var levelATable = ..table.array();
var levelLast = 0;var levelALast = 0;
for(line in ..string.lines(str) ){
//删除注释字段和空白行
line = ..string.splitEx(line,'\#')[1];
if( line===null || ..string.match(line,"^\s*$") ){continue;}
//确定proxies范围
if(..string.match(line,"^\a")){
if(..string.startWith(line,"proxies")){start = true;continue;}
else {if(start){break;}continue;}
}

if(start){
if( ..string.match(line,"^\s*\-\s*%\{\}\s*$") ){strTemp += line+'\n';}
elseif( !..string.match(line,"^\s*\-\s*%\{\}\s*$") ){
var numNow = #(..string.match(line,"^(\s*)\a"));//键缩进量
var numANow = #(..string.match(line,"^(\s*)\-"));//数组缩进量
//确定数组缩进等级
var levelA;
for(index,num in levelATable){if(num = numANow){levelA=index;break;}}
if(!levelA && numANow){
..table.push(levelATable,numANow);
levelA=..table.count(levelATable);
}
elseif(!levelA && !numANow){levelA=0}

if( levelA>1 ){
line = ..string.replace(line,"^\s*(-)",'');
numNow = #(..string.match(line,"^(\s*)\a"));
}
elseif( levelA==1 ){
var temp = '\n-{';
if(levelLast){for(i=1;levelLast;1){temp = '}'+temp;}}
line = ..string.replace(line,"^\s*-\s*",temp);
}

if( ..string.match(line,"^\}*\n\-\{\s*\a") ){strTemp += line+","}//-name:1
elseif( ..string.match(line,"^\}\n\-\{\s*$") ){strTemp += line}//-

levelALast = levelA;
//确定键缩进等级
var level;
for(index,num in levelTable){if(num=numNow){level=index;break;}}
if(!level && numNow){..table.push(levelTable,numNow);level=..table.count(levelTable);}
elseif(!level && !numNow){level=0}

if( ..string.match(line,"^\s*\a[^\s\:]*(\:)\s*$") ){//name:
line = ..string.trim(line);
if( levelLast>0 && level>levelLast ){strTemp += line+"{"}
elseif( level==levelLast ){strTemp += ","+line+"{"}
elseif( level<levelLast ){strTemp += "}"+line+"{"}
}
elseif( ..string.match(line,"^\s*\a[^\:]*\:?\s*[^\s]*\s*$") ){//name:1
line = ..string.trim(line);
if( levelLast==0 || level>levelLast ){strTemp += line}
elseif( levelLast>0 && level<levelLast){strTemp += "},"+line}
elseif( level==levelLast ){strTemp += ","+line}
}

levelLast = level;
}
}
}
var match1 = ..table.count(..string.matches(strTemp,"\{"));
var match2 = ..table.count(..string.matches(strTemp,"\}"));
for(i=1;match1-match2;1){strTemp += "}"}

if( #(..string.trim(strTemp)) ){str = ..string.trim(strTemp)}
}
else {
var urlmap = ..table.array();
var start = false;var levelTable = ..table.array();
for(line in ..string.lines(str) ){
//删除注释字段和空白行
line = ..string.splitEx(line,'\#')[1];
if( line===null || ..string.match(line,"^\s*$") ){continue;}
//确定proxies范围
if(..string.match(line,"^\a")){
if(..string.startWith(line,"proxy-providers")){start = true;continue;}
else {if(start){break;}continue;}
}

if(start){
var numNow = #(..string.match(line,"^(\s*)[^\s]"));//键缩进量
var level;
for(index,num in levelTable){if(num=numNow){level=index;break;}}
if(!level && numNow){..table.push(levelTable,numNow);level=..table.count(levelTable);}
elseif(!level && !numNow){level=0}

if(level==2){
var url = ..string.match(line,"^\s*url\:\s*(http.*)");
url = url ? ..string.trim(url,'"\'\s\t\r\n ');
if(..inet.url.is(url)){..table.push(urlmap,url)}
}
}
}

if(#urlmap){
return urlmap;
}
}
}*/

/**intellisense(xray.outbounds)
exportSharedLinks(.(outbounds) = 导出分享链接
importFromString(.(str,subscribeUrl) = 导入分享链接
importFromClipboard() = 自剪贴板导入分享链接
autoUpdateSubscription() = 自动并静默更新订阅源
updateSubscription() = 更新或自剪贴板导入订阅源\n可选在参数中用一个表自定义要更新的订阅地址,\n参数表中键为url,值为true
importFromClash(.(str,node) = 从clash文件导入节点或订阅
end intellisense**/
2 changes: 1 addition & 1 deletion main.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ import win.ui;
mainForm = win.form(text="WinXray";right=1019;bottom=679;bgcolor=15793151;border="none")
mainForm.add(
Promote={cls="plus";text="推荐";left=0;top=300;right=85;bottom=380;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(h=-13);iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF233';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=8};
caption={cls="bkplus";text="WinXray.COM V4.1";left=25;top=9;right=685;bottom=27;align="left";color=6052956;dl=1;dt=1;font=LOGFONT(h=-14);z=6};
caption={cls="bkplus";text="WinXray.COM V4.2";left=25;top=9;right=685;bottom=27;align="left";color=6052956;dl=1;dt=1;font=LOGFONT(h=-14);z=6};
custom={cls="custom";left=83;top=40;right=1022;bottom=679;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=3};
navBar={cls="bkplus";left=0;top=37;right=83;bottom=681;bgcolor=3442175;db=1;dl=1;dt=1;z=1};
navJsonConfig={cls="plus";text="配置";left=0;top=132;right=85;bottom=212;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(h=-13);iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF0F6';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=5};
Expand Down
Binary file modified release/WinXray.7z
Binary file not shown.
Binary file modified release/WinXray32.7z
Binary file not shown.
Binary file modified release/update/checksum.lzma
Binary file not shown.
Binary file modified release/update/files/WinXray.exe.lzma
Binary file not shown.
4 changes: 2 additions & 2 deletions release/update/version.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"description":"V4.1 增加CTRL+C/CTRL+V/CTRL+A/DELETE 快捷键操作!增加多选下批量复制及生成二维码!现在支持了文件解析节点(文件拖拽进入软件即可)!",
"description":"V4.2 修复文件拖拽解析节点后空白的BUG!",
"format":".lzma",
"main":"\\WinXray.exe",
"updater":"\\WinXray.exe",
"url":"https://raw.githubusercontent.com/TheMRLL/winxray/main/release/update/",
"version":"4.1"
"version":"4.2"
}
Binary file modified winXray/WinXray.exe
Binary file not shown.

0 comments on commit 828c30e

Please sign in to comment.