diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index a3772562..66e2e655 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -184,106 +184,16 @@ jobs: - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: ./run plugin hysteria - wireguard: - name: Native Build (WireGuard) - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/wireguard/*' > wireguard_status - - name: WireGuard Cache - id: cache - uses: actions/cache@v2 - with: - path: | - plugin/wireguard/src/main/jniLibs - key: ${{ hashFiles('.github/workflows/*', 'bin/lib/wireguard/*', 'wireguard_status') }} - - name: Install Golang - uses: actions/setup-go@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - go-version: 1.17.1 - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - run: ./run plugin wireguard - shadowsocks: - name: Native Build (shadowsocks-rust) - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'library/shadowsocks/*' > shadowsocks_status - - name: Shadowsocks Cache - id: cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }} - - name: Install Rust - if: steps.cache.outputs.cache-hit != 'true' - run: ./run init action shadowsocks - - name: Gradle cache - uses: actions/cache@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - path: ~/.gradle - key: native-${{ hashFiles('**/*.gradle.kts') }} - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - env: - BUILD_PLUGIN: none - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - ./run init action library - ./run lib shadowsocks - shadowsocks_libev: - name: Native Build (shadowsocks-libev) - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status - - name: shadowsocks-libev Cache - id: cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks-libev.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }} - - name: Gradle cache - uses: actions/cache@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - path: ~/.gradle - key: native-${{ hashFiles('**/*.gradle.kts') }} - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - env: - BUILD_PLUGIN: none - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - ./run init action library - ./run lib shadowsocks_libev - Lint: + lint: name: Android Lint runs-on: ubuntu-latest needs: - libcore - - shadowsocks - - shadowsocks_libev steps: - name: Checkout uses: actions/checkout@v2 - name: Fetch Status run: | - git submodule status 'library/shadowsocks/*' > shadowsocks_status - git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status git submodule status library/core > libcore_status - name: LibCore Cache uses: actions/cache@v2 @@ -291,18 +201,6 @@ jobs: path: | app/libs/libcore.aar key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }} - - name: Shadowsocks Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }} - - name: Shadowsocks (libev) Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks-libev.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }} - name: Gradle cache uses: actions/cache@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4b14452..9305980a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,85 +58,16 @@ jobs: echo "sdk.dir=${ANDROID_HOME}" > local.properties echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties ./run lib core - shadowsocks: - name: Native Build (shadowsocks-rust) - runs-on: ubuntu-latest - needs: check - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'library/shadowsocks/*' > shadowsocks_status - - name: Shadowsocks Cache - id: cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }} - - name: Install Rust - if: steps.cache.outputs.cache-hit != 'true' - run: ./run init action shadowsocks - - name: Gradle cache - uses: actions/cache@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - path: ~/.gradle - key: native-${{ hashFiles('**/*.gradle.kts') }} - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - env: - BUILD_PLUGIN: none - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - ./run init action library - ./run lib shadowsocks - shadowsocks_libev: - name: Native Build (shadowsocks-libev) - runs-on: ubuntu-latest - needs: check - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status - - name: Shadowsocks Cache - id: cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks-libev.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }} - - name: Gradle cache - uses: actions/cache@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - path: ~/.gradle - key: native-${{ hashFiles('**/*.gradle.kts') }} - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - env: - BUILD_PLUGIN: none - run: | - echo "sdk.dir=${ANDROID_HOME}" > local.properties - echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties - ./run init action library - ./run lib shadowsocks_libev build: name: Gradle Build runs-on: ubuntu-latest needs: - libcore - - shadowsocks - - shadowsocks_libev steps: - name: Checkout uses: actions/checkout@v2 - name: Fetch Status run: | - git submodule status 'library/shadowsocks/*' > shadowsocks_status - git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status git submodule status library/core > libcore_status - name: LibCore Cache uses: actions/cache@v2 @@ -144,18 +75,6 @@ jobs: path: | app/libs/libcore.aar key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }} - - name: Shadowsocks Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }} - - name: Shadowsocks (libev) Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks-libev.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }} - name: Gradle cache uses: actions/cache@v2 with: @@ -251,15 +170,11 @@ jobs: runs-on: ubuntu-latest needs: - libcore - - shadowsocks - - shadowsocks_libev steps: - name: Checkout uses: actions/checkout@v2 - name: Fetch Status run: | - git submodule status 'library/shadowsocks/*' > shadowsocks_status - git submodule status 'library/shadowsocks-libev/*' > shadowsocks_libev_status git submodule status library/core > libcore_status - name: LibCore Cache uses: actions/cache@v2 @@ -267,18 +182,6 @@ jobs: path: | app/libs/libcore.aar key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }} - - name: Shadowsocks Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks/build.gradle.kts', 'shadowsocks_status') }} - - name: Shadowsocks (libev) Cache - uses: actions/cache@v2 - with: - path: | - app/libs/shadowsocks-libev.aar - key: ${{ hashFiles('.github/workflows/*', 'library/shadowsocks-libev/build.gradle.kts', 'shadowsocks_libev_status') }} - name: Gradle cache uses: actions/cache@v2 with: diff --git a/.github/workflows/release_wireguard.yml b/.github/workflows/release_wireguard.yml deleted file mode 100644 index c590d976..00000000 --- a/.github/workflows/release_wireguard.yml +++ /dev/null @@ -1,198 +0,0 @@ -name: WireGuard 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/wireguard/*' > wireguard_status - - name: WireGuard Cache - id: cache - uses: actions/cache@v2 - with: - path: | - plugin/wireguard/src/main/jniLibs - key: ${{ hashFiles('.github/workflows/*', 'bin/lib/wireguard/*', 'wireguard_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle.kts') }} - - name: Install Golang - uses: actions/setup-go@v2 - if: steps.cache.outputs.cache-hit != 'true' - with: - go-version: 1.17.1 - - name: Native Build - if: steps.cache.outputs.cache-hit != 'true' - run: ./run plugin wireguard - 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/wireguard/*' > wireguard_status - - name: WireGuard Cache - uses: actions/cache@v2 - with: - path: | - plugin/wireguard/src/main/jniLibs - key: ${{ hashFiles('.github/workflows/*', 'bin/lib/wireguard/*', 'wireguard_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle.kts') }} - - name: Release Build - env: - SKIP_BUILD: on - BUILD_PLUGIN: wireguard - 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 }}" - ./run init action library - ./gradlew :plugin:wireguard:assembleOssRelease - APK=$(find plugin/wireguard/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.play != 'y' - runs-on: ubuntu-latest - needs: - - native - - check - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Fetch Status - run: git submodule status 'plugin/wireguard/*' > wireguard_status - - name: WireGuard Cache - uses: actions/cache@v2 - with: - path: | - plugin/wireguard/src/main/jniLibs - key: ${{ hashFiles('.github/workflows/*', 'bin/lib/wireguard/*', 'wireguard_status') }} - - name: Gradle cache - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle.kts') }} - - name: Release Build - env: - SKIP_BUILD: on - BUILD_PLUGIN: wireguard - 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 - ./run init action library - ./gradlew :plugin:wireguard:publishPlayReleaseBundle \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 4e88495e..b4801db5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "library/shadowsocks/src/main/rust/shadowsocks-rust"] - path = library/shadowsocks/src/main/rust/shadowsocks-rust - url = https://github.com/shadowsocks/shadowsocks-rust.git [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 @@ -40,28 +37,3 @@ [submodule "external/termux-view"] path = external/termux-view url = https://github.com/SagerNet/termux-view -[submodule "library/shadowsocks-libev/src/main/jni/libev"] - path = library/shadowsocks-libev/src/main/jni/libev - url = https://git.lighttpd.net/mirrors/libev.git -[submodule "library/shadowsocks-libev/src/main/jni/libancillary"] - path = library/shadowsocks-libev/src/main/jni/libancillary - url = https://github.com/shadowsocks/libancillary.git -[submodule "library/shadowsocks-libev/src/main/jni/libevent"] - path = library/shadowsocks-libev/src/main/jni/libevent - url = https://github.com/shadowsocks/libevent.git -[submodule "library/shadowsocks-libev/src/main/jni/mbedtls"] - path = library/shadowsocks-libev/src/main/jni/mbedtls - url = https://github.com/SagerNet/mbedtls -[submodule "library/shadowsocks-libev/src/main/jni/pcre"] - path = library/shadowsocks-libev/src/main/jni/pcre - url = https://android.googlesource.com/platform/external/pcre -[submodule "library/shadowsocks-libev/src/main/jni/libsodium"] - path = library/shadowsocks-libev/src/main/jni/libsodium - url = https://github.com/jedisct1/libsodium.git - branch = stable -[submodule "library/shadowsocks-libev/src/main/jni/shadowsocks-libev"] - path = library/shadowsocks-libev/src/main/jni/shadowsocks-libev - url = https://github.com/SagerNet/shadowsocks-libev -[submodule "plugin/wireguard/src/main/go/wgsocks"] - path = plugin/wireguard/src/main/go/wgsocks - url = https://github.com/SagerNet/wgsocks diff --git a/.idea/gradle.xml b/.idea/gradle.xml index e2cc14af..842178ee 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -76,8 +76,6 @@