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

Commit e58326de authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '1577-dialog_token_refresh_failure' into 'main'

removed redundant login failed dialog

See merge request !364
parents e67e3bd6 baf2fe48
Loading
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -139,11 +139,6 @@ class MainActivity : AppCompatActivity() {
                    )
                } else if (exception != null) {
                    Timber.e(exception, "Login failed! message: ${exception?.localizedMessage}")
                    ApplicationDialogFragment(
                        title = getString(R.string.sign_in_failed_title),
                        message = getString(R.string.sign_in_failed_desc),
                        positiveButtonText = getString(R.string.ok)
                    ).show(supportFragmentManager, TAG)
                }
            }
        }
+9 −9
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
    override suspend fun getHomeScreenData(): Any {
        val homeScreenData = mutableMapOf<String, List<App>>()
        val homeElements = createTopChartElements()
        val authData = loginSourceRepository.gplayAuth ?: return homeScreenData
        val authData = loginSourceRepository.gplayAuth!!

        homeElements.forEach {
            val chart = it.value.keys.iterator().next()
@@ -77,7 +77,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
        query: String,
        subBundle: MutableSet<SearchBundle.SubBundle>?
    ): Pair<List<App>, MutableSet<SearchBundle.SubBundle>> {
        var authData = loginSourceRepository.gplayAuth ?: return Pair(emptyList(), mutableSetOf())
        var authData = loginSourceRepository.gplayAuth!!
        val searchHelper =
            SearchHelper(authData).using(gPlayHttpClient)

@@ -102,7 +102,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
    }

    override suspend fun getSearchSuggestions(query: String): List<SearchSuggestEntry> {
        val authData = loginSourceRepository.gplayAuth ?: return listOf()
        val authData = loginSourceRepository.gplayAuth!!

        val searchData = mutableListOf<SearchSuggestEntry>()
        withContext(Dispatchers.IO) {
@@ -113,7 +113,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
    }

    override suspend fun getAppsByCategory(category: String, pageUrl: String?): StreamCluster {
        val authData = loginSourceRepository.gplayAuth ?: return StreamCluster()
        val authData = loginSourceRepository.gplayAuth!!

        val subCategoryHelper =
            CategoryAppsHelper(authData).using(gPlayHttpClient)
@@ -131,7 +131,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
            return categoryList
        }

        val authData = loginSourceRepository.gplayAuth ?: return categoryList
        val authData = loginSourceRepository.gplayAuth!!

        withContext(Dispatchers.IO) {
            val categoryHelper = CategoryHelper(authData).using(gPlayHttpClient)
@@ -142,7 +142,7 @@ class GplayStoreRepositoryImpl @Inject constructor(

    override suspend fun getAppDetails(packageNameOrId: String): App? {
        var appDetails: App?
        val authData = loginSourceRepository.gplayAuth ?: return null
        val authData = loginSourceRepository.gplayAuth!!

        withContext(Dispatchers.IO) {
            val appDetailsHelper = AppDetailsHelper(authData).using(gPlayHttpClient)
@@ -153,7 +153,7 @@ class GplayStoreRepositoryImpl @Inject constructor(

    override suspend fun getAppsDetails(packageNamesOrIds: List<String>): List<App> {
        val appDetailsList = mutableListOf<App>()
        val authData = loginSourceRepository.gplayAuth ?: return appDetailsList
        val authData = loginSourceRepository.gplayAuth!!

        withContext(Dispatchers.IO) {
            val appDetailsHelper = AppDetailsHelper(authData).using(gPlayHttpClient)
@@ -185,7 +185,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
        offerType: Int
    ): List<File> {
        val downloadData = mutableListOf<File>()
        val authData = loginSourceRepository.gplayAuth ?: return downloadData
        val authData = loginSourceRepository.gplayAuth!!

        withContext(Dispatchers.IO) {
            val version = versionCode?.let { it as Int } ?: -1
@@ -202,7 +202,7 @@ class GplayStoreRepositoryImpl @Inject constructor(
        offerType: Int
    ): List<File> {
        val downloadData = mutableListOf<File>()
        val authData = loginSourceRepository.gplayAuth ?: return downloadData
        val authData = loginSourceRepository.gplayAuth!!

        withContext(Dispatchers.IO) {
            val purchaseHelper = PurchaseHelper(authData).using(gPlayHttpClient)
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@ class LoginCommon @Inject constructor(
        loginDataStore.saveUserType(user)
    }

    fun getUserType(): User {
        return loginDataStore.getUserType()
    }

    suspend fun saveGoogleLogin(email: String, oauth: String) {
        loginDataStore.saveGoogleLogin(email, oauth)
    }
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ package foundation.e.apps.data.login
import com.aurora.gplayapi.data.models.AuthData
import foundation.e.apps.data.ResultSupreme
import foundation.e.apps.data.enums.User
import foundation.e.apps.data.login.exceptions.GPlayLoginException
import javax.inject.Inject
import javax.inject.Singleton

@@ -31,6 +32,8 @@ class LoginSourceRepository @Inject constructor(
) {

    var gplayAuth: AuthData? = null
        get() = field ?: throw GPlayLoginException(false, "AuthData is not available!", getUserType())

    suspend fun getAuthObjects(clearAuthTypes: List<String> = listOf()): List<AuthObject> {

        val authObjectsLocal = ArrayList<AuthObject>()
@@ -71,4 +74,8 @@ class LoginSourceRepository @Inject constructor(
        this.gplayAuth = validateAuthData.data
        return validateAuthData
    }

    private fun getUserType(): User {
        return loginCommon.getUserType()
    }
}