Tamim Hossain 9b4cc201e7 Add preSharedKey support and fix parsing function #3512 (#3989)
Add support for preSharedKey in WireGuard configurations and fix the parsing function to correctly handle all necessary fields.

Previously, the application did not support the optional preSharedKey parameter in WireGuard config files, forcing users to rely on JSON custom configurations. This update introduces a dedicated field for preSharedKey in the UI, aligning with Xray Core's support and simplifying the setup process for users.

Changes include:
- Added `preSharedKey` field in the WireGuard UI configuration.
- Updated `parseWireguardConfFile` function to correctly parse `PrivateKey`, `PublicKey`, and `preSharedKey`.
- Ensured `preSharedKey` is optional and handled gracefully when absent.
- Updated `toOutbound` method to include `preSharedKey` in the outbound configuration.
- Set `remarks` to the current Unix time during parsing.

Tested with the following configuration:
```[Interface]
Address = 192.168.6.66/32
DNS = 1.1.1.1,8.8.8.8
PrivateKey = eD/6cpJQaEeDH05AMeFyN3KSLLX+7YFR+MYRdgPDQ3Y=
[Peer]
publickey=/HS7r3waPuU7tTBLd2FlBhC+VROpJ5bwh5XXxuOoKFs=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = sg3.vpnjantit.com:1024
```
Resolves #3512
2024-11-20 09:15:11 +08:00
2024-11-04 09:32:16 +08:00
.
2023-01-12 14:35:38 +08:00
.
2023-01-12 14:35:38 +08:00
2023-11-17 14:15:29 +08:00
.
2023-01-12 14:35:38 +08:00

v2rayNG

A V2Ray client for Android, support Xray core and v2fly core

API Kotlin Version GitHub commit activity CodeFactor GitHub Releases Chat on Telegram

Get it on Google Play

Telegram Channel

github_2dust

Usage

Geoip and Geosite

  • geoip.dat and geosite.dat files are in Android/data/com.v2ray.ang/files/assets (path may differ on some Android device)
  • download feature will get enhanced version in this repo (Note it need a working proxy)
  • latest official domain list and ip list can be imported manually
  • possible to use third party dat file in the same folder, like h2y

More in our wiki

Development guide

Android project under V2rayNG folder can be compiled directly in Android Studio, or using Gradle wrapper. But the v2ray core inside the aar is (probably) outdated.
The aar can be compiled from the Golang project AndroidLibV2rayLite or AndroidLibXrayLite. For a quick start, read guide for Go Mobile and Makefiles for Go Developers

v2rayNG can run on Android Emulators. For WSA, VPN permission need to be granted via appops set [package name] ACTIVATE_VPN allow

S
Description
olcng - fast, simple VPN
Readme GPL-3.0 277 MiB
v4.3.0 Latest
2026-06-29 17:36:43 +02:00
Languages
Kotlin 91.6%
HTML 6.4%
Go 1.4%
Shell 0.6%