Horis 1 год назад
Родитель
Сommit
5e209cccf6

+ 5 - 5
app/src/main/java/io/legado/app/help/http/ObsoleteUrlFactory.kt

@@ -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()

+ 4 - 0
app/src/main/java/io/legado/app/model/SharedJsScope.kt

@@ -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

+ 1 - 0
app/src/main/java/io/legado/app/ui/book/manga/recyclerview/MangaVH.kt

@@ -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