
In the pervious article Developing a Post-Quantum Key Exchange Extension for WireGuard VPN Using MMS-Based Key Distribution, I have introduced the general design of the tow app WireGuard-β QS-VPN App and the MMS-Based-QKD App of the PQC key exchange project. In this article, I will walk the detail steps to setup the two apps on your android phone and connect to VPN Server. As a user manual for an end user working with a VPN administrator, this article includes 5 main sections:
-
Install or open the modified WireGuard-β QS-VPN Android app.
-
Create a client interface and provide its public key to the VPN administrator.
-
Configure the server peer and the Android peer parameters.
-
Run the separate QS-Key Exchange app to derive and provision a post-quantum preshared key (PSK).
-
Activate the tunnel and verify traffic in the Android app and on the server.
# Author: Yuancheng Liu
# Created: 2026/11/29
# Version: v_0.0.2
# Copyright: Copyright (c) 2026 Liu Yuancheng
# License: GNU General Public License V3
1. Introduction
The WireGuard-β QS-VPN Client App is a modified version of the open-source WireGuard VPN Android Client App. WireGuard is an extremely fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec while avoiding complex configuration overhead. This user manual contains two main sections:
-
Project Development Setup: Shows developers how to set up the development environment on a host computer and build the app installation file (
.apk) from the source code. (End users can skip this section.) -
Configure and Use the WireGuard-β VPN Client App: Explains how to install, configure, and use the app on an Android mobile device, verify that it operates properly, and route traffic from other apps through the VPN tunnel.
1.1 Understand the QS-VPN workflow
The project separates key exchange from VPN transport. The QS-Key Exchange Android app performs the PQC-KEM operations and communicates with the PQC Key Exchange Gateway through MMS. The WireGuard-β QS-VPN app remains responsible for creating the encrypted IP tunnel. The two applications exchange the derived key through a protected local hand-off as shown below:

In the QS-VPN Android project, WireGuard is used to establish the basic peer-to-peer VPN communication tunnel. We have added two main features to the standard WireGuard client:
-
A communication handshake session information logging module.
-
A QS-Share-Secret integration interface, which links to the QS-Key Exchange Android App and inserts the quantum-safe message encryption key into WireGuard VPN's data encryption keychain.
The main UI of the WireGuard-β QS-VPN Client App is shown below:

1.2 Required items
This guide assumes that the server environment and the two Android applications have already been prepared. The 2021 client manual documents WireGuard-β QS-VPN v0.2.2 and Android 8–11-era testing; the supplied material does not establish compatibility with current Android releases.
-
An Android phone with the WireGuard-β QS-VPN APK installed from a trusted project source. The standard WireGuard app is not a drop-in replacement for this modified build.
-
The separate QS-Key Exchange Android app, configured with the required authorization and device registration information.
-
A working mobile subscription that can send and receive MMS, plus the required app permissions.
-
A running WireGuard VPN gateway reachable from the phone over UDP, and a corresponding PQC Key Exchange Gateway.
-
The VPN administrator’s details: server public key, public endpoint hostname/IP and UDP port, assigned client tunnel address, DNS server, and routing policy (full tunnel or split tunnel).
2. Project Development Setup
This section provides detailed setup steps if you wish to modify the WireGuard-β QS-VPN Client App source code and rebuild the project into an APK installation file. Like the official WireGuard Android app, the source code can only be built on a Linux system.
In this guide, Ubuntu 20.04 is used as the host operating system. The complete compilation and build process (including the IDE, libraries, and toolchains) requires approximately 8.6 GB of disk space; however, having more than 20 GB of free space is recommended.
Supported Mobile Device Specifications:
-
CPU ABI:
arm64-v8a,armeabi-v7a,x86_64 -
Android OS Version: Android 8.0 – 11.0
2.1 Development Environment Setup
2.1.1 Android Studio SDK Configuration
-
Follow this guide to install the JDK, JVM, and Android Studio on your Ubuntu 20.04 host computer: https://linuxhint.com/install_android_studio_ubuntu
-
Once installed, open Android Studio and navigate to File > Settings > Appearance & Behavior > System Settings > Android SDK.
-
Configure the SDK with the versions shown in Figure 2 (requires approximately 6.8 GB of disk space) and set up the cross-compile toolchain NDK 21.0.6113669 by following the official Android NDK guide: https://developer.android.com/studio/projects/install-ndk

