ProtonVPN for Android

Overview

ProtonVPN for Android

Copyright (c) 2019 Proton Technologies AG

Build instructions

  • Install sdk, ndk, cmake, swig
  • Clone this repository
  • ./gradlew assembleProdDebug or open and build in Android Studio

Build release

To complete a release build signing keys need to be provided: ./gradlew assembleProdRelease -PkeyStoreFilePath= -PkeyStoreKeyAlias= -PkeyStorePassword= -PkeyStoreKeyPassword=`

Rebuild strongswan

This project is using native libraries from open-source project Strongswan. To simplify the build process we include prebuilt copies of those libraries here. To rebuild them follow these steps:

  • git submodule init followed by git submodule update in the main directory (we include original Strongswan repository as a git submodule)
  • cd strongswan and follow build instructions from Strongswan to rebuild native libraries
  • after a successful build, run cp -r strongswan/src/frontends/android/app/src/main/libs/* app/src/main/jniLibs in our main directory to copy the prebuilt libraries and rebuild the ProtonVPN client

Code style

Project uses agreed code style ProtonStyle.xml for java. Import it in Android studio via File>>Settings>>Editor>>Code style>>Import Scheme For kotlin's code style we use ktlint with default rules

Contributing

If you would like to contribute, please keep in mind the following rules:

  • Try to stick to the project's existing code style and naming conventions
  • The code base is mostly written in Java, but we are transitioning to Kotlin, so new code should be written in Kotlin where possible
  • Our preferred tech stack is Kotlin, MVVM, data-binding and coroutines, so any new features or large refactors should conform to this preferred tech stack
  • After adding/updating open source dependencies run gradlew updateLicensesJson to update attributions.

Internally our CI automatically checks all pull requests for code style issues, and runs our tests. However you can run those locally as well.

gradlew checkstyle
gradlew detekt
gradlew test
gradlew androidTest

By making a contribution to this project you agree to the following:

  1. I assign any and all copyright related to the contribution to Proton Technologies AG;
  2. I certify that the contribution was created in whole by me;
  3. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it) is maintained indefinitely and may be redistributed with this project or the open source license(s) involved.

Manage Image for the CI

Create an image NAME_IMAGE:branch-

$ make image [branch=name]

For the dev ~ Build the image on your computer: output ci-android:latest

$ make local

Run the image built via make local on your compute so you can inspect its content

$ make debug-local

Deploy the image of the CI from your computer

$ make deploy-local: login-deploy imag

Versioning

  • Version matches format: [major][minor][patch]

License

The code and datafiles in this distribution are licensed under the terms of the GPLv3 as published by the Free Software Foundation. See https://www.gnu.org/licenses/ for a copy of this license.

Copyright (c) 2019 Proton Technologies AG

Comments
  • F-Droid can't build

    F-Droid can't build

    ERROR: Found Android AAR library at app/libs/tunnel-release.aar ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/3108039077#L92

    But, if I remove the file it fails later

    ...
    > Task :app:optimizeProdReleaseResources
    
    > Task :app:kaptProdReleaseKotlin
    Note: [1] Wrote GeneratedAppGlideModule with: []
    /home/vagrant/build/ch.protonvpn.android/app/build/tmp/kapt3/stubs/prodRelease/com/protonvpn/android/vpn/wireguard/WireguardWrapperService.java:7: error: [Hilt]
    public final class WireguardWrapperService {
                 ^
      @AndroidEntryPoint base class must extend ComponentActivity, (support) Fragment, View, Service, or BroadcastReceiver.
      [Hilt] Processing did not complete. See error above for details.
    
    > Task :app:kaptProdReleaseKotlin FAILED
    
    > Task :openvpn:buildCMakeRelWithDebInfo
    C/C++: ninja: Entering directory `/home/vagrant/build/ch.protonvpn.android/openvpn/.cxx/RelWithDebInfo/5w6n5m4f/x86'
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/crypto/threads_pthread.c:220:16: warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (8 bytes) exceeds the actual alignment (4 bytes) [-Watomic-alignment]
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/crypto/threads_pthread.c:245:9: warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (8 bytes) exceeds the actual alignment (4 bytes) [-Watomic-alignment]
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openvpn/src/openvpn/init.c:2434:64: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openvpn/src/openvpn/error.h:152:67: note: expanded from macro 'msg'
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/ovpnutil/rsapss.cpp:110:7: warning: 'PKCS1_MGF1' is deprecated [-Wdeprecated-declarations]
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/rsa.h:389:1: note: 'PKCS1_MGF1' has been explicitly marked deprecated here
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
    C/C++: ninja: Entering directory `/home/vagrant/build/ch.protonvpn.android/openvpn/.cxx/RelWithDebInfo/5w6n5m4f/x86_64'
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/ovpnutil/rsapss.cpp:110:7: warning: 'PKCS1_MGF1' is deprecated [-Wdeprecated-declarations]
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/rsa.h:389:1: note: 'PKCS1_MGF1' has been explicitly marked deprecated here
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
    C/C++: /home/vagrant/build/ch.protonvpn.android/openvpn/src/main/cpp/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:kaptProdReleaseKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
       > java.lang.reflect.InvocationTargetException (no error message)
    

    ...as expected since the recipe does not build Wireguard too?

    opened by licaon-kter 16
  • DSN Errors

    DSN Errors

    Hi all,

    Tried to make a production build, but got stuck with DSN Exception.

    Question: What to do on that case? This is not well documented. I'm only intended to build a Debug release?

    Thanks!

    opened by waltercool 11
  • F-Droid can't build

    F-Droid can't build

    Updating recipe, to remove the swan part...

      - versionName: 4.4.73.0
        versionCode: 104047300
        commit: 0dfed59817a87e1d63cb72230cec6d18f3c944b5
        timeout: 7200
        subdir: app
        sudo:
          - apt-get update
          - apt-get install -y --no-install-recommends make libgmp-dev autoconf automake
            libtool pkg-config autogen gettext libssl-dev libsqlite3-dev libpam0g-dev
            libldap2-dev gperf bison bzip2 flex swig cmake
        gradle:
          - prod
        rm:
          - app/src/main/jniLibs/x86/*
          - app/src/main/jniLibs/x86_64/*
          - app/src/main/jniLibs/armeabi-v7a/*
          - app/src/main/jniLibs/arm64-v8a/*
          - openvpn/src/main/cpp/mbedtls/tests
          - openvpn/src/main/cpp/openvpn3/test/unittests
          - openvpn/src/main/cpp/mbedtls/programs/fuzz/corpuses/*
        prebuild:
          - sed -i -e '/triple/d' -e '/play\ {/,+4d' build.gradle
          - sed -i -e '/gradle-build-cache/d' ../settings.gradle.kts
        scandelete:
          - openvpn/src/main/cpp/lz4/tmp
        build:
          - pushd ../openvpn
          - gradle assembleRelease
          - rm -fr build/intermediates build/kotlin build/tmp .cxx
          - popd
        ndk: r23b
        gradleprops:
          - buildUniversalApk
    

    but... now I'm missing some libs in the APK: libipsec.so and libtncif.so

    Thoughts?

    opened by licaon-kter 8
  • Add touch states

    Add touch states

    Adds a touch state to the ProtonSwitch and to the Secure Core switches in the main screen and the profiles activity.

    I would like to see touch states on the "Next" and "Skip" buttons of the onboarding and the "Got it" button of the Onboarding Dialogs as well, but those won't be one-line changes so I'll leave them for later.

    You might notice that I'm a great advocate of touch states :)

    opened by thgoebel 7
  • Latest version of the app F-Droid

    Latest version of the app F-Droid

    We are happy to answer your questions about the code or discuss technical ideas.

    Please complete the following checklist (by adding [x]):

    • [x] I have searched open and closed issues for duplicates
    • [x] This isn't a feature request
    • [x] This is not a report about my app not working as expected

    Latest version of the app is not yet available in F-Droid Store. The version_fdroid.txt file was not updated to the latest version.

    opened by johndoe432 6
  • f-droid repo is out of date

    f-droid repo is out of date

    We are happy to answer your questions about the code or discuss technical ideas.

    Please complete the following checklist (by adding [x]):

    • [x] I have searched open and closed issues for duplicates
    • [x] This isn't a feature request
    • [x] This is not a report about my app not working as expected

    I'm not sure if this is the correct place to ask about this, but... It's been 26 days since the release of 2.8.75.0 and f-droid still only has version 2.7.70.0 available. https://f-droid.org/en/packages/ch.protonvpn.android/

    Is this something that can be remedied by someone here or should I ask elsewhere?

    opened by michaeljensen 6
  • Signature mismatch between the Google Play, Github and F-Droid APK

    Signature mismatch between the Google Play, Github and F-Droid APK

    It seems the app signature is different between the different distribution channels for Proton VPN. This prevents users from updating their app without loosing their data if they change distribution channels.

    The build number is also inconsistent, see: https://github.com/ProtonVPN/android-app/issues/86

    opened by carlosjeurissen 4
  • Don't show upgrade button for server under maintenance

    Don't show upgrade button for server under maintenance

    For a server under maintenance, the current v2.0.21 shows an upgrade button upon tap, even though I'm a Plus user.

    This PR fixes this. As a side effect, Free users won't see the upgrade button anymore either if they tap on a country under maintenance. I would argue however that this constitutes a sensible separation:

    • offline countries => cannot connect anyway, show nothing upon tap.
    • online countries => show Connect or Upgrade, depending on your subscription.
    opened by thgoebel 4
  • Protocols

    Protocols

    We are happy to answer your questions about the code or discuss technical ideas.

    Please complete the following checklist (by adding [x]):

    • [ ] I have searched open and closed issues for duplicates
    • [ ] This isn't a feature request
    • [ ] This is not a report about my app not working as expected

    Why none of the protocols work in Iran

    opened by asadayaz 3
  • Open app on long pressing quick setting tile

    Open app on long pressing quick setting tile

    Adding the action QS_TILE_PREFERENCES to an activity makes android open that particular activity instead of the app info screen in settings app when the quick setting tile is long pressed.

    Adding this action to the SplashScreen makes it a bit easier to switch between servers.

    Maybe this could have been added to SettingsDefaultProfileActivity but it made more sense to link it with SplashScreen rather than default profile activity as opening the app for changing server would happen more than changing the default quick connect setting.

    opened by supershadoe 3
  • [feature request] proper android tv support

    [feature request] proper android tv support

    As it is right now, the android app is unfortunately barely usable on android tv without a mouse and keyboard. It rarely supports landscape mode (yet constantly switches to landscape mode for a split of a second to switch back to portrait mode again), and most options aren't accessible with just a remote. Using a mouse and keyboard helps a bit, but not much. Allowing a functional landscape mode and making all buttons selectable with a remote directional pad would improve it a lot, for my usecase.

    opened by MGThePro 3
  • Feature request

    Feature request

    Hello! Sometimes you want to use VPN only with certain applications or set up a seamless collaboration with traffic filtering applications such as AdGuard, for example.

    Please implement the possibility of using your application in the local Proxy mode (when you enable the corresponding function, the application creates a local proxy server, which will be specified in the applications that need to be compatible)

    opened by ghost 0
  • Incomplete login code

    Incomplete login code

    Hello,

    I face an issue that the code is incomplete at API Level 23.

    image

    Actually your login code is 8 digits right? I can only obtain a complete login code by rotating my device. Could you fix this bug cause it is very inconvenient.

    opened by rudmannn 0
  • Install fails on Kindle Fire 2018

    Install fails on Kindle Fire 2018

    We are happy to answer your questions about the code or discuss technical ideas.

    Please complete the following checklist (by adding [x]):

    • [X ] I have searched open and closed issues for duplicates
    • [ x] This isn't a feature request
    • [x ] This is not a report about my app not working as expected Downloaded APK file but it failed the install on my Kindle Fire. No access to goofle play store. F-Droid does not respond. Any suggestions?

    opened by labbatt50 0
  • Menggunakan akun apa untuk login

    Menggunakan akun apa untuk login

    We are happy to answer your questions about the code or discuss technical ideas.

    Please complete the following checklist (by adding [x]):

    • [ ] I have searched open and closed issues for duplicates
    • [ ] This isn't a feature request
    • [ ] This is not a report about my app not working as expected

    opened by xco170586 0
  • Sign-in issues in small height situation.

    Sign-in issues in small height situation.

    When the height of the app is not high enough due to landscape or splitscreen, the sign-in view is not scroll able. Preventing users from signing in to the app.

    small-signin-protonvpn

    opened by carlosjeurissen 1
Releases(4.4.73.0)
Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo.

CutoutScreenSupport Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo. Usage whether the mobile phone is cutout

hacket 5 Nov 3, 2022
FoldingNavigationDrawer-Android This is a sample project present how to use Folding-Android to add Folding Efect to Navigation Drawer.

FoldingNavigationDrawer-Android Sample (Play Store Demo) This is a sample project present how to use Folding-Android to add Folding Efect to Navigatio

null 242 Nov 25, 2022
Twidere-Android Twidere is a powerful twitter client for Android 1.6+ 1 , which gives you a full Holo experience and nearly full Twitter's feature.

Twidere for Android Material Design ready and feature rich Twitter/Mastodon/Fanfou app for Android 4.1+. Enjoy Fediverse now! Twidere-Android is maint

Twidere Project 2.7k Jan 2, 2023
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
Extensible Android mobile voice framework: wakeword, ASR, NLU, and TTS. Easily add voice to any Android app!

Spokestack is an all-in-one solution for mobile voice interfaces on Android. It provides every piece of the speech processing puzzle, including voice

Spokestack 57 Nov 20, 2022
Aggregated Android news, articles, podcasts and conferences about Android Development

DroidFeed Curated news feed for Android Developers! Stay up to date with the latest Android Development news. Built for the Android developer communit

Dogan Gulcan 183 Dec 2, 2022
Shreyas Patil 2.1k Dec 30, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
The Android startup used to schedule tasks, jobs while launching Android App.

Android Startup, schedule your startup jobs Introduction AndroidStartup is an open source project used to refine your Andriod App startup. Compared wi

ShouHeng 46 Aug 24, 2022
Android playground project with modularization by feature (android libraries), unit tests, MVVM & MVI.

Movies Movies is a simple project to study and play with some android components, architecture and tools for Android development. Tech Stack This proj

Christopher Elias 333 Dec 30, 2022
🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 242 Dec 28, 2022
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

MindOrks 1.2k Dec 29, 2022
A simple Android app to demonstrate the use of Hover SDK for M-PESA Send Money while offline. This SDK does not require an internet connection, it automates USSD sessions in the background of an android application.

HoverSDKDemo Hover SDK is an Android SDK that lets mobile developers to add money features to the applications. This SDK does not require an internet

Joel Kanyi 9 Dec 21, 2022
Source code of JekyllEx Android App which can manage your Jekyll blog directly from your Android device!

JekyllEx Android App Built with ❤︎ by Gourav Khunger ?? Introduction JekyllEx is an Android App that allows you to manage a Jekyll Blog directly from

JekyllEx 24 Nov 8, 2022
A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools

Quotee Android ?? A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools. Developed with ❤️ by Aminullah

null 12 Aug 24, 2022
🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose.

ComposeMovie Android ?? A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose. Built with

null 13 Oct 1, 2022
Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime

TodoApp Android: An Android Sample App This Android Studio project wraps the Desktop Sample App to run on an Android phone. How to build & run Install

elixir-desktop 78 Dec 10, 2022
GmailCompose is an Android application 📱 for showcasing Jetpack Compose for building declarative UI in Android.

GmailCompose GmailCompose Demo GmailCompose is an Android application ?? for showcasing Jetpack Compose for building declarative UI in Android. About

Baljeet Singh 35 Nov 29, 2022
Parsing and re-packing Android boot.img/vbmeta.img, supporting Android 12(preview)

Android_boot_image_editor A tool for reverse engineering Android ROM images. Getting Started install required packages Mac: brew install lz4 xz dtc Li

null 615 Dec 30, 2022