diff options
Diffstat (limited to 'api/src/main/java/foundation/e/privacymodules/trackers')
4 files changed, 0 insertions, 246 deletions
| diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt b/api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt deleted file mode 100644 index 53b540e..0000000 --- a/api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt +++ /dev/null @@ -1,96 +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 <https://www.gnu.org/licenses/>. - */ - -package foundation.e.privacymodules.trackers - - -/** - * Manage trackers blocking and whitelisting. - */ -interface IBlockTrackersPrivacyModule { - - -    /** -     * Get the state of the blockin module -     * @return true when blocking is enabled, false otherwise. -     */ -    fun isBlockingEnabled(): Boolean - -    /** -     * Enable blocking, using the previously configured whitelists -     */ -    fun enableBlocking() - -    /** -     * Disable blocking -     */ -    fun disableBlocking() - -    /** -     * Set or unset in whitelist the App with the specified uid. -     * @param appUid the uid of the app -     * @param isWhiteListed true, the app will appears in whitelist, false, it won't -     */ -    fun setWhiteListed(appUid: Int, isWhiteListed: Boolean) - -    /** -     * Set or unset in whitelist the specifid tracked, for the App specified by its uid. -     * @param tracker the tracker -     * @param appUid the uid of the app -     * @param isWhiteListed true, the app will appears in whitelist, false, it won't -     */ -    fun setWhiteListed(tracker: Tracker, appUid: Int, isWhiteListed: Boolean) - -    /** -     * Return true if nothing has been added to the whitelist : everything is blocked. -     */ -    fun isWhiteListEmpty(): Boolean - -    /** -     * Return the white listed App, by their UID -     */ -    fun getWhiteListedApp(): List<Int> - -    /** -     * Return true if the App is whitelisted for trackers blocking. -     */ -    fun isWhitelisted(appUid: Int): Boolean - - -    /** -     * List the white listed trackers for an App specified by it uid -     */ -    fun getWhiteList(appUid: Int): List<Tracker> - -    /** -     * Callback interface to get updates about the state of the Block trackers module. -     */ -    interface Listener { - -        /** -         * Called when the trackers blocking is activated or deactivated. -         * @param isBlocking true when activated, false otherwise. -         */ -        fun onBlockingToggle(isBlocking: Boolean) -    } - -    fun addListener(listener: Listener) - -    fun removeListener(listener: Listener) - -    fun clearListeners() -} diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt b/api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt deleted file mode 100644 index a132aef..0000000 --- a/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 <https://www.gnu.org/licenses/>. - */ - -package foundation.e.privacymodules.trackers - -interface IDNSBlocker { -    companion object { -        const val DUMMY_APP_UID = -1 -    } - -    fun shouldBlock(hostname: String, appUid: Int): Boolean -} diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt b/api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt deleted file mode 100644 index 139290e..0000000 --- a/api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt +++ /dev/null @@ -1,96 +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 <https://www.gnu.org/licenses/>. - */ - -package foundation.e.privacymodules.trackers - -/** - * Get reporting about trackers calls. - */ -interface ITrackTrackersPrivacyModule { - -    fun start(trackers: List<Tracker>, enableNotification: Boolean = true) - -    /** -     * List all the trackers encountered for a specific app. -     */ -    fun getTrackersForApp(appUid: Int): List<Tracker> - -    /** -     * Return the number of encountered trackers since "ever" -     */ -    fun getTrackersCount(): Int - -    /** -     * Return the number of encountere trackers since "ever", for each app uid. -     */ -    fun getTrackersCountByApp(): Map<Int, Int> - -    /** -     * Return the number of encountered trackers for the last 24 hours -     */ -    fun getPastDayTrackersCount(): Int - -    /** -     * Return the number of encountered trackers for the last month -     */ -    fun getPastMonthTrackersCount(): Int - -    /** -     * Return the number of encountered trackers for the last year -     */ -    fun getPastYearTrackersCount(): Int - - -    /** -     * Return number of trackers calls by hours, for the last 24hours. -     * @return list of 24 numbers of trackers calls by hours -     */ -    fun getPastDayTrackersCalls(): List<Pair<Int, Int>> - -    /** -     * Return number of trackers calls by day, for the last 30 days. -     * @return list of 30 numbers of trackers calls by day -     */ -    fun getPastMonthTrackersCalls(): List<Pair<Int, Int>> - -    /** -     * Return number of trackers calls by month, for the last 12 month. -     * @return list of 12 numbers of trackers calls by month -     */ -    fun getPastYearTrackersCalls(): List<Pair<Int, Int>> - -    fun getPastDayTrackersCallsByApps(): Map<Int, Pair<Int, Int>> - -    fun getPastDayTrackersCallsForApp(appUId: Int): Pair<Int, Int> - -    fun getPastDayMostLeakedApp(): Int - -    interface Listener { - -        /** -         * Called when a new tracker attempt is logged. Consumer may choose to call other methods -         * to refresh the data. -         */ -        fun onNewData() -    } - -    fun addListener(listener: Listener) - -    fun removeListener(listener: Listener) - -    fun clearListeners() -}
\ No newline at end of file diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt b/api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt deleted file mode 100644 index 0a4395a..0000000 --- a/api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt +++ /dev/null @@ -1,28 +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 <https://www.gnu.org/licenses/>. - */ - -package foundation.e.privacymodules.trackers - -/** - * Describe a tracker. - */ -data class Tracker( -    val id: String, -    val hostnames: Set<String>, -    val label: String, -    val exodusId: String? -) | 
