feat: import hosts from PuTTY .reg files#9
Open
steffen-heil-secforge wants to merge 7 commits into
Open
Conversation
Parses Windows Registry Editor files exported by PuTTY, extracting SSH sessions as Host + PortForward objects with BOM detection, URL-decoding of session names, NFC deduplication, a 100-session cap, and full support for local, remote, and dynamic (SOCKS5) port-forward entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 1..65535 range checks for srcPort and destPort in parseSinglePortForward - Replace deprecated URLDecoder.decode(String, String) with Charset overload - Add tests for out-of-range source and destination port rejection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements PuttyImportViewModel for the PuTTY .reg import feature with loadFile(), toggleSession(), selectAll(), setBindAddress(), and importSelected() logic backed by HostRepository and PuttyRegistryParser. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the PuTTY import screen with file picker (State 1) and session list + bind address selector + import button (State 2). Adds all putty_import_* and list_menu_import_putty string resources. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- importSelected() now sets isLoading=true at start and false on success/failure - importResult changed from String? to Boolean (removes hardcoded English strings) - LaunchedEffect checks importResult as Boolean instead of null check - anySelected wrapped with remember(uiState.sessions) - bindOptions extracted outside LazyColumn item and wrapped with remember - ArrowBack icon contentDescription set to R.string.button_navigate_up Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add PUTTY_IMPORT route to NavDestinations, register PuttyImportScreen as a composable in NavGraph, and expose an onImportFromPuTTY callback in HostListScreen that is wired to a new "Import PuTTY hosts" overflow menu item. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
.regfiles exported from PuTTY (UTF-8, UTF-16 LE/BE BOM detection)Hostentries; URL-decodes session names, NFC-deduplicates, caps at 100 sessions[46]?[LRD]<port>[=host:port], comma-separated) intoPortForwardentitiesPuttyImportScreen: file picker → session checklist with select/deselect all, bind address picker (reusing hotspot bind address constants), security warning, import buttonTest plan
./gradlew testOssDebugUnitTest— 18PuttyRegistryParserTestcases cover basic parse, URL-decode, BOM variants, port forwards (L/R/D), 100-session cap, NFC dedup, invalid ports.reg, copy to device, import via menu → host appears in list with correct details🤖 Generated with Claude Code