Conversation
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added input validation for route names and CIDR content. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary of ChangesHello @Asutorufa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's network routing capabilities by providing users with the flexibility to define and manage their own custom Android route configurations. This allows for more granular control over network traffic, moving away from static, predefined routes to a fully customizable system that adapts to user-specific needs and preferences. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces custom route configuration, covering UI for creation, editing, and deletion, and backend logic. However, there are security and performance concerns: heavy operations like JSON parsing and large string splitting on the main thread can cause ANR issues, and route name validation is insufficient against navigation-related injection. Additionally, consider centralizing store keys, optimizing CIDR validation, using formatted string resources for UI text, and cleaning up redundant validation logic.
app/src/main/kotlin/io/github/asutorufa/yuhaiin/MainApplication.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/compose/route/RouteConfigScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/compose/route/RouteConfigScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/service/YuhaiinVpnService.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/compose/route/RouteConfigScreen.kt
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/compose/route/RouteConfigScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/io/github/asutorufa/yuhaiin/compose/route/RouteConfigScreen.kt
Outdated
Show resolved
Hide resolved
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added `Store.remove` extension function to handle route deletion. - Added input validation for route names and CIDR content. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added `Store.remove` extension function to handle route deletion. - Added input validation for route names and CIDR content. - Ensured no mock artifacts are included in the build. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added `Store.remove` extension function to handle route deletion. - Added input validation for route names and CIDR content. - Refined UI with swipe-to-delete, monospace font for editing, and shared element transitions. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added `Store.remove` extension function to handle route deletion. - Added input validation for route names and CIDR content. - Refined UI with swipe-to-delete, monospace font for editing, and shared element transitions. - Fixed an issue where swipe-to-delete would not reset if cancelled. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
- Introduced `RouteConfigScreen` and `RouteEditScreen` for managing custom routes. - Stored route configurations in `MainApplication.Store` with editable CIDR lists. - Initialized default routes (All, Non-Local, Non-Chinese) as editable saved routes. - Updated `YuhaiinVpnService` to use dynamic route configuration from the store. - Updated `Setting` screen to link to the new route configuration UI. - Added `Store.remove` extension function to handle route deletion. - Added input validation for route names and CIDR content. - Refined UI with swipe-to-delete, monospace font for editing, and shared element transitions. - Fixed threading issues by moving store operations to background threads. - Centralized store keys in `Constants.kt`. Co-authored-by: Asutorufa <16442314+Asutorufa@users.noreply.github.com>
This PR adds the ability for users to create, edit, and delete custom Android route configurations (CIDR lists).
Changes:
UI:
RouteConfigScreento list and add new routes.RouteEditScreento edit the CIDR content of a route or delete it.Logic:
saved_routes_listexists in the store. If not, initializes it with the default routes ("All", "Non-Local", "Non-Chinese") and their standard CIDR lists.configure()to fetch the selected route's CIDR content from the store (keyroute_content_<Name>) instead of using hardcoded logic. Added a fallback to0.0.0.0/0and::/0if the content is empty.Validation:
/to prevent navigation issues.Yuhaiin.parseCIDR. Invalid lines prevent saving.Resources:
PR created automatically by Jules for task 15319386141857302974 started by @Asutorufa