summaryrefslogtreecommitdiff
path: root/privacymodule-api/src/main/java
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2022-09-07 12:30:29 +0000
committerGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2022-09-07 12:30:29 +0000
commitdf7f3d969e0338acbb7efff6a3361f9aed927cf7 (patch)
tree37c1359cdf5573bfd90e23c138aa8aedfd341238 /privacymodule-api/src/main/java
parent54fcb13a713993687e8385dd2ff6d70563b5a1c2 (diff)
2 - Convert trackers to kotlin, fix trackers count for system app
Diffstat (limited to 'privacymodule-api/src/main/java')
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt41
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt96
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt96
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt28
4 files changed, 0 insertions, 261 deletions
diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt
deleted file mode 100644
index ecad2a4..0000000
--- a/privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt
+++ /dev/null
@@ -1,41 +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.location
-
-/**
- * Manage a fake location on the device.
- */
-interface IFakeLocationModule {
- /**
- * Start to fake the location module. Call [setFakeLocation] after to set the fake
- * position.
- */
- fun startFakeLocation()
-
- /**
- * Set or update the faked position.
- * @param latitude the latitude of the fake position in degrees.
- * @param longitude the longitude of the fake position in degrees.
- */
- fun setFakeLocation(latitude: Double, longitude: Double)
-
- /**
- * Stop the fake location module, giving back hand to the true location modules.
- */
- fun stopFakeLocation()
-}
diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt
deleted file mode 100644
index 53b540e..0000000
--- a/privacymodule-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/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt
deleted file mode 100644
index 139290e..0000000
--- a/privacymodule-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/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt
deleted file mode 100644
index 0a4395a..0000000
--- a/privacymodule-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?
-)