From 53f4a9ce311d612d43fa770cf7e8f8e98fbb43a0 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Tue, 12 Sep 2023 06:17:39 +0000 Subject: 2: organise module with clean archi, use Koin for injection. --- privacymodule-api/.gitignore | 1 - privacymodule-api/build.gradle | 111 -------------- privacymodule-api/consumer-rules.pro | 0 privacymodule-api/proguard-rules.pro | 21 --- privacymodule-api/src/main/AndroidManifest.xml | 21 --- .../e/privacymodules/DependencyInjector.kt | 31 ---- .../permissions/APermissionsPrivacyModule.kt | 160 --------------------- .../permissions/IPermissionsPrivacyModule.kt | 143 ------------------ .../privacymodules/permissions/data/AppOpModes.kt | 47 ------ .../permissions/data/ApplicationDescription.kt | 50 ------- .../permissions/data/PermissionDescription.kt | 26 ---- .../e/privacymodules/trackers/IDNSBlocker.kt | 26 ---- 12 files changed, 637 deletions(-) delete mode 100644 privacymodule-api/.gitignore delete mode 100644 privacymodule-api/build.gradle delete mode 100644 privacymodule-api/consumer-rules.pro delete mode 100644 privacymodule-api/proguard-rules.pro delete mode 100644 privacymodule-api/src/main/AndroidManifest.xml delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt delete mode 100644 privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt (limited to 'privacymodule-api') diff --git a/privacymodule-api/.gitignore b/privacymodule-api/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/privacymodule-api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/privacymodule-api/build.gradle b/privacymodule-api/build.gradle deleted file mode 100644 index 259672b..0000000 --- a/privacymodule-api/build.gradle +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'maven-publish' - -group 'foundation.e' - -android { - compileSdkVersion buildConfig.compileSdk - - defaultConfig { - minSdkVersion buildConfig.minSdk - targetSdkVersion buildConfig.targetSdk - - consumerProguardFiles "consumer-rules.pro" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation( - libs.androidx.core.ktx, - libs.kotlinx.coroutines - ) -} - -//url "https://gitlab.e.foundation/api/v4/groups/e/privacy-central/-/packages/maven" - -publishing { - publications { - maven(MavenPublication) { - groupId 'foundation.e' - //You can either define these here or get them from project conf elsewhere - artifactId 'privacymodule-api' - version buildConfig.version.name - artifact "$buildDir/outputs/aar/privacymodule-api-release.aar" - //aar artifact you want to publish - - //generate pom nodes for dependencies - pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') - configurations.implementation.allDependencies.each { dependency -> - if (dependency.name != 'unspecified') { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', dependency.group) - dependencyNode.appendNode('artifactId', dependency.name) - dependencyNode.appendNode('version', dependency.version) - } - } - } - repositories { - def ciJobToken = System.getenv("CI_JOB_TOKEN") - def ciApiV4Url = System.getenv("CI_API_V4_URL") - if (ciJobToken != null) { - maven { - url "${ciApiV4Url}/projects/900/packages/maven" - credentials(HttpHeaderCredentials) { - name = 'Job-Token' - value = ciJobToken - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - maven { -// url "https://gitlab.e.foundation/api/v4/projects/900/packages/maven" - // Use privacymodule-e repository (id = 781) for now, - // because repository not activated on Advanced Privacy (id = 900) - url "https://gitlab.e.foundation/api/v4/projects/781/packages/maven" - credentials(HttpHeaderCredentials) { - name = "Private-Token" - value = gitLabPrivateToken - // the variable resides in ~/.gradle/gradle.properties - } - authentication { - header(HttpHeaderAuthentication) - } - } - } - } - } - } -} diff --git a/privacymodule-api/consumer-rules.pro b/privacymodule-api/consumer-rules.pro deleted file mode 100644 index e69de29..0000000 diff --git a/privacymodule-api/proguard-rules.pro b/privacymodule-api/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/privacymodule-api/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/privacymodule-api/src/main/AndroidManifest.xml b/privacymodule-api/src/main/AndroidManifest.xml deleted file mode 100644 index 937e285..0000000 --- a/privacymodule-api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - \ No newline at end of file diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt deleted file mode 100644 index 9bf8aba..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules - -import foundation.e.privacymodules.trackers.IDNSBlocker - -object DependencyInjector { - fun initialize( - dnsBlocker: IDNSBlocker - ) { - this.dnsBlocker = dnsBlocker - } - - lateinit var dnsBlocker: IDNSBlocker - private set -} diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt deleted file mode 100644 index 64b2292..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2022 - 2023 MURENA SAS - * Copyright (C) 2021 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.permissions - -import android.app.AppOpsManager -import android.content.Context -import android.content.pm.ApplicationInfo -import android.content.pm.PackageManager -import android.content.pm.PermissionInfo -import android.content.pm.PermissionInfo.PROTECTION_DANGEROUS -import android.graphics.drawable.Drawable -import android.os.Build -import android.util.Log -import foundation.e.privacymodules.permissions.data.AppOpModes -import foundation.e.privacymodules.permissions.data.ApplicationDescription -import foundation.e.privacymodules.permissions.data.PermissionDescription -import foundation.e.privacymodules.permissions.data.ProfileType - -/** - * Implementation of the commons functionality between privileged and standard - * versions of the module. - * @param context an Android context, to retrieve packageManager for example. - */ -abstract class APermissionsPrivacyModule(protected val context: Context) : IPermissionsPrivacyModule { - - companion object { - private const val TAG = "PermissionsModule" - } - - /** - * @see IPermissionsPrivacyModule.getInstalledApplications - */ - override fun getApplicationDescription(packageName: String, withIcon: Boolean): ApplicationDescription { - val appDesc = buildApplicationDescription(context.packageManager.getApplicationInfo(packageName, 0)) - if (withIcon) { - appDesc.icon = getApplicationIcon(appDesc.packageName) - } - return appDesc - } - - /** - * * @see IPermissionsPrivacyModule.getPermissions - */ - override fun getPermissions(packageName: String): List { - val packageInfo = context.packageManager.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS) - return packageInfo.requestedPermissions?.asList() ?: emptyList() - } - - override fun getPermissionDescription(permissionName: String): PermissionDescription { - val info = context.packageManager.getPermissionInfo(permissionName, 0) - return PermissionDescription( - name = permissionName, - isDangerous = isPermissionsDangerous(info), - group = null, - label = info.loadLabel(context.packageManager), - description = info.loadDescription(context.packageManager) - ) - } - - /** - * @see IPermissionsPrivacyModule.isDangerousPermissionGranted - */ - override fun isDangerousPermissionGranted(packageName: String, permissionName: String): Boolean { - return context.packageManager - .checkPermission(permissionName, packageName) == PackageManager.PERMISSION_GRANTED - } - - // on google version, work only for the current package. - @Suppress("DEPRECATION") - override fun getAppOpMode( - appDesc: ApplicationDescription, - appOpPermissionName: String - ): AppOpModes { - - val appOps = context.getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager - - val mode = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { - appOps.checkOpNoThrow( - appOpPermissionName, - - appDesc.uid, appDesc.packageName - ) - } else { - appOps.unsafeCheckOpNoThrow( - appOpPermissionName, - appDesc.uid, appDesc.packageName - ) - } - - return AppOpModes.getByModeValue(mode) - } - - override fun isPermissionsDangerous(permissionName: String): Boolean { - try { - val permissionInfo = context.packageManager.getPermissionInfo(permissionName, 0) - return isPermissionsDangerous(permissionInfo) - } catch (e: Exception) { - Log.w(TAG, "exception in isPermissionsDangerous(String)", e) - return false - } - } - - @Suppress("DEPRECATION") - private fun isPermissionsDangerous(permissionInfo: PermissionInfo): Boolean { - try { - return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - permissionInfo.protectionLevel and PROTECTION_DANGEROUS == 1 - } else { - permissionInfo.protection == PROTECTION_DANGEROUS - } - } catch (e: Exception) { - Log.w(TAG, "exception in isPermissionsDangerous(PermissionInfo)", e) - return false - } - } - - override fun buildApplicationDescription( - appInfo: ApplicationInfo, - profileId: Int, - profileType: ProfileType - ): - ApplicationDescription { - return ApplicationDescription( - packageName = appInfo.packageName, - uid = appInfo.uid, - label = getAppLabel(appInfo), - icon = null, - profileId = profileId, - profileType = profileType, - ) - } - - private fun getAppLabel(appInfo: ApplicationInfo): CharSequence { - return context.packageManager.getApplicationLabel(appInfo) - } - - fun getApplicationIcon(appInfo: ApplicationInfo): Drawable? { - return context.packageManager.getApplicationIcon(appInfo) - } - - override fun getApplicationIcon(packageName: String): Drawable? { - return context.packageManager.getApplicationIcon(packageName) - } -} diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt deleted file mode 100644 index 39c726a..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2022 - 2023 MURENA SAS - * Copyright (C) 2021 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.permissions - -import android.app.NotificationChannel -import android.content.pm.ApplicationInfo -import android.content.pm.PackageInfo -import android.graphics.drawable.Drawable -import foundation.e.privacymodules.permissions.data.AppOpModes -import foundation.e.privacymodules.permissions.data.ApplicationDescription -import foundation.e.privacymodules.permissions.data.PermissionDescription -import foundation.e.privacymodules.permissions.data.ProfileType - -/** - * List applications and manage theirs permissions. - */ -interface IPermissionsPrivacyModule { - - fun buildApplicationDescription( - appInfo: ApplicationInfo, - profileId: Int = -1, - profileType: ProfileType = ProfileType.MAIN - ): ApplicationDescription - - fun getApplications( - filter: ((PackageInfo) -> Boolean)?, - ): List - - /** - * List of permissions names used by an app, specified by its [packageName]. - * @param packageName the appId of the app - * @return the list off permission, in the "android.permission.PERMISSION" format. - */ - fun getPermissions(packageName: String): List - - fun getPermissionDescription(permissionName: String): PermissionDescription - - /** - * Get the filled up [ApplicationDescription] for the app specified by its [packageName] - * @param packageName the appId of the app - * @return the informations about the app. - */ - fun getApplicationDescription(packageName: String, withIcon: Boolean = true): ApplicationDescription - - /** - * Check if the current runtime permission is granted for the specified app. - * - * @param packageName the packageName of the app - * @param permissionName the name of the permission in "android.permission.PERMISSION" format. - * @return the current status for this permission. - */ - fun isDangerousPermissionGranted(packageName: String, permissionName: String): Boolean - - /** - * Get the appOps mode for the specified [appOpPermissionName] of the specified application. - * - * @param appDesc the application - * @param appOpPermissionName the AppOps permission name. - * @return mode, as a [AppOpModes] - */ - fun getAppOpMode(appDesc: ApplicationDescription, appOpPermissionName: String): AppOpModes - - /** - * Grant or revoke the specified permission for the specigfied app. - * If their is not enough privileges to get the permission, return the false - * - * @param appDesc the application - * @param permissionName the name of the permission in "android.permission.PERMISSION" format. - * @param grant true grant the permission, false revoke it. - * @return true if the permission is or has just been granted, false if - * user has to do it himself. - */ - fun toggleDangerousPermission( - appDesc: ApplicationDescription, - permissionName: String, - grant: Boolean - ): Boolean - - /** - * Change the appOp Mode for the specified appOpPermission and application. - * @param appDesc the application - * @param appOpPermissionName the AppOps permission name. - * @return true if the mode has been changed, false if - * user has to do it himself. - */ - fun setAppOpMode( - appDesc: ApplicationDescription, - appOpPermissionName: String, - status: AppOpModes - ): Boolean - - /** - * Return true if the application is flagged Dangerous. - */ - fun isPermissionsDangerous(permissionName: String): Boolean - - /** - * Get the application icon. - */ - fun getApplicationIcon(packageName: String): Drawable? - - /** - * Get the application icon. - */ - fun getApplicationIcon(app: ApplicationDescription): Drawable? - - /** - * Authorize the specified package to be used as Vpn. - * @return true if authorization has been set, false if an error has occurred. - */ - fun setVpnPackageAuthorization(packageName: String): Boolean - - /** - * Returns the package name of the currently set always-on VPN application, or null. - */ - fun getAlwaysOnVpnPackage(): String? - - /** - * Allows users to block notifications sent through this channel, if this channel belongs to - * a package that is signed with the system signature. - * - * If the channel does not belong to a package that is signed with the system signature, this - * method does nothing, since such channels are blockable by default and cannot be set to be - * unblockable. - */ - fun setBlockable(notificationChannel: NotificationChannel) -} diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt deleted file mode 100644 index 4764596..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.permissions.data - -import android.app.AppOpsManager.MODE_ALLOWED -import android.app.AppOpsManager.MODE_DEFAULT -import android.app.AppOpsManager.MODE_ERRORED -import android.app.AppOpsManager.MODE_FOREGROUND -import android.app.AppOpsManager.MODE_IGNORED -import android.os.Build - -enum class AppOpModes(val modeValue: Int) { - ALLOWED(MODE_ALLOWED), - IGNORED(MODE_IGNORED), - ERRORED(MODE_ERRORED), - DEFAULT(MODE_DEFAULT), - FOREGROUND(if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) MODE_ALLOWED else MODE_FOREGROUND); - - companion object { - private val byMode = mapOf( - FOREGROUND.modeValue to FOREGROUND, - ALLOWED.modeValue to ALLOWED, - IGNORED.modeValue to IGNORED, - ERRORED.modeValue to ERRORED, - DEFAULT.modeValue to DEFAULT, - ) - - fun getByModeValue(modeValue: Int): AppOpModes { - return byMode.get(modeValue) ?: DEFAULT - } - } -} diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt deleted file mode 100644 index 4fa1bb9..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2023 MURENA SAS - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.permissions.data - -import android.graphics.drawable.Drawable - -/** - * Useful informations to identify and describe an application. - */ -data class ApplicationDescription( - val packageName: String, - val uid: Int, - val profileId: Int, - val profileType: ProfileType, - var label: CharSequence?, - var icon: Drawable? -) { - val profileFlag = when (profileType) { - ProfileType.MAIN -> PROFILE_FLAG_MAIN - ProfileType.WORK -> PROFILE_FLAG_WORK - else -> profileId - } - - val apId: String get() = "${profileFlag}_$packageName" - - companion object { - const val PROFILE_FLAG_MAIN = -1 - const val PROFILE_FLAG_WORK = -2 - } -} - -enum class ProfileType { - MAIN, WORK, OTHER -} diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt deleted file mode 100644 index 127192b..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.permissions.data - -data class PermissionDescription( - val name: String, - var isDangerous: Boolean, - val group: String?, - var label: CharSequence?, - var description: CharSequence? -) diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt deleted file mode 100644 index a132aef..0000000 --- a/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2022 E FOUNDATION - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package foundation.e.privacymodules.trackers - -interface IDNSBlocker { - companion object { - const val DUMMY_APP_UID = -1 - } - - fun shouldBlock(hostname: String, appUid: Int): Boolean -} -- cgit v1.2.1