GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Extract Root and Shizuku command execution by Dhangofa · Pull Request #9 · Dhangofa/NetToggle

Conversation

@Dhangofa

@Dhangofa Dhangofa commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes Phase 2 of the NetToggle modular refactor by moving Root and Shizuku shell execution out of NetworkTileService into dedicated command modules.

The refactor preserves the existing network-switching behavior while introducing structured command results for future error reporting.

New Command Modules

  • Added CommandExecutor as the shared execution interface.
  • Added RootCommandExecutor for commands executed through su.
  • Added ShizukuCommandExecutor for commands executed through Shizuku.
  • Added CommandExecutorFactory to select the appropriate executor from the saved execution mode.
  • Added ProcessResultReader to collect process results.
  • Added StreamCollector to read stdout and stderr concurrently.
  • Added CommandResult to store:
    • executed command
    • exit code
    • stdout
    • stderr
    • exception details
    • success state

NetworkTileService Changes

  • Removed direct Root process execution.
  • Removed direct Shizuku process execution and reflection handling.
  • Removed the local CommandResult implementation.
  • Removed duplicated process stream-reading logic.
  • Routed commands through CommandExecutorFactory.
  • Updated readback and apply operations to use the shared CommandResult model.
  • Preserved existing SIM resolution and network mode behavior.

Reliability Improvements

  • stdout and stderr are now consumed concurrently while commands run.
  • Command failures retain structured diagnostic information instead of returning only a boolean.
  • Root and Shizuku now use the same result contract.
  • The command layer is ready for the planned copyable error-reporting interface.

Behavior Preserved

  • Root execution mode

  • Shizuku execution mode

  • Auto Target SIM detection

  • Manual SIM 1 and SIM 2 selection

  • Subscription-ID based network mode readback

  • Physical-slot based network mode application

  • Cached Quick Settings tile state

  • Existing tile labels and icons

  • Existing mode cycle:

    4G Only → 5G Only → Preferred 5G → Preferred 4G

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Dhangofa added 10 commits August 11, 2026 13:05
@Dhangofa
Added a shared CommandExecutor interface
a2edafe
@Dhangofa
Added CommandExecutorFactory for execution-mode selection
007b695
@Dhangofa
Added CommandResult with command, exit code, stdout, stderr, and exce…
faad2e4
…ption details
@Dhangofa
Changed the location to model folder
a314dc3
@Dhangofa
Added concurrent stdout and stderr stream collection
9f01841
@Dhangofa
Added dedicated Root command executor
2711b59
@Dhangofa
Added dedicated Shizuku command executor
a59100f
@Dhangofa
Prepared the command layer for detailed in-app error reporting
8c63795
@Dhangofa
Refactor NetworkTileService to use modular command executors
266bc76
- Removed direct Root and Shizuku command execution from NetworkTileService.
- Removed the local CommandResult implementation and legacy stream-reading methods.
- Routed shell commands through CommandExecutorFactory based on the selected execution mode.
- Updated command handling to use the shared CommandResult model.
- Updated command result access to use exit code, stdout, and success getters.
- Preserved existing network mode readback, SIM resolution, tile state, and switching behavior.
@Dhangofa
Fix newline character in StreamCollector
4b701f9
- Corrected the broken newline character literal in StreamCollector.
- Restored valid Java syntax for appending captured process output.
- Fixes the Phase 2 release compilation failure.
@Dhangofa
Dhangofa merged commit 6b6dcb3 into main Aug 11, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Dhangofa
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.