Skip to content

feat: add shared Java guard module and class access policy - #23

Merged
NenkaLab merged 1 commit into
masterfrom
feat/java-guard
Nov 15, 2026
Merged

NenkaLab merged 1 commit into
masterfrom
feat/java-guard

Conversation

@NenkaLab

Copy link
Copy Markdown
Member

What changed

  • New :guard Android module (PluginApi-guard): the Java file and class guard shared by engines that run Java (NodeJSPlugin/Javet, PluginFixtures/GraalJS). File, file streams, RandomAccessFile, nio Path/Files, ZipFile/JarFile, Scanner, Environment, Class/reflection, Runtime/ProcessBuilder and System are replaced by same-shaped classes that open files through host descriptors (HostBridge.openFile) and the host fs module, so the engine app needs no storage permission. Denials are written once per name to the project log.
  • Contract: ClassAccess (presets Off/Safe/Wide/Custom, allow/deny lists, a rules switch) and LoadRequest.classAccess, carried over Wire. Manifest attribute java (ATTR_JAVA).
  • TCK: JavaGuardConformance (device suite, engine-neutral), FolderFiles, and an openFile hook in EngineHarness.
  • readme documents the module.

Testing

  • :contract:test (EngineSessionTest 16/16 incl. the new round trips), :guard:testDebugUnitTest (ClassRulesTest 7/7).
  • :guard:connectedDebugAndroidTest on an API 36 x86_64 emulator: 23/23 (differential tests against the real classes, public API parity, boundary tests).
  • JavaGuardConformance passes 11/11 on the emulator in both NodeJSPlugin and the GraalJS fixture (follow-up PRs there).

🤖 Generated with Claude Code

@NenkaLab
NenkaLab merged commit 5ffecb0 into master Nov 15, 2026
1 check passed
@NenkaLab
NenkaLab deleted the feat/java-guard branch November 15, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant