Search code examples
javaandroidconnectionopenvpnandroid-10.0

Creating VPN by using OpenVPN


I am facing issue to connect VPN on Android 10 and getting below message in logcat. This is Error of permissions. Looking for solution. Also added android:requestLegacyExternalStorage="true" in Mainfest but not work for me.

D/ConnectionStatus: IO Exceptionjava.io.IOException: Cannot run program "/data/user/0/com.casvpnapp/cache/pie_openvpn.x86_64": error=13, Permission denied

D/de.blinkt.openvpn.core.OpenVPNService: onStartCommand: Australia
I/VpnState: VPN_GENERATE_CONFIG  LEVEL_START
D/ConnectionStatus: ---/data/user/0/com.casvpnapp/cache/android.conf
D/ConnectionStatus: ---/data/user/0/com.casvpnapp/cache/android.conf
D/de.blinkt.openvpn.core.OpenVPNService: startOpenVPN: argv:3
D/ConnectionStatus: --[Ljava.lang.String;@ef1521a
I/OpenVPN: Starting openvpn  [Ljava.lang.String;@ef1521a
D/ConnectionStatus: ---29
    startOpenVPNThread---/data/user/0/com.casvpnapp/cache/pie_openvpn.x86_64
D/ConnectionStatus: IO Exceptionjava.io.IOException: Cannot run program "/data/user/0/com.casvpnapp/cache/pie_openvpn.x86_64": error=13, Permission denied
E/OpenVPN: OpenVPNThread Got java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Process.destroy()' on a null object reference
I/VpnState: NOPROCESS No process running. LEVEL_NOTCONNECTED
W/Thread-20: type=1400 audit(0.0:55): avc: granted { execute } for name="pie_openvpn.x86_64" dev="vdc" ino=23035 scontext=u:r:untrusted_app:s0:c139,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c139,c256,c512,c768 tclass=file app=com.casvpnapp
I/OpenVPN: Exiting

Solution

  • It seems it's a problem with your OpenVPN library. Although I have also developed a VPN app based on the OpenVPN library it's working fine for me. You can check my source code.

    https://github.com/ashraf789/Cake-VPN