diff --git a/app_juicity/build.gradle.kts b/app_juicity/build.gradle.kts index cb59f03..e9e9778 100644 --- a/app_juicity/build.gradle.kts +++ b/app_juicity/build.gradle.kts @@ -8,8 +8,8 @@ setupAll() android { defaultConfig { applicationId = "moe.matsuri.plugin.juicity" - versionCode = 2 - versionName = "v0.3.0" + versionCode = 3 + versionName = "v0.4.3" splits.abi { reset() include("arm64-v8a") diff --git a/app_juicity/src/main/AndroidManifest.xml b/app_juicity/src/main/AndroidManifest.xml index 3bd8f6c..9daf822 100644 --- a/app_juicity/src/main/AndroidManifest.xml +++ b/app_juicity/src/main/AndroidManifest.xml @@ -7,7 +7,9 @@ + android:icon="@mipmap/ic_launcher" + android:label="Juicity For NekoBox" + android:roundIcon="@mipmap/ic_launcher_round"> + + + + \ No newline at end of file diff --git a/app_juicity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app_juicity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/app_juicity/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app_juicity/src/main/res/mipmap-hdpi/ic_launcher.png b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..7ed77e8 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..6ba6472 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..7ed77e8 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app_juicity/src/main/res/mipmap-mdpi/ic_launcher.png b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..fb5e142 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..42ea672 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..fb5e142 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher.png b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..05dd031 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c822fec Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..05dd031 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..3fbac09 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..68104c6 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..3fbac09 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..8f54430 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..bfe47bf Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..8f54430 Binary files /dev/null and b/app_juicity/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app_juicity/src/main/res/values/ic_launcher_background.xml b/app_juicity/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..f622c72 --- /dev/null +++ b/app_juicity/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #D9D9D9 + \ No newline at end of file diff --git a/download.sh b/download.sh index b6418c3..88f8b72 100755 --- a/download.sh +++ b/download.sh @@ -111,7 +111,7 @@ download_tuic5() { } download_juicity() { - VERSION="v0.3.0" + VERSION="v0.4.3" mkdir_libs "app_juicity/libs" curl -Lso tmp.zip "https://github.com/juicity/juicity/releases/download/"$VERSION"/juicity-android-arm64.zip" diff --git a/js/common/translate.js b/js/common/translate.js index a9320d3..cfe3ff8 100644 --- a/js/common/translate.js +++ b/js/common/translate.js @@ -209,4 +209,17 @@ export var translates = { wireguardMTU: { "": "MTU", }, + + // Juicity + juicityCongestionControl: { + "zh_CN": "拥塞控制", + "": "Congestion Control", + }, + juicitySNI: { + "": "SNI", + }, + juicityPinnedCertchainSha256: { + "zh_CN": "固定证书链 SHA256 (可选)", + "": "Pinned Certchain SHA256 (Optional)" + }, } diff --git a/js/plugin_juicity/juicity.js b/js/plugin_juicity/juicity.js index 404e219..56646f5 100644 --- a/js/plugin_juicity/juicity.js +++ b/js/plugin_juicity/juicity.js @@ -16,11 +16,12 @@ class juicityClass { this.defaultSharedStorage.serverAddress = "127.0.0.1"; this.defaultSharedStorage.serverPort = "1080"; // end of default keys - this.defaultSharedStorage.uuid = "00000000-0000-0000-0000-000000000000"; + this.defaultSharedStorage.uuid = ""; this.defaultSharedStorage.password = ""; this.defaultSharedStorage.sni = ""; this.defaultSharedStorage.allowInsecure = false; this.defaultSharedStorage.congestionControl = "bbr"; + this.defaultSharedStorage.pinnedCertchainSha256 = ""; for (var k in this.defaultSharedStorage) { let v = this.defaultSharedStorage[k]; @@ -58,6 +59,9 @@ class juicityClass { if (this.sharedStorage.allowInsecure) { builder.searchParams.set("allow_insecure", "1") } + if (this.sharedStorage.pinnedCertchainSha256) { + builder.searchParams.set("pinned_certchain_sha256", this.sharedStorage.pinnedCertchainSha256) + } this.sharedStorage.shareLink = builder.toString() } @@ -84,28 +88,42 @@ class juicityClass { "type": "EditTextPreference", "key": "uuid", "icon": "ic_baseline_person_24", + "title": TR("serverUserId"), }, { "type": "EditTextPreference", "key": "password", "icon": "ic_settings_password", "summaryProvider": "PasswordSummaryProvider", + "title": TR("serverPassword"), }, // { "type": "EditTextPreference", "key": "sni", - "icon": "ic_action_copyright" + "icon": "ic_action_copyright", + "title": TR("juicitySNI"), }, { "type": "SwitchPreference", "key": "allowInsecure", "icon": "ic_notification_enhanced_encryption", + "title": TR("serverAllowInsecure"), }, { - "type": "EditTextPreference", + "type": "SimpleMenuPreference", "key": "congestionControl", "icon": "ic_baseline_stream_24", + "entries": { + "bbr": "bbr" + }, + "title": TR("juicityCongestionControl"), + }, + { + "type": "EditTextPreference", + "key": "pinnedCertchainSha256", + "icon": "ic_baseline_vpn_key_24", + "title": TR("juicityPinnedCertchainSha256") }, ], }, @@ -136,6 +154,8 @@ class juicityClass { neko.listenOnPreferenceChanged(key) this2._onPreferenceChanged(key, this2.sharedStorage[key]) } + + listenOnPreferenceChangedNow("pinnedCertchainSha256") } // 保存时调用(混合编辑后的值) @@ -154,6 +174,13 @@ class juicityClass { } _onPreferenceChanged(key, newValue) { + if (key == "pinnedCertchainSha256") { + try { + this.common.setKV(key, decodeURIComponent(newValue)) + } catch (error) { + neko.logError(error.toString()); + } + } } // Interface @@ -169,7 +196,7 @@ class juicityClass { var serverAddress = util.unwrapIpv6(url.hostname) this.sharedStorage.serverAddress = serverAddress - this.sharedStorage.serverPort = url.host.replace(serverAddress, "").substringAfter(":") + this.sharedStorage.serverPort = url.port this.sharedStorage.uuid = url.username this.sharedStorage.password = url.password this.sharedStorage.name = decodeURIComponent(url.hash.substringAfter("#")) @@ -181,7 +208,10 @@ class juicityClass { this.sharedStorage.sni = it }) util.ifNotNull(url.searchParams.get("allow_insecure"), (it) => { - if (it == "1" || it == "true") this.sharedStorage.allowInsecure = it + if (it == "1" || it == "true") this.sharedStorage.allowInsecure = true + }) + util.ifNotNull(url.searchParams.get("pinned_certchain_sha256"), (it) => { + this.sharedStorage.pinnedCertchainSha256 = it }) this._onSharedStorageUpdated() @@ -201,15 +231,18 @@ class juicityClass { "sni": ss.sni, "allow_insecure": ss.allowInsecure, "congestion_control": ss.congestionControl, + "pinned_certchain_sha256": ss.pinnedCertchainSha256, "log_level": "info", "protect_path": "protect_path" }; + let uniqueConfigName = 'config-' + Math.random().toString(36).slice(2) + Date.now() + '.json'; + let v = {}; - v.nekoCommands = ["%exe%", "run", "-c", "config.json"]; + v.nekoCommands = ["%exe%", "run", "-c", uniqueConfigName]; v.nekoRunConfigs = [ { - name: "config.json", + name: uniqueConfigName, content: JSON.stringify(configObject), }, ]; diff --git a/js/plugin_juicity/main.js b/js/plugin_juicity/main.js index cd5e161..accfe84 100644 --- a/js/plugin_juicity/main.js +++ b/js/plugin_juicity/main.js @@ -38,9 +38,8 @@ export function nekoProtocol(protocolId) { } export function nekoAbout() { - return "早期测试版本,上游版本 v0.3.0\n" + + return "早期测试版本,上游版本 v0.4.3\n" + "1 目前不兼容链式代理\n" + - "2 目前无法使用域名,请使用 IP 地址类型的服务器\n" + "这个插件是实验性的。如果在使用过程中遇到任何问题,请自行解决。" }