schwabe / ics-openvpn

OpenVPN for Android
3.31k stars 1.19k forks source link

External Allowed Apps not working #1469

Closed ar664 closed 2 years ago

ar664 commented 2 years ago

General information

  1. Android 12 ( One UI 4 )
  2. Stock OTA
  3. Samsung S10
  4. 0.7.33

Description of the issue

Doesn't remember/store trusted applications. For the "Trust this application" ui, I have to constantly press the checkbox and ok for the Tasker.

The following is what I see after I accept it as an allowed app. It basically shows up as an empty list of allowed apps. :

Screenshot_20220315-135531_OpenVPN for Android Screenshot_20220315-135540_OpenVPN for Android Screenshot_20220315-135609_OpenVPN for Android

Log (if applicable)

N/A

Configuration file

N/A
ar664 commented 2 years ago

Maybe this might be a possible source. Idk what api you are targeting with this app.

https://github.com/schwabe/ics-openvpn/blob/97546b9f8b51c0dc60d591b96ae835f00f2b6805/main/src/main/java/de/blinkt/openvpn/api/RemoteAction.java#L69 https://developer.android.com/reference/android/app/Activity#getCallingPackage()

schwabe commented 2 years ago

Since I am not familar with the Tasker setup how are you calling the app from Tasker?

The app targets API 30 or 32 (something very recent). Jelly_bean_mr2 is 4.3. YOur Android 10 is new enough not be affected by that bug.

ar664 commented 2 years ago

I found out Tasker doesn't use the startActivityForResult() function. I used the System->Intent function in Tasker with the de.blinkt.api you have. It worked, but it wasn't perfect.

Thankfully I found a solution, which was to install a plugin that does it the intended way. It looks to be alittle outdated, so I don't know how long it will work for. https://play.google.com/store/apps/details?id=com.ffrog8.openVpnTaskerPlugin

I would suggest adding this caveat in the documentation. Sorry about the confusion, hopefully this will be helpful for future people.