2.1.2 Install the Official WireGuard VPN Toolchain
Follow the official documentation (https://git.zx2c4.com/wireguard-tools/about/) to download and install WireGuard’s cross-platform Linux user-space tools to configure the WireGuard OS development environment. Ensure that both wg(8) and wg-quick(8) are installed.
In this project, we use wireguard-tools version 1.0.20200827 (released in August 2020), as shown in Figure 3.

2.1.3 Rebuild the WireGuard QS-VPN Client App Project
-
Download the WireGuard-β QS-VPN Client App project from the link below and extract it to a folder (requires approximately 560 MB of disk space): https://drive.google.com/file/d/1L4y-DTcFeKEvPjvRtTLejXGaaKCPQt3H/view?usp=sharing
-
Open the project in Android Studio and select File > Sync Project with Gradle Files (Figure 4).

-
Once synchronization finishes, select Build > Rebuild Project and verify that there are no build errors.
-
Select Build > Build Bundle(s) / APK(s) > Build APK(s) to generate the installation
.apkfile. -
Locate the generated
ui-debug.apkfile insideui/build/outputs/apk/debug/and copy it to your Android device (Figure 5).

2.1.4 Install the WireGuard-β QS-VPN Client App on a Mobile Device
-
For End Users: Copy the
ui-debug.apkfile generated in Section 2.1.3 to any folder on your phone, tap the file, and press Install. -
For Developers: You can alternatively enable Developer Options on your phone (e.g., Samsung Galaxy Developer Options Guide), connect the phone to your host computer via USB, and click the Run button in Android Studio to install and launch the app directly.
Once installed, the app will appear on your device as WireGuard β (Figure below).

3. Configure and Use the WireGuard-β VPN Client App
After installing the WireGuard-β QS-VPN Client App on your mobile device, you must configure the key file and app permissions before the application can run properly. This section covers:
-
Configuring the WireGuard QS-VPN Client App and initializing the QS-VPN interface.
-
Verifying that the VPN functions properly on your mobile device.
3.1 WireGuard QS-VPN Client App Configuration
3.1.1 Configuration File Setup
(Optional for standard users) After installing the APK, you can save the server's public key string into a text file named QS_Encryption_key.txt to load the QS-VPN Server’s public key into the app automatically (alternatively, you can type the key manually as shown in Section 3.1.6 as the file will be regularly overwrite by the MMS Based key distribution app).
Copy QS_Encryption_key.txt into your Android phone’s Download folder (Figure 7).

3.1.2 App Permission Configuration
On your Android phone, navigate to Settings > Apps > WireGuard-β > Permissions and enable internal storage access (Figure 8):
-
Android 8.0 and below: Enable Storage access permission.
-
Android 10: Enable Storage read and write permissions.
-
Android 11: Enable All files access / Storage management permission.

Note: The screenshots above are from a Samsung Galaxy device. The permission settings layout may vary slightly on other Android devices.
3.1.3 Create the QS-VPN Interface for the Server
You must create a QS-VPN interface to allow the app to connect to the QS-VPN server:
-
Launch the WireGuard-β app. On the landing page, tap the blue
+button in the bottom-right corner and select Create from scratch (Figure 9).

-
When the configuration screen appears, enter an interface Name (e.g.,
wgtest) and tap the Refresh (generate) button next to the Private key field once. The app will automatically generate a private key (masked) and a corresponding Public key (Figure 10). -
Record your generated Public key string (e.g.,
KdTJ7V/6e3wrZy/ab6Fkgr2WKnbDBiL/65VaKc2F8AE=) to share with the server administrator.

3.1.4 Create the Client VPN Interface on the Server Side
(This step is strictly for the QS-VPN server administrator. End users should skip this step and simply send their recorded public key from Section 3.1.3 to the server administrator.)
On the QS-VPN Ubuntu server, stop the running WireGuard service:
sudo systemctl stop wg-quick@wg0
Open the WireGuard configuration file:
sudo vim /etc/wireguard/wg0.conf
Append the client [Peer] configuration block to wg0.conf (Figure 11):
[Peer]
## Desktop/client VPN public key ##
PublicKey = KdTJ7V/6e3wrZy/ab6Fkgr2WKnbDBiL/65VaKc2F8AE=
## Client VPN IP address (note the /32 subnet) ##
AllowedIPs = 192.168.6.2/32
-
PublicKey: The client public key recorded from the Android app in Section 3.1.3. -
AllowedIPs: The internal VPN IP address assigned to this client upon connection.

Save the file and restart the WireGuard QS-VPN server:
sudo systemctl start wg-quick@wg0
3.1.5 Configure VPN Server Peer Information on the Android Client
(Server administrators can check/generate the server's public key using the commands below; end users can skip the terminal commands and obtain the key directly from the administrator.)
On the server, view or generate the public key:
umask 077; wg genkey | tee privatekey | wg pubkey > publickey
cat publickey

-
Create a blank text file named
QS_Encryption_key.txt, paste the server's public key string into it, and place the file in your phone’s Download folder (as described in Section 3.1.1). -
In the Android WireGuard-β app's Interface section, set the Addresses field to match the client IP assigned in the server's
AllowedIPs(e.g.,192.168.6.2/24) and enter a DNS server (e.g.,8.8.8.8), as shown in Figure 13.

3.1.6 Load the Server Public Key from a File
-
Tap Add Peer at the bottom of the interface setup screen to open the Peer configuration section.
-
Tap the Refresh icon inside the Peer's Public key field. A toast notification reading "Finished load the key from file to clipboard." will appear, indicating that the key string has been copied from
QS_Encryption_key.txtto your phone's clipboard (Figure 14).

Press and hold the Peer Public key text field for 2 seconds, then tap PASTE to insert the server's public key string (Figure 15). (Alternatively, you may type the key manually.)

3.1.7 Configure the VPN Server IP and Port
Complete the remaining fields in the Peer section (Figure 16):
-
Pre-shared key: Leave blank (unless configured on the server).
-
Persistent keepalive: Defines the interval (in seconds) at which keepalive packets are sent through the VPN tunnel when idle. You can set any preferred interval; we recommend 60 to 600 seconds (1–10 minutes) to avoid excessively frequent packets (such as every 1 second), which can degrade data throughput.
-
Endpoint: Enter the QS-VPN server’s public IP address and listening port in the format
IP:Port(e.g.,192.168.50.185:41194). -
Allowed IPs: Set to
0.0.0.0/0to route all IPv4 traffic through the VPN tunnel (or0.0.0.0/24if restricting to that specific subnet).

3.1.8 Save All Configuration Changes
Once all settings are complete, tap the Save (floppy disk) icon in the top-right corner (Figure 17).

The VPN tunnel summary screen will now appear (Figure 18). Next, follow the QS-Key Exchange Client App User Manual to run the QS-Key Exchange app and retrieve the QS-Share-Secret from the server.

4. Connect to the QS-VPN Server
This section explains how to connect to the QS-VPN server and configure specific Android apps to route their traffic through the WireGuard-β VPN tunnel.
4.1 Start the WireGuard-β QS-VPN Connection
4.1.1 Start the WireGuard-β QS-VPN Tunnel Interface
-
Ensure you have first run the QS-Key Exchange Client App as instructed in its user manual.
-
Open WireGuard-β and toggle the switch next to your tunnel interface (e.g.,
wgtest) to the On position (Figure 19).

(Optional) Swipe down to open the Android notification shade / Control Center to confirm that the system displays "VPN is activated by WireGuard" (Figure 20).

4.1.2 Check VPN Connection Status
Tap on your active tunnel in the WireGuard-β app to view its connection details. When non-zero data transfer counters (rx and tx) appear under the Transfer section (Figure 21), the client has successfully connected to the server and is transmitting data.

(For Server Administrators) You can also verify the active client connection on the Ubuntu server by running:

4.2 Include Other Apps in the QS-VPN Tunnel
If you want to protect the network traffic of specific Android apps using the QS-VPN tunnel:
-
Open the tunnel configuration editor (tap the Pencil icon on the tunnel status page) and tap ALL APPLICATIONS under the Interface section (Figure 23).

In the application selection screen, switch to the INCLUDE ONLY tab and check the boxes next to the apps whose traffic you want to route through the VPN tunnel (Figure 24).

Thanks for spending time to check the article detail, if you have any question and suggestion or find any program bug, please feel free to message me. Many thanks if you can give some comments and share any of the improvement advice so we can make our work better ~
No comment for this article.