refactor: replace C++ native checks with Rust

Port all 15 native VPN detection checks from C++ to Rust using
jni + libc crates. Gradle triggers cargo-ndk automatically via
a preBuild dependency — single `./gradlew installDebug` builds
everything.

- Remove CMakeLists.txt and native-lib.cpp
- Add test-app/native/ Rust crate with Cargo.toml and src/lib.rs
- Gradle buildRustNative task runs cargo-ndk, copies .so to jniLibs
- Update CI test-app job with Rust + NDK setup
- 23/23 checks pass on device
This commit is contained in:
okhsunrog 2026-04-11 22:19:59 +03:00
parent 5eaebd0a12
commit e413debe45
9 changed files with 880 additions and 550 deletions

View file

@ -192,8 +192,24 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install Rust + cargo-ndk
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
. "$HOME/.cargo/env"
rustup target add aarch64-linux-android
cargo install cargo-ndk --locked
- name: Set up Android NDK
uses: nttld/setup-ndk@v1
id: ndk
with:
ndk-version: r28b
- name: Build APK
run: cd test-app && ./gradlew --no-daemon assembleDebug
run: |
. "$HOME/.cargo/env"
export ANDROID_NDK_HOME=${{ steps.ndk.outputs.ndk-path }}
cd test-app && ./gradlew --no-daemon assembleDebug
- name: Upload artifact
uses: actions/upload-artifact@v4