Shows how to build a VPN app for Android using leaf: https://github.com/eycorsican/leaf .

Related tags

App aleaf
Overview

aleaf

Shows how to build a VPN app for Android using leaf.

Dependencies

  • Rust
  • GCC/clang
  • Make
  • SDK
  • NDK
  • LLVM (Windows host only, see below)

Building

Linux

export ANDROID_HOME=/path/to/sdk
export NDK_HOME=/path/to/sdk/ndk-bundle

rustup target add aarch64-linux-android x86_64-linux-android

git clone https://github.com/eycorsican/aleaf
cd aleaf

./app/src/main/rust/leaf-android/build.sh debug

Refer here and here for more details.

Windows

Building on Windows is a little tricky. This is because leaf relies on bindgen to generate bindings, which requires libclang.so or libclang.dll to exist. The Linux build of NDK has libclang.so.11git (and many other libs) included under toolchains/llvm/prebuilt/linux-x86_64/lib64, but when it comes to the Windows build, they are all missing. You could refer to this issue for detail.

To solve this problem, we could use the Windows build of LLVM. Note that it is for bindgen only, not to confuse it with the LLVM toolchain in NDK.

After installing LLVM, set LLVM_WIN64_HOME environment variable to the path of your LLVM installation.

$Env:LLVM_WIN64_HOME = 'C:\path\to\llvm-win64'
$Env:ANDROID_HOME = 'C:\path\to\android-sdk'
$Env:NDK_HOME = 'C:\path\to\android-ndk'

rustup target add aarch64-linux-android x86_64-linux-android

git clone https://github.com/eycorsican/aleaf
cd aleaf

& .\app\src\main\rust\leaf-android\build.ps1 debug
# For release build, run:
# & .\app\src\main\rust\leaf-android\build.ps1 release

Under the hood, the build.ps1 sets LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS environment variables that are used by bindgen. Setting LIBCLANG_PATH allows bindgen to consume a valid libclang.dll, and BINDGEN_EXTRA_CLANG_ARGS specifies extra args that are specified internally by libclang.so on Android NDK Linux build, but missing on LLVM Windows build. You could run $NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang -c some-file.c -v on Linux to get the args that are specified internally. The LLVM toolchain in NDK is v11.0.5, but v11.1.0 for Windows should work.

You might also like...
New version of my Android app that shows you popular movies using themoviedb.org API.
New version of my Android app that shows you popular movies using themoviedb.org API.

New version of my Android app that shows you popular movies using themoviedb.org API. Using Modern Android Develpment skills like Kotlin, Room, Retrofit, Hilt, coroutines, Flow and Jetpack Compose.

A complete app that demonstrate how to build an Android application using the Uncle Bob's Clean Architecture approach
A complete app that demonstrate how to build an Android application using the Uncle Bob's Clean Architecture approach

📷 Blog taking application utilizing Ktor REST-API and following modern practices: Kotlin, Coroutines, Flows, Channels, Room, Work Manager, Navigation Component, MVI, Clean Architecture, Modularization, Dagger Hilt, Tests...

To learn how to build an e-commerce app for Android using the Firestore database from Google Firebase Technology

It is an adjustable e-commerce application that you can use to create your own online store or use it as a template to create an e-commerce app for your client. In this app we are covering such topics as Firebase basics how to upload and download data to and from an online database Displaying Images from the Cloud Creating User Profiles Uploading and displaying Products Building a Cart System Selecting images from your phone

How to build an Android application using the Uncle Bob's Clean Architecture approach
How to build an Android application using the Uncle Bob's Clean Architecture approach

MVI-Clean-Architecture This is a sample app & basic code that demonstrate how to

Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks
Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

A sample app that shows how to easily encrypt the room database in an Android app
A sample app that shows how to easily encrypt the room database in an Android app

A sample app that shows how to easily encrypt the room database in an Android app. The password used for encryption is generated on the first use and saved in the Android EncryptedSharedPreferences.

The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.
The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

Il Bil App Introduction I will introduce you to how to implement Account Kit, Map Kit, Game Service. About the game: The app has got fullscreen Turkey

The AboutMe app - a demo app that shows information about a person
The AboutMe app - a demo app that shows information about a person

AboutMe The AboutMe app is a demo app that shows information about a person. Name Settable Nickname An image Scrollable information This app demonstra

Android app based on clean architecture and using the github API to show open pull requests

This app is based on clean architecture and using the github API to show open pull requests. The code is made considering all design principles and guidelines.

Owner
null
NamelessnessR is a vpn hub that combines a number of vpn protocols to provide a hub to a single vpn powerful to protect your privacy only.

namelessnexR Design concept The Design concept is designed using adobe xd basing of different ideas but mainly Anxray, V2rayNG and NamelessnetX with N

mxbhaee 2 Jan 13, 2022
This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi module clean architecture

GithubTrendingMVIFlow Build Architecture: This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi m

Zulqurnain Haider 0 Jun 2, 2022
Vanilla Music Player for Android (abandoned). Visit https://github.com/vanilla-music/vanilla for an actively developed fork

Translating You can help translate here. If your language isn't on the list, open an issue and I can add it. Building To build you will need: A Java c

Chris Eby 154 Dec 9, 2022
The App shows PR of Github Open Projects

GithubPull This App shows PR of Github Open Projects -> Developed using :- Kotlin Programming Language MVVM Design Pattern Data Binding Pagination for

Akshay Rohilla 0 Nov 2, 2021
Github-Api-Pagination-Example - Pagination 3 Example using Github Api

Github-Api-Pagination Pagination 3 Example using Github Api Tech Stack 100% Kotl

Anggoro Beno Lukito 2 Aug 22, 2022
GitHub application fetches events, repositories and profile using GitHub APIs

GitHub application using GitHub REST API Dagger MVVM architecture Mockk Jetpack Compose Kotlin Coroutines Application pages Attention If you want to u

Marjan DavoodiNejad 6 Oct 17, 2022
GithubUsersGalleryApp - Github users app consumed Github API

GithubUsersApp ✨ Github users app consumed Github API ✨ Architecture Using Moder

Ali Azaz Alam 1 Feb 20, 2022
DNS over HTTPS / DNS over Tor / DNSCrypt client, firewall, and connection tracker for Android.

RethinkDNS + Firewall for Android An OpenSnitch-inspired firewall and network monitor + a pi-hole-inspired DNS over HTTPS client with blocklists. In o

null 1.1k Jan 5, 2023
The implementation of https://dribbble.com/shots/2067564-Replace

FlyRefresh The Android implementation of Replace, designed by Zee Youn. I implement this as a FlyRefresh layout. The content of the layout can be any

吴晶 2.9k Nov 29, 2022
Solving all 25 days of the AOC 2021 event here: https://adventofcode.com

advent-of-code-2021-kotlin Welcome to the Advent of Code1 Kotlin project using the Advent of Code Kotlin Template delivered by JetBrains. In this repo

Mofe Ejegi 1 Dec 17, 2021