Repository navigation
feat: add shared Java guard module and class access policy - #23
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
:guardAndroid module (PluginApi-guard): the Java file and class guard shared by engines that run Java (NodeJSPlugin/Javet, PluginFixtures/GraalJS).File, file streams,RandomAccessFile, nioPath/Files,ZipFile/JarFile,Scanner,Environment,Class/reflection,Runtime/ProcessBuilderandSystemare replaced by same-shaped classes that open files through host descriptors (HostBridge.openFile) and the hostfsmodule, so the engine app needs no storage permission. Denials are written once per name to the project log.ClassAccess(presets Off/Safe/Wide/Custom, allow/deny lists, a rules switch) andLoadRequest.classAccess, carried over Wire. Manifest attributejava(ATTR_JAVA).JavaGuardConformance(device suite, engine-neutral),FolderFiles, and anopenFilehook inEngineHarness.Testing
:contract:test(EngineSessionTest 16/16 incl. the new round trips),:guard:testDebugUnitTest(ClassRulesTest 7/7).:guard:connectedDebugAndroidTeston an API 36 x86_64 emulator: 23/23 (differential tests against the real classes, public API parity, boundary tests).JavaGuardConformancepasses 11/11 on the emulator in both NodeJSPlugin and the GraalJS fixture (follow-up PRs there).🤖 Generated with Claude Code