@@ -279,6 +279,13 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
279279 }
280280 }
281281
282+ // VLESS encryption (ML-KEM-768)
283+ url.queryParameter(" encryption" )?.let {
284+ if (isVLESS && it != " none" ) {
285+ vlessEncryption = it
286+ }
287+ }
288+
282289 url.queryParameter(" fp" )?.let {
283290 utlsFingerprint = it
284291 }
@@ -472,7 +479,13 @@ fun StandardV2RayBean.toUriVMessVLESSTrojan(isTrojan: Boolean): String {
472479 .addQueryParameter(" type" , type)
473480
474481 if (isVLESS) {
475- builder.addQueryParameter(" encryption" , " none" )
482+ // Add encryption if configured
483+ if (vlessEncryption.isNotBlank() && vlessEncryption != " none" ) {
484+ builder.addQueryParameter(" encryption" , vlessEncryption)
485+ } else {
486+ builder.addQueryParameter(" encryption" , " none" )
487+ }
488+
476489 if (encryption != " auto" ) builder.addQueryParameter(" flow" , encryption)
477490 }
478491
@@ -642,11 +655,15 @@ fun buildSingBoxOutboundStreamSettings(bean: StandardV2RayBean): V2RayTransportO
642655 if (bean.xhttpExtra.isNotBlank()) {
643656 try {
644657 val gson = Gson ()
658+ // Convert base config to JSON
645659 val baseJson = JSONObject (gson.toJson(baseConfig))
660+ // Parse extra config
646661 val extraJson = JSONObject (bean.xhttpExtra)
662+ // Merge extra fields into base config (only allow download field)
647663 if (extraJson.has(" download" )) {
648664 baseJson.put(" download" , extraJson.get(" download" ))
649665 }
666+ // Convert merged JSON back to object
650667 return gson.fromJson(baseJson.toString(), V2RayTransportOptions_XHTTPOptions ::class .java)
651668 } catch (e: Exception ) {
652669 // If parsing fails, return base config
@@ -726,6 +743,9 @@ fun buildSingBoxOutboundStandardV2RayBean(bean: StandardV2RayBean): Outbound {
726743 if (bean.encryption.isNotBlank() && bean.encryption != " auto" ) {
727744 flow = bean.encryption
728745 }
746+ if (bean.vlessEncryption.isNotBlank() && bean.vlessEncryption != " none" ) {
747+ encryption = bean.vlessEncryption
748+ }
729749 when (bean.packetEncoding) {
730750 0 -> packet_encoding = " "
731751 1 -> packet_encoding = " packetaddr"
0 commit comments