Conversation
- Modified brand_primary_container from #EADDFF (purple tint) to #F3EDF7 (softer grayish-purple) for better contrast. - Modified surface_background from #FAF8F5 (warm off-white) to #FDFBFF (cooler, crisper white) to modernize the app's base background. - Removed unused status_success_text color since the success text color is currently handled inline or elsewhere in the UI. - Added segmented_separator (#CAC4D0) to provide a dedicated color for the vertical divider lines between the segmented control options (like Root | Shizuku). - Added a new Colorful Accents block containing accent_green, accent_orange, and accent_pink to provide vibrant tints for icons (like the developer person icon) and badges. - Added a new Cycle Card Custom Tones block containing specific warm/orange color overrides (cycle_card_surface, cycle_segmented_selected, cycle_badge_bg, cycle_segmented_text_selected) to give the Quick Tile Cycle card its distinct warm visual identity. - Added a new Exec Card Custom Tones block containing specific cool/blue color overrides (exec_accent, exec_card_surface, exec_segmented_selected, exec_segmented_text_selected) to give the Execution Mode card its distinct cool visual identity.
- Modified brand_primary_container from #4F378B (deep purple) to #23212A (dark grayish-purple) for a more muted, elegant dark mode contrast. - Modified surface_background from #141218 (dark gray) to #000000 (pure black) to improve AMOLED screen battery efficiency and provide a higher contrast canvas. - Modified card_surface from #211F26 to #141218 to match the darker overall theme. - Modified card_border from #36343B to #2B2930 for subtler edge highlights on cards. - Removed unused status_success_text color, as text color logic for status badges is handled efficiently via inline colors or specific badge shapes now. - Added segmented_separator (#49454F) to provide a dedicated, visible divider line between segmented control tabs (like Root | Shizuku) in dark mode. - Added a new Colorful Accents block (accent_green, accent_orange, accent_pink) to ensure UI icons and developer graphics remain vibrant against the dark backgrounds. - Added a new Cycle Card Custom Tones block (cycle_card_surface, cycle_segmented_selected, cycle_badge_bg, cycle_segmented_text_selected) bringing dark, warm/orange variants to the Quick Tile Cycle card so it visually distinguishes itself in dark mode. - Added a new Exec Card Custom Tones block (exec_accent, exec_card_surface, exec_segmented_selected, exec_segmented_text_selected) bringing dark, cool/blue variants to the Execution Mode card so it visually distinguishes itself in dark mode.
- Changed android:statusBarColor from @color/surface_background to @color/card_surface. This ensures the status bar visually blends with the top header cards and components rather than matching the pure black background, creating a more cohesive, edge-to-edge aesthetic in dark mode.
Changed android:statusBarColor from @color/surface_background to @color/card_surface. This ensures that the status bar visually blends with the top header cards instead of the background, creating a seamless and immersive top edge in light mode.
Created color_segmented_text_exec.xml as a color state selector to dynamically handle text color changes for the Execution Mode and Target SIM radio buttons. It applies the cool blue @color/exec_segmented_text_selected when checked and falls back to @color/segmented_text_unselected when unchecked.
Created color_segmented_text_cycle.xml as a color state selector to dynamically handle text color changes for the Quick Tile Cycle radio buttons. It applies the warm orange @color/cycle_segmented_text_selected when checked and falls back to @color/segmented_text_unselected when unchecked.
- Defines the scalable vector graphic (SVG) foreground layer for the Android adaptive launcher icon. - Separates the app logo from the background to support system-level icon animations and reshaping.
Mistanely previous commit meesage was wrongy added
- Defines the rounded corner background surface specifically for the newly modularized Execution Mode UI card. - References the new exec_card_surface color so it can shift between distinct light and dark mode variants.
Creates a standard background shape used for rendering the app icon in non-adaptive contexts or custom UI bounds inside the app.
- Defines the rounded corner background surface specifically for the newly modularized Quick Tile Cycle UI card. - References the new cycle_card_surface color to give it a distinct warm/orange visual identity.
- Creates the elevated, heavily rounded background shape for the Developer Profile card at the bottom of the scroll view. - Provides a clean surface that stands out against the main app background.
- Defines the background state selector for the Execution Mode and Target SIM radio buttons. - Dynamically applies the cool/blue @color/exec_segmented_selected color when the tab is checked, and remains transparent when unchecked.
- Defines the background state selector for the Quick Tile Cycle radio buttons. - Dynamically applies the warm/orange @color/cycle_segmented_selected color when the tab is checked, and remains transparent when unchecked.
- Provides a fallback rectangular background state selector for segmented tabs. - Used for radio buttons that need sharper corners rather than fully rounded pill shapes.
- Defines a rectangular bounding box background shape for segmented control groups. - Serves as the outer track for the rectangular segmented tabs.
- Creates a tiny rounded pill shape used as a horizontal separator line. - Implemented in the Execution card to visually separate the Root/Shizuku block from the Target SIM block.
- Defines the rounded pill background shape specifically for the dynamic "Cycle: 5G Only → 4G Only" text badge. - Uses the @color/segmented_container color to visually inset the text block against the cycle card's surface.
This generic radio item background was deprecated. We moved to dedicated color-state selectors (selector_segmented_tab_exec.xml and selector_segmented_tab_cycle.xml) to allow tabs to dynamically change their background colors based on whether they belong to the Execution Mode card or the Tile Cycle card.
- Increased corner radius from 16dp to 24dp for a softer, more modern M3 card aesthetic. - Removed the 1dp solid stroke (border) to rely entirely on elevation/shadows or background contrast for separation rather than harsh outlines. - Increased internal padding slightly from 14dp to 16dp to give content more breathing room inside the sections.
- Increased the corner radius from 8dp to 50dp for both the checked and unchecked states. - This transitions the active segmented tab indicator from a slightly rounded rectangle to a fully rounded pill shape, aligning with the latest Material 3 button guidelines.
- Increased corner radius from 16dp to 24dp to match the updated app-wide corner rounding aesthetics. - Removed the 1dp solid stroke (border), allowing the banner to blend more seamlessly into the UI using just its distinct background color (qs_hint_bg).
- Increased the corner radius from 12dp to 50dp. - This ensures the outer container/track of the segmented control perfectly wraps the newly rounded 50dp inner active tabs.
- Changed the base shape from oval (perfect circle) to rectangle. - Added a 12dp corner radius to create a soft "squircle" shape rather than a hard circle. - Removed the 1dp solid stroke (border) to make the social buttons feel flatter and more integrated as modern clickable surfaces.
- Extracted the "Execution Mode" and "Target SIM" cards, replacing their raw XML blocks with a clean <include layout="@layout/view_execution_card" /> tag to match the landscape activity structure. - Redesigned the top header into a "Custom Action Bar" by wrapping it in a RelativeLayout with a @color/card_surface background and 6dp elevation, blending seamlessly with the status bar. - Replaced the generic ic_network_bars vector in the header with the actual app icon (ic_launcher_foreground), giving the app strong branding on launch. - Upgraded the Developer Profile card at the bottom to use the new @drawable/shape_floating_footer background with 12dp elevation and margin adjustments, making it float elegantly above the scroll content. - Updated the Developer Profile icon to use the new vibrant @color/accent_pink tint.
- Upgraded the card background from the flat outline (section_outline_bg) to an elevated surface (shape_cycle_card_bg with 8dp elevation). - Expanded the cycle options from a 2x2 grid (4 items) to a 2x3 grid (6 items), adding support for Pref 3G and 2G Only. - Replaced the standard Android CheckBox buttons (with checkboxes on the left) with a custom "segmented control" UI. Checkboxes now use android:button="@null" and act as clickable pill tabs within a track (shape_segmented_container_rect). - Applied the new @drawable/selector_segmented_tab_cycle and @color/color_segmented_text_cycle so the selected modes dynamically highlight with a warm/orange background. - Added visual vertical separator lines (1dp views) between the segmented tabs to clearly define the hit areas. - Updated the header and footer badges to use the new @drawable/shape_cycle_order_badge and vibrant @color/accent_orange text for better visual hierarchy.
- Extracted the "Execution Mode" and "Target SIM" UI blocks from the main activity into a dedicated, reusable component file. - Wrapped both sections in a unified LinearLayout using the new elevated @drawable/shape_exec_card_bg background to create a distinct, modern card surface. - Upgraded the "Root/Shizuku" and "Auto/SIM 1/SIM 2" selectors from basic radio buttons to modern segmented controls using @drawable/shape_segmented_container and the cool/blue @drawable/selector_segmented_tab_exec selectors. - Added dynamic vertical 1dp separator lines between the segmented tabs to clearly divide the hit areas. - Added a subtle horizontal pill divider (@drawable/shape_small_divider) to cleanly separate the Execution Mode toggles from the Target SIM toggles within the same card. - Updated icons within this card to use the distinct cool/blue @color/exec_accent tint for visual grouping.
- Deleted the monolithic, hardcoded XML blocks for the Execution Mode, Target SIM, and Tile Cycle sections. - Replaced the deleted sections with <include> tags referencing @layout/view_execution_card (Left Column) and @layout/view_tile_cycle_card (Right Column). - Placed both included cards side-by-side using a horizontal LinearLayout with equal weights (layout_weight="1"). - Set android:layout_height="match_parent" for both included cards to ensure the shorter card dynamically stretches to perfectly match the height of the taller card. - Fixed Material elevation shadow clipping by adding android:clipChildren="false" and android:clipToPadding="false" to the ScrollView and row containers. - Reorganized the top header to optimize vertical space in landscape mode, shifting the Developer Profile icons and links directly into the top right of the Action Bar area.
- Expanded checkbox variables and bindings to support 6 network modes (Pref 5G/4G/3G and Only 5G/4G/2G). - Added variables and bindings for the 4 vertical separator lines in the segmented layout. - Added missing import android.view.View; to support visibility toggling. - Upgraded the refresh() visibility logic to handle the top row (Preferred modes) independently from the bottom row (Only modes). - Configured separators to hide dynamically if either of their adjacent horizontally-touching buttons is selected, ensuring the selected tab's colored pill shape doesn't get sliced by a visible divider.
- Changed the status bar color in configureStatusBar() from surface_background to card_surface so it visually blends with the new custom Action Bar layout. - Added view bindings for the three vertical separators (separatorRootShizuku, separatorAutoSim1, separatorSim1Sim2) used in the Execution Mode and Target SIM segmented controls. - Implemented updateSeparatorVisibility() to dynamically hide the vertical divider line if either of its adjacent radio buttons is selected, ensuring the colored pill backgrounds are not sliced by visible lines. - Hooked up the separator visibility logic to fire on initial launch (onCreate) and whenever the user taps a new option (setOnCheckedChangeListener). - Updated the Telegram support link from https://t.me/dhangofa to the group chat URL https://t.me/dhangofas_projects_chat.
- Added inner data class NetworkCapabilities to hold 2G/3G/4G/5G support flags. - Implemented zero-battery SIM-swap detection by caching SIM subId alongside its capabilities. - Added Device hardware capabilities caching.
…n architecture - Handles lazy carrier configurations (like Jio) where 2G/3G infrastructures do not exist, ensuring 2G/3G UI options are properly disabled for those specific networks, even if the Android OS claims they are available.
- Updated NUMBER_PATTERN to -?\d+ to properly match negative numbers (crucial for catching -1 invalid indices). - Added extractIntByKey(text, key) to safely pluck an integer following a specific keyword without getting confused by earlier numbers. - Added extractStringByKey(text, key, endDelimiter) to safely extract carrier names.
- Now fully consumes the SimInfo object provided by SimResolver. - Stage 1 & 2: Fetches OS capability (Build.VERSION) and global modem capability via getprop ro.telephony.default_network, checking globally if ANY number >= 23 exists. This bypasses the dangerous index-mapping flaw we found earlier. - Stage 3 & 4: Fetches per-slot capabilities by reading dumpsys carrier_config (to see if the slot disables 2G/3G or hides 5G) and simultaneously runs the slot's carrierName through the new LteAndAboveCarrierRegistry. - Solves the core "Capability vs Coverage" architecture issue. Safely evaluates hardware ceiling and combines it with exact per-slot configuration restrictions for a 100% accurate UI mapping.
Declared the android.permission.READ_PHONE_STATE permission inside the <manifest> tag to enable reading network state via native Android APIs.
- Added constant integer fields: TILE_ERROR_NONE, TILE_ERROR_SHIZUKU, TILE_ERROR_ROOT, and TILE_ERROR_CMD. - Added new string keys: KEY_TILE_ERROR, KEY_LAST_ERROR_CMD, KEY_LAST_ERROR_STDERR, and KEY_LAST_ERROR_TIMESTAMP. - Implemented getTileErrorState() and setTileErrorState(int state) to track explicit tile failures. - Implemented setLastError(String command, String stderr) to save the stderr output of failing shell commands. - Implemented getLastError() returning the new DiagnosticError object. - Implemented clearLastError() to wipe the diagnostic cache and reset the tile error state. - Added registerListener() and unregisterListener() for SharedPreferences.OnSharedPreferenceChangeListener. - Added clearDeviceCapabilities() to invalidate the 2g/3g/4g/5g device capability cache preferences. - Updated onExecutionModeChanged() to forcefully call setTileErrorState(TILE_ERROR_NONE).
- Added implementations for SharedPreferences.OnSharedPreferenceChangeListener interface to monitor preference changes. - Added updateAuthorizationUI(boolean authorized) method to dynamically change the alpha (opacity) of the Target SIM and Tile Cycle cards when unauthorized. - Injected calls to TileService.requestListeningState() inside checkRootPermission() and checkShizukuPermission() to force the - Quick Settings tile to redraw when authorization fails. - Added logic to set TILE_ERROR_ROOT and TILE_ERROR_SHIZUKU inside the permission check callbacks. - Implemented updateCapabilities() to fetch device network capabilities in a background thread and apply them to the tileCycleUiController. - Added showPermissionBottomSheet() and onRequestPermissionsResult() logic to handle the runtime request for READ_PHONE_STATE. - Implemented showDiagnosticDialog() to inflate R.layout.dialog_diagnostic and display the generated DiagnosticReporter output when a command fails. - Added updateErrorBanner() to display a floating action button/banner if getLastError() is not null. - Unregistered the shared preference listener inside onDestroy().
- Added Context argument to the instantiations of SimResolver and NetworkModeReader inside onCreate().
- Added a passive Shizuku.pingBinder() block at the top of onStartListening() that updates the AppPreferences error state if the binder is dead, and clears it if it recovers.
- Added null/invalid slot validation inside onClick(), triggering a Toast and reverting to Auto if no physical SIM slot could be resolved.
- Updated updateTileUI() to intercept the draw sequence and display custom labels/icons ("Shizuku Unavailable", "Root Unavailable", "Error Check App") based on the getTileErrorState().
- Updated the onClick() command execution block to catch su and Shizuku shell creation failures, explicitly setting authorization errors.
- Added logic inside onClick() to call setLastError() if a shell command returns an exit code other than 0.
- Added a Context field and updated the constructor to receive and store it. - Refactored readCurrentMode() to execute a try-catch block calling Settings.Global.getString(context.getContentResolver(), ...) before falling back to the shell execution. - Added logic to natively extract the multi_sim_data_call ID and target preferred_network_mode ID without spawning background shell processes if possible.
- Added a Context field and updated the constructor to receive and store it. - Added the SimInfo data class to hold the subId, slotIndex, and carrierName. - Refactored resolveTargetSimInfo() to use context.checkSelfPermission(Manifest.permission.READ_PHONE_STATE) to attempt to read data via SubscriptionManager directly. - Kept the existing dumpsys isub shell command logic, moving it to act purely as a fallback if the native API permission is denied or the OEM restricts the call.
- Updated getCapabilities() to check for invalid slot indexes and subIds before attempting to run carrier resolution shell commands. - Modified the caching mechanism to invoke appPreferences.invalidateSlotCache() if the SIM card in the physical slot changes.
- Added setAuthorized(boolean authorized) to enable/disable all CheckBox views. - Added applyCapabilities(AppPreferences.NetworkCapabilities caps) to dynamically uncheck and disable the 5gOnly, Pref5g, 2gOnly, etc. checkboxes if the device hardware or carrier blocklist reports they are unsupported.
Created a simple data class to encapsulate command, stderr, and timestamp fields
Created a utility class containing generateReport(), which reads device metadata (Android version, Exec Mode, target SubId) and appends the DiagnosticError details to generate a formatted text block for debugging.
Created a vector drawable for an alert/warning triangle used in the error banner.
Created a vector drawable for a speedometer icon used in the permission request bottom sheet.
Created a vector drawable used as a generic UI affordance in the permission sheet.
Created a rounded rectangle shape drawable to serve as the background layer for the custom Diagnostic Dialog window.
Created an XML layout for a dismissible, red-tinted alert banner that appears in MainActivity when a shell command fails.
Created an XML layout for a bottom sheet explaining why the app is requesting the optional Phone State permission to speed up tile execution.
Created the XML layout containing a ScrollView, a TextView for the error report block, and action buttons for "Copy" and "Close".
Added an <include layout="@layout/view_error_banner.xml" /> block inside the main scroll view hierarchy to support displaying shell failures to the user.
- Updated the UI controller to expose applyCapabilities() and setAuthorized(). - Added logic to gray out, disable, and uncheck specific network modes (like 5G or 2G) in the cycle selection if the background NetworkCapabilityResolver determines the device/SIM does not support them.
- Updated the Theme.NetToggle parent theme references to ensure custom layout components (like the dialogs and bottom sheets) style correctly across Android versions.
- Added <include layout="@layout/view_error_banner" />
- Added android:id="@+id/targetSimHeaderContainer" attribute in the Target SIM's RelativeLayout - MainActivity.java uses findViewById(R.id.targetSimHeaderContainer) to dim the text opacity when Root/Shizuku is not authorized
- Updated USA Registry: Added at&t, t-mobile, and dish to reflect the completed 2G/3G shutdowns across all major US networks as of August 2026. - Added Japan Registry: Created JAPAN_LTE_AND_ABOVE to include docomo, au (KDDI), softbank, and rakuten, reflecting the final termination of Docomo's FOMA network. - Added Australia Registry: Created AUSTRALIA_LTE_AND_ABOVE to include telstra, optus, and vodafone australia (TPG) following their nationwide 3G switch-offs. - Added Taiwan Registry: Created TAIWAN_LTE_AND_ABOVE to include chunghwa, taiwan mobile, and far eastone following their mid-2024 shutdowns. Added Singapore Registry: Created SINGAPORE_LTE_AND_ABOVE to include singtel, starhub, and m1 following their 2024 shutdowns. - Added South Korea Registry: Created SOUTHKOREA_LTE_AND_ABOVE for lg u+, which is fully LTE/5G (intentionally omitting SK Telecom and KT as they still operate 3G networks). - Updated Logic Flow: Appended new for loops inside the isLteAndAboveOnly() method to dynamically cross-reference the device's current SIM carrier against all the newly added regional lists.
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.
This pull request introduces significant architectural improvements to network capability resolution, modernizes the UI with a distinct segmented control design, adds robust diagnostic tracking, and expands the global LTEandAbove carrier registry.
Major Changes
NetworkCapabilityResolver) that evaluates hardware ceilings and combines them with exact per-slot configuration restrictions. This solves the core "Capability vs Coverage" architecture issue, ensuring the UI accurately reflects available network modes.LteAndAboveCarrierRegistryhas been significantly expanded with verified global 2G/3G sunset data for mid-2026. Added registries for the USA (now including AT&T, T-Mobile, Dish), Japan (Docomo, KDDI, SoftBank, Rakuten), Australia (Telstra, Optus, Vodafone), Taiwan, Singapore, and South Korea (LG U+). This ensures 2G/3G options are disabled for carriers that no longer support them.DiagnosticReporter,DiagnosticError). The app now tracks explicit tile failures (Root, Shizuku, Command) and caches thestderroutput of failing shell commands. A new Diagnostic Dialog allows users to view and copy these error reports for debugging.NetworkModeReaderto execute a try-catch block callingSettings.Global.getStringdirectly via Android's native Settings API before falling back to the slower shell execution.SimResolverto leverage the nativeSubscriptionManagerAPIs to quickly resolve the target physical SIM slot and sub ID. This requires the newly addedREAD_PHONE_STATEpermission, which is requested via a custom bottom sheet on launch. The olddumpsys isubshell command is retained purely as a fallback.view_execution_card.xml,view_tile_cycle_card.xml) utilizing elevated, rounded backgrounds.layout-land/activity_main.xml) to display the new modular cards side-by-side dynamically.Improvements & Tweaks
Shizuku.pingBinder()check ononStartListening(), dynamically updating the tile's UI state (e.g., "Shizuku Unavailable") if the binder dies.ShellValueParserto safely extract integers following specific keywords (crucial for catching-1invalid indices) and added support for extracting string values (like carrier names).