From fb09d7b7778d5a2d731f9043f9fabc7ffed53876 Mon Sep 17 00:00:00 2001 From: Eken Chan Date: Mon, 1 May 2023 19:24:44 +0800 Subject: [PATCH] add ReducedIvHeadEntropy feature to shadowsocks 2022 --- app_xray/build.gradle.kts | 4 ++-- download.sh | 12 ++++-------- js/common/translate.js | 7 +++++++ js/plugin_xray/ss2022.js | 9 +++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app_xray/build.gradle.kts b/app_xray/build.gradle.kts index 33e0ed2..a12cd18 100644 --- a/app_xray/build.gradle.kts +++ b/app_xray/build.gradle.kts @@ -8,7 +8,7 @@ setupAll() android { defaultConfig { applicationId = "moe.matsuri.plugin.xray" - versionCode = 15 - versionName = "v1.8.1" + versionCode = 16 + versionName = "v1.8.1-1" } } diff --git a/download.sh b/download.sh index 89c2ef4..d4a7d0c 100755 --- a/download.sh +++ b/download.sh @@ -34,14 +34,10 @@ download_xray() { VERSION="v1.8.1" mkdir_libs "app_xray/libs" - curl -Lso xray.zip "https://github.com/XTLS/Xray-core/releases/download/$VERSION/Xray-android-arm64-v8a.zip" - unzip_xray arm64-v8a - curl -Lso xray.zip "https://github.com/XTLS/Xray-core/releases/download/$VERSION/Xray-linux-arm32-v7a.zip" - unzip_xray armeabi-v7a - curl -Lso xray.zip "https://github.com/XTLS/Xray-core/releases/download/$VERSION/Xray-linux-32.zip" - unzip_xray x86 - curl -Lso xray.zip "https://github.com/XTLS/Xray-core/releases/download/$VERSION/Xray-linux-64.zip" - unzip_xray x86_64 + dl_and_chmod arm64-v8a/libxray.so "https://github.com/maskedeken/Xray-core/releases/download/$VERSION/xray-android-arm64" + dl_and_chmod armeabi-v7a/libxray.so "https://github.com/maskedeken/Xray-core/releases/download/$VERSION/xray-android-arm" + dl_and_chmod x86_64/libxray.so "https://github.com/maskedeken/Xray-core/releases/download/$VERSION/xray-android-x64" + dl_and_chmod x86/libxray.so "https://github.com/maskedeken/Xray-core/releases/download/$VERSION/xray-android-x86" } download_singbox() { diff --git a/js/common/translate.js b/js/common/translate.js index 33140bf..c3c20eb 100644 --- a/js/common/translate.js +++ b/js/common/translate.js @@ -166,6 +166,13 @@ export var translates = { spiderX: { "": "SpiderX", }, + reducedIvHeadEntropy: { + "": "ReducedIvHeadEntropy", + }, + reducedIvHeadEntropy_summary: { + "zh_CN": "这是 GFWReport 针对 GFW 上观察到的类似随机流的协议阻塞行为提出的对策。 这个选项将 IV 的前 6 个字节重新映射为可打印的字符,启用后,特权网络路径上的任何人都有可能识别该协议。", + "": "This is GFWReport's proposal for a countermeasure for the random stream like protocol blocking behaviour observed on GFW. This option remap the first 6 bytes of IV to printable characters, it's possible for anyone on the privileged network path to identify the protocol when enabled.", + }, // Brook serverProtocol: { diff --git a/js/plugin_xray/ss2022.js b/js/plugin_xray/ss2022.js index 9d23b06..3d45312 100644 --- a/js/plugin_xray/ss2022.js +++ b/js/plugin_xray/ss2022.js @@ -20,6 +20,8 @@ class ss2022Class { this.defaultSharedStorage.serverPassword = "" // UDP over TCP this.defaultSharedStorage.serverUoT = false + // reduce IV header entropy + this.defaultSharedStorage.reducedIvHeadEntropy = false for (var k in this.defaultSharedStorage) { let v = this.defaultSharedStorage[k] @@ -83,6 +85,12 @@ class ss2022Class { "key": "serverUoT", "icon": "baseline_wrap_text_24", }, + { + "type": "SwitchPreference", + "icon": "ic_baseline_grid_3x3_24", + "key": "reducedIvHeadEntropy", + "summary": TR("reducedIvHeadEntropy_summary") + }, ] } ] @@ -150,6 +158,7 @@ class ss2022Class { "method": ss.serverMethod, "password": ss.serverPassword, "uot": ss.serverUoT, + "reducedIvHeadEntropy": ss.reducedIvHeadEntropy, } ] }