mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
This commit is contained in:
@@ -6,7 +6,7 @@ import org.mozilla.javascript.Scriptable
|
||||
class ProtectedNativeJavaClass(
|
||||
scope: Scriptable,
|
||||
javaClass: Class<*>,
|
||||
private val protectedName: HashSet<String>
|
||||
private val protectedName: Set<String>
|
||||
) : NativeJavaClass(scope, javaClass) {
|
||||
|
||||
override fun has(
|
||||
|
||||
@@ -34,6 +34,7 @@ import java.io.ObjectOutputStream
|
||||
import java.lang.reflect.Member
|
||||
import java.nio.file.FileSystem
|
||||
import java.nio.file.Path
|
||||
import java.util.Collections
|
||||
|
||||
/**
|
||||
* This class prevents script access to certain sensitive classes.
|
||||
@@ -94,14 +95,19 @@ object RhinoClassShutter : ClassShutter {
|
||||
"androidx.sqlite.db",
|
||||
"androidx.room",
|
||||
"cn.hutool.core.io",
|
||||
"cn.hutool.core.lang.reflect",
|
||||
"dalvik.system",
|
||||
"java.nio.file",
|
||||
"java.lang.reflect",
|
||||
"java.lang.invoke",
|
||||
"io.legado.app.data.dao",
|
||||
)
|
||||
"com.script",
|
||||
"org.mozilla",
|
||||
).let { Collections.unmodifiableSet(it) }
|
||||
}
|
||||
|
||||
private val systemClassProtectedName by lazy {
|
||||
hashSetOf("load", "loadLibrary", "exit")
|
||||
Collections.unmodifiableSet(hashSetOf("load", "loadLibrary", "exit"))
|
||||
}
|
||||
|
||||
fun visibleToScripts(obj: Any): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user