Loading app/build.gradle +5 −0 Original line number Diff line number Diff line plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } android { Loading Loading @@ -84,6 +85,10 @@ android { aaptOptions { additionalParameters '-I', 'app/libs/e-ui-sdk-1.0.1-q.jar' } buildFeatures { dataBinding true } } dependencies { Loading app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt +16 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ package foundation.e.privacycentralapp import android.app.Application import android.content.Context import android.os.Process import foundation.e.privacycentralapp.data.repositories.LocalStateRepository import foundation.e.privacycentralapp.domain.usecases.GetQuickPrivacyStateUseCase import foundation.e.privacycentralapp.features.dashboard.DashBoardViewModelFactory import foundation.e.privacycentralapp.features.internetprivacy.InternetPrivacyViewModelFactory import foundation.e.privacycentralapp.features.location.FakeLocationViewModelFactory import foundation.e.privacycentralapp.features.location.LocationApiDelegate Loading @@ -40,6 +43,7 @@ class DependencyContainer constructor(val app: Application) { val context: Context by lazy { app.applicationContext } // Drivers private val fakeLocationModule: IFakeLocation by lazy { FakeLocation(app.applicationContext) } private val permissionsModule by lazy { PermissionsPrivacyModule(app.applicationContext) } private val ipScramblerModule: IIpScramblerModule by lazy { IpScramblerModule(app.applicationContext) } Loading @@ -57,6 +61,18 @@ class DependencyContainer constructor(val app: Application) { LocationApiDelegate(fakeLocationModule, permissionsModule, appDesc) } // Repositories private val localStateRepository by lazy { LocalStateRepository(context) } // Usecases private val getQuickPrivacyStateUseCase by lazy { GetQuickPrivacyStateUseCase(localStateRepository) } val dashBoardViewModelFactory by lazy { DashBoardViewModelFactory(getQuickPrivacyStateUseCase) } val fakeLocationViewModelFactory by lazy { FakeLocationViewModelFactory(locationApi) } Loading app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt +2 −5 Original line number Diff line number Diff line Loading @@ -31,10 +31,7 @@ class LocalStateRepository(context: Context) { get() = sharedPref.getBoolean(KEY_QUICK_PRIVACY, false) set(value) = set(KEY_QUICK_PRIVACY, value) private fun set(key: String, value: Boolean) { sharedPref.edit().putBoolean(key, value).apply() sharedPref.edit().putBoolean(key, value).commit() } } app/src/main/java/foundation/e/privacycentralapp/domain/entities/InternetPrivacyMode.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * 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 <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp.domain.entities enum class InternetPrivacyMode { REAL_IP, HIDE_IP } app/src/main/java/foundation/e/privacycentralapp/domain/entities/LocationMode.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * 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 <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp.domain.entities enum class LocationMode { REAL_LOCATION, RANDOM_LOCATION, CUSTOM_LOCATION } Loading
app/build.gradle +5 −0 Original line number Diff line number Diff line plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } android { Loading Loading @@ -84,6 +85,10 @@ android { aaptOptions { additionalParameters '-I', 'app/libs/e-ui-sdk-1.0.1-q.jar' } buildFeatures { dataBinding true } } dependencies { Loading
app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt +16 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ package foundation.e.privacycentralapp import android.app.Application import android.content.Context import android.os.Process import foundation.e.privacycentralapp.data.repositories.LocalStateRepository import foundation.e.privacycentralapp.domain.usecases.GetQuickPrivacyStateUseCase import foundation.e.privacycentralapp.features.dashboard.DashBoardViewModelFactory import foundation.e.privacycentralapp.features.internetprivacy.InternetPrivacyViewModelFactory import foundation.e.privacycentralapp.features.location.FakeLocationViewModelFactory import foundation.e.privacycentralapp.features.location.LocationApiDelegate Loading @@ -40,6 +43,7 @@ class DependencyContainer constructor(val app: Application) { val context: Context by lazy { app.applicationContext } // Drivers private val fakeLocationModule: IFakeLocation by lazy { FakeLocation(app.applicationContext) } private val permissionsModule by lazy { PermissionsPrivacyModule(app.applicationContext) } private val ipScramblerModule: IIpScramblerModule by lazy { IpScramblerModule(app.applicationContext) } Loading @@ -57,6 +61,18 @@ class DependencyContainer constructor(val app: Application) { LocationApiDelegate(fakeLocationModule, permissionsModule, appDesc) } // Repositories private val localStateRepository by lazy { LocalStateRepository(context) } // Usecases private val getQuickPrivacyStateUseCase by lazy { GetQuickPrivacyStateUseCase(localStateRepository) } val dashBoardViewModelFactory by lazy { DashBoardViewModelFactory(getQuickPrivacyStateUseCase) } val fakeLocationViewModelFactory by lazy { FakeLocationViewModelFactory(locationApi) } Loading
app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt +2 −5 Original line number Diff line number Diff line Loading @@ -31,10 +31,7 @@ class LocalStateRepository(context: Context) { get() = sharedPref.getBoolean(KEY_QUICK_PRIVACY, false) set(value) = set(KEY_QUICK_PRIVACY, value) private fun set(key: String, value: Boolean) { sharedPref.edit().putBoolean(key, value).apply() sharedPref.edit().putBoolean(key, value).commit() } }
app/src/main/java/foundation/e/privacycentralapp/domain/entities/InternetPrivacyMode.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * 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 <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp.domain.entities enum class InternetPrivacyMode { REAL_IP, HIDE_IP }
app/src/main/java/foundation/e/privacycentralapp/domain/entities/LocationMode.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * 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 <https://www.gnu.org/licenses/>. */ package foundation.e.privacycentralapp.domain.entities enum class LocationMode { REAL_LOCATION, RANDOM_LOCATION, CUSTOM_LOCATION }