Repository navigation
feat(i18n): локализация названий стран в фильтре локаций для RU, EN, … #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android CI Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| name: Build Debug APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Accept Android SDK licenses | |
| run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true | |
| - name: Install NDK | |
| run: | | |
| NDK_VER="28.2.13676358" | |
| echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \ | |
| --channel=0 \ | |
| --install "ndk;$NDK_VER" | |
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$NDK_VER" >> $GITHUB_ENV | |
| echo "NDK_HOME=$ANDROID_HOME/ndk/$NDK_VER" >> $GITHUB_ENV | |
| - name: Build libhevtun | |
| run: | | |
| bash compile-hevtun.sh | |
| mkdir -p V2rayNG/app/libs | |
| cp -r libs/* V2rayNG/app/libs/ | |
| - name: Cache Unified libv2ray | |
| id: cache-v2ray | |
| uses: actions/cache@v4 | |
| with: | |
| path: V2rayNG/app/libs/libv2ray.aar | |
| key: ${{ runner.os }}-libv2ray-ci-v3-${{ hashFiles('AndroidLibXrayLite/**/*.go', 'v2w-core/**/*.go', 'AndroidLibXrayLite/go.sum', 'v2w-core/go.sum') }} | |
| - name: Set up Go | |
| if: steps.cache-v2ray.outputs.cache-hit != 'true' | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26.x' | |
| - name: Build Unified libv2ray (Original Core + Scanner Core) | |
| if: steps.cache-v2ray.outputs.cache-hit != 'true' | |
| run: | | |
| export GOPROXY=https://proxy.golang.org,direct | |
| go install golang.org/x/mobile/cmd/gomobile@latest || (sleep 5 && go install golang.org/x/mobile/cmd/gomobile@latest) | |
| go install golang.org/x/mobile/cmd/gobind@latest || (sleep 5 && go install golang.org/x/mobile/cmd/gobind@latest) | |
| gomobile init | |
| # Patch anet to fix Go 1.26 incompatibility (must download first) | |
| pushd AndroidLibXrayLite | |
| go mod download | |
| popd | |
| pushd v2w-core | |
| go mod download | |
| popd | |
| ANET_DIR="$(go env GOPATH)/pkg/mod/github.com/wlynxg/anet@v0.0.5" | |
| chmod -R u+w "$ANET_DIR" 2>/dev/null || true | |
| sed -i '/\/\/go:linkname zoneCache/d' "$ANET_DIR/interface_android.go" || true | |
| sed -i '/var zoneCache ipv6ZoneCache/d' "$ANET_DIR/interface_android.go" || true | |
| sed -i '/\/\/go:linkname zoneCacheX/d' "$ANET_DIR/interface_android.go" || true | |
| sed -i '/var zoneCacheX ipv6ZoneCache/d' "$ANET_DIR/interface_android.go" || true | |
| sed -i '/zoneCache\.update/d' "$ANET_DIR/interface_android.go" || true | |
| sed -i '/zoneCacheX\.update/d' "$ANET_DIR/interface_android.go" || true | |
| # Patch libv2ray_main.go to include V2W scanner bindings | |
| if ! grep -q "RunV2WScanner" AndroidLibXrayLite/libv2ray_main.go; then | |
| sed -i '/mobasset "golang.org\/x\/mobile\/asset"/a \ \t"github.com/kiktor/v2w-core/v2wscanner"' AndroidLibXrayLite/libv2ray_main.go | |
| printf '\ntype V2WScanCallback interface {\n\tOnServerSuccess(configUrl string, delay int64)\n\tOnScanComplete(totalSuccess int64, totalFailed int64)\n}\n\nfunc RunV2WScanner(configs string, maxConcurrency int64, callback V2WScanCallback) {\n\tv2wscanner.RunV2WScanner(configs, maxConcurrency, callback)\n}\n\nfunc StopV2WScanner() {\n\tv2wscanner.StopV2WScanner()\n}\n' >> AndroidLibXrayLite/libv2ray_main.go | |
| fi | |
| # Run gomobile from within AndroidLibXrayLite so it is the "current module" | |
| pushd AndroidLibXrayLite | |
| V2W_ABS="$(readlink -f ../v2w-core)" | |
| go mod edit -require github.com/kiktor/v2w-core@v0.0.0 | |
| go mod edit -replace "github.com/kiktor/v2w-core=$V2W_ABS" | |
| GOWORK=off go mod tidy | |
| GOWORK=off gomobile bind -v -androidapi 21 -target=android \ | |
| -o ../V2rayNG/app/libs/libv2ray.aar \ | |
| . | |
| popd | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| working-directory: V2rayNG | |
| - name: Run Android Lint | |
| run: ./gradlew lintFdroidDebug | |
| working-directory: V2rayNG | |
| continue-on-error: true | |
| - name: Upload Lint Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: V2rayNG/app/build/reports/lint-results-fdroidDebug.html | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug | |
| working-directory: V2rayNG |