Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d43c66b authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Set VPN authorization for API 30

parent 379edfb3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -4,11 +4,12 @@ apply plugin: 'maven-publish'


android {
    compileSdkVersion 29
    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 26
        targetSdkVersion 29
        minSdkVersion 30
        targetSdkVersion 30

        versionName advanced_privacy_version
        consumerProguardFiles "consumer-rules.pro"
    }
@@ -37,7 +38,7 @@ publishing {
        maven(MavenPublication) {
            groupId 'foundation.e'
            //You can either define these here or get them from project conf elsewhere
            artifactId 'privacymodule.e-29'
            artifactId 'privacymodule.e-30'
            version android.defaultConfig.versionName
            artifact "$buildDir/outputs/aar/privacymodulese-release.aar" //aar artifact you want to publish
//            artifact "$buildDir/outputs/aar/privacymodulese-debug.aar" //aar artifact you want to publish
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import android.app.AppOpsManager.OP_NONE
import android.app.AppOpsManager.strOpToOp
import android.content.Context
import android.net.IConnectivityManager
import android.net.VpnManager.TYPE_VPN_SERVICE
import android.os.ServiceManager
import android.os.UserHandle
import android.util.Log
@@ -70,7 +71,7 @@ class PermissionsPrivacyModule(context: Context): APermissionsPrivacyModule(cont
            if (service.prepareVpn(null, packageName, UserHandle.myUserId())) {
                // Authorize this app to initiate VPN connections in the future without user
                // intervention.
                service.setVpnPackageAuthorization(packageName, UserHandle.myUserId(), true)
                service.setVpnPackageAuthorization(packageName, UserHandle.myUserId(), TYPE_VPN_SERVICE)
                return true
            }
        } catch (e: java.lang.Exception) {