Skip to content

Commit 828c30e

Browse files
authored
V4.2 修复文件拖拽解析节点后空白的BUG!
1 parent 8c062fc commit 828c30e

11 files changed

+124
-18
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

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

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

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

default.aproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<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">
2+
<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">
33
<file name="main" path="main.aardio"/>
44
<folder name="窗体" path="forms" comment="" embed="true" local="false" ignored="false">
55
<folder name="ico" path="forms\ico" comment="forms\ico" local="false" embed="false" ignored="false">

forms/main/xray.aardio

+8-9
Original file line numberDiff line numberDiff line change
@@ -1040,15 +1040,14 @@ frmXray.onDropFiles = function(files){
10401040
if(str){
10411041
str = ..string.trim(str,'"\'\t\r\n ');
10421042

1043-
var impoutbounds = xray.outbounds.importFromString(str);
1044-
if(#impoutbounds){
1045-
..table.append(config.proxy.outbounds,impoutbounds);
1046-
publish("uiCommand.OutboundsChange","obadd",#impoutbounds);
1047-
publish("uiCommand.restartCore","change");
1048-
publish("outbounds.updateConfigJson");
1049-
frmXray.msgOk("已成功导入" + #impoutbounds + "个节点",1200);
1050-
return;
1051-
}
1043+
var outbounds = xray.outbounds.importFromString(str);
1044+
if(#outbounds){
1045+
..table.append(config.proxy.outbounds,outbounds);
1046+
publish("uiCommand.restartxrayCore");
1047+
publish("outbounds.updateConfigJson");
1048+
frmXray.msgOk("已成功导入" + #outbounds + "个服务器",1200);
1049+
return;
1050+
}
10521051
}
10531052
}
10541053
frmXray.msgFrown('未能在文件中导入节点!');

lib/xray/outbounds.aardio

+110-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ var _subscriptionResponseCache = {
203203
importFromString = function(str,subscribeUrl){
204204
if(!str){ return; }
205205
str = ..string.trim(str);
206-
206+
207207
var jsonData;
208208
if(..string.match(str,"%\[\]") || (
209209
..string.match(str,"%\{\}") && !..string.match(str,"%\{\}.+%\{\}")
@@ -371,8 +371,8 @@ importFromString = function(str,subscribeUrl){
371371
if(..string.match(str,"^\s*[\w=+/-_]+\s*$")){
372372
str = ..crypt.decodeBin(str);
373373
if(!str) return;
374-
}
375-
374+
}
375+
376376
var outbounds = ..table.array();
377377
for(line in ..string.lines(str) ){
378378
if(#outbounds>=1500){
@@ -1200,10 +1200,117 @@ var currentActiveOutbound = ..globalActiveOutbound;
12001200
..publish("uiCommand.print","已自动刷新" + count + "个订阅服务器。")
12011201
} )
12021202

1203+
/*importFromClash = function(str,node){
1204+
if(node){
1205+
var start = false;var strTemp="";
1206+
var levelTable = ..table.array();var levelATable = ..table.array();
1207+
var levelLast = 0;var levelALast = 0;
1208+
for(line in ..string.lines(str) ){
1209+
//删除注释字段和空白行
1210+
line = ..string.splitEx(line,'\#')[1];
1211+
if( line===null || ..string.match(line,"^\s*$") ){continue;}
1212+
//确定proxies范围
1213+
if(..string.match(line,"^\a")){
1214+
if(..string.startWith(line,"proxies")){start = true;continue;}
1215+
else {if(start){break;}continue;}
1216+
}
1217+
1218+
if(start){
1219+
if( ..string.match(line,"^\s*\-\s*%\{\}\s*$") ){strTemp += line+'\n';}
1220+
elseif( !..string.match(line,"^\s*\-\s*%\{\}\s*$") ){
1221+
var numNow = #(..string.match(line,"^(\s*)\a"));//键缩进量
1222+
var numANow = #(..string.match(line,"^(\s*)\-"));//数组缩进量
1223+
//确定数组缩进等级
1224+
var levelA;
1225+
for(index,num in levelATable){if(num = numANow){levelA=index;break;}}
1226+
if(!levelA && numANow){
1227+
..table.push(levelATable,numANow);
1228+
levelA=..table.count(levelATable);
1229+
}
1230+
elseif(!levelA && !numANow){levelA=0}
1231+
1232+
if( levelA>1 ){
1233+
line = ..string.replace(line,"^\s*(-)",'');
1234+
numNow = #(..string.match(line,"^(\s*)\a"));
1235+
}
1236+
elseif( levelA==1 ){
1237+
var temp = '\n-{';
1238+
if(levelLast){for(i=1;levelLast;1){temp = '}'+temp;}}
1239+
line = ..string.replace(line,"^\s*-\s*",temp);
1240+
}
1241+
1242+
if( ..string.match(line,"^\}*\n\-\{\s*\a") ){strTemp += line+","}//-name:1
1243+
elseif( ..string.match(line,"^\}\n\-\{\s*$") ){strTemp += line}//-
1244+
1245+
levelALast = levelA;
1246+
//确定键缩进等级
1247+
var level;
1248+
for(index,num in levelTable){if(num=numNow){level=index;break;}}
1249+
if(!level && numNow){..table.push(levelTable,numNow);level=..table.count(levelTable);}
1250+
elseif(!level && !numNow){level=0}
1251+
1252+
if( ..string.match(line,"^\s*\a[^\s\:]*(\:)\s*$") ){//name:
1253+
line = ..string.trim(line);
1254+
if( levelLast>0 && level>levelLast ){strTemp += line+"{"}
1255+
elseif( level==levelLast ){strTemp += ","+line+"{"}
1256+
elseif( level<levelLast ){strTemp += "}"+line+"{"}
1257+
}
1258+
elseif( ..string.match(line,"^\s*\a[^\:]*\:?\s*[^\s]*\s*$") ){//name:1
1259+
line = ..string.trim(line);
1260+
if( levelLast==0 || level>levelLast ){strTemp += line}
1261+
elseif( levelLast>0 && level<levelLast){strTemp += "},"+line}
1262+
elseif( level==levelLast ){strTemp += ","+line}
1263+
}
1264+
1265+
levelLast = level;
1266+
}
1267+
}
1268+
}
1269+
var match1 = ..table.count(..string.matches(strTemp,"\{"));
1270+
var match2 = ..table.count(..string.matches(strTemp,"\}"));
1271+
for(i=1;match1-match2;1){strTemp += "}"}
1272+
1273+
if( #(..string.trim(strTemp)) ){str = ..string.trim(strTemp)}
1274+
}
1275+
else {
1276+
var urlmap = ..table.array();
1277+
var start = false;var levelTable = ..table.array();
1278+
for(line in ..string.lines(str) ){
1279+
//删除注释字段和空白行
1280+
line = ..string.splitEx(line,'\#')[1];
1281+
if( line===null || ..string.match(line,"^\s*$") ){continue;}
1282+
//确定proxies范围
1283+
if(..string.match(line,"^\a")){
1284+
if(..string.startWith(line,"proxy-providers")){start = true;continue;}
1285+
else {if(start){break;}continue;}
1286+
}
1287+
1288+
if(start){
1289+
var numNow = #(..string.match(line,"^(\s*)[^\s]"));//键缩进量
1290+
var level;
1291+
for(index,num in levelTable){if(num=numNow){level=index;break;}}
1292+
if(!level && numNow){..table.push(levelTable,numNow);level=..table.count(levelTable);}
1293+
elseif(!level && !numNow){level=0}
1294+
1295+
if(level==2){
1296+
var url = ..string.match(line,"^\s*url\:\s*(http.*)");
1297+
url = url ? ..string.trim(url,'"\'\s\t\r\n ');
1298+
if(..inet.url.is(url)){..table.push(urlmap,url)}
1299+
}
1300+
}
1301+
}
1302+
1303+
if(#urlmap){
1304+
return urlmap;
1305+
}
1306+
}
1307+
}*/
1308+
12031309
/**intellisense(xray.outbounds)
12041310
exportSharedLinks(.(outbounds) = 导出分享链接
12051311
importFromString(.(str,subscribeUrl) = 导入分享链接
12061312
importFromClipboard() = 自剪贴板导入分享链接
12071313
autoUpdateSubscription() = 自动并静默更新订阅源
12081314
updateSubscription() = 更新或自剪贴板导入订阅源\n可选在参数中用一个表自定义要更新的订阅地址,\n参数表中键为url,值为true
1315+
importFromClash(.(str,node) = 从clash文件导入节点或订阅
12091316
end intellisense**/

main.aardio

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ import win.ui;
162162
mainForm = win.form(text="WinXray";right=1019;bottom=679;bgcolor=15793151;border="none")
163163
mainForm.add(
164164
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};
165-
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};
165+
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};
166166
custom={cls="custom";left=83;top=40;right=1022;bottom=679;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=3};
167167
navBar={cls="bkplus";left=0;top=37;right=83;bottom=681;bgcolor=3442175;db=1;dl=1;dt=1;z=1};
168168
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};

release/WinXray.7z

-90 Bytes
Binary file not shown.

release/WinXray32.7z

-247 Bytes
Binary file not shown.

release/update/checksum.lzma

1 Byte
Binary file not shown.

release/update/files/WinXray.exe.lzma

-157 Bytes
Binary file not shown.

release/update/version.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"description":"V4.1 增加CTRL+C/CTRL+V/CTRL+A/DELETE 快捷键操作!增加多选下批量复制及生成二维码!现在支持了文件解析节点(文件拖拽进入软件即可)!",
2+
"description":"V4.2 修复文件拖拽解析节点后空白的BUG!",
33
"format":".lzma",
44
"main":"\\WinXray.exe",
55
"updater":"\\WinXray.exe",
66
"url":"https://raw.githubusercontent.com/TheMRLL/winxray/main/release/update/",
7-
"version":"4.1"
7+
"version":"4.2"
88
}

winXray/WinXray.exe

-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)