This commit is contained in:
Horis
2025-04-19 10:33:50 +08:00
parent d81a5e69ba
commit 5e9672924e
3 changed files with 10 additions and 5 deletions

View File

@@ -22,7 +22,6 @@ import okhttp3.internal.notifyAll
import okhttp3.internal.wait
import okio.Buffer
import okio.BufferedSink
import okio.ByteString.Companion.encode
import okio.Pipe
import okio.Timeout
import okio.buffer
@@ -211,9 +210,8 @@ class ObsoleteUrlFactory(private var client: OkHttpClient) : URLStreamHandlerFac
override fun getHeaderField(position: Int): String? {
return try {
val headers = headers
if (position < 0 || position >= headers.size) null else headers.value(
position
).encode().string(Charsets.ISO_8859_1)
if (position < 0 || position >= headers.size) null
else headers.value(position)
} catch (e: IOException) {
null
}
@@ -1120,7 +1118,9 @@ class ObsoleteUrlFactory(private var client: OkHttpClient) : URLStreamHandlerFac
var j = i + Character.charCount(c)
while (j < length) {
c = s.codePointAt(j)
buffer.writeUtf8CodePoint((if (c > '\u001f'.code && c < '\u007f'.code) c else '?') as Int)
buffer.writeUtf8CodePoint(
(if (c > '\u001f'.code && c < '\u007f'.code) c else '?') as Int
)
j += Character.charCount(c)
}
return buffer.readUtf8()

View File

@@ -13,6 +13,7 @@ import io.legado.app.utils.isAbsUrl
import io.legado.app.utils.isJsonObject
import kotlinx.coroutines.runBlocking
import org.mozilla.javascript.Scriptable
import org.mozilla.javascript.ScriptableObject
import splitties.init.appCtx
import java.io.File
import java.lang.ref.WeakReference
@@ -66,6 +67,9 @@ object SharedJsScope {
} else {
RhinoScriptEngine.eval(jsLib, scope, coroutineContext)
}
if (scope is ScriptableObject) {
scope.sealObject()
}
scopeMap[key] = WeakReference(scope)
}
return scope

View File

@@ -115,6 +115,7 @@ open class MangaVH<VB : ViewBinding>(val binding: VB, private val context: Conte
itemView.updateLayoutParams<ViewGroup.LayoutParams> {
height = ViewGroup.LayoutParams.MATCH_PARENT
}
itemView.minimumHeight = 0
mImage.updateLayoutParams<FrameLayout.LayoutParams> {
height = ViewGroup.LayoutParams.MATCH_PARENT
gravity = Gravity.CENTER