This commit is contained in:
kunfei
2023-06-16 16:52:03 +08:00
parent e071f6cfdf
commit ad904f660b
6 changed files with 26 additions and 22 deletions

View File

@@ -49,6 +49,7 @@ object RhinoClassShutter : ClassShutter {
"java.security.AccessController",
"java.nio.file.Paths",
"java.nio.file.Files",
"io.legado.app.data.AppDatabase",
"io.legado.app.data.AppDatabaseKt",
"io.legado.app.utils.ContextExtensionsKt",
"android.content.Intent",

View File

@@ -52,7 +52,13 @@ object RhinoWrapFactory : WrapFactory() {
): Scriptable? {
val classShutter = RhinoClassShutter
return when (javaObject) {
is ClassLoader, is Class<*>, is Member, is android.content.Context -> null
is ClassLoader,
is Class<*>,
is Member,
is android.content.Context -> {
null
}
else -> {
val name = javaObject.javaClass.name
if (classShutter.visibleToScripts(name)) {