diff --git a/package.json b/package.json index 1613697a..296f835b 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "markdown-to-jsx": "^7.4.0", "material-icons": "^1.10.8", "material-ui-confirm": "^3.0.16", - "modfs": "^1.3.2", + "modfs": "^1.4.2", "monaco-editor": "^0.48.0", "monaco-editor-core": "^0.50.0", "monaco-languageclient": "^6.5.0", diff --git a/src/native/IsolatedEval/index.ts b/src/native/IsolatedEval/index.ts index 406ef5e0..4bc078b7 100644 --- a/src/native/IsolatedEval/index.ts +++ b/src/native/IsolatedEval/index.ts @@ -22,6 +22,7 @@ import { IsoXMLSerializer } from "./IsoXMLSerializer"; import { IsolatedEvalError } from "./IsolatedEvalError"; import { IsolatedFunctionBlockError } from "./IsolatedFunctionBlockError"; import { InternalReact } from "@Activitys/ModConfActivity/components/ModConfView/libs"; +import ModFS from "modfs"; type IsoModule = { exports: { @@ -71,6 +72,7 @@ class IsolatedEval { os: os, BuildConfig: BuildConfig, Build: Build, + ModFS: ModFS, Native: Native, React: InternalReact, setInterval: setInterval, @@ -138,6 +140,7 @@ class IsolatedEval { this._prototypeWhitelist.set(Chooser, new Set()); this._prototypeWhitelist.set(Path, new Set()); this._prototypeWhitelist.set(React, new Set()); + this._prototypeWhitelist.set(ModFS, new Set()); this.require = this.require.bind(this); this._resolveModule = this._resolveModule.bind(this); diff --git a/src/native/Shell.ts b/src/native/Shell.ts index 883472e6..4d109cb3 100644 --- a/src/native/Shell.ts +++ b/src/native/Shell.ts @@ -40,6 +40,8 @@ interface NativeShellV2 extends NativeShell { }; } +type RootManager = "Magisk" | "KernelSU" | "APatchSU" | "Unknown"; + /** * Run Shell commands native on Android */ @@ -152,7 +154,7 @@ class Shell extends Native { } } - public static getRootManager(): string { + public static getRootManager(): RootManager { if (this.isMagiskSU()) { return "Magisk"; } else if (this.isKernelSU()) {