mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user