feat(happ): add routing editor, optional ad blocking, and LAN bypass preset (#6545)

* feat(happ): make ad blocking optional in routing presets

Add an independent AdBlock toggle for Iran, China, and global presets, applied only when generating routing rules. Update the China preset to Bypass-CN and cover preset behavior and localized controls.

* feat: add visual routing editor with JSON support and localization updates

- Implemented a new modal for editing routing profiles with basic and advanced tabs.
- Added functionality to load, parse, and generate routing profiles in JSON format.
- Enhanced user experience with validation and error handling for JSON input.
- Updated translations for Russian, Turkish, Ukrainian, Vietnamese, Chinese (Simplified and Traditional) to include new routing editor terms.
- Created helper functions for managing routing profiles and generating deep links.
- Added unit tests for routing editor functionalities and JSON handling.

* feat: update routing editor to preserve null lists in profiles and enhance validation messages
This commit is contained in:
NgaiYeanCoi
2026-09-27 04:57:01 +08:00
committed by GitHub
parent 94fa317e76
commit 5e15120cec
22 changed files with 1363 additions and 209 deletions
+15 -4
View File
@@ -1690,9 +1690,11 @@
"subHappPerAppList": "Android Package Names",
"subHappPerAppListDesc": "Comma-separated package names of Android applications to include or exclude (e.g. org.telegram.messenger).",
"subHappPresetIran": "Iran Bypass",
"subHappPresetChina": "China Direct",
"subHappPresetAdblock": "AdBlock",
"subHappPresetChina": "China Direct (Bypass-CN)",
"subHappIncludeAdblock": "Include AdBlock",
"subHappApplyPreset": "Apply preset",
"subHappPresetGlobal": "Full Proxy",
"subHappPresetLocal": "Global Bypass Local Network",
"subHappPresetOff": "Disable Routing (happ://routing/off)",
"subHappColorBlue": "Blue (Standard / Default)",
"subHappColorGreen": "Green (Success)",
@@ -1716,9 +1718,18 @@
"subHappPerAppBypass": "Bypass (Exclude Listed Apps)",
"subHappPresetApplied": "Happ preset applied to routing rules",
"subHappPresets": "Routing Presets",
"subHappPresetsDesc": "Pre-configured routing rule presets tailored for Happ clients.",
"subHappPresetsDesc": "Choose a base preset and optional ad blocking, then apply to replace the current routing rules.",
"subHappVisualBuilder": "Visual Rule Generator",
"subHappVisualBuilderDesc": "Create custom routing deeplink from domain and IP lists.",
"subHappVisualBuilderDesc": "Load the current routing profile and edit its rules or full JSON.",
"subHappEditorBasic": "Basic rules",
"subHappEditorAdvanced": "Advanced editor",
"subHappEditorListHint": "One rule per line. Other profile fields are preserved.",
"subHappEditorAdvancedHint": "Edit the complete JSON profile. Changes sync with the basic rules tab.",
"subHappEditorInvalidJson": "Enter a JSON object. Routing lists, when present, must be arrays of strings or null.",
"subHappEditorLoadInvalid": "The current rules are not a valid Happ routing link or JSON profile.",
"subHappEditorLoadRemote": "Remote URLs cannot be loaded here. Paste a Happ routing link or JSON profile first.",
"subHappEditorLoadOff": "Routing is disabled. Apply a preset or clear the routing rules to create a profile.",
"subHappEditorNew": "No current rules. Start with an empty custom profile.",
"subHappBuildDeeplink": "Generate Deeplink",
"subHappModalTitle": "Happ Visual Routing Rule Generator",
"subHappDirectDomains": "Direct Domains (Bypass)",