Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
jens 2021-05-08 02:03:18 +02:00
commit 22533fcfee
6 changed files with 19 additions and 0 deletions

View File

@ -63,6 +63,7 @@
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/> <uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
<!-- Commented out because of Google Play policy --> <!-- Commented out because of Google Play policy -->

View File

@ -60,6 +60,8 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
<uses-feature <uses-feature
android:name="android.hardware.telephony" android:name="android.hardware.telephony"

View File

@ -61,6 +61,8 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"/>
<uses-permission android:name="com.wireguard.android.permission.CONTROL_TUNNELS"/>
<application <application
android:allowBackup="true" android:allowBackup="true"

View File

@ -58,6 +58,10 @@ public class Actions
private static List<String> suResult = null; private static List<String> suResult = null;
final static String smsSeparator = "&sms&"; final static String smsSeparator = "&sms&";
public static final String wireguard_tunnel_up = "com.wireguard.android.action.SET_TUNNEL_UP";
public static final String wireguard_tunnel_down = "com.wireguard.android.action.SET_TUNNEL_DOWN";
public static final String wireguard_tunnel_refresh = "com.wireguard.android.action.REFRESH_TUNNEL_STATES";
public static Boolean setWifi(Context context, Boolean desiredState, boolean toggleActionIfPossible) public static Boolean setWifi(Context context, Boolean desiredState, boolean toggleActionIfPossible)
{ {
Miscellaneous.logEvent("i", "Wifi", "Changing Wifi to " + String.valueOf(desiredState), 4); Miscellaneous.logEvent("i", "Wifi", "Changing Wifi to " + String.valueOf(desiredState), 4);

View File

@ -55,6 +55,7 @@ public class ActivityPermissions extends Activity
public static final String permissionNameCall = "android.permission.PROCESS_OUTGOING_CALLS"; public static final String permissionNameCall = "android.permission.PROCESS_OUTGOING_CALLS";
public static final String permissionNameStartService = "android.permission.FOREGROUND_SERVICE"; public static final String permissionNameStartService = "android.permission.FOREGROUND_SERVICE";
public static final String permissionNameReadNotifications = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"; public static final String permissionNameReadNotifications = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE";
public static final String permissionNameWireguard = "com.wireguard.android.permission.CONTROL_TUNNELS";
public static ActivityPermissions getInstance() public static ActivityPermissions getInstance()
{ {
@ -534,6 +535,14 @@ public class ActivityPermissions extends Activity
case speakText: case speakText:
break; break;
case startOtherActivity: case startOtherActivity:
if(
action.getParameter2().contains(Actions.wireguard_tunnel_up)
||
action.getParameter2().contains(Actions.wireguard_tunnel_down)
||
action.getParameter2().contains(Actions.wireguard_tunnel_refresh)
)
addToArrayListUnique(ActivityPermissions.permissionNameWireguard, requiredPermissions);
break; break;
case triggerUrl: case triggerUrl:
addToArrayListUnique("android.permission.INTERNET", requiredPermissions); addToArrayListUnique("android.permission.INTERNET", requiredPermissions);

View File

@ -639,4 +639,5 @@
<string name="errorRunningRule">There was an error running a rule.</string> <string name="errorRunningRule">There was an error running a rule.</string>
<string name="cantFindSoundFile">Cannot find sound file %1$s and therefore not play it.</string> <string name="cantFindSoundFile">Cannot find sound file %1$s and therefore not play it.</string>
<string name="addParameters">Add parameters</string> <string name="addParameters">Add parameters</string>
<string name="com.wireguard.android.permission.CONTROL_TUNNELS">Control tunnels of the wireguard app</string>
</resources> </resources>