Skip to content

feat: multi-tab UI, broadcast automation, app shortcuts, multi-SIM targeting - #27

Merged
Dhangofa merged 394 commits into
mainfrom
dev
Sep 14, 2026
Merged

Dhangofa merged 394 commits into
mainfrom
dev

Conversation

@Dhangofa

Copy link
Copy Markdown
Owner

📌 Overview

This PR merges all new features, architectural refactors, UI redesigns, and localization updates from the dev branch into main. It transforms NetToggle into a comprehensive cellular network switching and automation suite for Android, supporting modern privileged execution (Root & Shizuku), multi-SIM management, OS routines/shortcuts, and background broadcast automation.


🚀 Key Features & Changes

1. 🗂️ Modern 3-Tab Architecture & Navigation

  • Home Tab: Core Quick Tile cycle manager, execution mode switcher (Root / Shizuku), target SIM selector, auto-restore cooldown settings, and real-time status badges.
  • Automation Tab:
    • App Shortcuts & Routines: Configure up to 4 native launcher shortcuts and 1-tap pinned widgets with live hardware capability filtering; integrates seamlessly with Samsung Bixby Routines and Google Assistant.
    • Broadcast Automation: Opt-in background broadcast receiver (com.dhangofa.networktoggle.SET_MODE) with secure authentication tokens, interactive ADB command preview, and instant execution testing.
  • Guides & Info Tab: Step-by-step setup walkthroughs for KernelSU, APatch, Magisk, and Shizuku, complete with troubleshooting tips and developer info.

2. 🤖 Broadcast Automation Engine

  • Background Automation Receiver: Added AutomationReceiver to process silent network mode changes from third-party tools (Tasker, MacroDroid, Automate, ADB).
  • Security Token Validation: Added generated token protection to prevent unauthorized broadcast execution from third-party apps.
  • Interactive ADB Preview: Generates real-time, copyable am broadcast shell commands directly from the UI.

3. 📱 App Shortcuts & Zero-UI Launcher Actions

  • Added ShortcutActionActivity (translucent, zero-UI activity) for instant shortcut execution without launching the main dashboard.
  • Dynamic hardware capability resolution per SIM slot ensuring shortcuts only present modes supported by the modem.

4. 📶 Enhanced Dual-SIM & Telephony Layer

  • Target SIM Selection: Added support for Auto, SIM 1, SIM 2, and Both SIMs (simultaneous batch switching).
  • Refactored Telephony Architecture:
    • Modularized controller hierarchy: ShizukuBinderModeController, ModernRootModeController, and LegacyRootModeController.
    • Added PrivilegedModeReader and ShizukuBinderModeReader for accurate, zero-latency network mode detection.
  • Runtime Phone State Permission: Added PhoneStatePermissionManager with persistent bottom sheet rationale and direct system settings fallback for physical SIM slot detection.

5. 🎨 Theming, AMOLED & Dynamic Colors

  • Integrated ThemeController supporting Light, Dark, Auto (System), and Pure AMOLED Black modes.
  • Added Android 12+ Material You dynamic color scheme support (values-v31 / values-night-v31).
  • Custom splash screen theme (Theme.NetToggle.Splash).

6. 🌐 Comprehensive Internationalization (i18n)

  • Added full translations across all UI components, dialogs, and error diagnostics for:
    • 🇧🇩 Bengali (values-bn)
    • 🇪🇸 Spanish (values-es)
    • 🇵🇹 Portuguese (values-pt)
    • 🇷🇺 Russian (values-ru)
    • 🇨🇳 Simplified Chinese (values-zh-rCN)

7. 🛠️ Diagnostics & Quality of Life

  • Redesigned DiagnosticUiController with real-time permission status, SELinux enforcement checks, telephony state inspection, and one-tap diagnostic reporting.
  • Enhanced QS tile icon synchronization and auto-restore background watchdog.
  • Fully updated project README.md and documentation.

