From f1aaf1d640f71fbaeb651584ffaee1afbc1d371e Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 25 Aug 2021 16:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/data/entities/RssSource.kt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/RssSource.kt b/app/src/main/java/io/legado/app/data/entities/RssSource.kt index ca09ac7b8..6195bfa21 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssSource.kt @@ -4,13 +4,9 @@ import android.os.Parcelable import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey -import io.legado.app.constant.AppConst -import io.legado.app.help.CacheManager -import io.legado.app.help.http.CookieStore import io.legado.app.utils.ACache import kotlinx.parcelize.Parcelize import splitties.init.appCtx -import javax.script.SimpleBindings @Parcelize @Entity(tableName = "rssSources", indices = [(Index(value = ["sourceUrl"], unique = false))]) @@ -85,17 +81,12 @@ data class RssSource( val aCache = ACache.get(appCtx, "rssSortUrl") a = aCache.getAsString(sourceUrl) ?: "" if (a.isBlank()) { - val bindings = SimpleBindings() - bindings["baseUrl"] = sourceUrl - bindings["java"] = this - bindings["cookie"] = CookieStore - bindings["cache"] = CacheManager val jsStr = if (sortUrl!!.startsWith("@")) { sortUrl!!.substring(3) } else { sortUrl!!.substring(4, sortUrl!!.lastIndexOf("<")) } - a = AppConst.SCRIPT_ENGINE.eval(jsStr, bindings).toString() + a = evalJS(jsStr).toString() aCache.put(sourceUrl, a) } }