├── .idea ├── .name ├── vcs.xml ├── dictionaries │ └── muizzuabbas.xml ├── misc.xml ├── runConfigurations.xml ├── gradle.xml └── codeStyles │ └── Project.xml ├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── xyz │ │ │ └── oboloi │ │ │ └── openvpnexample │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── xyz │ │ │ └── oboloi │ │ │ └── openvpnexample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── xyz │ │ └── oboloi │ │ └── openvpnexample │ │ └── ExampleInstrumentedTest.java ├── libs │ └── armeabi-v7a │ │ └── libopvpnutil.so ├── proguard-rules.pro └── build.gradle ├── openvpn ├── consumer-rules.pro ├── .gitignore ├── src │ ├── main │ │ ├── aidl │ │ │ └── de │ │ │ │ └── blinkt │ │ │ │ └── openvpn │ │ │ │ ├── core │ │ │ │ ├── LogItem.aidl │ │ │ │ ├── ConnectionStatus.aidl │ │ │ │ ├── TrafficHistory.aidl │ │ │ │ ├── IOpenVPNServiceInternal.aidl │ │ │ │ ├── IStatusCallbacks.aidl │ │ │ │ └── IServiceStatus.aidl │ │ │ │ └── api │ │ │ │ ├── APIVpnProfile.aidl │ │ │ │ ├── IOpenVPNStatusCallback.aidl │ │ │ │ └── IOpenVPNAPIService.aidl │ │ ├── assets │ │ │ ├── pie_openvpn.arm64-v8a │ │ │ ├── nopie_openvpn.arm64-v8a │ │ │ ├── pie_openvpn.armeabi-v7a │ │ │ └── nopie_openvpn.armeabi-v7a │ │ ├── jniLibs │ │ │ └── armeabi-v7a │ │ │ │ ├── libopenvpn.so │ │ │ │ ├── libjbcrypto.so │ │ │ │ └── libopvpnutil.so │ │ ├── res │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_help.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_connection_icon.png │ │ │ ├── values │ │ │ │ ├── plurals.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── untranslatable.xml │ │ │ │ └── strings.xml │ │ │ ├── layout │ │ │ │ ├── launchvpn.xml │ │ │ │ ├── userpass.xml │ │ │ │ └── api_confirm.xml │ │ │ └── drawable │ │ │ │ └── progressbar.xml │ │ ├── java │ │ │ ├── xyz │ │ │ │ └── oboloi │ │ │ │ │ └── openvpn │ │ │ │ │ ├── OnVPNStatusChangeListener.java │ │ │ │ │ ├── DataCleanManager.java │ │ │ │ │ ├── ProfileAsync.java │ │ │ │ │ └── OboloiVPN.java │ │ │ ├── org │ │ │ │ └── spongycastle │ │ │ │ │ └── util │ │ │ │ │ ├── io │ │ │ │ │ └── pem │ │ │ │ │ │ ├── PemObjectGenerator.java │ │ │ │ │ │ ├── PemGenerationException.java │ │ │ │ │ │ ├── PemHeader.java │ │ │ │ │ │ ├── PemObject.java │ │ │ │ │ │ ├── PemReader.java │ │ │ │ │ │ └── PemWriter.java │ │ │ │ │ └── encoders │ │ │ │ │ ├── Encoder.java │ │ │ │ │ ├── Base64.java │ │ │ │ │ └── Base64Encoder.java │ │ │ └── de │ │ │ │ └── blinkt │ │ │ │ └── openvpn │ │ │ │ ├── api │ │ │ │ ├── SecurityRemoteException.java │ │ │ │ ├── GrantPermissionsActivity.java │ │ │ │ ├── APIVpnProfile.java │ │ │ │ ├── ExternalAppDatabase.java │ │ │ │ └── ConfirmDialog.java │ │ │ │ └── core │ │ │ │ ├── NativeUtils.java │ │ │ │ ├── Preferences.java │ │ │ │ ├── OpenVPNManagement.java │ │ │ │ ├── ConnectionStatus.java │ │ │ │ ├── PasswordCache.java │ │ │ │ ├── ProxyDetection.java │ │ │ │ ├── Connection.java │ │ │ │ ├── CIDRIP.java │ │ │ │ ├── LollipopDeviceStateListener.java │ │ │ │ ├── App.java │ │ │ │ ├── StatusListener.java │ │ │ │ ├── VPNLaunchHelper.java │ │ │ │ ├── TrafficHistory.java │ │ │ │ ├── LogFileHandler.java │ │ │ │ ├── X509Utils.java │ │ │ │ ├── OpenVPNStatusService.java │ │ │ │ ├── OpenVPNThread.java │ │ │ │ ├── ProfileManager.java │ │ │ │ └── DeviceStateReceiver.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── xyz │ │ │ └── oboloi │ │ │ └── openvpn │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── xyz │ │ └── oboloi │ │ └── openvpn │ │ └── ExampleInstrumentedTest.java ├── libs │ ├── arm64 │ │ └── libopvpnutil.so │ └── armeabi-v7a │ │ ├── libjbcrypto.so │ │ ├── libopenvpn.so │ │ └── libopvpnutil.so ├── proguard-rules.pro └── build.gradle ├── README.md ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── LICENSE ├── gradle.properties ├── gradlew.bat └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | OpenVPNExample -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /openvpn/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /openvpn/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenVPN-Android 2 | OpenVPN library for android 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':openvpn' 2 | rootProject.name='OpenVPNExample' 3 | -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/core/LogItem.aidl: -------------------------------------------------------------------------------- 1 | package de.blinkt.openvpn.core; 2 | 3 | parcelable LogItem; -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | OpenVPNExample 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /openvpn/libs/arm64/libopvpnutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/libs/arm64/libopvpnutil.so -------------------------------------------------------------------------------- /app/libs/armeabi-v7a/libopvpnutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/libs/armeabi-v7a/libopvpnutil.so -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/api/APIVpnProfile.aidl: -------------------------------------------------------------------------------- 1 | package de.blinkt.openvpn.api; 2 | 3 | parcelable APIVpnProfile; 4 | -------------------------------------------------------------------------------- /openvpn/libs/armeabi-v7a/libjbcrypto.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/libs/armeabi-v7a/libjbcrypto.so -------------------------------------------------------------------------------- /openvpn/libs/armeabi-v7a/libopenvpn.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/libs/armeabi-v7a/libopenvpn.so -------------------------------------------------------------------------------- /openvpn/libs/armeabi-v7a/libopvpnutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/libs/armeabi-v7a/libopvpnutil.so -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/core/ConnectionStatus.aidl: -------------------------------------------------------------------------------- 1 | package de.blinkt.openvpn.core; 2 | 3 | parcelable ConnectionStatus; -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/core/TrafficHistory.aidl: -------------------------------------------------------------------------------- 1 | package de.blinkt.openvpn.core; 2 | 3 | 4 | parcelable TrafficHistory; 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /openvpn/src/main/assets/pie_openvpn.arm64-v8a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/assets/pie_openvpn.arm64-v8a -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /openvpn/src/main/assets/nopie_openvpn.arm64-v8a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/assets/nopie_openvpn.arm64-v8a -------------------------------------------------------------------------------- /openvpn/src/main/assets/pie_openvpn.armeabi-v7a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/assets/pie_openvpn.armeabi-v7a -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /openvpn/src/main/assets/nopie_openvpn.armeabi-v7a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/assets/nopie_openvpn.armeabi-v7a -------------------------------------------------------------------------------- /openvpn/src/main/jniLibs/armeabi-v7a/libopenvpn.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/jniLibs/armeabi-v7a/libopenvpn.so -------------------------------------------------------------------------------- /openvpn/src/main/res/drawable-xxhdpi/ic_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/res/drawable-xxhdpi/ic_help.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /openvpn/src/main/jniLibs/armeabi-v7a/libjbcrypto.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/jniLibs/armeabi-v7a/libjbcrypto.so -------------------------------------------------------------------------------- /openvpn/src/main/jniLibs/armeabi-v7a/libopvpnutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/jniLibs/armeabi-v7a/libopvpnutil.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /openvpn/src/main/res/drawable-xhdpi/ic_connection_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muizzu/OpenVPN-Android/HEAD/openvpn/src/main/res/drawable-xhdpi/ic_connection_icon.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/dictionaries/muizzuabbas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | oboloi 5 | ovpn 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 26 23:44:35 MVT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /openvpn/src/main/java/xyz/oboloi/openvpn/OnVPNStatusChangeListener.java: -------------------------------------------------------------------------------- 1 | package xyz.oboloi.openvpn; 2 | 3 | public interface OnVPNStatusChangeListener 4 | { 5 | public void onProfileLoaded(boolean profileLoaded); 6 | public void onVPNStatusChanged(boolean vpnActivated); 7 | 8 | } 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /openvpn/src/main/java/org/spongycastle/util/io/pem/PemObjectGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package org.spongycastle.util.io.pem; 6 | 7 | public interface PemObjectGenerator { 8 | PemObject generate() throws PemGenerationException; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /openvpn/src/main/java/de/blinkt/openvpn/api/SecurityRemoteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2016 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package de.blinkt.openvpn.api; 6 | import android.os.RemoteException; 7 | 8 | public class SecurityRemoteException extends RemoteException { 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | } 14 | -------------------------------------------------------------------------------- /openvpn/src/test/java/xyz/oboloi/openvpn/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package xyz.oboloi.openvpn; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/test/java/xyz/oboloi/openvpnexample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package xyz.oboloi.openvpnexample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl: -------------------------------------------------------------------------------- 1 | package de.blinkt.openvpn.api; 2 | 3 | /** 4 | * Example of a callback interface used by IRemoteService to send 5 | * synchronous notifications back to its clients. Note that this is a 6 | * one-way interface so the server does not block waiting for the client. 7 | */ 8 | interface IOpenVPNStatusCallback { 9 | /** 10 | * Called when the service has a new status for you. 11 | */ 12 | oneway void newStatus(in String uuid, in String state, in String message, in String level); 13 | } 14 | -------------------------------------------------------------------------------- /openvpn/src/main/res/values/plurals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | One month left 5 | %d months left 6 | 7 | 8 | One day left 9 | %d days left 10 | 11 | 12 | One hour left 13 | %d hours left 14 | 15 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /openvpn/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #17C7D1 4 | #17C7D1 5 | #17C7D1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | #17C7D1 15 | #37E7F1 16 | #47F7FF 17 | #BB47F7FF 18 | 19 | -------------------------------------------------------------------------------- /openvpn/src/main/res/layout/launchvpn.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/core/IOpenVPNServiceInternal.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2016 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | 6 | package de.blinkt.openvpn.core; 7 | 8 | /** 9 | * Created by arne on 15.11.16. 10 | */ 11 | 12 | interface IOpenVPNServiceInternal { 13 | 14 | boolean protect(int fd); 15 | 16 | void userPause(boolean b); 17 | 18 | /** 19 | * @param replaceConnection True if the VPN is connected by a new connection. 20 | * @return true if there was a process that has been send a stop signal 21 | */ 22 | boolean stopVPN(boolean replaceConnection); 23 | } 24 | -------------------------------------------------------------------------------- /openvpn/src/main/java/org/spongycastle/util/encoders/Encoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package org.spongycastle.util.encoders; 6 | 7 | import java.io.IOException; 8 | import java.io.OutputStream; 9 | 10 | /** 11 | * Encode and decode byte arrays (typically from binary to 7-bit ASCII 12 | * encodings). 13 | */ 14 | public interface Encoder { 15 | int encode(byte[] data, int off, int length, OutputStream out) throws IOException; 16 | 17 | int decode(byte[] data, int off, int length, OutputStream out) throws IOException; 18 | 19 | int decode(String data, OutputStream out) throws IOException; 20 | } 21 | -------------------------------------------------------------------------------- /openvpn/src/main/res/drawable/progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /openvpn/src/main/java/org/spongycastle/util/io/pem/PemGenerationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package org.spongycastle.util.io.pem; 6 | 7 | import java.io.IOException; 8 | 9 | @SuppressWarnings("serial") 10 | public class PemGenerationException extends IOException { 11 | private Throwable cause; 12 | 13 | public PemGenerationException(String message, Throwable cause) { 14 | super(message); 15 | this.cause = cause; 16 | } 17 | 18 | public PemGenerationException(String message) { 19 | super(message); 20 | } 21 | 22 | public Throwable getCause() { 23 | return cause; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openvpn/src/main/aidl/de/blinkt/openvpn/core/IStatusCallbacks.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2016 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | 6 | package de.blinkt.openvpn.core; 7 | 8 | import de.blinkt.openvpn.core.LogItem; 9 | import de.blinkt.openvpn.core.ConnectionStatus; 10 | 11 | 12 | 13 | interface IStatusCallbacks { 14 | /** 15 | * Called when the service has a new status for you. 16 | */ 17 | oneway void newLogItem(in LogItem item); 18 | 19 | oneway void updateStateString(in String state, in String msg, in int resid, in ConnectionStatus level); 20 | 21 | oneway void updateByteCount(long inBytes, long outBytes); 22 | 23 | oneway void connectedVPN(String uuid); 24 | } 25 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /openvpn/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /openvpn/src/main/java/de/blinkt/openvpn/core/NativeUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2016 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package de.blinkt.openvpn.core; 6 | 7 | import android.os.Build; 8 | 9 | import java.security.InvalidKeyException; 10 | 11 | public class NativeUtils { 12 | static { 13 | System.loadLibrary("opvpnutil"); 14 | if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) 15 | System.loadLibrary("jbcrypto"); 16 | } 17 | public static native byte[] rsasign(byte[] input, int pkey) throws InvalidKeyException; 18 | public static native String[] getIfconfig() throws IllegalArgumentException; 19 | static native void jniclose(int fdint); 20 | public static native String getNativeAPI(); 21 | } 22 | -------------------------------------------------------------------------------- /openvpn/src/main/java/de/blinkt/openvpn/core/Preferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2016 Arne Schwabe 3 | * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt 4 | */ 5 | package de.blinkt.openvpn.core; 6 | import android.content.Context; 7 | import android.content.SharedPreferences; 8 | 9 | /** 10 | * Created by arne on 08.01.17. 11 | */ 12 | // Until I find a good solution 13 | public class Preferences { 14 | static SharedPreferences getSharedPreferencesMulti(String name, Context c) { 15 | return c.getSharedPreferences(name, Context.MODE_MULTI_PROCESS | Context.MODE_PRIVATE); 16 | } 17 | public static SharedPreferences getDefaultSharedPreferences(Context c) { 18 | return c.getSharedPreferences(c.getPackageName() + "_preferences", Context.MODE_MULTI_PROCESS | Context.MODE_PRIVATE); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |