A streamlined Android VPN client based on V2rayNG, customized for VLESS + Reality protocol integration with our VPN service system.
- Minimum SDK: Android 5.0 (API Level 21)
- Target SDK: Android 14 (API Level 34)
- Architecture: arm64-v8a, armeabi-v7a, x86_64, x86
- Permissions: Network access, VPN service permissions
- Android Studio (latest version recommended)
- Android SDK with API Level 21-34
- Java Development Kit (JDK) 17 or higher
- Gradle 8.0+
- Android NDK (for native library compilation)
Ensure you have the following SDK components installed:
# Install required SDK platforms and tools
sdkmanager "platforms;android-21"
sdkmanager "platforms;android-34"
sdkmanager "build-tools;34.0.0"
sdkmanager "ndk;25.1.8937393"# Navigate to the project directory
cd android/
# Ensure gradlew has execute permissions (Linux/macOS)
chmod +x gradlew# Windows
gradlew.bat assembleDebug
# Linux/macOS
./gradlew assembleDebugThe debug APK will be generated at:
V2rayNG/app/build/outputs/apk/debug/app-debug.apk
# Windows
gradlew.bat assembleRelease
# Linux/macOS
./gradlew assembleReleaseNote: Release builds require signing configuration in app/build.gradle.kts
# Windows
gradlew.bat clean
# Linux/macOS
./gradlew clean# Run unit tests
./gradlew test
# Run tests with coverage report
./gradlew jacocoTestReport# Run instrumentation tests on connected device/emulator
./gradlew connectedAndroidTest-
Install Debug APK:
adb install V2rayNG/app/build/outputs/apk/debug/app-debug.apk
-
Test Configuration Import:
- Launch the app
- Use the configuration import feature
- Verify VLESS configuration parsing
- Test VPN connection establishment
-
Test Backend Integration:
- Verify API communication with backend
- Test configuration updates
- Validate user authentication flow
# Profile app performance
./gradlew app:profileInstall
# Memory leak detection
./gradlew app:lintDebug- MainActivity.kt: Main application entry point and UI controller
- AngConfigManager: Configuration management and import logic
- V2rayNG Core: Core VPN functionality and protocol handling
- Backend Integration: API communication layer for configuration retrieval
// Import configuration from backend
val vlessLink = "vless://..."
val (count, _) = AngConfigManager.importBatchConfig(vlessLink, subscriptionId, true)
// Refresh server list after successful import
if (count > 0) {
mainViewModel.reloadServerList()
}| Variant | Description | Use Case |
|---|---|---|
debug |
Debug build with logging | Development and testing |
release |
Optimized production build | Distribution |
- arm64-v8a: 64-bit ARM devices (recommended)
- armeabi-v7a: 32-bit ARM devices
- x86_64: 64-bit x86 devices (emulators)
- x86: 32-bit x86 devices (legacy emulators)
-
SDK Path Issues:
# Set ANDROID_HOME environment variable export ANDROID_HOME="/path/to/android/sdk" export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
-
NDK Build Failures:
- Ensure NDK is properly installed via SDK Manager
- Check NDK version compatibility in
build.gradle.kts
-
Gradle Sync Issues:
# Clean and rebuild ./gradlew clean ./gradlew build --refresh-dependencies -
Permission Errors:
# Grant execute permission (Linux/macOS) chmod +x gradlew
- VPN Service Permission: Ensure VPN permissions are granted in device settings
- Network Configuration: Verify device has internet connectivity
- Backend Connectivity: Check backend API accessibility
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request with detailed description
Based on V2rayNG project. Please refer to the original project license terms.
For technical support and bug reports, please open an issue in this repository.