🧪 Verification & Testing

  • Verified Root mode execution on Magisk, KernelSU, and APatch.
  • Verified Shizuku mode binder transactions on Android 11 through Android 15+.
  • Verified dual-SIM switching and capability filtering across physical and eSIM slots.
  • Verified broadcast intent handling with and without security tokens.
  • Tested launcher shortcuts and pinned widgets on multiple OEM launchers.
  • Confirmed zero memory leaks and proper lifecycle cleanup in all tab controllers.

- Cleaned up line endings and preserved capability pruning logic (5G, 3G, 2G support checks).
- Cleaned up unused imports (Bitmap, Canvas, Color, Paint, Typeface, Icon, Intent, PendingIntent, Build).
- Added try...finally block when overriding targetSim during TargetSim.BOTH cycle execution to guarantee overrideTargetSim is restored to null.
- Appended detailed failure descriptions from result1 and result2 in CommandResult.failed.
- Updated dual-SIM tile badge indicator from "B" to "+".
- Added isGrantedCallbackDispatched boolean guard to ensure onGranted callback triggers at most once per check cycle.
- Prevents redundant carrier configuration and capability resolution queries on repeated activity onResume events.
- Removed unused android.os.Build import and cleaned up dialog helper methods.
- Added process destruction (rootCheckProcess.destroy()) and background thread interruption (rootCheckThread.interrupt()) during cleanup to prevent leaked background processes.
- Extracted execution mode selection card logic (Root vs Shizuku) into a standalone controller.
- Managed active selection state, interactive radio chip styling, click listeners, and status synchronization with ExecutionStateController.
- Cleaned up trailing line formatting and maintained SIM slot selection logic.
- Cleaned up trailing whitespace and preserved quick settings tile icon rendering utilities.
- Added explicit handling for TargetSim.BOTH mode during tile cycle synchronization.
- Sequentially applies fallback network mode to SIM 1 and SIM 2 with try...finally override cleanup, tracking partial successes and error states.
- Cleaned up line endings and maintained Quick Tile cycle selection UI bindings.
- Extracted diagnostic error banner, log modal dialog, and copy-to-clipboard functionality into dedicated DiagnosticUiController.
- Created controller for External Automation and Broadcast Protocol configuration on the Automate tab.
- Manages External Automation toggle, authorization checks, and dynamic status badge (● READY / ○ DISABLED).
- Provides 8-character random token generation and clipboard copying.
- Interactive mode chips (5G, 4G, PREF_5G, PREF_4G, PREF_3G, 2G) and SIM chips (1, 2, 3) with device capability filtering.
- Real-time Shell / ADB command preview generator with syntax highlighting and one-tap copy.
- Standard Android Intent specifications generator and live "Test Broadcast" action dispatcher.
- Created controller for the Routine Shortcuts sub-tab supporting up to 4 routine shortcuts.
- Implemented automatic real-time saving to AppPreferences and Android ShortcutManager on text and spinner changes.
- Added Pin to Home launcher action via ShortcutManager.requestPinShortcut.
- Added live Test Shortcut action invoking AutomationExecutor.
- Added dynamic shortcut count tracking badge (# of 4) and limit banner toggle.
- Handled soft keyboard visibility and scroll-linked Add Shortcut FAB animations.
- Created controller for the dedicated Guides tab.
- Binds all 6 interactive guide cards (Execution Mode, Target SIM & Quick Tile Cycle, Quick Tile, App Shortcuts, Broadcasts, Troubleshooting) with popup animations and external documentation links.
- Binds top header elements including app logo, title, version badge, GPL v3 license link, and developer social pill.
- Extracted footer link bindings (GitHub repository, Telegram community, license page) into a reusable helper class.
- Created modular controller managing 3 theme modes: Light, Dark, and AMOLED black.
- Persists user selection in AppPreferences and dynamically updates system window status bar and navigation bar colors.
- Created helper managing landscape edge navigation rail positioning (left dock for 90°, right dock for 270° rotation).
- Handles navigation indicator pill dimensions, margins, and layout bounds tracking.
- Created controller handling 3-tab navigation (Home, Automate, Guides).
- Implemented horizontal swipe gesture detection and real-time touch drag tracking.
- Coordinates top action bar slide-and-fade animation and continuous mathematical navigation pill morphing.
- Handles soft keyboard detection to automatically hide/show the bottom navigation pill and Add Shortcut FAB.
- Deleted CarouselManager as the horizontal onboarding viewpager was replaced by the dedicated 2-column Guides tab.
- Deleted modal ShortcutDialogHelper as shortcut management was moved into the inline, auto-saving Routine Shortcuts sub-tab.
- Added Warm Charcoal & Sand navigation bar color tokens (nav_pill_bg, nav_pill_stroke, nav_item_selected_bg, nav_item_selected_content, nav_item_unselected_icon).
- Added pure black AMOLED color tokens (nav_pill_bg_amoled, nav_pill_stroke_amoled, nav_item_selected_bg_amoled, nav_item_selected_content_amoled).
- Added subtle stroke colors for the Broadcasts tab matching shape backgrounds.
- Added Routine Shortcuts color palette (shortcut_badge_purple_bg, shortcut_badge_green_bg, shortcut_count_badge_bg, shortcut_tip_bg, FAB colors).
- Added carousel_page6_bg and carousel_page6_accent for Troubleshooting guide card.
- Added dark mode tokens for the floating navigation bar, active indicator pill, and AMOLED theme.
- Added dark mode subtle stroke colors for broadcast parameter chips and containers.
- Added dark mode Routine Shortcuts badge, tip, and FAB colors.
- Added dark mode colors for Troubleshooting guide card.
- Created color selector displaying brand green text when checked and muted text when unselected.
- Added Theme.NetToggle.Splash for cold start splash screen support with @drawable/splash_background.
- Explicitly assigned android:windowBackground="@color/surface_background" to Theme.NetToggle.
- Added dark mode Theme.NetToggle.Splash style resource.
- Explicitly assigned android:windowBackground="@color/surface_background" to dark Theme.NetToggle.
- Created API 31+ Theme.NetToggle.Splash with android:windowSplashScreenBackground and android:windowSplashScreenAnimatedIcon.
- Created API 31+ dark mode Theme.NetToggle.Splash with system splash screen integration.
- Created StateListAnimator providing 3D lift (scale and translationZ) on card press.
- Created high-contrast, unpadded vector logo asset for prominent rendering in the Guides header.
- Created pre-Android 12 splash screen layer-list drawable centering @drawable/splash_icon on @color/brand_primary.
- Added `hasRequestedPhonePermission()` and `setPhonePermissionRequested(boolean)` to persist whether the user has been prompted for phone permission across app cold starts.
- Added overloaded `buildPermissionBottomSheet` supporting boolean `isPermanentlyDenied`, `onActionClicked`, and `onDismissClicked` callbacks.
- Swapped action button text between "Grant Permission" and "Open Settings" and updated description text when permission is permanently denied.
…d cold starts

- Updated `checkAndRequest()` to show the permission bottom sheet on app reopen, resume, and cold start whenever permission is not granted, including after 2 denials / permanent denial (providing the "Open Settings" button).
- Removed the rationale dismissal block so minimizing/reopening the app or clearing from recents consistently prompts the user until permission is granted.
- Guarded `showPermissionBottomSheet` to prevent recreating or flashing if the bottom sheet is already showing.
- Injected `AppPreferences` instance into `PhoneStatePermissionManager`.
- Updated full description for NetToggle app to enhance clarity and detail on features, network modes, and requirements.
- This update includes a complete redesign of NetToggle with new features and improvements, as well as additional language support.
- Replaced fixed geometric radar rings with new path data for outer and inner rings.
- Uses branded olive colour background gradient.
- Added wavy radar rings in background.
- Thicken the antenna base.
Updated full description to include 'secure broadcast automation'.
- Handmade banner with custom branding
- Frame 1: Multitheme
- Frame 2: Setup Card
- Frame 3: Target Sim Card
- Frame 4: Quick Tile Cycle Card
- Frame 5: Brodacast Page
- Frame 6: Shortcuts Page
- Frame7: Guides Page
- Added Stroke and round corner in Frame 1-7
- Added new Frame 8 screenshot
@Dhangofa
Dhangofa merged commit f0f53b0 into main Sep 14, 2026
1 check passed
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