Add Age key helper (X25519/Hybrid) and end-to-end key validation APIs#317
Merged
Conversation
Copilot
AI
changed the title
Port ClashMetaForAndroid PR #768 age key helper
Port PR #768: add Age key helper (X25519/Hybrid) and end-to-end key validation APIs
Jun 7, 2026
Copilot created this pull request from a session on behalf of
Goooler
June 7, 2026 00:07
View session
…ingText in helper dialog
There was a problem hiding this comment.
Pull request overview
This PR ports the upstream “Age key helper” feature into Tabby, adding end-to-end support (native → JNI → Kotlin → settings UI) for generating Age keypairs (X25519 and MLKEM768-X25519), deriving public keys from secrets, and validating secret/public keys using core logic.
Changes:
- Added native/core exports + JNI + Kotlin bridge APIs for Age keypair generation, secret→public derivation, and key validation.
- Updated Age secret-key validation to rely on core verification instead of a prefix-only heuristic.
- Added a Meta Features “Age Key” settings section with a helper dialog and localized strings/resources.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/settings/src/main/res/values/strings.xml | Adds Age Key helper UI strings (EN). |
| ui/settings/src/main/res/values/non-translatable.xml | Adds non-translatable key-type labels (X25519 / MLKEM768-X25519). |
| ui/settings/src/main/res/values-zh/strings.xml | Adds Age Key helper UI strings (ZH). |
| ui/settings/src/main/res/values-zh-rTW/strings.xml | Adds Age Key helper UI strings (ZH-TW). |
| ui/settings/src/main/res/values-zh-rHK/strings.xml | Adds Age Key helper UI strings (ZH-HK). |
| ui/settings/src/main/res/values-vi/strings.xml | Adds Age Key helper UI strings (VI). |
| ui/settings/src/main/res/values-ru/strings.xml | Adds Age Key helper UI strings (RU). |
| ui/settings/src/main/res/values-ko-rKR/strings.xml | Adds Age Key helper UI strings (KO-KR). |
| ui/settings/src/main/res/values-ja-rJP/strings.xml | Adds Age Key helper UI strings (JA-JP). |
| ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/MetaFeatureSettingsScreen.kt | Adds settings entries + Compose dialog for generating/deriving/copying/validating keys. |
| glue/src/main/kotlin/com/github/kr328/clash/glue/util/Validator.kt | Switches Age secret key validator to core-based verification. |
| core/src/main/kotlin/com/github/kr328/clash/core/model/AgeKeyPair.kt | Introduces a typed model for decoded keypair results. |
| core/src/main/kotlin/com/github/kr328/clash/core/Clash.kt | Exposes high-level Kotlin APIs for keypair generation / validation / derivation. |
| core/src/main/kotlin/com/github/kr328/clash/core/bridge/Bridge.kt | Adds new JNI extern declarations for Age helper APIs. |
| core/src/main/golang/native/config/age.go | Adds Go-side wrappers for Age helper operations. |
| core/src/main/golang/native/config.go | Exports new cgo functions for JNI to call (generate/verify/derive). |
| core/src/main/cpp/main.c | Wires new exported native functions into JNI entry points. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…dundant JNI/native calls
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 ports the upstream Age key helper feature into Tabby: users can now generate X25519/MLKEM768-X25519 keypairs, derive public keys from secrets, and validate Age keys from settings.
The change wires these capabilities through the full native/core stack and exposes them in Meta Feature settings.
Ports MetaCubeX#768.
Core bridge + native exports
genX25519KeyPair,genHybridKeyPair)core/src/main/cpp/main.c.Bridge.ktand surfaced high-level APIs inClash.kt.AgeKeyPairmodel for typed keypair decoding.Validation behavior
Settings UX (Meta Features)
X25519MLKEM768-X25519Localization/resources
ui/settings/src/main/res/values/non-translatable.xml.