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

Commit 0312ce64 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Merge branch 'epic18-standalone_trackers_tor_alone' into 'main'

epic18: tracker control while tor is activated.

See merge request !148
parents d0c2b36e 54892a22
Loading
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ import foundation.e.advancedprivacy.features.trackers.TrackersViewModel
import foundation.e.advancedprivacy.features.trackers.apptrackers.AppTrackersViewModel
import foundation.e.advancedprivacy.ipscrambler.ipScramblerModule
import foundation.e.advancedprivacy.permissions.externalinterfaces.PermissionsPrivacyModuleImpl
import foundation.e.advancedprivacy.trackers.domain.externalinterfaces.TrackersServiceSupervisor
import foundation.e.advancedprivacy.trackers.service.TrackersServiceSupervisorImpl
import foundation.e.advancedprivacy.trackers.service.trackerServiceModule
import foundation.e.advancedprivacy.trackers.trackersModule
import org.koin.android.ext.koin.androidContext
@@ -122,11 +120,12 @@ val appModule = module {
    singleOf(::GetQuickPrivacyStateUseCase)
    single {
        IpScramblingStateUseCase(
            ipScramblerModule = get(),
            orbotServiceSupervisor = get(),
            permissionsPrivacyModule = get(),
            appDesc = get(named("AdvancedPrivacy")),
            localStateRepository = get(),
            appListsRepository = get(),
            trackersServiceSupervisor = get(),
            coroutineScope = get()
        )
    }
@@ -138,12 +137,6 @@ val appModule = module {
        PermissionsPrivacyModuleImpl(context = androidContext())
    }

    single<TrackersServiceSupervisor> {
        TrackersServiceSupervisorImpl(
            context = androidContext(),
        )
    }

    viewModel { parameters ->
        val appListUseCase: AppListUseCase = get()
        val app = appListUseCase.getApp(parameters.get())
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import foundation.e.advancedprivacy.domain.entities.CHANNEL_FAKE_LOCATION_FLAG
import foundation.e.advancedprivacy.domain.entities.CHANNEL_FIRST_BOOT
import foundation.e.advancedprivacy.domain.entities.CHANNEL_IPSCRAMBLING_FLAG
import foundation.e.advancedprivacy.domain.entities.CHANNEL_TRACKER_FLAG
import foundation.e.advancedprivacy.domain.entities.InternetPrivacyMode
import foundation.e.advancedprivacy.domain.entities.FeatureServiceState
import foundation.e.advancedprivacy.domain.entities.MainFeatures
import foundation.e.advancedprivacy.domain.entities.NOTIFICATION_FAKE_LOCATION_FLAG
import foundation.e.advancedprivacy.domain.entities.NOTIFICATION_FIRST_BOOT
@@ -105,7 +105,7 @@ object Notifications {
        }.launchIn(appScope)

        getQuickPrivacyStateUseCase.ipScramblingMode.map {
            it != InternetPrivacyMode.REAL_IP
            it != FeatureServiceState.OFF
        }.distinctUntilChanged().onEach {
            if (it) {
                showFlagNotification(appContext, MainFeatures.IP_SCRAMBLING)
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ package foundation.e.advancedprivacy.data.repositories
import android.content.Context
import android.content.Intent
import foundation.e.advancedprivacy.domain.entities.ApplicationDescription
import foundation.e.advancedprivacy.domain.entities.InternetPrivacyMode
import foundation.e.advancedprivacy.domain.entities.FeatureServiceState
import foundation.e.advancedprivacy.domain.entities.LocationMode
import foundation.e.advancedprivacy.domain.entities.ShowFeaturesWarning
import kotlinx.coroutines.flow.MutableSharedFlow
@@ -89,7 +89,7 @@ class LocalStateRepository(context: Context) {
        _ipScramblingSetting.update { enabled }
    }

    val internetPrivacyMode: MutableStateFlow<InternetPrivacyMode> = MutableStateFlow(InternetPrivacyMode.REAL_IP)
    val internetPrivacyMode: MutableStateFlow<FeatureServiceState> = MutableStateFlow(FeatureServiceState.OFF)

    private val _startVpnDisclaimer = MutableSharedFlow<ShowFeaturesWarning.IpScrambling>()
    suspend fun emitStartVpnDisclaimer(intent: Intent?) {
+0 −29
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.advancedprivacy.domain.entities

enum class InternetPrivacyMode {
    REAL_IP,
    HIDE_IP,
    HIDE_IP_LOADING,
    REAL_IP_LOADING;

    val isChecked get() = this == HIDE_IP || this == HIDE_IP_LOADING

    val isLoading get() = this == HIDE_IP_LOADING || this == REAL_IP_LOADING
}
+3 −1
Original line number Diff line number Diff line
@@ -21,9 +21,11 @@ import android.content.Intent
import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
sealed class ShowFeaturesWarning : Parcelable {
    @Parcelize
    object TrackersControl : ShowFeaturesWarning()
    @Parcelize
    object FakeLocation : ShowFeaturesWarning()
    @Parcelize
    data class IpScrambling(val startVpnDisclaimer: Intent? = null) : ShowFeaturesWarning()
}
Loading