@@ -30,6 +30,7 @@ import {
3030 isSupportedXrayEchConfigList ,
3131 isSupportedXrayEchForceQuery ,
3232} from '../ech-utils' ;
33+ import { normalizeVmessSecurity } from '../vmess-security' ;
3334
3435function surge_port_hopping ( raw ) {
3536 const [ parts , port_hopping ] =
@@ -636,7 +637,9 @@ function URI_VMess() {
636637 type : 'vmess' ,
637638 server : partitions [ 1 ] ,
638639 port : partitions [ 2 ] ,
639- cipher : getIfNotBlank ( partitions [ 3 ] , 'auto' ) ,
640+ cipher : normalizeVmessSecurity (
641+ getIfNotBlank ( partitions [ 3 ] , 'auto' ) ,
642+ ) ,
640643 uuid : partitions [ 4 ] . match ( / ^ " ( .* ) " $ / ) [ 1 ] ,
641644 tls : params . obfs === 'wss' ,
642645 udp : getIfPresent ( params [ 'udp-relay' ] ) ,
@@ -718,14 +721,7 @@ function URI_VMess() {
718721 port,
719722 // https://github.com/2dust/v2rayN/wiki/Description-of-VMess-share-link
720723 // https://github.com/XTLS/Xray-core/issues/91
721- cipher : [
722- 'auto' ,
723- 'aes-128-gcm' ,
724- 'chacha20-poly1305' ,
725- 'none' ,
726- ] . includes ( params . scy )
727- ? params . scy
728- : 'auto' ,
724+ cipher : normalizeVmessSecurity ( params . scy ) ,
729725 uuid : params . id ,
730726 alterId : parseInt (
731727 getIfPresent ( params . aid ?? params . alterId , 0 ) ,
@@ -2513,6 +2509,9 @@ function Clash_All() {
25132509 if ( proxy [ 'benchmark-timeout' ] ) {
25142510 proxy [ 'test-timeout' ] = proxy [ 'benchmark-timeout' ] ;
25152511 }
2512+ if ( proxy . type === 'vmess' ) {
2513+ proxy . cipher = normalizeVmessSecurity ( proxy . cipher ) ;
2514+ }
25162515
25172516 return proxy ;
25182517 } ;
0 commit comments