From 5003f66fffabb4c8439bfe7f8d51a9a86507937b Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sun, 13 Apr 2025 18:32:26 +0800 Subject: [PATCH] Revert "AuthProvider: Use actual device properties to generate anonymous auth" This reverts commit 3b41525c5041c66600e8af632518f5ac68d319dd. --- .../java/com/aurora/store/data/model/Auth.kt | 25 +++++++++++++++++++ .../store/data/providers/AuthProvider.kt | 11 ++++---- 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/com/aurora/store/data/model/Auth.kt diff --git a/app/src/main/java/com/aurora/store/data/model/Auth.kt b/app/src/main/java/com/aurora/store/data/model/Auth.kt new file mode 100644 index 000000000..ea8fae583 --- /dev/null +++ b/app/src/main/java/com/aurora/store/data/model/Auth.kt @@ -0,0 +1,25 @@ +/* + * Aurora Store + * Copyright (C) 2021, Rahul Kumar Patel + * + * 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 . + * + */ + +package com.aurora.store.data.model + +data class Auth( + val email: String, + val auth: String +) diff --git a/app/src/main/java/com/aurora/store/data/providers/AuthProvider.kt b/app/src/main/java/com/aurora/store/data/providers/AuthProvider.kt index 358e844b3..d7c78d405 100644 --- a/app/src/main/java/com/aurora/store/data/providers/AuthProvider.kt +++ b/app/src/main/java/com/aurora/store/data/providers/AuthProvider.kt @@ -23,10 +23,12 @@ import android.content.Context import android.util.Log import com.aurora.gplayapi.data.models.AuthData import com.aurora.gplayapi.data.models.PlayResponse +import com.aurora.gplayapi.helpers.AppDetailsHelper import com.aurora.gplayapi.helpers.AuthHelper import com.aurora.gplayapi.network.IHttpClient import com.aurora.store.R import com.aurora.store.data.model.AccountType +import com.aurora.store.data.model.Auth import com.aurora.store.util.Preferences import com.aurora.store.util.Preferences.PREFERENCE_AUTH_DATA import com.aurora.store.util.Preferences.PREFERENCE_DISPENSER_URLS @@ -111,18 +113,15 @@ class AuthProvider @Inject constructor( suspend fun buildAnonymousAuthData(): Result { return withContext(Dispatchers.IO) { try { - val playResponse = httpClient.postAuth( - dispenserURL!!, - gson.toJson(spoofProvider.deviceProperties).toByteArray() - ).also { + val playResponse = httpClient.getAuth(dispenserURL!!).also { if (!it.isSuccessful) throwError(it, context) } - val auth = gson.fromJson(String(playResponse.responseBytes), AuthData::class.java) + val auth = gson.fromJson(String(playResponse.responseBytes), Auth::class.java) return@withContext Result.success( AuthHelper.build( email = auth.email, - token = auth.authToken, + token = auth.auth, tokenType = AuthHelper.Token.AUTH, isAnonymous = true, properties = spoofProvider.deviceProperties,