A lightweight, fully functional reference VPN client for Android, written entirely in Java and XML. This repository demonstrates how to integrate the Surf Shield Android SDK into legacy or Java-first codebases without needing Kotlin or Jetpack Compose.
- Connect and disconnect using the Surf Shield
LeafVPNService. - Simple input flow for dynamically fetching remote
clientIdsubscriptions. - Background asset synchronization (GeoIP/Geosite data).
- Integrity checking and safe
VpnServicepermission handling. - Lightweight, relying on standard Android View binding (
activity_main.xml).
- Clone the repository:
git clone https://github.com/shiroedev2024/sample-android-java.git
- Open in Android Studio and sync the Gradle project.
- Run the App:
./gradlew :app:assembleDebug
This project relies on the ServiceManagement singleton provided by the Surfshield SDK:
// Fetch configuration from the Surfshield Panel
ServiceManagement.getInstance().updateSubscription(clientId, callback);
// Start the VPN
ServiceManagement.getInstance().startLeaf();Open-sourced under the Apache 2.0 License.