Skip to content

Fix/ipv6 not proxy#431

Merged
Q7DF1 merged 2 commits into
mainfrom
fix/ipv6NotProxy
Jun 21, 2026
Merged

Fix/ipv6 not proxy#431
Q7DF1 merged 2 commits into
mainfrom
fix/ipv6NotProxy

Conversation

@Q7DF1

@Q7DF1 Q7DF1 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

@Q7DF1

Q7DF1 commented Jun 21, 2026

Copy link
Copy Markdown
Owner Author

fix issue #430

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds IPv6 support by configuring IPv6 DNS servers and routing in XrayBaseService, updating the DNS query strategy in AbstractConfigParser, and adding IPv4/IPv6 addresses to the tun2socks configuration. It also adds LeakCanary as a debug dependency. The review feedback recommends wrapping the IPv6 DNS server registration in a try-catch block to prevent crashes from invalid user input, and centralizing the LeakCanary dependency version within the Version Catalog.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +159 to +162
if (settings.ipV6Enable) {
val dnsV6Servers = settings.dnsIPv6.split(",").filter { it.isNotBlank() }
dnsV6Servers.forEach { builder.addDnsServer(it.trim()) }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding DNS servers directly from user-configured settings without validation can cause the application to crash if an invalid IPv6 address is entered. VpnService.Builder.addDnsServer throws an IllegalArgumentException for malformed addresses. Wrapping the call in a try-catch block ensures the service remains robust and doesn't crash due to invalid user input.

        if (settings.ipV6Enable) {
            val dnsV6Servers = settings.dnsIPv6.split(",").filter { it.isNotBlank() }
            dnsV6Servers.forEach {
                try {
                    builder.addDnsServer(it.trim())
                } catch (e: IllegalArgumentException) {
                    Log.e(TAG, "Invalid IPv6 DNS server: $it", e)
                }
            }
        }

Comment thread app/build.gradle.kts
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.14")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency and centralized dependency management, avoid hardcoding dependency versions directly in build.gradle.kts. Instead, define the LeakCanary dependency in the Version Catalog (gradle/libs.versions.toml) and reference it here.

    debugImplementation(libs.leakcanary)

@Q7DF1 Q7DF1 merged commit a068baf into main Jun 21, 2026
2 checks 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