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

Commit 4d6e9032 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

842: fix whitelist compatapps, when system app in whitelist.

parent eecf7650
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 E FOUNDATION
 * Copyright (C) 2021 E FOUNDATION, 2023 MURENA SAS
 *
 * 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
@@ -17,6 +17,7 @@

package foundation.e.privacycentralapp.domain.usecases

import android.util.Log
import foundation.e.privacycentralapp.data.repositories.AppListsRepository
import foundation.e.privacycentralapp.data.repositories.LocalStateRepository
import foundation.e.privacycentralapp.domain.entities.InternetPrivacyMode
@@ -90,19 +91,18 @@ class IpScramblingStateUseCase(

    val bypassTorApps: Set<String> get() {
        var whitelist = ipScramblerModule.appList

        if (getHiddenPackageNames().any { it in whitelist }) {
            val mutable = whitelist.toMutableSet()
            mutable.removeAll(getHiddenPackageNames())
            mutable.add(appListsRepository.dummySystemApp.packageName)
            whitelist = mutable
        } else if (AppListsRepository.appsCompatibiltyPNames.any { it in whitelist }) {
        }
        if (AppListsRepository.appsCompatibiltyPNames.any { it in whitelist }) {
            val mutable = whitelist.toMutableSet()
            mutable.removeAll(AppListsRepository.appsCompatibiltyPNames)
            mutable.add(appListsRepository.dummyAppsCompatibilityApp.packageName)
            whitelist = mutable
        }

        return whitelist
    }