Loading app/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ plugins { id 'kotlin-android' id 'com.google.devtools.ksp' alias libs.plugins.ktlint alias libs.plugins.kotlin.serialization id 'androidx.navigation.safeargs.kotlin' id 'com.google.dagger.hilt.android' id 'kotlin-allopen' Loading Loading @@ -227,6 +228,7 @@ dependencies { implementation(libs.kotlinx.coroutines.android) testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.kotlin.test) implementation(libs.kotlinx.serialization.json) // Testing dependencies testImplementation(libs.truth) Loading app/src/main/java/foundation/e/apps/data/blockedApps/AppWarningInfo.kt +7 −5 Original line number Diff line number Diff line /* * Copyright (C) 2022-2024 E FOUNDATION * Copyright (C) 2022-2025 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 Loading @@ -18,10 +18,12 @@ package foundation.e.apps.data.blockedApps import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class AppWarningInfo( @SerializedName("not_working_apps") val notWorkingApps: List<String>, @SerializedName("zero_privacy_apps") val zeroPrivacyApps: List<String>, @SerializedName("third_party_store_apps") val thirdPartyStoreApps: List<String> = emptyList() @SerialName("not_working_apps") val notWorkingApps: List<String>, @SerialName("zero_privacy_apps") val zeroPrivacyApps: List<String>, @SerialName("third_party_store_apps") val thirdPartyStoreApps: List<String> = emptyList() ) app/src/main/java/foundation/e/apps/data/blockedApps/BlockedAppRepository.kt +4 −4 Original line number Diff line number Diff line /* * Copyright (C) 2022-2024 E FOUNDATION * Copyright (C) 2022-2025 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 Loading @@ -17,10 +17,10 @@ */ package foundation.e.apps.data.blockedApps import com.google.gson.Gson import foundation.e.apps.data.DownloadManager import foundation.e.apps.data.install.FileManager import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.serialization.json.Json import timber.log.Timber import java.io.File import javax.inject.Inject Loading @@ -31,7 +31,7 @@ import kotlin.coroutines.resume @Singleton class BlockedAppRepository @Inject constructor( private val downloadManager: DownloadManager, private val gson: Gson, private val json: Json, @Named("cacheDir") private val cacheDir: String, ) { Loading Loading @@ -79,7 +79,7 @@ class BlockedAppRepository @Inject constructor( Timber.d("Blocked list file exists: ${downloadedFile.exists()}") val blockedAppInfoJson = String(downloadedFile.inputStream().readBytes()) Timber.d("Blocked list file contents: $blockedAppInfoJson") gson.fromJson(blockedAppInfoJson, AppWarningInfo::class.java) json.decodeFromString<AppWarningInfo>(blockedAppInfoJson) } catch (exception: Exception) { Timber.e(exception.localizedMessage ?: "", exception) AppWarningInfo(listOf(), listOf(), listOf()) Loading app/src/main/java/foundation/e/apps/data/login/Auth.kt 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Aurora Store * Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com> * * Aurora Store 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 2 of the License, or * (at your option) any later version. * * Aurora Store 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 Aurora Store. If not, see <http://www.gnu.org/licenses/>. * */ package foundation.e.apps.data.login import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class Auth( val email: String, @SerialName("authToken") val auth: String, ) app/src/main/java/foundation/e/apps/data/login/PlayStoreAuthenticator.kt +5 −5 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ package foundation.e.apps.data.login import android.content.Context import com.aurora.gplayapi.data.models.AuthData import com.google.gson.Gson import dagger.hilt.android.qualifiers.ApplicationContext import foundation.e.apps.data.ResultSupreme import foundation.e.apps.data.enums.ResultStatus Loading @@ -33,6 +32,7 @@ import foundation.e.apps.data.preference.AppLoungeDataStore import foundation.e.apps.data.preference.AppLoungePreference import foundation.e.apps.data.preference.getSync import foundation.e.apps.data.retryWithBackoff import kotlinx.serialization.json.Json import timber.log.Timber import java.util.Locale import javax.inject.Inject Loading @@ -47,7 +47,7 @@ import javax.inject.Singleton @Singleton class PlayStoreAuthenticator @Inject constructor( @ApplicationContext private val context: Context, private val gson: Gson, private val json: Json, private val appLoungeDataStore: AppLoungeDataStore, private val appLoungePreference: AppLoungePreference, ) : StoreAuthenticator, AuthDataValidator { Loading Loading @@ -122,7 +122,7 @@ class PlayStoreAuthenticator @Inject constructor( val authJson = appLoungeDataStore.authData.getSync() return if (authJson.isBlank()) null else try { gson.fromJson(authJson, AuthData::class.java) json.decodeFromString<AuthData>(authJson) } catch (e: Exception) { e.printStackTrace() null Loading @@ -149,8 +149,8 @@ class PlayStoreAuthenticator @Inject constructor( * Converting [authData] to Json and back to [AuthData] fixed it. */ private fun formatAuthData(authData: AuthData): AuthData { val localAuthDataJson = gson.toJson(authData) return gson.fromJson(localAuthDataJson, AuthData::class.java) val localAuthDataJson = json.encodeToString(authData) return json.decodeFromString<AuthData>(localAuthDataJson) } private suspend fun getAuthDataAnonymously(): ResultSupreme<AuthData?> { Loading Loading
app/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ plugins { id 'kotlin-android' id 'com.google.devtools.ksp' alias libs.plugins.ktlint alias libs.plugins.kotlin.serialization id 'androidx.navigation.safeargs.kotlin' id 'com.google.dagger.hilt.android' id 'kotlin-allopen' Loading Loading @@ -227,6 +228,7 @@ dependencies { implementation(libs.kotlinx.coroutines.android) testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.kotlin.test) implementation(libs.kotlinx.serialization.json) // Testing dependencies testImplementation(libs.truth) Loading
app/src/main/java/foundation/e/apps/data/blockedApps/AppWarningInfo.kt +7 −5 Original line number Diff line number Diff line /* * Copyright (C) 2022-2024 E FOUNDATION * Copyright (C) 2022-2025 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 Loading @@ -18,10 +18,12 @@ package foundation.e.apps.data.blockedApps import com.google.gson.annotations.SerializedName import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class AppWarningInfo( @SerializedName("not_working_apps") val notWorkingApps: List<String>, @SerializedName("zero_privacy_apps") val zeroPrivacyApps: List<String>, @SerializedName("third_party_store_apps") val thirdPartyStoreApps: List<String> = emptyList() @SerialName("not_working_apps") val notWorkingApps: List<String>, @SerialName("zero_privacy_apps") val zeroPrivacyApps: List<String>, @SerialName("third_party_store_apps") val thirdPartyStoreApps: List<String> = emptyList() )
app/src/main/java/foundation/e/apps/data/blockedApps/BlockedAppRepository.kt +4 −4 Original line number Diff line number Diff line /* * Copyright (C) 2022-2024 E FOUNDATION * Copyright (C) 2022-2025 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 Loading @@ -17,10 +17,10 @@ */ package foundation.e.apps.data.blockedApps import com.google.gson.Gson import foundation.e.apps.data.DownloadManager import foundation.e.apps.data.install.FileManager import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.serialization.json.Json import timber.log.Timber import java.io.File import javax.inject.Inject Loading @@ -31,7 +31,7 @@ import kotlin.coroutines.resume @Singleton class BlockedAppRepository @Inject constructor( private val downloadManager: DownloadManager, private val gson: Gson, private val json: Json, @Named("cacheDir") private val cacheDir: String, ) { Loading Loading @@ -79,7 +79,7 @@ class BlockedAppRepository @Inject constructor( Timber.d("Blocked list file exists: ${downloadedFile.exists()}") val blockedAppInfoJson = String(downloadedFile.inputStream().readBytes()) Timber.d("Blocked list file contents: $blockedAppInfoJson") gson.fromJson(blockedAppInfoJson, AppWarningInfo::class.java) json.decodeFromString<AppWarningInfo>(blockedAppInfoJson) } catch (exception: Exception) { Timber.e(exception.localizedMessage ?: "", exception) AppWarningInfo(listOf(), listOf(), listOf()) Loading
app/src/main/java/foundation/e/apps/data/login/Auth.kt 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Aurora Store * Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com> * * Aurora Store 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 2 of the License, or * (at your option) any later version. * * Aurora Store 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 Aurora Store. If not, see <http://www.gnu.org/licenses/>. * */ package foundation.e.apps.data.login import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class Auth( val email: String, @SerialName("authToken") val auth: String, )
app/src/main/java/foundation/e/apps/data/login/PlayStoreAuthenticator.kt +5 −5 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ package foundation.e.apps.data.login import android.content.Context import com.aurora.gplayapi.data.models.AuthData import com.google.gson.Gson import dagger.hilt.android.qualifiers.ApplicationContext import foundation.e.apps.data.ResultSupreme import foundation.e.apps.data.enums.ResultStatus Loading @@ -33,6 +32,7 @@ import foundation.e.apps.data.preference.AppLoungeDataStore import foundation.e.apps.data.preference.AppLoungePreference import foundation.e.apps.data.preference.getSync import foundation.e.apps.data.retryWithBackoff import kotlinx.serialization.json.Json import timber.log.Timber import java.util.Locale import javax.inject.Inject Loading @@ -47,7 +47,7 @@ import javax.inject.Singleton @Singleton class PlayStoreAuthenticator @Inject constructor( @ApplicationContext private val context: Context, private val gson: Gson, private val json: Json, private val appLoungeDataStore: AppLoungeDataStore, private val appLoungePreference: AppLoungePreference, ) : StoreAuthenticator, AuthDataValidator { Loading Loading @@ -122,7 +122,7 @@ class PlayStoreAuthenticator @Inject constructor( val authJson = appLoungeDataStore.authData.getSync() return if (authJson.isBlank()) null else try { gson.fromJson(authJson, AuthData::class.java) json.decodeFromString<AuthData>(authJson) } catch (e: Exception) { e.printStackTrace() null Loading @@ -149,8 +149,8 @@ class PlayStoreAuthenticator @Inject constructor( * Converting [authData] to Json and back to [AuthData] fixed it. */ private fun formatAuthData(authData: AuthData): AuthData { val localAuthDataJson = gson.toJson(authData) return gson.fromJson(localAuthDataJson, AuthData::class.java) val localAuthDataJson = json.encodeToString(authData) return json.decodeFromString<AuthData>(localAuthDataJson) } private suspend fun getAuthDataAnonymously(): ResultSupreme<AuthData?> { Loading