Skip to content

feat: proot debug toggle - #2563

Open
RohitKushvaha01 wants to merge 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:proot-debug
Open

feat: proot debug toggle#2563
RohitKushvaha01 wants to merge 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:proot-debug

Conversation

@RohitKushvaha01

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a persisted PRoot debugging toggle that propagates through the Cordova terminal bridge and conditionally sets PROOT_VERBOSE=2 for newly launched processes.

  • Adds the prootDebug terminal default and maintenance-settings checkbox.
  • Adds setProotDebug actions to foreground and background native executors.
  • Applies PROOT_VERBOSE=2 while building process environments when native debug state is enabled.

Confidence Score: 4/5

The persisted setting must be applied to native state at startup before this PR is safe to merge.

After an Android process restart, the UI restores prootDebug as enabled while ProcessManager.prootDebug returns to false, causing subsequent PRoot launches to omit the requested verbose logging until the user toggles the setting again.

Files Needing Attention: src/settings/terminalSettings.js and the terminal native initialization path

Important Files Changed

Filename Overview
src/settings/terminalSettings.js Adds and persists the toggle, but synchronizes native state only during direct UI interaction, so restored values are not applied.
src/plugins/terminal/src/android/ProcessManager.java Adds shared debug state and conditionally injects PROOT_VERBOSE into each newly built process environment.
src/plugins/terminal/src/android/Executor.java Adds the foreground Cordova action that updates the shared debug flag.
src/plugins/terminal/src/android/BackgroundExecutor.java Adds the equivalent background Cordova action.
src/plugins/terminal/www/Executor.js Exposes the new native action through the existing foreground and background executor instances.
src/components/terminal/terminalDefaults.js Adds the false-by-default persisted terminal preference.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  UI[Terminal settings toggle] --> Persist[Persist prootDebug]
  UI --> FG[Foreground Executor bridge]
  UI --> BG[Background Executor bridge]
  FG --> Flag[ProcessManager.prootDebug]
  BG --> Flag
  Flag --> Env[Build process environment]
  Env --> PRoot[PRoot with PROOT_VERBOSE=2]
  Persist -. app restart does not restore native flag .-> Flag
Loading

Reviews (1): Last reviewed commit: "feat: proot debug toggle" | Re-trigger Greptile

Comment on lines +332 to +333
Executor.setProotDebug(value);
Executor.BackgroundExecutor.setProotDebug(value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Persisted debug state is lost

When Android restarts the application process after PRoot Debug has been enabled, settings initialization restores the checkbox without calling these native setters, so ProcessManager.prootDebug remains false and newly launched PRoot processes omit PROOT_VERBOSE=2.

Knowledge Base Used: Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant