Manhastro: Fix auth cookie duplicated (#9798)

* Fix auth cookie duplicated

* Remove looper
This commit is contained in:
Chopper 2025-07-27 03:36:31 -03:00 committed by Draff
parent e5ab6fbb21
commit dad8bbf372
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.Manhastro'
themePkg = 'madara'
baseUrl = 'https://manhastro.net'
overrideVersionCode = 8
overrideVersionCode = 9
isNsfw = true
}

View File

@ -6,6 +6,7 @@ import android.os.Handler
import android.os.Looper
import android.util.Base64
import android.util.Log
import android.webkit.CookieManager
import android.widget.Toast
import androidx.preference.EditTextPreference
import androidx.preference.PreferenceScreen
@ -52,9 +53,14 @@ class Manhastro :
private val application: Application by lazy { Injekt.get<Application>() }
private val cookieManager by lazy { CookieManager.getInstance() }
private var showWarning: Boolean = true
private val authCookie: Cookie by lazy {
cookieManager.removeAllCookies(null)
cookieManager.flush()
val cookieJson = preferences.getString(COOKIE_STORAGE_PREF, "") as String
if (cookieJson.isBlank()) {
return@lazy doAuth().also(::upsetCookie)