Remove usage of okhttp internal variables (#9216)

* Remove usage of okhttp internal variables

inaccessable or removed in new version of okhttp

* lint

* lint :2
This commit is contained in:
AwkwardPeak7 2025-06-14 02:08:43 +05:00 committed by Draff
parent 3244e3fe53
commit 49ecc98bce
Signed by: Draff
GPG Key ID: E8A89F3211677653
10 changed files with 15 additions and 18 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.IgnisComic' extClass = '.IgnisComic'
themePkg = 'mangathemesia' themePkg = 'mangathemesia'
baseUrl = 'https://manhuaga.com' baseUrl = 'https://manhuaga.com'
overrideVersionCode = 2 overrideVersionCode = 3
isNsfw = false isNsfw = false
} }

View File

@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.extension.en.igniscomic
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.internal.http.HTTP_INTERNAL_SERVER_ERROR import java.net.HttpURLConnection.HTTP_INTERNAL_ERROR
import okhttp3.internal.http.HTTP_OK import java.net.HttpURLConnection.HTTP_OK
class IgnisComic : MangaThemesia( class IgnisComic : MangaThemesia(
"Ignis Comic", "Ignis Comic",
@ -13,7 +13,7 @@ class IgnisComic : MangaThemesia(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor { chain -> .addInterceptor { chain ->
val response = chain.proceed(chain.request()) val response = chain.proceed(chain.request())
response.takeIf { it.code < HTTP_INTERNAL_SERVER_ERROR } response.takeIf { it.code < HTTP_INTERNAL_ERROR }
?: response.newBuilder() ?: response.newBuilder()
.code(HTTP_OK) .code(HTTP_OK)
.build() .build()

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Mangamo' extName = 'Mangamo'
extClass = '.Mangamo' extClass = '.Mangamo'
extVersionCode = 4 extVersionCode = 5
isNsfw = false isNsfw = false
} }

View File

@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.network.POST
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.internal.EMPTY_HEADERS
class MangamoAuth( class MangamoAuth(
private val helper: MangamoHelper, private val helper: MangamoHelper,
@ -53,8 +52,7 @@ class MangamoAuth(
val googleIdentityResponse = client.newCall( val googleIdentityResponse = client.newCall(
POST( POST(
"https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=${MangamoConstants.FIREBASE_API_KEY}", "https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=${MangamoConstants.FIREBASE_API_KEY}",
EMPTY_HEADERS, body = "{\"token\":\"$customToken\",\"returnSecureToken\":true}".toRequestBody(),
"{\"token\":\"$customToken\",\"returnSecureToken\":true}".toRequestBody(),
), ),
).execute() ).execute()
@ -97,8 +95,7 @@ class MangamoAuth(
val googleIdentityResponse = client.newCall( val googleIdentityResponse = client.newCall(
POST( POST(
"https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${MangamoConstants.FIREBASE_API_KEY}", "https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${MangamoConstants.FIREBASE_API_KEY}",
EMPTY_HEADERS, body = "{\"returnSecureToken\":true}".toRequestBody(),
"{\"returnSecureToken\":true}".toRequestBody(),
), ),
).execute() ).execute()

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Gekkou Scans' extName = 'Gekkou Scans'
extClass = '.GekkouScans' extClass = '.GekkouScans'
extVersionCode = 42 extVersionCode = 43
isNsfw = true isNsfw = true
} }

View File

@ -14,8 +14,8 @@ import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import okhttp3.internal.http.HTTP_FORBIDDEN
import java.io.IOException import java.io.IOException
import java.net.HttpURLConnection.HTTP_FORBIDDEN
class GekkouScans : HttpSource() { class GekkouScans : HttpSource() {

View File

@ -3,7 +3,7 @@ ext {
extClass = '.ImperioDaBritannia' extClass = '.ImperioDaBritannia'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://imperiodabritannia.com' baseUrl = 'https://imperiodabritannia.com'
overrideVersionCode = 3 overrideVersionCode = 4
isNsfw = false isNsfw = false
} }

View File

@ -3,8 +3,8 @@ package eu.kanade.tachiyomi.extension.pt.imperiodabritannia
import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.internal.http.HTTP_FORBIDDEN import java.net.HttpURLConnection.HTTP_FORBIDDEN
import okhttp3.internal.http.HTTP_OK import java.net.HttpURLConnection.HTTP_OK
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Taiyō' extName = 'Taiyō'
extClass = '.Taiyo' extClass = '.Taiyo'
extVersionCode = 7 extVersionCode = 8
isNsfw = true isNsfw = true
} }

View File

@ -32,13 +32,13 @@ import okhttp3.MediaType.Companion.toMediaType
import okhttp3.Request import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response import okhttp3.Response
import okhttp3.internal.http.HTTP_FORBIDDEN
import okhttp3.internal.http.HTTP_UNAUTHORIZED
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.jsoup.select.Elements import org.jsoup.select.Elements
import rx.Observable import rx.Observable
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.net.HttpURLConnection.HTTP_FORBIDDEN
import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale