From 7f76ec2ec6cca37518f50679ad06f49e1b404f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 13 Jun 2021 02:44:15 +0800 Subject: [PATCH] Remove Xray related parts for fork --- .github/workflows/debug.yml | 23 - .github/workflows/release_xtls.yml | 194 ------ .gitmodules | 3 - .idea/codeStyles/Project.xml | 7 + .idea/gradle.xml | 1 - README.md | 2 - app/build.gradle.kts | 7 +- .../java/io/nekohasekai/sagernet/Constants.kt | 1 - .../nekohasekai/sagernet/bg/ProxyInstance.kt | 24 - .../sagernet/database/DataStore.kt | 1 - .../sagernet/database/ProfileManager.kt | 79 +-- .../sagernet/database/ProxyEntity.kt | 22 +- .../nekohasekai/sagernet/fmt/ConfigBuilder.kt | 590 ++++++------------ .../sagernet/fmt/trojan/TrojanBean.java | 11 - .../sagernet/fmt/trojan/TrojanFmt.kt | 5 - .../sagernet/fmt/v2ray/StandardV2RayBean.java | 21 - .../sagernet/fmt/v2ray/V2RayConfig.java | 28 - .../sagernet/fmt/v2ray/V2RayFmt.kt | 37 +- .../profile/StandardV2RaySettingsActivity.kt | 18 +- .../ui/profile/TrojanSettingsActivity.kt | 29 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values/arrays.xml | 22 - app/src/main/res/values/strings.xml | 1 - .../res/xml/standard_v2ray_preferences.xml | 7 - app/src/main/res/xml/trojan_preferences.xml | 7 - bin/plugin/xtls/arm64-v8a.sh | 9 - bin/plugin/xtls/armeabi-v7a.sh | 9 - bin/plugin/xtls/build.sh | 15 - bin/plugin/xtls/end.sh | 5 - bin/plugin/xtls/init.sh | 13 - bin/plugin/xtls/x86.sh | 9 - bin/plugin/xtls/x86_64.sh | 9 - plugin/brook/src/main/AndroidManifest.xml | 2 +- plugin/xtls/build.gradle.kts | 5 - plugin/xtls/src/main/AndroidManifest.xml | 39 -- plugin/xtls/src/main/go/Xray-core | 1 - .../xtls/src/main/ic_launcher-playstore.png | Bin 12949 -> 0 bytes .../sagernet/plugin/xtls/BinaryProvider.kt | 42 -- plugin/xtls/src/main/play | 1 - .../res/drawable/ic_launcher_foreground.xml | 23 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 1660 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 3651 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 1132 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2296 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 2375 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 5315 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 3539 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 8089 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 4967 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 11922 -> 0 bytes .../res/values/ic_launcher_background.xml | 4 - settings.gradle.kts | 1 - 54 files changed, 230 insertions(+), 1108 deletions(-) delete mode 100644 .github/workflows/release_xtls.yml delete mode 100755 bin/plugin/xtls/arm64-v8a.sh delete mode 100755 bin/plugin/xtls/armeabi-v7a.sh delete mode 100755 bin/plugin/xtls/build.sh delete mode 100755 bin/plugin/xtls/end.sh delete mode 100755 bin/plugin/xtls/init.sh delete mode 100755 bin/plugin/xtls/x86.sh delete mode 100755 bin/plugin/xtls/x86_64.sh delete mode 100644 plugin/xtls/build.gradle.kts delete mode 100644 plugin/xtls/src/main/AndroidManifest.xml delete mode 160000 plugin/xtls/src/main/go/Xray-core delete mode 100644 plugin/xtls/src/main/ic_launcher-playstore.png delete mode 100644 plugin/xtls/src/main/java/io/nekohasekai/sagernet/plugin/xtls/BinaryProvider.kt delete mode 120000 plugin/xtls/src/main/play delete mode 100644 plugin/xtls/src/main/res/drawable/ic_launcher_foreground.xml delete mode 100644 plugin/xtls/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 plugin/xtls/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 plugin/xtls/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 plugin/xtls/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 plugin/xtls/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 plugin/xtls/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 plugin/xtls/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 plugin/xtls/src/main/res/values/ic_launcher_background.xml diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 7b08cb93..dc22d7b1 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -63,29 +63,6 @@ jobs: - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: ./run lib v2ray - xtls: - name: Native Build (XTLS) - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/xtls/*' > xtls_status - - name: XTLS Cache - id: cache - uses: actions/cache@v2 - with: - path: | - plugin/xtls/src/main/jniLibs - key: ${{ hashFiles('bin/lib/xtls/*', 'xtls_status') }} - - name: Install Golang - uses: actions/setup-go@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - go-version: 1.16 - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - run: ./run plugin xtls trojan-go: name: Native Build (Trojan-Go) runs-on: ubuntu-latest diff --git a/.github/workflows/release_xtls.yml b/.github/workflows/release_xtls.yml deleted file mode 100644 index 7dd650a9..00000000 --- a/.github/workflows/release_xtls.yml +++ /dev/null @@ -1,194 +0,0 @@ -name: XTLS Plugin 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: - check: - name: Check Access - runs-on: ubuntu-latest - steps: - - name: "Check access" - uses: "lannonbr/repo-permission-check-action@2.0.0" - with: - permission: "write" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - native: - name: Native Build - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/xtls/*' > xtls_status - - name: XTLS Cache - id: cache - uses: actions/cache@v2 - with: - path: | - plugin/xtls/src/main/jniLibs - key: ${{ hashFiles('bin/lib/xtls/*', 'xtls_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle') }} - - name: Install Golang - uses: actions/setup-go@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - go-version: 1.16 - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - run: ./run plugin xtls - build: - name: Gradle Build - runs-on: ubuntu-latest - needs: - - native - - check - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/xtls/*' > xtls_status - - name: XTLS Cache - uses: actions/cache@v2 - with: - path: | - plugin/xtls/src/main/jniLibs - key: ${{ hashFiles('bin/lib/xtls/*', 'xtls_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle') }} - - name: Release Build - env: - SKIP_BUILD: on - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" - ./gradlew :plugin:xtls:assembleOssRelease - APK=$(find plugin/xtls/build/outputs/apk -name '*arm64-v8a*.apk') - APK=$(dirname $APK) - echo "APK=$APK" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 - with: - name: APKs - path: ${{ env.APK }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-ARM ${{ env.SHA256_ARM }}" - path: ${{ env.SUM_ARM }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-ARM64 ${{ env.SHA256_ARM64 }}" - path: ${{ env.SUM_ARM64 }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-X64 ${{ env.SHA256_X64 }}" - path: ${{ env.SUM_X64 }} - - uses: actions/upload-artifact@v2 - with: - name: "SHA256-X86 ${{ env.SHA256_X86 }}" - path: ${{ env.SUM_X86 }} - publish: - name: Publish Release - if: github.event.inputs.publish != 'y' - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Donwload Artifacts - uses: actions/download-artifact@v2 - 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 \; - find artifacts -name "*.sha256sum.txt" -exec cp {} apks \; - ./ghr -delete -prerelease -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@v2 - 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: Publish to Play Store - if: github.event.inputs.upload != 'y' - runs-on: ubuntu-latest - needs: - - native - - check - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/xtls/*' > xtls_status - - name: XTLS Cache - uses: actions/cache@v2 - with: - path: | - plugin/xtls/src/main/jniLibs - key: ${{ hashFiles('bin/lib/xtls/*', 'xtls_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle') }} - - name: Release Build - env: - SKIP_BUILD: on - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" - cat > service_account_credentials.json << EOF - ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}" - EOF - ./gradlew :plugin:xtls:publishPlayRelease \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index c52709e2..05fa7123 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,9 +28,6 @@ [submodule "library/shadowsocksr/src/main/jni/re2"] path = library/shadowsocksr/src/main/jni/re2 url = https://github.com/google/re2 -[submodule "plugin/xtls/src/main/go/Xray-core"] - path = plugin/xtls/src/main/go/Xray-core - url = https://github.com/XTLS/Xray-core [submodule "plugin/trojan-go/src/main/go/trojan-go"] path = plugin/trojan-go/src/main/go/trojan-go url = https://github.com/p4gefau1t/trojan-go diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 34f68fe5..15c9f851 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -122,6 +122,13 @@