From f402ea13399b9a9ebd8f9c80df31484f38efc7e9 Mon Sep 17 00:00:00 2001 From: bannedbook Date: Sat, 20 Jan 2024 19:21:14 +0800 Subject: [PATCH] update to v6.3.2 --- .github/FUNDING.yml | 1 - .github/ISSUE_TEMPLATE/bug-report-en.md | 22 +++ .github/ISSUE_TEMPLATE/bug-report-zh_cn.md | 22 +++ .github/ISSUE_TEMPLATE/bug_report.md | 58 ------ .github/ISSUE_TEMPLATE/feature_request-en.md | 12 ++ .../ISSUE_TEMPLATE/feature_request-zh_cn.md | 12 ++ .github/ISSUE_TEMPLATE/feature_request.md | 19 -- .../questions-support-requests-other.md | 7 - .github/faq.md | 92 ---------- .github/faq.ru.md | 93 ---------- .github/workflows/android.yml | 71 ++++++++ .github/workflows/release.yml | 170 ++++++++++++++++++ app/build.gradle.kts | 1 + .../java/io/nekohasekai/sagernet/Constants.kt | 3 + .../sagernet/database/DataStore.kt | 3 + .../nekohasekai/sagernet/fmt/ConfigBuilder.kt | 2 +- .../sagernet/fmt/hysteria/HysteriaFmt.kt | 4 +- .../nekohasekai/sagernet/fmt/tuic/TuicFmt.kt | 3 +- .../sagernet/fmt/v2ray/V2RayFmt.kt | 3 +- .../nekohasekai/sagernet/group/RawUpdater.kt | 3 + .../nekohasekai/sagernet/ui/MainActivity.kt | 20 --- app/src/main/res/values-zh-rCN/strings.xml | 5 +- app/src/main/res/values/arrays.xml | 2 +- app/src/main/res/values/strings.xml | 109 +++++++---- app/src/main/res/xml/global_preferences.xml | 7 + buildScript/lib/core/get_source_env.sh | 2 +- buildSrc/build.gradle.kts | 2 +- buildSrc/src/main/kotlin/Helpers.kt | 8 +- gitupdate.bat | 6 +- gradle.properties | 3 + gradle/wrapper/gradle-wrapper.properties | 2 +- libcore/build.sh | 4 +- libcore/go.mod | 28 ++- libcore/go.sum | 90 +++------- libcore/http.go | 5 + nb4a.properties | 4 +- settings.gradle.kts | 2 +- update-zh.json | 2 +- update.json | 2 +- 39 files changed, 480 insertions(+), 424 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug-report-en.md create mode 100644 .github/ISSUE_TEMPLATE/bug-report-zh_cn.md delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request-en.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request-zh_cn.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/questions-support-requests-other.md delete mode 100644 .github/faq.md delete mode 100644 .github/faq.ru.md create mode 100644 .github/workflows/android.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index bd23b60..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [Mygod] diff --git a/.github/ISSUE_TEMPLATE/bug-report-en.md b/.github/ISSUE_TEMPLATE/bug-report-en.md new file mode 100644 index 0000000..5390a49 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report-en.md @@ -0,0 +1,22 @@ +--- +name: 'Bug Report' +about: 'Please troubleshoot server-side issues and upgrade to the latest client before raising a question.' +title: 'BUG: ' +labels: '' +assignees: '' + +--- + +## Describe the problem + +Expected behavior: + +Actual behavior: + +## How to reproduce + +Provide helpful screenshots, videos, text descriptions, subscription links, etc. + +## log + +If you have logs, please upload them. Please see the detailed steps for exporting logs in the documentation. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report-zh_cn.md b/.github/ISSUE_TEMPLATE/bug-report-zh_cn.md new file mode 100644 index 0000000..232e6a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report-zh_cn.md @@ -0,0 +1,22 @@ +--- +name: '问题反馈' +about: '在提出问题前请先自行排除服务器端问题和升级到最新客户端。' +title: 'BUG: ' +labels: '' +assignees: '' + +--- + +## 描述问题 + +预期行为: + +实际行为: + +## 如何复现 + +提供有帮助的截图,录像,文字说明,订阅链接等。 + +## 日志 + +如果有日志,请上传。请在文档内查看导出日志的详细步骤。 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 34e5050..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Please read contributing guidelines. Thanks. - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Smartphone (please complete the following information):** - - Android/Chrome OS version: [e.g. "7.0.0_r14" or "71.0.3578.94 (32-bit)", more detailed description is preferred] - - Device: [e.g. Google Pixel XL] - - Version: [e.g. version code "v3.0.0" or commit ID "a073f85"] - - Last version that did not exhibit the issue: [not applicable] - -**Configuration** -Put an `x` inside the [ ] that applies. - -* [ ] IPv4 server address -* [ ] IPv6 server address -* [ ] Client IPv4 availability -* [ ] Client IPv6 availability -* Encrypt method: -* Route - * [ ] All - * [ ] Bypass LAN - * [ ] Bypass China - * [ ] Bypass LAN & China - * [ ] GFW List - * [ ] China List - * [ ] Custom rules -* [ ] IPv6 route -* [ ] Apps VPN mode - * [ ] Bypass mode -* Remote DNS: 8.8.8.8 -* [ ] DNS over UDP -* Plugin configuration (if applicable): -* [ ] Auto Connect -* [ ] TCP Fast Open -* If you're not using VPN mode, please supply more details here: - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request-en.md b/.github/ISSUE_TEMPLATE/feature_request-en.md new file mode 100644 index 0000000..e688400 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request-en.md @@ -0,0 +1,12 @@ +--- +name: 'Feature Request' +about: 'Make suggestions for new features of the software' +title: '' +labels: '' +assignees: '' + +--- + +## Description suggestions + +## Necessity of recommendations diff --git a/.github/ISSUE_TEMPLATE/feature_request-zh_cn.md b/.github/ISSUE_TEMPLATE/feature_request-zh_cn.md new file mode 100644 index 0000000..93baf21 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request-zh_cn.md @@ -0,0 +1,12 @@ +--- +name: '功能请求' +about: '对软件的新功能提出建议。' +title: '' +labels: '' +assignees: '' + +--- + +## 描述建议 + +## 建议的必要性 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 3b0dcd7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -Please read contributing guidelines. Thanks. - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/questions-support-requests-other.md b/.github/ISSUE_TEMPLATE/questions-support-requests-other.md deleted file mode 100644 index 2e41aa1..0000000 --- a/.github/ISSUE_TEMPLATE/questions-support-requests-other.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Questions/Support requests/Other -about: You should probably use the forum - ---- - -Please use the forum at https://discourse.shadowsocks.org/c/implementations/shadowsocks-android instead. Your issue will probably be closed. diff --git a/.github/faq.md b/.github/faq.md deleted file mode 100644 index 1f27781..0000000 --- a/.github/faq.md +++ /dev/null @@ -1,92 +0,0 @@ -### Troubleshooting - -Cannot connect to server: - -1. Stop battery saver if it's active; -2. Check your config; -3. Wipe app data. - -Crash: [Submit an issue](https://github.com/shadowsocks/shadowsocks-android/issues/new) with logcat attached, or submit a crash report to Google Play. Then, try wiping app data. - -### How to create a widget and/or switch profile based on network connectivity? - -Use [Tasker](http://tasker.dinglisch.net/) integration. - -### Why is NAT mode deprecated? - -1. Requiring ROOT permission; -2. No IPv6 support; -3. No UDP relay support. - -### How to remove the exclamation mark when using VPN mode? - -The exclamation mark in the Wi-Fi/cellular icon appears because the system fails to connect to portal server (defaults to `clients3.google.com`) without VPN connection. To remove it, follow the instructions in [this article](https://www.noisyfox.cn/45.html). (in Simplified Chinese) - -### Why is my ROM not supported? - -1. Some ROM has broken VPNService implementation, especially for IPv6; -2. Some ROM has aggressive (or called broken) background service killing policy; -3. Some ROM like [Flyme](https://github.com/shadowsocks/shadowsocks-android/issues/1821) is basically broken **in every way possible**; -4. If you have Xposed framework and/or battery saver apps, it's likely that this app wouldn't work well with these either. - -* Fixes for MIUI: [#772](https://github.com/shadowsocks/shadowsocks-android/issues/772) -* Fixes for EMUI: [#888](https://github.com/shadowsocks/shadowsocks-android/issues/888) -* Fixes for Huawei: [#1091 (comment)](https://github.com/shadowsocks/shadowsocks-android/issues/1091#issuecomment-276949836) -* Related to Xposed: [#1414](https://github.com/shadowsocks/shadowsocks-android/issues/1414) -* Samsung and/or Brevent: [#1410](https://github.com/shadowsocks/shadowsocks-android/issues/1410) -* Another Samsung: [#1712](https://github.com/shadowsocks/shadowsocks-android/issues/1712) -* Samsung with GMS: [#2138](https://github.com/shadowsocks/shadowsocks-android/issues/2138) -* Don't install this app on SD card because of permission issues: [#1124 (comment)](https://github.com/shadowsocks/shadowsocks-android/issues/1124#issuecomment-307556453) -* `INTERACT_ACROSS_USERS` permission missing: [#1184](https://github.com/shadowsocks/shadowsocks-android/issues/1184) - -### How to pause Shadowsocks service? - -* For Android 7.0+: Use quick switch tile in Quick Settings; -* Use Tasker integration; -* Add a profile with per-app proxy enabled for Shadowsocks only, bypass mode off. - -### Why does Shadowsocks consume so much battery on Android 5.0+? - -As Shadowsocks takes over the whole device network, any battery used by network activities from other apps are also counted as those from Shadowsocks. So, the battery usage of Shadowsocks equals to the sum of all the network activities of your device. Shadowsocks itself is a totally I/O bound application on modern Android devices, which is expected not to consume any notable battery. - -So if you notice a significant increase in battery usage after you use Shadowsocks, it's most likely caused by other apps. For example, Google Play services can consume more battery after being able to connecting to Google, etc. - -More details: https://kb.adguard.com/en/android/solving-problems/battery - -### It works fine under Wi-Fi but can't connect through cellular data? - -Allow this app to consume background data in app settings. - -### How to use Transproxy mode? - -1. Install [AFWall+](https://github.com/ukanth/afwall); -2. Set custom script: -```sh -IP6TABLES=/system/bin/ip6tables -IPTABLES=/system/bin/iptables -ULIMIT=/system/bin/ulimit -SHADOWSOCKS_UID=`dumpsys package com.github.shadowsocks | grep userId | cut -d= -f2 - | cut -d' ' -f1 -` -PORT_DNS=5450 -PORT_TRANSPROXY=8200 -$ULIMIT -n 4096 -$IP6TABLES -F -$IP6TABLES -A INPUT -j DROP -$IP6TABLES -A OUTPUT -j DROP -$IPTABLES -t nat -F OUTPUT -$IPTABLES -t nat -A OUTPUT -o lo -j RETURN -$IPTABLES -t nat -A OUTPUT -d 127.0.0.1 -j RETURN -$IPTABLES -t nat -A OUTPUT -m owner --uid-owner $SHADOWSOCKS_UID -j RETURN -$IPTABLES -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS -$IPTABLES -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS -$IPTABLES -t nat -A OUTPUT -p tcp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY -$IPTABLES -t nat -A OUTPUT -p udp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY -``` -3. Set custom shutdown script: -```sh -IP6TABLES=/system/bin/ip6tables -IPTABLES=/system/bin/iptables -$IPTABLES -t nat -F OUTPUT -$IP6TABLES -F -``` -4. Make sure to allow traffic for Shadowsocks; -5. Start Shadowsocks transproxy service and enable firewall. diff --git a/.github/faq.ru.md b/.github/faq.ru.md deleted file mode 100644 index 0d497eb..0000000 --- a/.github/faq.ru.md +++ /dev/null @@ -1,93 +0,0 @@ -### Решение проблем - -Не получается подключиться к серверу: - -1. Выключите режим энергосбережения, если он активен; -2. Проверьте настройки; -3. Сотрите данные приложения. - -Не работает: [Добавьте отчет](https://github.com/shadowsocks/shadowsocks-android/issues/new) прикрепив лог (logcat), или отправьте отзыв в Google Play. Затем попробуйте стереть данные приложения. - -### Как добавить виджет и/или переключать профиль на основании состояния сети? - -Использйте интеграцию с [Tasker](http://tasker.dinglisch.net/). - -### Почему режим NAT более не поддерживается? - -1. Требуются ROOT права; -2. Нет поддержки IPv6; -3. Нет поддержки UDP relay. - -### Как убрать восклицательный знак когда используется режим VPN? - -Восклицательный знак на значке Wi-Fi/Сотовой связи появляется, потому что система не может подключиться к portal-серверу (по-умолчанию к `clients3.google.com`) без VPN подключения. Чтобы убрать его, следуйте инструкциям в [этом топике](https://www.noisyfox.cn/45.html). (на упрощенном китайском) - -### Почему мой ROM не поддерживается? - -1. Некоторые ROM используют неправильную реализацию службы VPN, особенно IPv6; -2. Некоторые ROM используют агрессивную (или так называемую испорченную) неправильную политику остановки фоновых служб; -3. Некоторые ROM, такие как [Flyme](https://github.com/shadowsocks/shadowsocks-android/issues/1821) просто не работают **в любом случае**; -4. Если вы используете фреймворк Xposed и/или приложения для энергосбережения, вероятно наше приложение не будет нормально работать с ними. - -* Исправления для MIUI: [#772](https://github.com/shadowsocks/shadowsocks-android/issues/772) -* Исправления для EMUI: [#888](https://github.com/shadowsocks/shadowsocks-android/issues/888) -* Иправления для Huawei: [#1091 (комментарий)](https://github.com/shadowsocks/shadowsocks-android/issues/1091#issuecomment-276949836) -* Связанные с Xposed: [#1414](https://github.com/shadowsocks/shadowsocks-android/issues/1414) -* Samsung и/или Brevent: [#1410](https://github.com/shadowsocks/shadowsocks-android/issues/1410) -* Ещё Samsung: [#1712](https://github.com/shadowsocks/shadowsocks-android/issues/1712) -* Не устанавливайте это приложение на SD карту, из-за проблем с разрешениями: [#1124 (комментарий)](https://github.com/shadowsocks/shadowsocks-android/issues/1124#issuecomment-307556453) -* Отсутствует разрешение `INTERACT_ACROSS_USERS`: [#1184](https://github.com/shadowsocks/shadowsocks-android/issues/1184) - -### Как приостановить службу Shadowsocks? - -* Для Android 7.0+: Используйте переключатель в быстрых настройках; -* Используйте интеграцию с Tasker; -* Добавьте профиль c выбранными приложениями, которые будут работать через Shadowsocks прокси, выключив обходной режим. - -### Почему Shadowsocks потребляет так много энергии на Android 5.0+? - -Так как Shadowsocks работает со всем траффиком устройства, заряд батареи используемый другими приложениями также считается за тот, что использует Shadowsocks. Таким образом использование батареи Shadowsocks'ом равен сумме всей активности устройства в сети. Shadowsocks сам по себе в общем-то является приложением связанного процесса ввода/вывода на современных Android устройствах, которое, ожидаемо, не потребляет значительного количества энергии. - -Так что если вы заметите значительное увеличение потребляемой энергии после того, как вы использовали Shadowsocks, это скорее всего вызванно другими приложениями. Например, сервисы Google Play могут потреблять больше энергии после того, как смогут подключиться к Google, и т.д. - -Больше информации: https://kb.adguard.com/en/android/solving-problems/battery - -### Оно прекрасно работает при Wi-Fi но не может подключиться через сотовую связь? - -Разрешите этому приложению передачу данных в фоновом режиме в настройках приложения. - -Если у вас оперератор Yota, то увы, но они запрещают P2P-траффик, коим является (или просто определяется фильтрами оператора как P2P-траффик) Shadowsocks. Оператор не будет предпринимать никаких действий для решения данной проблемы. - -### Как использовать режим Transproxy (прозрачный прокси)? - -1. Установите [AFWall+](https://github.com/ukanth/afwall); -2. Настройте пользовательский скрипт: -```sh -IP6TABLES=/system/bin/ip6tables -IPTABLES=/system/bin/iptables -ULIMIT=/system/bin/ulimit -SHADOWSOCKS_UID=`dumpsys package com.github.shadowsocks | grep userId | cut -d= -f2 - | cut -d' ' -f1 -` -PORT_DNS=5450 -PORT_TRANSPROXY=8200 -$ULIMIT -n 4096 -$IP6TABLES -F -$IP6TABLES -A INPUT -j DROP -$IP6TABLES -A OUTPUT -j DROP -$IPTABLES -t nat -F OUTPUT -$IPTABLES -t nat -A OUTPUT -o lo -j RETURN -$IPTABLES -t nat -A OUTPUT -d 127.0.0.1 -j RETURN -$IPTABLES -t nat -A OUTPUT -m owner --uid-owner $SHADOWSOCKS_UID -j RETURN -$IPTABLES -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS -$IPTABLES -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS -$IPTABLES -t nat -A OUTPUT -p tcp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY -$IPTABLES -t nat -A OUTPUT -p udp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY -``` -3. Настройте пользовательский скрипт отключения: -```sh -IP6TABLES=/system/bin/ip6tables -IPTABLES=/system/bin/iptables -$IPTABLES -t nat -F OUTPUT -$IP6TABLES -F -``` -4. Убедитесь, что траффик для Shadowsocks разрешен; -5. Запустите службу прозрачного прокси (transproxy) в Shadowsocks и включите брандмауэр. diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..0409a41 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,71 @@ +name: Android CI + +on: + push: + branches: [ main ] + +jobs: + libcore: + name: Native Build (LibCore) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Golang Status + run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status + - name: Libcore Status + run: git ls-files libcore | xargs cat | sha1sum > libcore_status + - name: LibCore Cache + id: cache + uses: actions/cache@v3 + with: + path: | + app/libs/libcore.aar + key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} + - name: Install Golang + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/setup-go@v3 + with: + go-version: ^1.21 + - name: Native Build + if: steps.cache.outputs.cache-hit != 'true' + run: ./run lib core + build: + name: Build APK + runs-on: ubuntu-latest + needs: + - libcore + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Golang Status + run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status + - name: Libcore Status + run: git ls-files libcore | xargs cat | sha1sum > libcore_status + - name: LibCore Cache + uses: actions/cache@v3 + with: + path: | + app/libs/libcore.aar + key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} + - name: Gradle cache + uses: actions/cache@v3 + with: + path: ~/.gradle + key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }} + - name: Gradle Build + env: + BUILD_PLUGIN: none + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties + export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" + ./run init action gradle + ./gradlew app:assembleOssRelease + APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk') + APK=$(dirname $APK) + echo "APK=$APK" >> $GITHUB_ENV + - uses: actions/upload-artifact@v3 + with: + name: APKs + path: ${{ env.APK }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f8ffea9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,170 @@ +name: Release Build +on: + workflow_dispatch: + inputs: + tag: + description: 'Release Tag' + required: true + upload: + description: 'Upload: If want ignore' + required: false + publish: + description: 'Publish: If want ignore' + required: false + play: + description: 'Play: If want ignore' + required: false +jobs: + libcore: + name: Native Build (LibCore) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Golang Status + run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status + - name: Libcore Status + run: git ls-files libcore | xargs cat | sha1sum > libcore_status + - name: LibCore Cache + id: cache + uses: actions/cache@v3 + with: + path: | + app/libs/libcore.aar + key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} + - name: Install Golang + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/setup-go@v3 + with: + go-version: ^1.21 + - name: Native Build + if: steps.cache.outputs.cache-hit != 'true' + run: ./run lib core + build: + name: Build OSS APK + runs-on: ubuntu-latest + needs: + - libcore + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Golang Status + run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status + - name: Libcore Status + run: git ls-files libcore | xargs cat | sha1sum > libcore_status + - name: LibCore Cache + uses: actions/cache@v3 + with: + path: | + app/libs/libcore.aar + key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} + - name: Gradle cache + uses: actions/cache@v3 + with: + path: ~/.gradle + key: gradle-oss-${{ hashFiles('**/*.gradle.kts') }} + - name: Gradle Build + env: + BUILD_PLUGIN: none + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties + export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" + ./run init action gradle + ./gradlew app:assembleOssRelease + APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk') + APK=$(dirname $APK) + echo "APK=$APK" >> $GITHUB_ENV + - uses: actions/upload-artifact@v3 + with: + name: APKs + path: ${{ env.APK }} + publish: + name: Publish Release + if: github.event.inputs.publish != 'y' + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Donwload Artifacts + uses: actions/download-artifact@v3 + with: + name: APKs + path: artifacts + - name: Release + run: | + wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz + tar -xvf ghr.tar.gz + mv ghr*linux_amd64/ghr . + mkdir apks + find artifacts -name "*.apk" -exec cp {} apks \; + ./ghr -delete -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks + upload: + name: Upload Release + if: github.event.inputs.upload != 'y' + runs-on: ubuntu-latest + needs: build + steps: + - name: Donwload Artifacts + uses: actions/download-artifact@v3 + with: + name: APKs + path: artifacts + - name: Release + run: | + mkdir apks + find artifacts -name "*.apk" -exec cp {} apks \; + + function upload() { + for apk in $@; do + echo ">> Uploading $apk" + curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \ + -X POST \ + -F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ + -F document="@$apk" \ + --silent --show-error --fail >/dev/null & + done + for job in $(jobs -p); do + wait $job || exit 1 + done + } + upload apks/* + play: + name: Build Play Bundle + if: github.event.inputs.play != 'y' + runs-on: ubuntu-latest + needs: + - libcore + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Golang Status + run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status + - name: Libcore Status + run: git ls-files libcore | xargs cat | sha1sum > libcore_status + - name: LibCore Cache + uses: actions/cache@v3 + with: + path: | + app/libs/libcore.aar + key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} + - name: Gradle cache + uses: actions/cache@v3 + with: + path: ~/.gradle + key: gradle-play-${{ hashFiles('**/*.gradle.kts') }} + - name: Checkout Library + run: | + git submodule update --init 'app/*' + - name: Gradle Build + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties + export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" + ./run init action gradle + ./gradlew bundlePlayRelease + - uses: actions/upload-artifact@v3 + with: + name: AAB + path: app/build/outputs/bundle/playRelease/app-play-release.aab diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 82c1259..e285669 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,6 +24,7 @@ android { } buildFeatures { viewBinding = true + aidl = true } namespace = "io.nekohasekai.sagernet" } diff --git a/app/src/main/java/io/nekohasekai/sagernet/Constants.kt b/app/src/main/java/io/nekohasekai/sagernet/Constants.kt index 884d0d7..6f3df76 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/Constants.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/Constants.kt @@ -55,10 +55,13 @@ object Key { const val MUX_TYPE = "muxType" const val MUX_PROTOCOLS = "mux" const val MUX_CONCURRENCY = "muxConcurrency" + const val GLOBAL_ALLOW_INSECURE = "globalAllowInsecure" const val ACQUIRE_WAKE_LOCK = "acquireWakeLock" const val SHOW_BOTTOM_BAR = "showBottomBar" + const val ALLOW_INSECURE_ON_REQUEST = "allowInsecureOnRequest" + const val TUN_IMPLEMENTATION = "tunImplementation" const val PROFILE_TRAFFIC_STATISTICS = "profileTrafficStatistics" diff --git a/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt b/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt index b189155..e868b9b 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/database/DataStore.kt @@ -75,6 +75,8 @@ object DataStore : OnPreferenceDataStoreChangeListener { var enableClashAPI by configurationStore.boolean(Key.ENABLE_CLASH_API) var showBottomBar by configurationStore.boolean(Key.SHOW_BOTTOM_BAR) + var allowInsecureOnRequest by configurationStore.boolean(Key.ALLOW_INSECURE_ON_REQUEST) + // var isExpert by configurationStore.boolean(Key.APP_EXPERT) @@ -159,6 +161,7 @@ object DataStore : OnPreferenceDataStoreChangeListener { var muxType by configurationStore.stringToInt(Key.MUX_TYPE) var muxProtocols by configurationStore.stringSet(Key.MUX_PROTOCOLS) var muxConcurrency by configurationStore.stringToInt(Key.MUX_CONCURRENCY) { 8 } + var globalAllowInsecure by configurationStore.boolean(Key.GLOBAL_ALLOW_INSECURE) { false } // old cache, DO NOT ADD diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt b/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt index d38e4c4..4d4d5f6 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt @@ -396,7 +396,7 @@ fun buildConfig( 2 -> "yamux" else -> "h2mux" } - } + }.asMap() } } } diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaFmt.kt b/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaFmt.kt index 7c966d9..5211c18 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaFmt.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/hysteria/HysteriaFmt.kt @@ -311,7 +311,7 @@ fun buildSingBoxOutboundHysteriaBean(bean: HysteriaBean): MutableMap restrictedTLS() } }.newRequest().apply { + if (DataStore.allowInsecureOnRequest) { + allowInsecure() + } setURL(subscription.link) setUserAgent(subscription.customUserAgent.takeIf { it.isNotBlank() } ?: USER_AGENT) }.execute() diff --git a/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt b/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt index 25218c1..9e5e6e7 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt @@ -48,7 +48,6 @@ import io.nekohasekai.sagernet.group.GroupUpdater import io.nekohasekai.sagernet.ktx.* import io.nekohasekai.sagernet.widget.ListHolderListener import moe.matsuri.nb4a.utils.Util -import java.io.File import java.util.* import com.google.android.gms.ads.MobileAds import com.google.android.gms.ads.interstitial.InterstitialAd @@ -207,25 +206,6 @@ class MainActivity : ThemedActivity(), } } - // consent - try { - val f = File(application.filesDir, "consent") - if (!f.exists()) { - MaterialAlertDialogBuilder(this@MainActivity) - .setTitle("VpnService policy") - .setMessage("Since the main function of this application is VPN, it must use VpnService.") - .setPositiveButton(R.string.yes) { _, _ -> - f.createNewFile() - } - .setNegativeButton(android.R.string.cancel) { _, _ -> - finish() - } - .show() - } - } catch (e: Exception) { - Logs.w(e) - } - runOnDefaultDispatcher { val builtinGlobalUrls = app.resources.getStringArray(R.array.builtinGlobalUrls) var mygroup = SagerDatabase.groupDao.getByName(VpnEncrypt.vpnGroupName) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index dc39bb9..d1a522d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -355,7 +355,8 @@ 原始 以名称 以延时 - 配置 %s 需要插件 %s,但你的专有设备供应商(通常也是监视资本主义巨头和恶意软件制造商)篡改了你的安卓系统,使该插件无法使用。 + 配置 %s 需要插件 + %s,但你的专有设备供应商(通常也是监视资本主义巨头和恶意软件制造商)篡改了你的安卓系统,使该插件无法使用。 V2Ray (Shadowsocks Android 插件) Simple Obfs (Shadowsocks Android 插件) 流量 @@ -489,6 +490,8 @@ HTTPUpgrade 路径 更新当前组订阅 组类型不是订阅 + 更新订阅的时候允许不安全的连接 + 总是跳过 TLS 证书验证 " diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 92b812d..1e58c64 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -263,7 +263,7 @@ http quic grpc - httpupgrade + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dc2347a..66c57be 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,10 +68,12 @@ Show Stop Button If you don’t want to use Quick Tile as the switch Show Direct Speed - Show the traffic speed without proxy in the notification as well + Show the traffic speed without proxy in the notification as + well TLS Security Settings Allow Insecure - Disable certificate checking. When enabled, this configuration is as secure as plaintext + Disable certificate checking. When enabled, this configuration + is as secure as plaintext %1$s↑ %2$s↓ Proxy: %1$s↑ %2$s↓\nDirect: %3$s↑ %4$s↓ %s/s @@ -85,9 +87,11 @@ Remote DNS Direct DNS Enable DNS Routing - Resolve domains in bypass routes with Direct DNS. Be aware of potential DNS leaks + Resolve domains in bypass routes with Direct DNS. Be aware of + potential DNS leaks Enable FakeDNS - May cause other applications need to be restarted to reconnect to the network after proxy stopped + May cause other applications need to be restarted to reconnect to + the network after proxy stopped Domain rewrite Local DNS Port Enable Transproxy Inbound @@ -161,7 +165,9 @@ Domain Resolution Strategy Enable Traffic Sniffing Enable Multiplexer - Mux is designed to reduce TCP handshake latency, not to increase connection throughput. Using Mux to watch videos, download or speed test is usually counter productive. If the server does not support it, you will not be able to access the Internet. + Mux is designed to reduce TCP handshake latency, not to increase + connection throughput. Using Mux to watch videos, download or speed test is usually counter + productive. If the server does not support it, you will not be able to access the Internet. Mux Concurrent Connections TCP keep active packet delivery interval Apps VPN mode @@ -177,7 +183,8 @@ Auto Connect Enable proxy on startup/app update if it was running before Allow Toggling in Lock Screen - Your selected profile information will be less protected + Your selected profile information will be less + protected VPN Service Proxy Service @@ -188,7 +195,8 @@ Shutting down… %s Permission denied to create a VPN service - Failed to start VPN service. You might need to reboot your device. + Failed to start VPN service. You might need to reboot your + device. Please select a profile Connect @@ -235,7 +243,8 @@ Failed to export. Successfully import! Failed to import. - Your device lacks an Android standard file selector, please install one, such as Material Files. + Your device lacks an Android standard file selector, please + install one, such as Material Files. Profile config @@ -278,7 +287,8 @@ Configure… Disabled Unknown plugin %s - Warning: This plugin does not seem to come from a known trusted source. + Warning: This plugin does not seem to come from a known trusted + source. This plugin might not work with Auto Connect Server Settings Shadowsocks Settings @@ -288,7 +298,8 @@ Apply Reload proxy service to apply changes License - Make sure you have read the documentation before adding custom rules, otherwise you may not be able to connect to the Internet. + Make sure you have read the documentation before adding custom rules, + otherwise you may not be able to connect to the Internet. %d Lines Night Mode Follow System @@ -307,7 +318,8 @@ %dms Unavailable Always Show Address - Always display the server address on the configuration card + Always display the server address on the configuration + card Clear traffic statistics Connection test Clear test results @@ -321,7 +333,8 @@ Unreachable Timeout Append HTTP Proxy to VPN - HTTP proxy will be used directly from (browser/ some supported apps), without going through the virtual NIC device (Android 10+) + HTTP proxy will be used directly from (browser/ some + supported apps), without going through the virtual NIC device (Android 10+) Protocol Settings Trojan Provider Basic @@ -332,7 +345,8 @@ Subscription Type Are you sure you want to remove this group? Force Resolve - Resolve all domain names to IP addresses when updating. Host and SNI will be automatically appended if possible + Resolve all domain names to IP addresses when updating. Host + and SNI will be automatically appended if possible Remove duplicate configurations when updating Raw Update Settings @@ -343,7 +357,8 @@ UserAgent Confirm Missing Plugin - Profile %s requires the %s plugin to be installed, but it was not found. + Profile %s requires the %s plugin to be installed, but + it was not found. LEARN MORE DOWNLOAD Install from Play Store @@ -351,9 +366,11 @@ Download OOCv1 API Token Invalid OOCv1 Token - Proxy is not connected, are you sure you want to continue updating? + Proxy is not connected, are you sure you want to + continue updating? Warning - The subscription requires support for protocol %s, but it cannot be found. Unsupported profiles will be ignored. + The subscription requires support for protocol %s, but it + cannot be found. Unsupported profiles will be ignored. Subscription Update Service Subscription Update Updating %s … @@ -362,7 +379,9 @@ %s Used / %s Remaining Expire: %s Import subscription - Confirm you want to import subscription %s? If you are coming from an untrusted source, doing this may result in your IP and this behavior being leaked. + Confirm you want to import subscription %s? If you + are coming from an untrusted source, doing this may result in your IP and this behavior + being leaked. Import profile Confirm you want to import profile %s? Are you sure you want to clear this group? @@ -382,7 +401,9 @@ Origin By Name By Delay - Profile %s requires the %s plugin, but your proprietary equipment vendor (usually surveillance capital giants and malware maker) tampered with your Android, making the plugin unusable. + Profile %s requires the %s plugin, but your + proprietary equipment vendor (usually surveillance capital giants and malware maker) + tampered with your Android, making the plugin unusable. Simple Obfs (Shadowsocks Android Plugin) V2Ray (Shadowsocks Android Plugin) @@ -408,10 +429,12 @@ The app has no interface. Rule for %s - Routing rule %s relies on the VPN to be in effect, so it is ignored. + Routing rule %s relies on the VPN to be in effect, so it is + ignored. Profile Traffic Statistics - When disabled, the used traffic will not be counted + When disabled, the used traffic will not be + counted No statistics yet App Traffic statistics disabled None @@ -427,21 +450,29 @@ Peer Pre-Shared Key Cloudflare Warp - CloudFlare Warp is a free WireGuard VPN provider. By using it, you agree to the TOS. + CloudFlare Warp is a free WireGuard VPN provider. By using it, you + agree to the TOS. Generate Configuration Generating… TUN Implementation Override Destination - Use the sniffed domain to overwrite the destination address, not just for routing + Use the sniffed domain to overwrite the destination + address, not just for routing Resolve Destination - If the destination address is a domain, it is then passed out based on the IPv6 strategy (conflicts with FakeDNS) + If the destination address is a domain, it is then + passed out based on the IPv6 strategy (conflicts with FakeDNS) Pcap Pcap files will be saved to %s Insecure Concurrency - Use N concurrent tunnel connections to be more robust under bad network conditions. More connections make the tunneling easier to detect and less secure. This project strives for the strongest security against traffic analysis. Using it in an insecure way defeats its purpose. \n\nIf you must use this, try N=2 first to see if it solves your issues. Strongly recommend against using more than 4 connections here. + Use N concurrent tunnel connections to be more + robust under bad network conditions. More connections make the tunneling easier to detect + and less secure. This project strives for the strongest security against traffic analysis. + Using it in an insecure way defeats its purpose. \n\nIf you must use this, try N=2 first to + see if it solves your issues. Strongly recommend against using more than 4 connections here. NAT behaviour discovery - Determine the client\'s NAT mapping behaviour and the NAT filtering behaviour defined in RFC 3478 using STUN. + Determine the client\'s NAT mapping behaviour and the NAT + filtering behaviour defined in RFC 3478 using STUN. Start This may take a few minutes… Stun server @@ -453,7 +484,8 @@ Groups and configurations Routing rules Settings - If the routing settings are not backed up with configurations, then custom outbounds will be lost. + If the routing settings are not backed up with configurations, + then custom outbounds will be lost. Not an backup file: excepted .json, but %s Invalid backup file Import @@ -471,12 +503,16 @@ Disable SNI Enable 0-RTT QUIC handshake - Your APP is too old (%s). And will stop working at %s. Please update! - Your APP is too old (%s). And has been stopped working at %s. Please update! + Your APP is too old (%s). And will stop working at %s. Please + update! + Your APP is too old (%s). And has been stopped working at %s. + Please update! Clear unavailable Advanced plugin - Advanced plugins can provide protocols that are not originally supported.\n\n -Anyone can write advanced plugins, which can control NekoBox. please download and install from trusted sources. + Advanced plugins can provide protocols that are not + originally supported.\n\n + Anyone can write advanced plugins, which can control NekoBox. please download and install + from trusted sources. %s internal error Move Plugin Preferred Provider @@ -518,18 +554,25 @@ Anyone can write advanced plugins, which can control NekoBox. please download an Sniff result for destination Resolve the server address according to the IPv6 policy Auto select proxy apps - Auto select proxy apps, this will clear your current selection. + Auto select proxy apps, this will clear your + current selection. Enable ECH Enable Encrypted Client Hello ECH Settings - Enable post-quantum peer certificate signature supports + Enable post-quantum peer certificate signature + supports Disables adaptive sizing of TLS records ECH Config - If enable, the largest possible TLS record size is always used. When disable, the size of TLS records may be adjusted in an attempt to improve latency. + If enable, the largest possible TLS record size is + always used. When disable, the size of TLS records may be adjusted in an attempt to improve + latency. HTTPUpgrade Host HTTPUpgrade Path Update current Group\'s subscription Group type is not subscription + Disable certificate checking when updating + subscriptions + Always allow insecure " diff --git a/app/src/main/res/xml/global_preferences.xml b/app/src/main/res/xml/global_preferences.xml index 4adabe1..8053304 100644 --- a/app/src/main/res/xml/global_preferences.xml +++ b/app/src/main/res/xml/global_preferences.xml @@ -156,6 +156,10 @@ app:key="muxConcurrency" app:title="@string/mux_concurrency" app:useSimpleSummaryProvider="true" /> + @@ -260,5 +264,8 @@ + diff --git a/buildScript/lib/core/get_source_env.sh b/buildScript/lib/core/get_source_env.sh index 593497b..458b0b9 100644 --- a/buildScript/lib/core/get_source_env.sh +++ b/buildScript/lib/core/get_source_env.sh @@ -1,5 +1,5 @@ if [ ! -z $ENV_NB4A ]; then - export COMMIT_SING_BOX_EXTRA="b13bae46e9fcd330c26e66caedf5640ba31f4505" + export COMMIT_SING_BOX_EXTRA="5b03ea2516de4ab47a022c9dcbea96e57eadf432" fi if [ ! -z $ENV_SING_BOX_EXTRA ]; then diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index a6aa10a..0d381ae 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -7,6 +7,6 @@ apply(from = "../repositories.gradle.kts") dependencies { // Gradle Plugins - implementation("com.android.tools.build:gradle:7.4.2") + implementation("com.android.tools.build:gradle:8.1.3") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10") } diff --git a/buildSrc/src/main/kotlin/Helpers.kt b/buildSrc/src/main/kotlin/Helpers.kt index 14c08dc..1e6cb11 100644 --- a/buildSrc/src/main/kotlin/Helpers.kt +++ b/buildSrc/src/main/kotlin/Helpers.kt @@ -106,11 +106,11 @@ fun Project.setupCommon() { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } (android as ExtensionAware).extensions.getByName("kotlinOptions").apply { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } lint { showAll = true @@ -246,7 +246,7 @@ fun Project.setupApp() { applicationVariants.all { outputs.all { this as BaseVariantOutputImpl - outputFileName = outputFileName.replace(project.name, "NB4A-$versionName") + outputFileName = outputFileName.replace(project.name, "v2ray.vpn-$versionName") .replace("-release", "") .replace("-oss", "") } diff --git a/gitupdate.bat b/gitupdate.bat index de7cea6..fbf1bc4 100644 --- a/gitupdate.bat +++ b/gitupdate.bat @@ -1,8 +1,8 @@ git config --global core.autocrlf true - +git pull origin master git add -A -git commit -m "update to v6.3.1 based on NekoBoxForAndroid" +git commit -m "update to v6.3.2" git push origin master -git tag -a v6.3.1 -m "v6.3.1 based on NekoBoxForAndroid" +git tag -a v6.3.2 -m "v6.3.2" git push origin --tags pause \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index fcc04f0..a9faaf7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,3 +21,6 @@ android.enableJetifier=true kotlin.code.style=official # Gradle parallel build org.gradle.parallel=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7e62b17..3ffebc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/libcore/build.sh b/libcore/build.sh index 2f8b060..22b9a7b 100644 --- a/libcore/build.sh +++ b/libcore/build.sh @@ -2,8 +2,6 @@ source ../buildScript/init/env_ndk.sh -[ $rel ] || sed -i "s/buildDate .*/buildDate := `date +'%Y%m%d'`/g" date.go - BUILD=".build" rm -rf $BUILD/android \ @@ -11,7 +9,7 @@ rm -rf $BUILD/android \ $BUILD/javac-output \ $BUILD/src -gomobile bind -v -androidapi 21 -trimpath -ldflags='-s -w' -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . || exit 1 +gomobile bind -v -androidapi 21 -cache $(realpath $BUILD) -trimpath -ldflags='-s -w' -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . || exit 1 rm -r libcore-sources.jar proj=../app/libs diff --git a/libcore/go.mod b/libcore/go.mod index b892441..ba46284 100644 --- a/libcore/go.mod +++ b/libcore/go.mod @@ -7,12 +7,12 @@ require ( github.com/matsuridayo/libneko v1.0.0 // replaced github.com/matsuridayo/sing-box-extra v1.0.0 // replaced github.com/miekg/dns v1.1.56 - github.com/sagernet/sing v0.2.16-0.20231028125948-afcc9cb766c2 + github.com/sagernet/sing v0.2.17 github.com/sagernet/sing-box v1.0.0 // replaced github.com/sagernet/sing-dns v0.1.10 - github.com/sagernet/sing-tun v0.1.17-0.20231030120513-2e85725657c1 - github.com/ulikunitz/xz v0.5.10 - golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105 + github.com/sagernet/sing-tun v0.1.20-0.20231116102114-958d6a25a41d + github.com/ulikunitz/xz v0.5.11 + golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da ) require ( @@ -29,8 +29,6 @@ require ( github.com/go-chi/render v1.0.3 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect github.com/gofrs/uuid/v5 v5.0.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/btree v1.1.2 // indirect @@ -61,7 +59,7 @@ require ( github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect github.com/sagernet/quic-go v0.0.0-20231008035953-32727fef9460 // indirect github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 // indirect - github.com/sagernet/sing-mux v0.1.3 // indirect + github.com/sagernet/sing-mux v0.1.4 // indirect github.com/sagernet/sing-quic v1.0.0 // indirect github.com/sagernet/sing-shadowsocks v0.2.5 // indirect github.com/sagernet/sing-shadowsocks2 v0.1.4 // indirect @@ -70,10 +68,10 @@ require ( github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 // indirect github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 // indirect github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 // indirect + github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e // indirect github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f // indirect - github.com/sagernet/ws v0.0.0-20231030053741-7d481eb31bed // indirect github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 // indirect - github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect @@ -81,14 +79,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.15.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/tools v0.15.0 // indirect golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect diff --git a/libcore/go.sum b/libcore/go.sum index 7623029..f623b1e 100644 --- a/libcore/go.sum +++ b/libcore/go.sum @@ -1,6 +1,5 @@ berty.tech/go-libtor v1.0.385 h1:RWK94C3hZj6Z2GdvePpHJLnWYobFr3bY/OdUJ5aoEXw= berty.tech/go-libtor v1.0.385/go.mod h1:9swOOQVb+kmvuAlsgWUK/4c52pm69AdbJsxLzk+fJEw= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= @@ -14,7 +13,7 @@ github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlU github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/codeclysm/extract v2.2.0+incompatible h1:q3wyckoA30bhUSiwdQezMqVhwd8+WGE64/GL//LtUhI= github.com/codeclysm/extract v2.2.0+incompatible/go.mod h1:2nhFMPHiU9At61hz+12bfrlpXSUrOnK+wR+KlGO4Uks= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw= github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo= github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI= @@ -36,10 +35,6 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -117,20 +112,20 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byL github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= -github.com/sagernet/sing v0.2.16-0.20231028125948-afcc9cb766c2 h1:PW18IgRodvppd09d4mewYM3Hedu3PtFERN8yOqkTVk0= -github.com/sagernet/sing v0.2.16-0.20231028125948-afcc9cb766c2/go.mod h1:AhNEHu0GXrpqkuzvTwvC8+j2cQUU/dh+zLEmq4C99pg= +github.com/sagernet/sing v0.2.17 h1:vMPKb3MV0Aa5ws4dCJkRI8XEjrsUcDn810czd0FwmzI= +github.com/sagernet/sing v0.2.17/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo= github.com/sagernet/sing-dns v0.1.10 h1:iIU7nRBlUYj+fF2TaktGIvRiTFFrHwSMedLQsvlTZCI= github.com/sagernet/sing-dns v0.1.10/go.mod h1:vtUimtf7Nq9EdvD5WTpfCr69KL1M7bcgOVKiYBiAY/c= -github.com/sagernet/sing-mux v0.1.3 h1:fAf7PZa2A55mCeh0KKM02f1k2Y4vEmxuZZ/51ahkkLA= -github.com/sagernet/sing-mux v0.1.3/go.mod h1:wGeIeiiFLx4HUM5LAg65wrNZ/X1muOimqK0PEhNbPi0= +github.com/sagernet/sing-mux v0.1.4 h1:BPNPOQr6HkXG3iY/BrfvUKUl+A7gYsGKVSxvoR3PO50= +github.com/sagernet/sing-mux v0.1.4/go.mod h1:dKvcu/sb3fZ88uGv9vzAqUej6J4W+pHu5GqjRuFwAWs= github.com/sagernet/sing-shadowsocks v0.2.5 h1:qxIttos4xu6ii7MTVJYA8EFQR7Q3KG6xMqmLJIFtBaY= github.com/sagernet/sing-shadowsocks v0.2.5/go.mod h1:MGWGkcU2xW2G2mfArT9/QqpVLOGU+dBaahZCtPHdt7A= github.com/sagernet/sing-shadowsocks2 v0.1.4 h1:vht2M8t3m5DTgXR2j24KbYOygG5aOp+MUhpQnAux728= github.com/sagernet/sing-shadowsocks2 v0.1.4/go.mod h1:Mgdee99NxxNd5Zld3ixIs18yVs4x2dI2VTDDE1N14Wc= github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k= github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4= -github.com/sagernet/sing-tun v0.1.17-0.20231030120513-2e85725657c1 h1:QxC+myHDZ0BnkIEqXE0lWUzfYEVlhhQdSCo7mOMm7x4= -github.com/sagernet/sing-tun v0.1.17-0.20231030120513-2e85725657c1/go.mod h1:4ACZp3C6TDSy1rsMrfwtSyLrKPtm9Wm2eKHwhYIojbU= +github.com/sagernet/sing-tun v0.1.20-0.20231116102114-958d6a25a41d h1:c0M01hMieuYwOMk+xzgudn0jNjPLUR15I/QnXk0eLkc= +github.com/sagernet/sing-tun v0.1.20-0.20231116102114-958d6a25a41d/go.mod h1:6kkPL/u9tWcLFfu55VbwMDnO++17cUihSmImkZjdZro= github.com/sagernet/sing-vmess v0.1.8 h1:XVWad1RpTy9b5tPxdm5MCU8cGfrTGdR8qCq6HV2aCNc= github.com/sagernet/sing-vmess v0.1.8/go.mod h1:vhx32UNzTDUkNwOyIjcZQohre1CaytquC5mPplId8uA= github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as= @@ -139,14 +134,14 @@ github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6 h1:Px+hN4Vzgx+iCGV github.com/sagernet/tfo-go v0.0.0-20230816093905-5a5c285d44a6/go.mod h1:zovq6vTvEM6ECiqE3Eeb9rpIylPpamPcmrJ9tv0Bt0M= github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 h1:kDUqhc9Vsk5HJuhfIATJ8oQwBmpOZJuozQG7Vk88lL4= github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2/go.mod h1:JKQMZq/O2qnZjdrt+B57olmfgEmLtY9iiSIEYtWvoSM= +github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e h1:7uw2njHFGE+VpWamge6o56j2RWk4omF6uLKKxMmcWvs= +github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e/go.mod h1:45TUl8+gH4SIKr4ykREbxKWTxkDlSzFENzctB1dVRRY= github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f h1:Kvo8w8Y9lzFGB/7z09MJ3TR99TFtfI/IuY87Ygcycho= github.com/sagernet/wireguard-go v0.0.0-20230807125731-5d4a7ef2dc5f/go.mod h1:mySs0abhpc/gLlvhoq7HP1RzOaRmIXVeZGCh++zoApk= -github.com/sagernet/ws v0.0.0-20231030053741-7d481eb31bed h1:90a510OeE9siSJoYsI8nSjPmA+u5ROMDts/ZkdNsuXY= -github.com/sagernet/ws v0.0.0-20231030053741-7d481eb31bed/go.mod h1:LtfoSK3+NG57tvnVEHgcuBW9ujgE8enPSgzgwStwCAA= github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 h1:rc/CcqLH3lh8n+csdOuDfP+NuykE0U6AeYSJJHKDgSg= github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9/go.mod h1:a/83NAfUXvEuLpmxDssAXxgUgrEy12MId3Wd7OTs76s= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -156,11 +151,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 h1:tHNk7XK9GkmKUR6Gh8gVBKXc2MVSZ4G/NnWLtzw4gNA= github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264= -github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= -github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg= github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY= github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= @@ -174,70 +168,44 @@ go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go4.org/netipx v0.0.0-20230824141953-6213f710f925 h1:eeQDDVKFkx0g4Hyy8pHgmZaK0EqB4SD6rvKbUdN3ziQ= go4.org/netipx v0.0.0-20230824141953-6213f710f925/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105 h1:3vUV5x5+3LfQbgk7paCM6INOaJG9xXQbn79xoNkwfIk= -golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da h1:gS9sVMAeHM+gVBmM9bTM6vUi/NHv58O3QzJ3vjjN84M= +golang.org/x/mobile v0.0.0-20231108233038-35478a0c49da/go.mod h1:IEceR0jfVklLJXrbUe90rfdAFAYDW0SQwKl4qvO1GBQ= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 h1:CawjfCvYQH2OU3/TnxLx97WDSUDRABfT18pCOYwc2GE= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6/go.mod h1:3rxYc4HtVcSG9gVaTs2GEBdehh+sYPOwKtyUWEOTb80= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= diff --git a/libcore/http.go b/libcore/http.go index d4db1ff..609fadd 100644 --- a/libcore/http.go +++ b/libcore/http.go @@ -40,6 +40,7 @@ type HTTPRequest interface { SetContent(content []byte) SetContentString(content string) SetUserAgent(userAgent string) + AllowInsecure() Execute() (HTTPResponse, error) } @@ -142,6 +143,10 @@ type httpRequest struct { request http.Request } +func (r *httpRequest) AllowInsecure() { + r.tls.InsecureSkipVerify = true +} + func (r *httpRequest) SetURL(link string) (err error) { r.request.URL, err = url.Parse(link) if err != nil { diff --git a/nb4a.properties b/nb4a.properties index 55f7e73..df87be6 100644 --- a/nb4a.properties +++ b/nb4a.properties @@ -1,3 +1,3 @@ PACKAGE_NAME=free.v2ray.proxy.VPN -VERSION_NAME=6.3.1 -VERSION_CODE=5001219 +VERSION_NAME=6.3.2 +VERSION_CODE=5001229 diff --git a/settings.gradle.kts b/settings.gradle.kts index 4d530e5..926c250 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1,2 @@ include(":app") -rootProject.name = "NB4A" +rootProject.name = "v2ray.vpn" diff --git a/update-zh.json b/update-zh.json index 7f533f0..22cece0 100644 --- a/update-zh.json +++ b/update-zh.json @@ -1,5 +1,5 @@ { - "version": "5001209", + "version": "5001229", "title": "V2ray VPN 有新版本", "text": "请尽快从Google Play下载更新。如果您以前不是从Google Play安装的,则可能需要先卸载再安装!", "uri": "https://play.google.com/store/apps/details?id=free.v2ray.proxy.VPN" diff --git a/update.json b/update.json index caf585d..9b94b17 100644 --- a/update.json +++ b/update.json @@ -1,5 +1,5 @@ { - "version": "5001209", + "version": "5001229", "title": "New version detected", "text": "Please download the update from Google Play as soon as possible. If you did not install it from Google Play before, you may need to uninstall then to install it!", "uri": "https://play.google.com/store/apps/details?id=free.v2ray.proxy.VPN"