generated from ali/HarmonyTemplate
提交 Haven Android 仓库源码 v5.87.79
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.hilt)
|
||||
alias(libs.plugins.ksp)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "sh.haven.feature.rdp"
|
||||
compileSdk = 37
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":core:ui"))
|
||||
implementation(project(":core:rdp"))
|
||||
implementation(project(":core:knock"))
|
||||
implementation(project(":core:ssh"))
|
||||
implementation(project(":core:mosh"))
|
||||
implementation(project(":core:et"))
|
||||
implementation(project(":core:data"))
|
||||
|
||||
implementation(libs.activity.compose)
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
implementation(libs.hilt.navigation.compose)
|
||||
implementation(libs.lifecycle.viewmodel)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
// #504: the input-ordering test drives real dispatchers.
|
||||
testImplementation(libs.coroutines.core)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|
||||
@@ -0,0 +1,346 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
/**
|
||||
* Maps a typed character to the appropriate RDP wire events. Modern
|
||||
* Windows shells (cmd, PowerShell, full-screen apps) silently ignore
|
||||
* `TS_FP_UNICODE_KEYBOARD_EVENT` (the `WM_UNICHAR` Windows message),
|
||||
* so ASCII input has to be sent as scancode-based key events. IME-
|
||||
* capable apps (Notepad, browsers, Word) accept both, so the
|
||||
* scancode path is fine for them too.
|
||||
*
|
||||
* Non-ASCII falls back to the Unicode path — there's no scancode for
|
||||
* an emoji on a US keyboard. Apps that ignore `WM_UNICHAR` will drop
|
||||
* those silently, but on a Windows host with a hardware keyboard, US-
|
||||
* layout typing covers ~99% of real input.
|
||||
*
|
||||
* @param ch the character the user typed
|
||||
* @param sendKey `(scancode, pressed) -> Unit` — invoke for scancode
|
||||
* events (matches the FFI `RdpClient.sendKey(scancode, pressed)`)
|
||||
* @param sendUnicode `(codepoint) -> Unit` — invoke for the Unicode
|
||||
* fallback (typically wraps `RdpClient.sendUnicodeKey(cp, true)`
|
||||
* immediately followed by `(cp, false)`)
|
||||
*/
|
||||
fun typeRdpChar(
|
||||
ch: Char,
|
||||
sendKey: (Int, Boolean) -> Unit,
|
||||
sendUnicode: (Int) -> Unit,
|
||||
layoutKlid: UInt = sh.haven.core.rdp.keyboardLayoutKlid(),
|
||||
) {
|
||||
// #504 follow-up: base-remapped layouts (QWERTZ, AZERTY, UK). The KLID we
|
||||
// announce makes the server interpret scancodes through THAT layout, so
|
||||
// the US char→position table is wrong for them — 'z' at the US position
|
||||
// types 'y' on a QWERTZ server. Each such layout gets a self-contained
|
||||
// table; a char it can't produce falls straight to unicode, NEVER to the
|
||||
// US table, because a US position can land on the layout's dead key and
|
||||
// silently poison the following keystroke.
|
||||
val remapped = baseRemapTableFor(layoutKlid)
|
||||
if (remapped != null) {
|
||||
val stroke = remapped[ch] ?: CONTROL_KEYSTROKES[ch] ?: run {
|
||||
sendUnicode(ch.code)
|
||||
return
|
||||
}
|
||||
emitKeystroke(stroke, sendKey)
|
||||
return
|
||||
}
|
||||
val mapped = asciiCharToRdpScancode(ch)
|
||||
if (mapped != null) {
|
||||
val (scancode, shift) = mapped
|
||||
emitKeystroke(LayoutKeystroke(scancode, shift = shift), sendKey)
|
||||
return
|
||||
}
|
||||
// #504: scancodes-only servers (VirtualBox VRDP) discard the unicode
|
||||
// fallback, so layouts with an AltGr overlay get their characters
|
||||
// synthesised as real key sequences the guest's own keymap resolves.
|
||||
val altGr = altGrCharToRdpScancode(ch, layoutKlid)
|
||||
if (altGr != null) {
|
||||
val (scancode, shift) = altGr
|
||||
emitKeystroke(LayoutKeystroke(scancode, shift = shift, altGr = true), sendKey)
|
||||
return
|
||||
}
|
||||
sendUnicode(ch.code)
|
||||
}
|
||||
|
||||
/**
|
||||
* One synthesised key tap: the base [scancode] with the modifiers that make
|
||||
* the server's own keymap produce the intended character.
|
||||
*/
|
||||
data class LayoutKeystroke(
|
||||
val scancode: Int,
|
||||
val shift: Boolean = false,
|
||||
val altGr: Boolean = false,
|
||||
)
|
||||
|
||||
private fun emitKeystroke(stroke: LayoutKeystroke, sendKey: (Int, Boolean) -> Unit) {
|
||||
if (stroke.altGr) sendKey(SC_ALTGR_PUBLIC, true)
|
||||
if (stroke.shift) sendKey(SC_SHIFT_L_PUBLIC, true)
|
||||
sendKey(stroke.scancode, true)
|
||||
sendKey(stroke.scancode, false)
|
||||
if (stroke.shift) sendKey(SC_SHIFT_L_PUBLIC, false)
|
||||
if (stroke.altGr) sendKey(SC_ALTGR_PUBLIC, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* AltGr-overlay synthesis (#504): for layouts whose base is exactly US and
|
||||
* whose national characters live on AltGr combinations, a non-ASCII char
|
||||
* becomes AltGr(+Shift)+basekey — key events every server understands,
|
||||
* resolved by the SERVER side's layout for the announced KLID. This is what
|
||||
* makes Polish typing reach a VirtualBox guest whose RDP server accepts only
|
||||
* scancodes (the unicode path is discarded there).
|
||||
*
|
||||
* Only pure-overlay layouts belong here. Layouts that REMAP the base (German
|
||||
* QWERTZ, French AZERTY, Spanish...) can't be served by an overlay table —
|
||||
* their fix is a full base-map swap, tracked separately. Returns
|
||||
* (base scancode, needs-shift) or null when [layoutKlid] has no overlay
|
||||
* entry for [ch].
|
||||
*/
|
||||
fun altGrCharToRdpScancode(ch: Char, layoutKlid: UInt): Pair<Int, Boolean>? {
|
||||
val overlay = when (layoutKlid) {
|
||||
POLISH_PROGRAMMERS_KLID -> POLISH_ALTGR_OVERLAY
|
||||
else -> return null
|
||||
}
|
||||
overlay[ch.lowercaseChar()]?.let { baseScancode ->
|
||||
return Pair(baseScancode, ch.isUpperCase())
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/** Right Alt (AltGr): the extended twin of left Alt 0x38. */
|
||||
const val SC_ALTGR_PUBLIC: Int = 0xE038
|
||||
|
||||
/** Polish (programmers), the standard Polish layout: US base + AltGr. */
|
||||
const val POLISH_PROGRAMMERS_KLID: UInt = 0x0415u
|
||||
|
||||
// AltGr + <US base key> for each Polish national letter (lowercase form;
|
||||
// uppercase adds Shift). kbdpl1.dll's overlay, verbatim.
|
||||
private val POLISH_ALTGR_OVERLAY: Map<Char, Int> = mapOf(
|
||||
'ą' to 0x1E, // AltGr+A
|
||||
'ć' to 0x2E, // AltGr+C
|
||||
'ę' to 0x12, // AltGr+E
|
||||
'ł' to 0x26, // AltGr+L
|
||||
'ń' to 0x31, // AltGr+N
|
||||
'ó' to 0x18, // AltGr+O
|
||||
'ś' to 0x1F, // AltGr+S
|
||||
'ź' to 0x2D, // AltGr+X
|
||||
'ż' to 0x2C, // AltGr+Z
|
||||
)
|
||||
|
||||
/** German QWERTZ (kbdgr.dll). */
|
||||
const val GERMAN_QWERTZ_KLID: UInt = 0x0407u
|
||||
|
||||
/** French AZERTY (kbdfr.dll). */
|
||||
const val FRENCH_AZERTY_KLID: UInt = 0x040Cu
|
||||
|
||||
/** UK English (kbduk.dll) — US base with a handful of moved symbols. */
|
||||
const val UK_ENGLISH_KLID: UInt = 0x0809u
|
||||
|
||||
/** The ISO 102nd key (between left Shift and Z on non-US boards). */
|
||||
const val SC_ISO_102: Int = 0x56
|
||||
|
||||
/**
|
||||
* Full char→keystroke table for a base-remapped [layoutKlid], or null when
|
||||
* the layout is US-based (overlay layouts included) and the plain ASCII path
|
||||
* applies. Returned tables are SELF-CONTAINED: a missing char means the
|
||||
* layout needs a dead-key composition for it, and the caller must use the
|
||||
* unicode fallback, not the US table.
|
||||
*/
|
||||
fun baseRemapTableFor(layoutKlid: UInt): Map<Char, LayoutKeystroke>? = when (layoutKlid) {
|
||||
GERMAN_QWERTZ_KLID -> GERMAN_QWERTZ_BASE
|
||||
FRENCH_AZERTY_KLID -> FRENCH_AZERTY_BASE
|
||||
UK_ENGLISH_KLID -> UK_ENGLISH_BASE
|
||||
else -> null
|
||||
}
|
||||
|
||||
// US-layout AT scancodes (Set 1) for letters a..z. Indexed by ch - 'a'.
|
||||
private val LOWER_LETTER_SC = intArrayOf(
|
||||
0x1E, 0x30, 0x2E, 0x20, 0x12, 0x21, 0x22, 0x23, 0x17, 0x24, // a..j
|
||||
0x25, 0x26, 0x32, 0x31, 0x18, 0x19, 0x10, 0x13, 0x1F, 0x14, // k..t
|
||||
0x16, 0x2F, 0x11, 0x2D, 0x15, 0x2C, // u..z
|
||||
)
|
||||
|
||||
// US-layout scancodes for digits 0..9. Indexed by ch - '0'.
|
||||
private val DIGIT_SC = intArrayOf(
|
||||
0x0B, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
|
||||
)
|
||||
|
||||
// Control keys sit on the same scancodes in every layout.
|
||||
private val CONTROL_KEYSTROKES: Map<Char, LayoutKeystroke> = mapOf(
|
||||
' ' to LayoutKeystroke(0x39),
|
||||
'\t' to LayoutKeystroke(0x0F),
|
||||
'\n' to LayoutKeystroke(0x1C),
|
||||
'\r' to LayoutKeystroke(0x1C),
|
||||
'\b' to LayoutKeystroke(0x0E),
|
||||
)
|
||||
|
||||
// German QWERTZ (kbdgr.dll), T1. Dead keys ´ ` ^ have no entry — they need a
|
||||
// two-key composition (dead + space) the synthesis deliberately avoids; those
|
||||
// chars take the unicode fallback.
|
||||
private val GERMAN_QWERTZ_BASE: Map<Char, LayoutKeystroke> = buildMap {
|
||||
// Letters: US positions except the y/z swap.
|
||||
"abcdefghijklmnopqrstuvwx".forEach { c ->
|
||||
put(c, LayoutKeystroke(LOWER_LETTER_SC[c - 'a']))
|
||||
put(c.uppercaseChar(), LayoutKeystroke(LOWER_LETTER_SC[c - 'a'], shift = true))
|
||||
}
|
||||
put('y', LayoutKeystroke(0x2C)); put('Y', LayoutKeystroke(0x2C, shift = true))
|
||||
put('z', LayoutKeystroke(0x15)); put('Z', LayoutKeystroke(0x15, shift = true))
|
||||
// Digit row: plain digits; shifted symbols; AltGr brackets.
|
||||
"1234567890".forEachIndexed { i, c -> put(c, LayoutKeystroke(0x02 + i)) }
|
||||
"!\"§$%&/()=".forEachIndexed { i, c -> put(c, LayoutKeystroke(0x02 + i, shift = true)) }
|
||||
put('²', LayoutKeystroke(0x03, altGr = true))
|
||||
put('³', LayoutKeystroke(0x04, altGr = true))
|
||||
put('{', LayoutKeystroke(0x08, altGr = true))
|
||||
put('[', LayoutKeystroke(0x09, altGr = true))
|
||||
put(']', LayoutKeystroke(0x0A, altGr = true))
|
||||
put('}', LayoutKeystroke(0x0B, altGr = true))
|
||||
// ß key (right of 0) and its friends.
|
||||
put('ß', LayoutKeystroke(0x0C))
|
||||
put('?', LayoutKeystroke(0x0C, shift = true))
|
||||
put('\\', LayoutKeystroke(0x0C, altGr = true))
|
||||
// Umlaut keys and neighbours.
|
||||
put('ü', LayoutKeystroke(0x1A)); put('Ü', LayoutKeystroke(0x1A, shift = true))
|
||||
put('+', LayoutKeystroke(0x1B))
|
||||
put('*', LayoutKeystroke(0x1B, shift = true))
|
||||
put('~', LayoutKeystroke(0x1B, altGr = true))
|
||||
put('ö', LayoutKeystroke(0x27)); put('Ö', LayoutKeystroke(0x27, shift = true))
|
||||
put('ä', LayoutKeystroke(0x28)); put('Ä', LayoutKeystroke(0x28, shift = true))
|
||||
put('°', LayoutKeystroke(0x29, shift = true))
|
||||
put('#', LayoutKeystroke(0x2B))
|
||||
put('\'', LayoutKeystroke(0x2B, shift = true))
|
||||
put(',', LayoutKeystroke(0x33)); put(';', LayoutKeystroke(0x33, shift = true))
|
||||
put('.', LayoutKeystroke(0x34)); put(':', LayoutKeystroke(0x34, shift = true))
|
||||
put('-', LayoutKeystroke(0x35)); put('_', LayoutKeystroke(0x35, shift = true))
|
||||
put('<', LayoutKeystroke(SC_ISO_102))
|
||||
put('>', LayoutKeystroke(SC_ISO_102, shift = true))
|
||||
put('|', LayoutKeystroke(SC_ISO_102, altGr = true))
|
||||
put('@', LayoutKeystroke(0x10, altGr = true)) // AltGr+Q
|
||||
put('€', LayoutKeystroke(0x12, altGr = true)) // AltGr+E
|
||||
put('µ', LayoutKeystroke(0x32, altGr = true)) // AltGr+M
|
||||
}
|
||||
|
||||
// French AZERTY (kbdfr.dll). Dead keys (^ ¨ on 0x1A; AltGr ~ and `) have no
|
||||
// entry; capital accented letters (É È Ç À Ù) need Caps Lock on a real French
|
||||
// board, so they take the unicode fallback too.
|
||||
private val FRENCH_AZERTY_BASE: Map<Char, LayoutKeystroke> = buildMap {
|
||||
val letterPos = mapOf(
|
||||
'a' to 0x10, 'z' to 0x11, 'e' to 0x12, 'r' to 0x13, 't' to 0x14,
|
||||
'y' to 0x15, 'u' to 0x16, 'i' to 0x17, 'o' to 0x18, 'p' to 0x19,
|
||||
'q' to 0x1E, 's' to 0x1F, 'd' to 0x20, 'f' to 0x21, 'g' to 0x22,
|
||||
'h' to 0x23, 'j' to 0x24, 'k' to 0x25, 'l' to 0x26, 'm' to 0x27,
|
||||
'w' to 0x2C, 'x' to 0x2D, 'c' to 0x2E, 'v' to 0x2F, 'b' to 0x30,
|
||||
'n' to 0x31,
|
||||
)
|
||||
letterPos.forEach { (c, sc) ->
|
||||
put(c, LayoutKeystroke(sc))
|
||||
put(c.uppercaseChar(), LayoutKeystroke(sc, shift = true))
|
||||
}
|
||||
// Digit row: plain gives the national chars, SHIFT gives the digits.
|
||||
"&é\"'(-è_çà".forEachIndexed { i, c -> put(c, LayoutKeystroke(0x02 + i)) }
|
||||
"1234567890".forEachIndexed { i, c -> put(c, LayoutKeystroke(0x02 + i, shift = true)) }
|
||||
// AltGr row (non-dead only; ~ and ` are dead on AltGr+2/AltGr+7).
|
||||
put('#', LayoutKeystroke(0x04, altGr = true))
|
||||
put('{', LayoutKeystroke(0x05, altGr = true))
|
||||
put('[', LayoutKeystroke(0x06, altGr = true))
|
||||
put('|', LayoutKeystroke(0x07, altGr = true))
|
||||
put('\\', LayoutKeystroke(0x09, altGr = true))
|
||||
put('^', LayoutKeystroke(0x0A, altGr = true)) // AltGr+9: NON-dead caret
|
||||
put('@', LayoutKeystroke(0x0B, altGr = true))
|
||||
put('€', LayoutKeystroke(0x12, altGr = true))
|
||||
put(')', LayoutKeystroke(0x0C))
|
||||
put('°', LayoutKeystroke(0x0C, shift = true))
|
||||
put(']', LayoutKeystroke(0x0C, altGr = true))
|
||||
put('=', LayoutKeystroke(0x0D))
|
||||
put('+', LayoutKeystroke(0x0D, shift = true))
|
||||
put('}', LayoutKeystroke(0x0D, altGr = true))
|
||||
put('$', LayoutKeystroke(0x1B))
|
||||
put('£', LayoutKeystroke(0x1B, shift = true))
|
||||
put('¤', LayoutKeystroke(0x1B, altGr = true))
|
||||
put('ù', LayoutKeystroke(0x28))
|
||||
put('%', LayoutKeystroke(0x28, shift = true))
|
||||
put('²', LayoutKeystroke(0x29))
|
||||
put('*', LayoutKeystroke(0x2B))
|
||||
put('µ', LayoutKeystroke(0x2B, shift = true))
|
||||
put(',', LayoutKeystroke(0x32)); put('?', LayoutKeystroke(0x32, shift = true))
|
||||
put(';', LayoutKeystroke(0x33)); put('.', LayoutKeystroke(0x33, shift = true))
|
||||
put(':', LayoutKeystroke(0x34)); put('/', LayoutKeystroke(0x34, shift = true))
|
||||
put('!', LayoutKeystroke(0x35)); put('§', LayoutKeystroke(0x35, shift = true))
|
||||
put('<', LayoutKeystroke(SC_ISO_102))
|
||||
put('>', LayoutKeystroke(SC_ISO_102, shift = true))
|
||||
}
|
||||
|
||||
// UK (kbduk.dll): US base plus the handful of moved symbols. Built as the US
|
||||
// table with overrides, so it stays self-contained like the others.
|
||||
private val UK_ENGLISH_BASE: Map<Char, LayoutKeystroke> = buildMap {
|
||||
('a'..'z').forEach { c ->
|
||||
put(c, LayoutKeystroke(LOWER_LETTER_SC[c - 'a']))
|
||||
put(c.uppercaseChar(), LayoutKeystroke(LOWER_LETTER_SC[c - 'a'], shift = true))
|
||||
}
|
||||
"0123456789".forEach { c -> put(c, LayoutKeystroke(DIGIT_SC[c - '0'])) }
|
||||
"!$%^&*()".forEachIndexed { i, c ->
|
||||
// UK shift row matches US except positions 2 and 3 (see overrides).
|
||||
put(c, LayoutKeystroke(intArrayOf(0x02, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B)[i], shift = true))
|
||||
}
|
||||
put('-', LayoutKeystroke(0x0C)); put('_', LayoutKeystroke(0x0C, shift = true))
|
||||
put('=', LayoutKeystroke(0x0D)); put('+', LayoutKeystroke(0x0D, shift = true))
|
||||
put('[', LayoutKeystroke(0x1A)); put('{', LayoutKeystroke(0x1A, shift = true))
|
||||
put(']', LayoutKeystroke(0x1B)); put('}', LayoutKeystroke(0x1B, shift = true))
|
||||
put(';', LayoutKeystroke(0x27)); put(':', LayoutKeystroke(0x27, shift = true))
|
||||
put(',', LayoutKeystroke(0x33)); put('<', LayoutKeystroke(0x33, shift = true))
|
||||
put('.', LayoutKeystroke(0x34)); put('>', LayoutKeystroke(0x34, shift = true))
|
||||
put('/', LayoutKeystroke(0x35)); put('?', LayoutKeystroke(0x35, shift = true))
|
||||
// The UK differences: @ and " swap, £ on 2... on 3, # gets its own key,
|
||||
// backslash moves to the 102nd key, ` gains ¬, € rides AltGr+4.
|
||||
put('\'', LayoutKeystroke(0x28)); put('@', LayoutKeystroke(0x28, shift = true))
|
||||
put('"', LayoutKeystroke(0x03, shift = true))
|
||||
put('£', LayoutKeystroke(0x04, shift = true))
|
||||
put('#', LayoutKeystroke(0x2B)); put('~', LayoutKeystroke(0x2B, shift = true))
|
||||
put('\\', LayoutKeystroke(SC_ISO_102)); put('|', LayoutKeystroke(SC_ISO_102, shift = true))
|
||||
put('`', LayoutKeystroke(0x29)); put('¬', LayoutKeystroke(0x29, shift = true))
|
||||
put('€', LayoutKeystroke(0x05, altGr = true))
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an ASCII character to a Windows AT-keyboard Set 1 scancode
|
||||
* plus a shift indicator (true = needs left-shift held). Returns null
|
||||
* for chars that have no scancode on a US keyboard (use the Unicode
|
||||
* path for those).
|
||||
*
|
||||
* Mapping is US English (kbdusa.dll) — matches the keyboard_layout
|
||||
* (0x0409) advertised in `build_config`. Non-US layouts would emit
|
||||
* the wrong character on the server side. Out of scope for now.
|
||||
*/
|
||||
fun asciiCharToRdpScancode(ch: Char): Pair<Int, Boolean>? {
|
||||
val code = ch.code
|
||||
return when (ch) {
|
||||
in 'a'..'z' -> Pair(LOWER_LETTER_SC[code - 'a'.code], false)
|
||||
in 'A'..'Z' -> Pair(LOWER_LETTER_SC[code - 'A'.code], true)
|
||||
in '0'..'9' -> Pair(DIGIT_SC[code - '0'.code], false)
|
||||
' ' -> Pair(0x39, false)
|
||||
'\t' -> Pair(0x0F, false)
|
||||
'\n', '\r' -> Pair(0x1C, false)
|
||||
'\b' -> Pair(0x0E, false)
|
||||
'`' -> Pair(0x29, false); '~' -> Pair(0x29, true)
|
||||
'!' -> Pair(0x02, true)
|
||||
'@' -> Pair(0x03, true)
|
||||
'#' -> Pair(0x04, true)
|
||||
'$' -> Pair(0x05, true)
|
||||
'%' -> Pair(0x06, true)
|
||||
'^' -> Pair(0x07, true)
|
||||
'&' -> Pair(0x08, true)
|
||||
'*' -> Pair(0x09, true)
|
||||
'(' -> Pair(0x0A, true)
|
||||
')' -> Pair(0x0B, true)
|
||||
'-' -> Pair(0x0C, false); '_' -> Pair(0x0C, true)
|
||||
'=' -> Pair(0x0D, false); '+' -> Pair(0x0D, true)
|
||||
'[' -> Pair(0x1A, false); '{' -> Pair(0x1A, true)
|
||||
']' -> Pair(0x1B, false); '}' -> Pair(0x1B, true)
|
||||
'\\' -> Pair(0x2B, false); '|' -> Pair(0x2B, true)
|
||||
';' -> Pair(0x27, false); ':' -> Pair(0x27, true)
|
||||
'\'' -> Pair(0x28, false); '"' -> Pair(0x28, true)
|
||||
',' -> Pair(0x33, false); '<' -> Pair(0x33, true)
|
||||
'.' -> Pair(0x34, false); '>' -> Pair(0x34, true)
|
||||
'/' -> Pair(0x35, false); '?' -> Pair(0x35, true)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
// Public left-shift scancode (mirrors RdpScreen's private SC_SHIFT_L).
|
||||
const val SC_SHIFT_L_PUBLIC: Int = 0x2A
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,419 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import sh.haven.core.et.EtSessionManager
|
||||
import sh.haven.core.mosh.MoshSessionManager
|
||||
import sh.haven.core.data.db.entities.ConnectionLog
|
||||
import sh.haven.core.data.preferences.UserPreferencesRepository
|
||||
import sh.haven.core.data.repository.ConnectionLogRepository
|
||||
import sh.haven.core.rdp.RdpSession
|
||||
import sh.haven.core.rdp.RdpSessionManager
|
||||
import sh.haven.core.rdp.redactHost
|
||||
import sh.haven.core.rdp.redactUsername
|
||||
import sh.haven.core.ssh.SshClient
|
||||
import sh.haven.core.ssh.SshConnection
|
||||
import sh.haven.core.ssh.SshSessionManager
|
||||
import sh.haven.rdp.MouseButton
|
||||
import kotlinx.coroutines.flow.first
|
||||
import java.net.ConnectException
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import java.net.NoRouteToHostException
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
import javax.inject.Inject
|
||||
|
||||
private const val TAG = "RdpViewModel"
|
||||
|
||||
@HiltViewModel
|
||||
class RdpViewModel @Inject constructor(
|
||||
private val rdpSessionManager: RdpSessionManager,
|
||||
private val sshSessionManager: SshSessionManager,
|
||||
private val moshSessionManager: MoshSessionManager,
|
||||
private val etSessionManager: EtSessionManager,
|
||||
private val connectionLogRepository: ConnectionLogRepository,
|
||||
private val preferencesRepository: UserPreferencesRepository,
|
||||
private val tlsCertVerifier: sh.haven.core.data.agent.TlsCertVerifier,
|
||||
) : ViewModel() {
|
||||
|
||||
private val _frame = MutableStateFlow<Bitmap?>(null)
|
||||
val frame: StateFlow<Bitmap?> = _frame.asStateFlow()
|
||||
|
||||
/** #422: the frame bitmap is mutated in place, so its identity no longer
|
||||
* changes per update — the viewer repaints on this instead. */
|
||||
private val _frameSeq = MutableStateFlow(0L)
|
||||
val frameSeq: StateFlow<Long> = _frameSeq.asStateFlow()
|
||||
|
||||
private val _connected = MutableStateFlow(false)
|
||||
val connected: StateFlow<Boolean> = _connected.asStateFlow()
|
||||
|
||||
private val _error = MutableStateFlow<String?>(null)
|
||||
val error: StateFlow<String?> = _error.asStateFlow()
|
||||
|
||||
private var rdpSession: RdpSession? = null
|
||||
private var rdpVerboseBuffer: ConcurrentLinkedQueue<String>? = null
|
||||
private var rdpProfileId: String? = null
|
||||
private var tunnelPort: Int? = null
|
||||
private var tunnelSessionId: String? = null
|
||||
|
||||
/**
|
||||
* Connect RDP through an SSH tunnel.
|
||||
* Creates a local port forward and connects RDP to localhost.
|
||||
*/
|
||||
fun connectViaSsh(
|
||||
sessionId: String,
|
||||
remoteHost: String,
|
||||
remotePort: Int,
|
||||
username: String,
|
||||
password: String,
|
||||
domain: String = "",
|
||||
) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
_error.value = null
|
||||
val client = findSshClient(sessionId)
|
||||
?: throw IllegalStateException(
|
||||
"SSH session not found. Return to the Terminal tab and check the connection is still active."
|
||||
)
|
||||
val localPort = client.setPortForwardingL(
|
||||
"127.0.0.1", 0, remoteHost, remotePort,
|
||||
)
|
||||
tunnelPort = localPort
|
||||
tunnelSessionId = sessionId
|
||||
Log.d(TAG, "SSH tunnel: localhost:$localPort -> ${redactHost(remoteHost, remotePort)}")
|
||||
doConnect(
|
||||
"127.0.0.1", localPort, username, password, domain,
|
||||
certHost = remoteHost, certPort = remotePort,
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "SSH tunnel setup failed", e)
|
||||
_error.value = describeError(e, remoteHost, remotePort)
|
||||
val profileId = rdpProfileId
|
||||
if (profileId != null) {
|
||||
connectionLogRepository.logEvent(profileId, ConnectionLog.Status.FAILED, details = "SSH tunnel: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Set the connection profile ID for logging. Call before connect(). */
|
||||
fun setProfileId(profileId: String) {
|
||||
rdpProfileId = profileId
|
||||
}
|
||||
|
||||
fun connect(
|
||||
host: String,
|
||||
port: Int,
|
||||
username: String,
|
||||
password: String,
|
||||
domain: String = "",
|
||||
) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
_error.value = null
|
||||
doConnect(host, port, username, password, domain)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "RDP connect failed", e)
|
||||
_error.value = describeError(e, host, port)
|
||||
val profileId = rdpProfileId
|
||||
if (profileId != null) {
|
||||
connectionLogRepository.logEvent(profileId, ConnectionLog.Status.FAILED, details = e.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun doConnect(
|
||||
host: String,
|
||||
port: Int,
|
||||
username: String,
|
||||
password: String,
|
||||
domain: String,
|
||||
// Real remote for the TLS cert pin; defaults to the socket target. The
|
||||
// SSH-tunnel path passes the real remote (host here is 127.0.0.1).
|
||||
certHost: String = host,
|
||||
certPort: Int = port,
|
||||
) {
|
||||
Log.d(TAG, "doConnect: ${redactHost(host, port)} user=${redactUsername(username)} domain=${redactUsername(domain)}")
|
||||
val verboseEnabled = kotlinx.coroutines.runBlocking { preferencesRepository.verboseLoggingEnabled.first() }
|
||||
val verboseBuffer = if (verboseEnabled) ConcurrentLinkedQueue<String>() else null
|
||||
rdpVerboseBuffer = verboseBuffer
|
||||
val session = RdpSession(
|
||||
sessionId = "rdp-${System.currentTimeMillis()}",
|
||||
host = host,
|
||||
port = port,
|
||||
username = username,
|
||||
password = password,
|
||||
domain = domain,
|
||||
verboseBuffer = verboseBuffer,
|
||||
tlsCertVerifier = tlsCertVerifier,
|
||||
certHost = certHost,
|
||||
certPort = certPort,
|
||||
)
|
||||
|
||||
session.onFrameUpdate = { bitmap ->
|
||||
_frame.value = bitmap
|
||||
_frameSeq.value = _frameSeq.value + 1
|
||||
}
|
||||
session.onError = { e ->
|
||||
Log.e(TAG, "RDP error", e)
|
||||
_error.value = describeError(e, host, port)
|
||||
_connected.value = false
|
||||
}
|
||||
|
||||
rdpSession = session
|
||||
try {
|
||||
session.start()
|
||||
_connected.value = true
|
||||
Log.d(TAG, "RDP session started")
|
||||
// Log the connection with any verbose data captured during start()
|
||||
val profileId = rdpProfileId
|
||||
if (profileId != null) {
|
||||
val startLog = session.drainVerboseLog()
|
||||
connectionLogRepository.logEvent(profileId, ConnectionLog.Status.CONNECTED, verboseLog = startLog)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "RDP session.start() threw", e)
|
||||
_error.value = describeError(e, host, port)
|
||||
val profileId = rdpProfileId
|
||||
if (profileId != null) {
|
||||
val failLog = session.drainVerboseLog()
|
||||
connectionLogRepository.logEvent(profileId, ConnectionLog.Status.FAILED, details = e.message, verboseLog = failLog)
|
||||
}
|
||||
rdpSession = null
|
||||
}
|
||||
}
|
||||
|
||||
/** Find the SSH client for a session across all session managers. */
|
||||
private fun findSshClient(sessionId: String): SshConnection? {
|
||||
sshSessionManager.getSession(sessionId)?.let { return it.client }
|
||||
moshSessionManager.sessions.value[sessionId]?.sshClient?.let { return it as? SshClient }
|
||||
etSessionManager.sessions.value[sessionId]?.sshClient?.let { return it as? SshClient }
|
||||
return null
|
||||
}
|
||||
|
||||
fun disconnect() {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val verboseLog = rdpSession?.drainVerboseLog()
|
||||
rdpSession?.close()
|
||||
rdpSession = null
|
||||
val profileId = rdpProfileId
|
||||
if (profileId != null) {
|
||||
connectionLogRepository.logEvent(profileId, ConnectionLog.Status.DISCONNECTED, verboseLog = verboseLog)
|
||||
rdpProfileId = null
|
||||
}
|
||||
// Tear down SSH tunnel if one was created
|
||||
val tp = tunnelPort
|
||||
val tsId = tunnelSessionId
|
||||
if (tp != null && tsId != null) {
|
||||
try {
|
||||
findSshClient(tsId)?.delPortForwardingL("127.0.0.1", tp)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Failed to remove SSH tunnel", e)
|
||||
}
|
||||
tunnelPort = null
|
||||
tunnelSessionId = null
|
||||
}
|
||||
_connected.value = false
|
||||
_frame.value = null
|
||||
}
|
||||
}
|
||||
|
||||
// --- Input forwarding ---
|
||||
|
||||
/**
|
||||
* Every input event goes through here, in the order it happened.
|
||||
*
|
||||
* Each of these used to be its own `launch(Dispatchers.IO)`. That is a
|
||||
* multi-threaded pool, so two launches have no ordering guarantee between
|
||||
* them — a key *release* could reach the server before its own press. The
|
||||
* guest then holds the key down, which is @pawlosck's "last letter is
|
||||
* repeating forever" on #504, and the same inversion on a button press is
|
||||
* his "I have to press 20 times to minimize".
|
||||
*
|
||||
* It also explains the part of his report that looked like a contradiction:
|
||||
* "moving works correctly". Pointer movement is absolute and idempotent, so
|
||||
* reordering it is invisible. Only the paired press/release events break,
|
||||
* which is exactly the set that misbehaved.
|
||||
*
|
||||
* `limitedParallelism(1)` keeps the work off the main thread while running
|
||||
* it one at a time, in submission order. Input all originates on the main
|
||||
* thread, so submission order is the order the user did things.
|
||||
*/
|
||||
@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
|
||||
private val inputDispatcher = Dispatchers.IO.limitedParallelism(1)
|
||||
|
||||
fun sendPointer(x: Int, y: Int) {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseMove(x, y) }
|
||||
}
|
||||
|
||||
fun sendClick(x: Int, y: Int, button: MouseButton = MouseButton.LEFT) {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseClick(x, y, button) }
|
||||
}
|
||||
|
||||
fun pressButton(button: MouseButton = MouseButton.LEFT) {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseButton(button, true) }
|
||||
}
|
||||
|
||||
fun releaseButton(button: MouseButton = MouseButton.LEFT) {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseButton(button, false) }
|
||||
}
|
||||
|
||||
fun sendKey(scancode: Int, pressed: Boolean) {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendKey(scancode, pressed) }
|
||||
}
|
||||
|
||||
fun typeKey(scancode: Int) {
|
||||
viewModelScope.launch(inputDispatcher) {
|
||||
rdpSession?.sendKey(scancode, true)
|
||||
rdpSession?.sendKey(scancode, false)
|
||||
}
|
||||
}
|
||||
|
||||
fun typeUnicode(codepoint: Int) {
|
||||
viewModelScope.launch(inputDispatcher) {
|
||||
rdpSession?.sendUnicodeKey(codepoint, true)
|
||||
rdpSession?.sendUnicodeKey(codepoint, false)
|
||||
}
|
||||
}
|
||||
|
||||
fun scrollUp() {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseWheel(true, 120) }
|
||||
}
|
||||
|
||||
fun scrollDown() {
|
||||
viewModelScope.launch(inputDispatcher) { rdpSession?.sendMouseWheel(true, -120) }
|
||||
}
|
||||
|
||||
fun sendClipboardText(text: String) {
|
||||
viewModelScope.launch(Dispatchers.IO) { rdpSession?.sendClipboardText(text) }
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
disconnect()
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Render a Rust-side rustls failure message into something a human can act on.
|
||||
* The Rust layer (`rdp-kotlin/rust/src/lib.rs::diagnose_tls_error`) already
|
||||
* names the specific failure mode; we re-shape it for the end user and tack
|
||||
* on a hint about what to try server-side. (#109)
|
||||
*/
|
||||
private fun describeTlsFailure(msg: String): String {
|
||||
val classified = when {
|
||||
msg.contains("no shared TLS parameters", ignoreCase = true) ||
|
||||
msg.contains("PeerIncompatible", ignoreCase = true) -> buildString {
|
||||
append("TLS negotiation failed: no shared cipher / key-exchange / signature with the server.\n\n")
|
||||
append("Haven uses the rustls/ring TLS stack, which supports a narrower cipher set than ")
|
||||
append("Microsoft's Windows RDP client (SChannel) or OpenSSL. The most compatible server-side ")
|
||||
append("setting is ECDHE-RSA + AES-GCM over TLS 1.2 or 1.3.")
|
||||
}
|
||||
msg.contains("HandshakeFailure", ignoreCase = true) -> buildString {
|
||||
append("TLS handshake failed: server rejected our cipher list.\n\n")
|
||||
append("This usually means the server has no cipher suite in common with Haven. ")
|
||||
append("Enable ECDHE-RSA + AES-GCM (TLS 1.2 or 1.3) on the server, or check the server's RDP TLS configuration.")
|
||||
}
|
||||
msg.contains("certificate problem", ignoreCase = true) ||
|
||||
msg.contains("InvalidCertificate", ignoreCase = true) -> buildString {
|
||||
append("TLS handshake failed: server certificate problem.\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
msg.contains("ALPN", ignoreCase = true) -> buildString {
|
||||
append("TLS negotiation failed: server requires an application protocol Haven doesn't advertise.\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
else -> "TLS negotiation failed.\n\nDetail: $msg"
|
||||
}
|
||||
return classified + "\n\nIf this persists please file an issue at https://github.com/GlassHaven/Haven/issues with the message above."
|
||||
}
|
||||
|
||||
/** Map RDP/network exceptions to user-friendly messages. */
|
||||
fun describeError(e: Exception, host: String? = null, port: Int? = null): String {
|
||||
val portStr = port?.toString() ?: "3389"
|
||||
val hostStr = host ?: "the remote host"
|
||||
return when (e) {
|
||||
is ConnectException -> buildString {
|
||||
append("Connection refused")
|
||||
if (e.message?.contains("refused", ignoreCase = true) == true) {
|
||||
append(". No RDP server appears to be listening on $hostStr:$portStr.\n\n")
|
||||
append("Check:\n")
|
||||
append(" - Remote Desktop is enabled on the target machine\n")
|
||||
append(" - Linux: xrdp is installed and running\n")
|
||||
append(" - Port $portStr is not blocked by a firewall\n")
|
||||
append(" - Verify: ss -tlnp | grep $portStr")
|
||||
}
|
||||
}
|
||||
is SocketTimeoutException -> buildString {
|
||||
append("Connection timed out reaching $hostStr:$portStr.\n\n")
|
||||
append("Check:\n")
|
||||
append(" - Host address is correct\n")
|
||||
append(" - Port $portStr is not blocked by a firewall\n")
|
||||
append(" - If tunneling through SSH, the SSH session is still connected")
|
||||
}
|
||||
is UnknownHostException ->
|
||||
"Could not resolve hostname \"$hostStr\". Check the address is correct."
|
||||
is NoRouteToHostException ->
|
||||
"No route to $hostStr. Check your network connection and that the host is reachable."
|
||||
else -> {
|
||||
val msg = e.message ?: "Unknown error"
|
||||
when {
|
||||
// CredSSP MessageAltered = pub_key_auth hash mismatch.
|
||||
// Most often caused by gnome-remote-desktop /
|
||||
// FreeRDP-server interop bugs. The fix is server-side
|
||||
// (uncheck NLA on the connection profile).
|
||||
msg.contains("MessageAltered", ignoreCase = true) ||
|
||||
msg.contains("public-key hash", ignoreCase = true) -> buildString {
|
||||
append("Authentication failed: server rejected the CredSSP public-key hash.\n\n")
|
||||
append("This is usually a server-side interop bug — Linux gnome-remote-desktop ")
|
||||
append("and certain xrdp builds compute the hash differently than Haven's ironrdp/sspi-rs.\n\n")
|
||||
append("Workaround: edit this connection profile and uncheck \"Network Level Authentication (NLA)\". ")
|
||||
append("Without NLA, RDP authenticates after channel setup instead — slower but unaffected by this mismatch.\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
msg.contains("LogonDenied", ignoreCase = true) ||
|
||||
msg.contains("wrong username", ignoreCase = true) -> buildString {
|
||||
append("Authentication failed: wrong username or password.\n\n")
|
||||
append("For Linux/xrdp the credentials should match a system account; ")
|
||||
append("Domain can usually be left empty.\n\nDetail: $msg")
|
||||
}
|
||||
msg.contains("TimeSkew", ignoreCase = true) -> buildString {
|
||||
append("Authentication failed: clock skew with server is too large.\n\n")
|
||||
append("Check that the device's clock is correct (Settings → Date & time → Set automatically).\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
msg.contains("(CredSSP)", ignoreCase = true) ||
|
||||
msg.contains("Credssp", ignoreCase = true) -> buildString {
|
||||
append("Authentication failed during CredSSP/NLA.\n\n")
|
||||
append("Detail: $msg\n\n")
|
||||
append("If this is a Linux server, try unchecking \"Network Level Authentication (NLA)\" in the connection profile.")
|
||||
}
|
||||
msg.contains("Authentication", ignoreCase = true) -> buildString {
|
||||
append("Authentication failed.\n\n")
|
||||
append("Check your username and password.\n")
|
||||
append("For xrdp, the username/password should match a system account.\n")
|
||||
append("Domain can usually be left empty for Linux/xrdp connections.\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
msg.contains("TLS", ignoreCase = true) || msg.contains("SSL", ignoreCase = true) ->
|
||||
describeTlsFailure(msg)
|
||||
msg.contains("RDP security negotiation", ignoreCase = true) -> buildString {
|
||||
append("RDP security negotiation failed.\n\n")
|
||||
append("Detail: $msg")
|
||||
}
|
||||
else -> msg
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">جارٍ الاتصال…</string>
|
||||
<string name="rdp_status_connecting_hint">المصافحة جارية. إذا توقف، فعّل تسجيل الاتصال التفصيلي في الإعدادات وأعِد المحاولة لرؤية الخطأ الأساسي.</string>
|
||||
<string name="rdp_status_waiting_for_frame">متصل — في انتظار الإطار الأول…</string>
|
||||
<string name="rdp_status_connection_failed">فشل الاتصال</string>
|
||||
<string name="rdp_action_close">إغلاق</string>
|
||||
<string name="rdp_action_cancel">إلغاء</string>
|
||||
<string name="rdp_action_retry">إعادة المحاولة</string>
|
||||
<string name="rdp_cd_disconnect">قطع الاتصال</string>
|
||||
<string name="rdp_cd_toggle_keyboard">تبديل لوحة المفاتيح</string>
|
||||
<string name="rdp_cd_reset_zoom">إعادة ضبط التكبير</string>
|
||||
<string name="rdp_cd_fullscreen">ملء الشاشة</string>
|
||||
<string name="rdp_cd_session_menu">قائمة الجلسة</string>
|
||||
<string name="rdp_cd_exit_fullscreen">الخروج من ملء الشاشة</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">وضع لوحة التتبع مفعّل (اضغط للمس المباشر)</string>
|
||||
<string name="rdp_cd_input_mode_direct">وضع اللمس المباشر (اضغط للوحة التتبع)</string>
|
||||
<string name="rdp_orientation_landscape_desc">تثبيت أفقي (اضغط للتبديل إلى عمودي)</string>
|
||||
<string name="rdp_orientation_portrait_desc">تثبيت عمودي (اضغط للتبديل إلى تلقائي)</string>
|
||||
<string name="rdp_orientation_auto_desc">دوران تلقائي (اضغط للتبديل إلى أفقي)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">الخادم يستخدم بروتوكول RDP قديمًا غير مشفّر</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">يدعم Haven بروتوكول RDP المشفّر بـ TLS فقط. تفاوض خادمك (عادةً xrdp على Linux) على بروتوكول STANDARD_RDP_SECURITY المهمَل — عادةً بسبب فقدان شهادة TLS الخاصة بالخادم أو تعذّر قراءتها. أعِد إنشاء /etc/xrdp/cert.pem و /etc/xrdp/key.pem على الخادم، ثم أعِد تشغيل xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">تعليمات الإصلاح على جانب الخادم</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">رفض الخادم جلسة TLS أثناء NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">كان هذا في السابق عَرَضًا لخطأ في Haven تم إصلاحه في v5.24.37 — إذا كنت على إصدار أحدث ولا تزال ترى هذا، فقد لا يدعم الخادم CredSSP إطلاقًا. جرّب إلغاء تحديد Network Level Authentication في ملف تعريف الاتصال وأعِد الاتصال.</string>
|
||||
<string name="rdp_hint_logon_failure_title">اسم مستخدم أو كلمة مرور خاطئة</string>
|
||||
<string name="rdp_hint_logon_failure_body">أكمل الخادم CredSSP بنجاح ورفض بيانات اعتمادك. تحقّق من اسم المستخدم (جرّب DOMAIN\\User إذا كان الحساب منضمًّا إلى نطاق) وكلمة المرور.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">رفض الخادم تجزئة المفتاح العام لـ CredSSP</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">يحسب gnome-remote-desktop على Linux وبعض إصدارات xrdp تجزئة CredSSP pub_key_auth بطريقة مختلفة عن ironrdp/sspi-rs في Haven — تنجح مصافحة TLS لكن يفشل NLA في الطبقة الأعلى.\n\nالحل البديل: عدّل ملف تعريف هذا الاتصال وألغِ تحديد \"Network Level Authentication (NLA)\". سيعود RDP إلى المصادقة بعد إعداد القناة، وهو ما لا يمر عبر التجزئة غير المتطابقة.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">متتبّع المشكلات</string>
|
||||
<string name="rdp_hint_time_skew_title">ساعة الجهاز تختلف عن ساعة الخادم</string>
|
||||
<string name="rdp_hint_time_skew_body">يرفض CredSSP الجلسة عندما تختلف ساعة الجهاز عن ساعة الخادم بأكثر من بضع دقائق. تحقّق من الإعدادات ← التاريخ والوقت ← الضبط تلقائيًا وأعِد الاتصال.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">يتطلّب الخادم خوارزميات تشفير TLS لا يدعمها Haven</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">يستخدم Haven حزمة TLS الخاصة بـ rustls/ring، التي تغطي خوارزميات تشفير أضيق من عميل RDP من Microsoft (SChannel) أو OpenSSL. أكثر إعداد متوافق على جانب الخادم هو ECDHE-RSA + AES-GCM عبر TLS 1.2 أو 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">إصبعان يحرّكان العرض (اضغط لتمرير الشاشة البعيدة)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">إصبعان يمرّران الشاشة البعيدة (اضغط لتحريك العرض)</string>
|
||||
<string name="rdp_hint_nla_required_title">الخادم يتطلب مصادقة على مستوى الشبكة (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">تم إعداد الخادم لقبول العملاء الذين يصادقون عبر NLA فقط، وخيار NLA غير مُفعّل في ملف الاتصال هذا. فعّل “Network Level Authentication (NLA)” في الملف، أو خفّف الشرط على الحاسوب: الإعدادات ← النظام ← سطح المكتب البعيد ← الإعدادات المتقدمة ← أزل تحديد “Require devices to use Network Level Authentication”.</string>
|
||||
<string name="rdp_hint_mixed_username_title">لا يمكن لـ NLA استخدام هذا الشكل من اسم المستخدم</string>
|
||||
<string name="rdp_hint_mixed_username_body">يرفض NLA اسم مستخدم يجمع بين بادئة نطاق وعنوان بريد إلكتروني (مثل MicrosoftAccount\\you@example.com)، وفي حالة البريد الإلكتروني وحده يقتطع كل ما بعد الـ @ — وهو قيد في مكتبة sspi الأصلية بالنسبة لحسابات Microsoft.\n\nلحاسوب يستخدم حساب Microsoft: أزل تحديد “Network Level Authentication (NLA)” في هذا الملف، واسمح بالاتصالات بدون NLA على الحاسوب (سطح المكتب البعيد ← الإعدادات المتقدمة)، واستخدم MicrosoftAccount\\you@example.com أو you@example.com فقط كاسم مستخدم.</string>
|
||||
<string name="rdp_hint_mixed_username_link">متتبّع المشكلات</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">সংযোগ হচ্ছে…</string>
|
||||
<string name="rdp_status_connecting_hint">হ্যান্ডশেক চলছে। এটি আটকে থাকলে Settings-এ verbose লগিং চালু করে পুনরায় চেষ্টা করুন।</string>
|
||||
<string name="rdp_status_waiting_for_frame">সংযুক্ত — প্রথম ফ্রেমের জন্য অপেক্ষা করছে…</string>
|
||||
<string name="rdp_status_connection_failed">সংযোগ ব্যর্থ হয়েছে</string>
|
||||
<string name="rdp_action_close">বন্ধ</string>
|
||||
<string name="rdp_action_cancel">বাতিল</string>
|
||||
<string name="rdp_action_retry">পুনরায় চেষ্টা</string>
|
||||
<string name="rdp_cd_disconnect">সংযোগ বিচ্ছিন্ন</string>
|
||||
<string name="rdp_cd_toggle_keyboard">কীবোর্ড টগল</string>
|
||||
<string name="rdp_cd_reset_zoom">জুম রিসেট</string>
|
||||
<string name="rdp_cd_fullscreen">ফুলস্ক্রিন</string>
|
||||
<string name="rdp_cd_session_menu">সেশন মেনু</string>
|
||||
<string name="rdp_cd_exit_fullscreen">ফুলস্ক্রিন থেকে বেরিয়ে আসুন</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Trackpad মোড চালু (সরাসরি স্পর্শের জন্য ট্যাপ করুন)</string>
|
||||
<string name="rdp_cd_input_mode_direct">সরাসরি স্পর্শ মোড (trackpad-এর জন্য ট্যাপ করুন)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Landscape লক (portrait-এ যেতে ট্যাপ করুন)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Portrait লক (auto-তে যেতে ট্যাপ করুন)</string>
|
||||
<string name="rdp_orientation_auto_desc">স্বয়ংক্রিয় ঘোরানো (landscape-এ যেতে ট্যাপ করুন)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">সার্ভার পুরোনো, এনক্রিপশনহীন RDP ব্যবহার করছে</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven শুধু TLS-এনক্রিপ্টেড RDP সমর্থন করে। আপনার সার্ভার (Linux-এ সাধারণত xrdp) অবচিত STANDARD_RDP_SECURITY প্রোটোকল নেগোশিয়েট করেছে — সাধারণত কারণ সার্ভারের TLS সার্টিফিকেট অনুপস্থিত বা পঠনযোগ্য নয়। সার্ভারে /etc/xrdp/cert.pem এবং /etc/xrdp/key.pem পুনরায় তৈরি করুন, তারপর xrdp রিস্টার্ট করুন।</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">সার্ভার-সাইড সমাধানের নির্দেশনা</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">NLA চলাকালীন সার্ভার TLS সেশন প্রত্যাখ্যান করেছে</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">এটি আগে v5.24.37-এ ঠিক করা একটি Haven বাগের লক্ষণ ছিল — যদি আপনি নতুন বিল্ডে থাকেন এবং তবুও এটি দেখেন, সার্ভার হয়তো CredSSP একদমই বোঝে না। সংযোগ প্রোফাইলে Network Level Authentication আনটিক করে আবার সংযোগ করার চেষ্টা করুন।</string>
|
||||
<string name="rdp_hint_logon_failure_title">ভুল ইউজারনেম বা পাসওয়ার্ড</string>
|
||||
<string name="rdp_hint_logon_failure_body">সার্ভার CredSSP পরিষ্কারভাবে সম্পন্ন করেছে এবং আপনার credentials প্রত্যাখ্যান করেছে। ইউজারনেম (অ্যাকাউন্ট domain-যুক্ত হলে DOMAIN\\User চেষ্টা করুন) ও পাসওয়ার্ড যাচাই করুন।</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">সার্ভার CredSSP public-key hash প্রত্যাখ্যান করেছে</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop এবং কিছু xrdp বিল্ড CredSSP pub_key_auth hash Haven-এর ironrdp/sspi-rs থেকে ভিন্নভাবে গণনা করে — TLS handshake সফল হয় কিন্তু এক স্তর উপরে NLA ব্যর্থ হয়।\n\nWorkaround: এই সংযোগের প্রোফাইল সম্পাদনা করে \"Network Level Authentication (NLA)\" আনচেক করুন। RDP তখন চ্যানেল সেটআপের পরে authenticate করতে ফিরে যাবে, যা mismatched hash দিয়ে যায় না।</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Issue tracker</string>
|
||||
<string name="rdp_hint_time_skew_title">ডিভাইসের ঘড়ি সার্ভারের থেকে আলাদা</string>
|
||||
<string name="rdp_hint_time_skew_body">ডিভাইসের ঘড়ি সার্ভারের থেকে কয়েক মিনিটের বেশি আলাদা হলে CredSSP সেশন প্রত্যাখ্যান করে। Settings → Date & time → Set automatically দেখুন এবং আবার সংযোগ করুন।</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">সার্ভার এমন TLS ciphers চায় যা Haven সমর্থন করে না</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven rustls/ring TLS স্ট্যাক ব্যবহার করে, যার cipher কভারেজ Microsoft-এর RDP ক্লায়েন্ট (SChannel) বা OpenSSL-এর চেয়ে সংকীর্ণ। সবচেয়ে সামঞ্জস্যপূর্ণ সার্ভার-সাইড সেটিং হলো TLS 1.2 বা 1.3-এর উপর ECDHE-RSA + AES-GCM।</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">দুই আঙুলে ভিউ প্যান হয় (রিমোট স্ক্রোল করতে ট্যাপ করুন)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">দুই আঙুলে রিমোট স্ক্রোল হয় (ভিউ প্যান করতে ট্যাপ করুন)</string>
|
||||
<string name="rdp_hint_nla_required_title">সার্ভারের নেটওয়ার্ক লেভেল অথেনটিকেশন প্রয়োজন</string>
|
||||
<string name="rdp_hint_nla_required_body">সার্ভারটি কেবল NLA দিয়ে প্রমাণীকরণ করা ক্লায়েন্ট গ্রহণ করার জন্য কনফিগার করা, আর এই সংযোগ প্রোফাইলে NLA টিক দেওয়া নেই। হয় প্রোফাইলে “Network Level Authentication (NLA)” টিক দিন, নয়তো পিসিতে শর্তটি শিথিল করুন: Settings → System → Remote Desktop → Advanced settings → “Require devices to use Network Level Authentication” এর টিক তুলে দিন।</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA এই ধরনের ইউজারনেম ব্যবহার করতে পারে না</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA এমন ইউজারনেম প্রত্যাখ্যান করে যা ডোমেইন প্রিফিক্স ও ইমেইল ঠিকানা একসঙ্গে রাখে (যেমন MicrosoftAccount\\you@example.com), আর কেবল ইমেইল দিলে @ এর পরের সব কেটে ফেলে — Microsoft অ্যাকাউন্টের ক্ষেত্রে এটি upstream sspi লাইব্রেরির সীমাবদ্ধতা।\n\nMicrosoft অ্যাকাউন্টের পিসির জন্য: এই প্রোফাইলে “Network Level Authentication (NLA)” এর টিক তুলে দিন, পিসিতে NLA ছাড়া সংযোগ অনুমোদন করুন (Remote Desktop → Advanced settings), এবং ইউজারনেম হিসেবে MicrosoftAccount\\you@example.com বা শুধু you@example.com ব্যবহার করুন।</string>
|
||||
<string name="rdp_hint_mixed_username_link">ইস্যু ট্র্যাকার</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">Verbindung wird hergestellt…</string>
|
||||
<string name="rdp_status_connecting_hint">Handshake läuft. Falls dies hängt, ausführliches Verbindungsprotokoll in den Einstellungen aktivieren und erneut versuchen, um den genauen Fehler zu sehen.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Verbunden — warte auf ersten Frame…</string>
|
||||
<string name="rdp_status_connection_failed">Verbindung fehlgeschlagen</string>
|
||||
<string name="rdp_action_close">Schließen</string>
|
||||
<string name="rdp_action_cancel">Abbrechen</string>
|
||||
<string name="rdp_action_retry">Erneut versuchen</string>
|
||||
<string name="rdp_cd_disconnect">Trennen</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Tastatur ein-/ausblenden</string>
|
||||
<string name="rdp_cd_reset_zoom">Zoom zurücksetzen</string>
|
||||
<string name="rdp_cd_fullscreen">Vollbild</string>
|
||||
<string name="rdp_cd_session_menu">Sitzungsmenü</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Vollbild beenden</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Trackpad-Modus aktiv (Tippen für direkte Berührung)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Direktberührungs-Modus (Tippen für Trackpad)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Querformat sperren (Tippen zum Wechsel in Hochformat)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Hochformat sperren (Tippen zum Wechsel in Automatik)</string>
|
||||
<string name="rdp_orientation_auto_desc">Automatisch drehen (Tippen zum Wechsel in Querformat)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">Server verwendet veraltetes, unverschlüsseltes RDP</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven unterstützt nur TLS-verschlüsseltes RDP. Dein Server (häufig xrdp unter Linux) hat das veraltete Protokoll STANDARD_RDP_SECURITY ausgehandelt — meist weil das TLS-Zertifikat des Servers fehlt oder nicht lesbar ist. Erzeuge /etc/xrdp/cert.pem und /etc/xrdp/key.pem auf dem Server neu und starte xrdp anschließend neu.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Anleitung zur serverseitigen Behebung</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">Server hat die TLS-Sitzung während NLA abgelehnt</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">Dies war früher das Symptom eines in v5.24.37 behobenen Haven-Fehlers — wenn du eine neuere Version nutzt und dies weiterhin siehst, spricht der Server möglicherweise gar kein CredSSP. Deaktiviere die Network Level Authentication im Verbindungsprofil und verbinde erneut.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Falscher Benutzername oder falsches Passwort</string>
|
||||
<string name="rdp_hint_logon_failure_body">Der Server hat CredSSP sauber abgeschlossen und deine Anmeldedaten abgelehnt. Prüfe den Benutzernamen (probiere DOMAIN\\User, wenn das Konto einer Domäne angehört) und das Passwort.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">Server hat den CredSSP-Public-Key-Hash abgelehnt</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop und bestimmte xrdp-Versionen berechnen den CredSSP-pub_key_auth-Hash anders als Havens ironrdp/sspi-rs — der TLS-Handshake gelingt, aber NLA scheitert eine Ebene darüber.\n\nWorkaround: Bearbeite das Profil dieser Verbindung und deaktiviere \"Network Level Authentication (NLA)\". RDP authentifiziert dann nach dem Kanalaufbau, was den abweichenden Hash umgeht.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Issue-Tracker</string>
|
||||
<string name="rdp_hint_time_skew_title">Geräteuhr weicht von der des Servers ab</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP lehnt die Sitzung ab, wenn die Geräteuhr mehr als ein paar Minuten von der des Servers abweicht. Prüfe Einstellungen → Datum & Uhrzeit → Automatisch einstellen und verbinde erneut.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">Server erfordert TLS-Cipher, die Haven nicht unterstützt</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven verwendet den TLS-Stack rustls/ring, der eine geringere Cipher-Abdeckung als Microsofts RDP-Client (SChannel) oder OpenSSL hat. Die kompatibelste serverseitige Einstellung ist ECDHE-RSA + AES-GCM über TLS 1.2 oder 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">Zwei Finger verschieben die Ansicht (tippen, um den entfernten Bildschirm zu scrollen)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Zwei Finger scrollen den entfernten Bildschirm (tippen, um die Ansicht zu verschieben)</string>
|
||||
<string name="rdp_hint_nla_required_title">Server verlangt Authentifizierung auf Netzwerkebene (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">Der Server akzeptiert nur Clients, die sich per NLA authentifizieren, und NLA ist in diesem Verbindungsprofil nicht aktiviert. Aktiviere entweder „Network Level Authentication (NLA)“ im Profil oder lockere die Anforderung am PC: Einstellungen → System → Remotedesktop → Erweiterte Einstellungen → „Require devices to use Network Level Authentication“ abwählen.</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA kann diese Form des Benutzernamens nicht verwenden</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA lehnt einen Benutzernamen ab, der ein Domänenpräfix mit einer E-Mail-Adresse kombiniert (etwa MicrosoftAccount\\you@example.com), und bei einer reinen E-Mail-Adresse schneidet es alles nach dem @ ab — eine Einschränkung der zugrunde liegenden sspi-Bibliothek bei Microsoft-Konten.\n\nFür einen PC mit Microsoft-Konto: „Network Level Authentication (NLA)“ in diesem Profil abwählen, Verbindungen ohne NLA am PC erlauben (Remotedesktop → Erweiterte Einstellungen) und MicrosoftAccount\\you@example.com oder nur you@example.com als Benutzernamen verwenden.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Issue-Tracker</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rdp_status_connecting">Conectando…</string>
|
||||
<string name="rdp_status_connecting_hint">Negociación en curso. Si se queda colgado, activa el registro detallado en Ajustes y reintenta para ver el error subyacente.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Conectado — esperando el primer fotograma…</string>
|
||||
<string name="rdp_status_connection_failed">Conexión fallida</string>
|
||||
<string name="rdp_action_close">Cerrar</string>
|
||||
<string name="rdp_action_cancel">Cancelar</string>
|
||||
<string name="rdp_action_retry">Reintentar</string>
|
||||
<string name="rdp_cd_disconnect">Desconectar</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Mostrar/ocultar teclado</string>
|
||||
<string name="rdp_cd_reset_zoom">Restablecer zoom</string>
|
||||
<string name="rdp_cd_fullscreen">Pantalla completa</string>
|
||||
<string name="rdp_cd_session_menu">Menú de sesión</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Salir de pantalla completa</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Modo trackpad activado (toca para toque directo)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Modo de toque directo (toca para trackpad)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Bloquear horizontal (toca para cambiar a vertical)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Bloquear vertical (toca para cambiar a automático)</string>
|
||||
<string name="rdp_orientation_auto_desc">Rotación automática (toca para cambiar a horizontal)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">El servidor usa RDP heredado sin cifrar</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven solo admite RDP cifrado con TLS. Tu servidor (normalmente xrdp en Linux) negoció el protocolo obsoleto STANDARD_RDP_SECURITY, generalmente porque el certificado TLS del servidor falta o no se puede leer. Vuelve a generar /etc/xrdp/cert.pem y /etc/xrdp/key.pem en el servidor y reinicia xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Instrucciones de corrección del lado del servidor</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">El servidor rechazó la sesión TLS durante NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">Esto solía ser el síntoma de un error de Haven corregido en v5.24.37. Si usas una versión más reciente y aún lo ves, puede que el servidor no admita CredSSP en absoluto. Prueba a desmarcar Network Level Authentication en el perfil de conexión y vuelve a conectar.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Usuario o contraseña incorrectos</string>
|
||||
<string name="rdp_hint_logon_failure_body">El servidor completó CredSSP correctamente y rechazó tus credenciales. Comprueba el nombre de usuario (prueba DOMAIN\\User si la cuenta pertenece a un dominio) y la contraseña.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">El servidor rechazó el hash de clave pública de CredSSP</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">gnome-remote-desktop en Linux y ciertas versiones de xrdp calculan el hash pub_key_auth de CredSSP de forma distinta a ironrdp/sspi-rs de Haven: el handshake TLS funciona, pero NLA falla una capa más arriba.\n\nSolución alternativa: edita el perfil de esta conexión y desmarca \"Network Level Authentication (NLA)\". RDP recurrirá a autenticarse tras configurar el canal, lo que no pasa por el hash que no coincide.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Seguimiento de incidencias</string>
|
||||
<string name="rdp_hint_time_skew_title">El reloj del dispositivo difiere del servidor</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP rechaza la sesión cuando el reloj del dispositivo difiere del servidor en más de unos minutos. Comprueba Ajustes → Fecha y hora → Establecer automáticamente y vuelve a conectar.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">El servidor requiere cifrados TLS que Haven no admite</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven usa la pila TLS rustls/ring, que cubre menos cifrados que el cliente RDP de Microsoft (SChannel) u OpenSSL. La configuración del lado del servidor más compatible es ECDHE-RSA + AES-GCM sobre TLS 1.2 o 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">Dos dedos mueven la vista (toca para desplazar la pantalla remota)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Dos dedos desplazan la pantalla remota (toca para mover la vista)</string>
|
||||
<string name="rdp_hint_nla_required_title">El servidor requiere autenticación a nivel de red (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">El servidor está configurado para aceptar solo clientes que se autentiquen con NLA, y NLA está desmarcado en este perfil de conexión. Marca “Network Level Authentication (NLA)” en el perfil, o relaja el requisito en el PC: Configuración → Sistema → Escritorio remoto → Configuración avanzada → desmarca “Require devices to use Network Level Authentication”.</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA no admite este formato de nombre de usuario</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA rechaza un nombre de usuario que combina un prefijo de dominio con una dirección de correo (como MicrosoftAccount\\you@example.com), y con un correo a secas trunca todo lo que sigue a la @: una limitación de la biblioteca sspi original con las cuentas de Microsoft.\n\nPara un PC con cuenta de Microsoft: desmarca “Network Level Authentication (NLA)” en este perfil, permite conexiones sin NLA en el PC (Escritorio remoto → Configuración avanzada) y usa MicrosoftAccount\\you@example.com o solo you@example.com como nombre de usuario.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Rastreador de incidencias</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">Connexion…</string>
|
||||
<string name="rdp_status_connecting_hint">Poignée de main en cours. Si elle se bloque, activez la journalisation détaillée dans les Paramètres et réessayez pour voir l\'erreur sous-jacente.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Connecté — en attente de la première image…</string>
|
||||
<string name="rdp_status_connection_failed">Échec de la connexion</string>
|
||||
<string name="rdp_action_close">Fermer</string>
|
||||
<string name="rdp_action_cancel">Annuler</string>
|
||||
<string name="rdp_action_retry">Réessayer</string>
|
||||
<string name="rdp_cd_disconnect">Déconnecter</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Afficher/masquer le clavier</string>
|
||||
<string name="rdp_cd_reset_zoom">Réinitialiser le zoom</string>
|
||||
<string name="rdp_cd_fullscreen">Plein écran</string>
|
||||
<string name="rdp_cd_session_menu">Menu de session</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Quitter le plein écran</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Mode pavé tactile activé (appuyer pour toucher direct)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Mode toucher direct (appuyer pour pavé tactile)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Bloquer en paysage (appuyer pour passer en portrait)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Bloquer en portrait (appuyer pour passer en automatique)</string>
|
||||
<string name="rdp_orientation_auto_desc">Rotation automatique (appuyer pour passer en paysage)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">Le serveur utilise un RDP ancien non chiffré</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven ne prend en charge que le RDP chiffré par TLS. Votre serveur (souvent xrdp sous Linux) a négocié le protocole obsolète STANDARD_RDP_SECURITY — généralement parce que le certificat TLS du serveur est manquant ou illisible. Régénérez /etc/xrdp/cert.pem et /etc/xrdp/key.pem sur le serveur, puis redémarrez xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Instructions de correction côté serveur</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">Le serveur a rejeté la session TLS pendant NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">C\'était autrefois le symptôme d\'un bug de Haven corrigé en v5.24.37 — si vous êtes sur une version plus récente et que vous voyez toujours cela, le serveur ne prend peut-être pas du tout en charge CredSSP. Essayez de décocher Network Level Authentication dans le profil de connexion et reconnectez-vous.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Nom d\'utilisateur ou mot de passe incorrect</string>
|
||||
<string name="rdp_hint_logon_failure_body">Le serveur a terminé CredSSP proprement et a rejeté vos identifiants. Vérifiez le nom d\'utilisateur (essayez DOMAIN\\User si le compte appartient à un domaine) et le mot de passe.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">Le serveur a rejeté le hachage de clé publique CredSSP</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">gnome-remote-desktop sous Linux et certaines versions de xrdp calculent le hachage CredSSP pub_key_auth différemment de ironrdp/sspi-rs de Haven — la poignée de main TLS réussit, mais NLA échoue une couche plus haut.\n\nContournement : modifiez le profil de cette connexion et décochez \"Network Level Authentication (NLA)\". RDP basculera vers une authentification après la configuration du canal, ce qui ne passe pas par le hachage incompatible.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Suivi des problèmes</string>
|
||||
<string name="rdp_hint_time_skew_title">L\'horloge de l\'appareil diffère de celle du serveur</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP rejette la session lorsque l\'horloge de l\'appareil diffère de celle du serveur de plus de quelques minutes. Vérifiez Paramètres → Date et heure → Réglage automatique et reconnectez-vous.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">Le serveur exige des chiffrements TLS non pris en charge par Haven</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven utilise la pile TLS rustls/ring, dont la couverture de chiffrements est plus étroite que celle du client RDP de Microsoft (SChannel) ou d\'OpenSSL. Le réglage côté serveur le plus compatible est ECDHE-RSA + AES-GCM sur TLS 1.2 ou 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">Deux doigts déplacent la vue (toucher pour faire défiler l\'écran distant)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Deux doigts font défiler l\'écran distant (toucher pour déplacer la vue)</string>
|
||||
<string name="rdp_hint_nla_required_title">Le serveur exige l’authentification au niveau du réseau (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">Le serveur n’accepte que les clients qui s’authentifient via NLA, et NLA est décoché sur ce profil de connexion. Cochez « Network Level Authentication (NLA) » dans le profil, ou assouplissez l’exigence sur le PC : Paramètres → Système → Bureau à distance → Paramètres avancés → décochez « Require devices to use Network Level Authentication ».</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA ne peut pas utiliser ce format de nom d’utilisateur</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA rejette un nom d’utilisateur qui combine un préfixe de domaine et une adresse e-mail (comme MicrosoftAccount\\you@example.com), et pour une simple adresse e-mail il tronque tout ce qui suit le @ — une limitation de la bibliothèque sspi en amont pour les comptes Microsoft.\n\nPour un PC à compte Microsoft : décochez « Network Level Authentication (NLA) » sur ce profil, autorisez les connexions sans NLA sur le PC (Bureau à distance → Paramètres avancés), et utilisez MicrosoftAccount\\you@example.com ou simplement you@example.com comme nom d’utilisateur.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Suivi des tickets</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">कनेक्ट हो रहा है…</string>
|
||||
<string name="rdp_status_connecting_hint">Handshake जारी है। अगर यह रुका रहे, तो Settings में verbose connection logging चालू करें और अंदरूनी त्रुटि देखने के लिए पुनः प्रयास करें।</string>
|
||||
<string name="rdp_status_waiting_for_frame">कनेक्टेड — पहले frame की प्रतीक्षा…</string>
|
||||
<string name="rdp_status_connection_failed">कनेक्शन विफल</string>
|
||||
<string name="rdp_action_close">बंद करें</string>
|
||||
<string name="rdp_action_cancel">रद्द करें</string>
|
||||
<string name="rdp_action_retry">पुनः प्रयास करें</string>
|
||||
<string name="rdp_cd_disconnect">डिस्कनेक्ट करें</string>
|
||||
<string name="rdp_cd_toggle_keyboard">कीबोर्ड टॉगल करें</string>
|
||||
<string name="rdp_cd_reset_zoom">ज़ूम रीसेट करें</string>
|
||||
<string name="rdp_cd_fullscreen">फ़ुलस्क्रीन</string>
|
||||
<string name="rdp_cd_session_menu">Session मेनू</string>
|
||||
<string name="rdp_cd_exit_fullscreen">फ़ुलस्क्रीन से बाहर निकलें</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Trackpad mode चालू (सीधे touch के लिए टैप करें)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Direct touch mode (trackpad के लिए टैप करें)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Landscape लॉक (portrait पर स्विच करने के लिए टैप करें)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Portrait लॉक (auto पर स्विच करने के लिए टैप करें)</string>
|
||||
<string name="rdp_orientation_auto_desc">Auto rotate (landscape पर स्विच करने के लिए टैप करें)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">सर्वर पुराने, बिना एन्क्रिप्शन वाले RDP का उपयोग कर रहा है</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven केवल TLS-एन्क्रिप्टेड RDP का समर्थन करता है। आपके सर्वर (Linux पर आमतौर पर xrdp) ने अप्रचलित STANDARD_RDP_SECURITY प्रोटोकॉल पर बातचीत की — आमतौर पर इसलिए कि सर्वर का TLS सर्टिफिकेट गायब है या पढ़ा नहीं जा सकता। सर्वर पर /etc/xrdp/cert.pem और /etc/xrdp/key.pem फिर से जनरेट करें, फिर xrdp को रीस्टार्ट करें।</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">सर्वर-साइड फिक्स निर्देश</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">सर्वर ने NLA के दौरान TLS सेशन अस्वीकार किया</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">यह पहले v5.24.37 में ठीक किए गए एक Haven बग का लक्षण था — अगर आप नए बिल्ड पर हैं और फिर भी यह दिख रहा है, तो हो सकता है सर्वर CredSSP बिल्कुल न समझता हो। कनेक्शन प्रोफ़ाइल में Network Level Authentication को अनटिक करके फिर से कनेक्ट करने का प्रयास करें।</string>
|
||||
<string name="rdp_hint_logon_failure_title">गलत उपयोगकर्ता नाम या पासवर्ड</string>
|
||||
<string name="rdp_hint_logon_failure_body">सर्वर ने CredSSP साफ-सुथरे ढंग से पूरा किया और आपके credentials अस्वीकार कर दिए। उपयोगकर्ता नाम (यदि खाता domain-joined है तो DOMAIN\\User आज़माएँ) और पासवर्ड जाँचें।</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">सर्वर ने CredSSP public-key hash अस्वीकार किया</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop और कुछ xrdp बिल्ड CredSSP pub_key_auth hash को Haven के ironrdp/sspi-rs से अलग तरीके से गणना करते हैं — TLS handshake सफल होता है लेकिन एक परत ऊपर NLA विफल हो जाता है।\n\nWorkaround: इस कनेक्शन की प्रोफ़ाइल संपादित करें और \"Network Level Authentication (NLA)\" को अनचेक करें। तब RDP चैनल सेटअप के बाद authenticate करने पर वापस आ जाएगा, जो mismatched hash से नहीं गुज़रता।</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Issue tracker</string>
|
||||
<string name="rdp_hint_time_skew_title">डिवाइस की घड़ी सर्वर से भिन्न है</string>
|
||||
<string name="rdp_hint_time_skew_body">जब डिवाइस की घड़ी सर्वर से कुछ मिनट से अधिक भिन्न होती है, तो CredSSP सेशन अस्वीकार कर देता है। Settings → Date & time → Set automatically जाँचें और फिर से कनेक्ट करें।</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">सर्वर को ऐसे TLS ciphers चाहिए जिन्हें Haven समर्थित नहीं करता</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven rustls/ring TLS स्टैक का उपयोग करता है, जिसका cipher कवरेज Microsoft के RDP क्लाइंट (SChannel) या OpenSSL से संकीर्ण है। सबसे अधिक संगत सर्वर-साइड सेटिंग TLS 1.2 या 1.3 पर ECDHE-RSA + AES-GCM है।</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">दो उँगलियाँ व्यू पैन करती हैं (रिमोट स्क्रॉल करने के लिए टैप करें)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">दो उँगलियाँ रिमोट स्क्रॉल करती हैं (व्यू पैन करने के लिए टैप करें)</string>
|
||||
<string name="rdp_hint_nla_required_title">सर्वर को नेटवर्क लेवल ऑथेंटिकेशन चाहिए</string>
|
||||
<string name="rdp_hint_nla_required_body">सर्वर केवल उन क्लाइंट को स्वीकार करने के लिए कॉन्फ़िगर है जो NLA से प्रमाणीकरण करते हैं, और इस कनेक्शन प्रोफ़ाइल में NLA अनटिक है। या तो प्रोफ़ाइल में “Network Level Authentication (NLA)” टिक करें, या PC पर आवश्यकता ढीली करें: Settings → System → Remote Desktop → Advanced settings → “Require devices to use Network Level Authentication” अनटिक करें।</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA इस रूप का उपयोगकर्ता नाम नहीं ले सकता</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA ऐसा उपयोगकर्ता नाम अस्वीकार करता है जो डोमेन उपसर्ग और ईमेल पते को जोड़ता हो (जैसे MicrosoftAccount\\you@example.com), और सादे ईमेल के लिए वह @ के बाद सब कुछ काट देता है — Microsoft खातों के लिए यह अपस्ट्रीम sspi लाइब्रेरी की सीमा है।\n\nMicrosoft खाते वाले PC के लिए: इस प्रोफ़ाइल में “Network Level Authentication (NLA)” अनटिक करें, PC पर बिना NLA के कनेक्शन की अनुमति दें (Remote Desktop → Advanced settings), और उपयोगकर्ता नाम के रूप में MicrosoftAccount\\you@example.com या केवल you@example.com उपयोग करें।</string>
|
||||
<string name="rdp_hint_mixed_username_link">इश्यू ट्रैकर</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">接続中…</string>
|
||||
<string name="rdp_status_connecting_hint">ハンドシェイク中です。この状態が続く場合は、設定で詳細接続ログを有効にして再試行し、エラー内容を確認してください。</string>
|
||||
<string name="rdp_status_waiting_for_frame">接続しました — 最初のフレームを待機中…</string>
|
||||
<string name="rdp_status_connection_failed">接続に失敗しました</string>
|
||||
<string name="rdp_action_close">閉じる</string>
|
||||
<string name="rdp_action_cancel">キャンセル</string>
|
||||
<string name="rdp_action_retry">再試行</string>
|
||||
<string name="rdp_cd_disconnect">切断</string>
|
||||
<string name="rdp_cd_toggle_keyboard">キーボードを切り替え</string>
|
||||
<string name="rdp_cd_reset_zoom">ズームをリセット</string>
|
||||
<string name="rdp_cd_fullscreen">全画面</string>
|
||||
<string name="rdp_cd_session_menu">セッションメニュー</string>
|
||||
<string name="rdp_cd_exit_fullscreen">全画面を終了</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">トラックパッドモード オン(タップでダイレクトタッチ)</string>
|
||||
<string name="rdp_cd_input_mode_direct">ダイレクトタッチモード(タップでトラックパッド)</string>
|
||||
<string name="rdp_orientation_landscape_desc">横向きにロック(タップで縦向きに切替)</string>
|
||||
<string name="rdp_orientation_portrait_desc">縦向きにロック(タップで自動回転に切替)</string>
|
||||
<string name="rdp_orientation_auto_desc">自動回転(タップで横向きに切替)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">サーバーが旧式の暗号化なし RDP を使用しています</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven は TLS 暗号化 RDP のみをサポートします。お使いのサーバー(Linux では通常 xrdp)は非推奨の STANDARD_RDP_SECURITY プロトコルをネゴシエートしました。通常はサーバーの TLS 証明書が見つからないか読み取れないためです。サーバー上で /etc/xrdp/cert.pem と /etc/xrdp/key.pem を再生成し、xrdp を再起動してください。</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">サーバー側の修正手順</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">NLA 中にサーバーが TLS セッションを拒否しました</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">これは以前、v5.24.37 で修正された Haven の不具合の症状でした。より新しいビルドでこれが表示される場合、サーバーが CredSSP をまったくサポートしていない可能性があります。接続プロファイルで Network Level Authentication のチェックを外して再接続してみてください。</string>
|
||||
<string name="rdp_hint_logon_failure_title">ユーザー名またはパスワードが違います</string>
|
||||
<string name="rdp_hint_logon_failure_body">サーバーは CredSSP を正常に完了し、資格情報を拒否しました。ユーザー名(アカウントがドメイン参加している場合は DOMAIN\\User を試してください)とパスワードを確認してください。</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">サーバーが CredSSP 公開鍵ハッシュを拒否しました</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux の gnome-remote-desktop と一部の xrdp ビルドは、CredSSP の pub_key_auth ハッシュを Haven の ironrdp/sspi-rs とは異なる方法で計算します。TLS ハンドシェイクは成功しますが、その 1 つ上の層で NLA が失敗します。\n\n回避策: この接続のプロファイルを編集し、\"Network Level Authentication (NLA)\" のチェックを外してください。RDP はチャネル設定後に認証する方式にフォールバックし、不一致のハッシュを経由しなくなります。</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">課題トラッカー</string>
|
||||
<string name="rdp_hint_time_skew_title">デバイスの時計がサーバーと異なります</string>
|
||||
<string name="rdp_hint_time_skew_body">デバイスの時計がサーバーから数分以上ずれていると、CredSSP はセッションを拒否します。設定 → 日付と時刻 → 自動設定 を確認して再接続してください。</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">サーバーが Haven の非対応 TLS 暗号スイートを要求しています</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven は rustls/ring TLS スタックを使用しており、Microsoft の RDP クライアント(SChannel)や OpenSSL よりも対応する暗号スイートが狭い範囲です。最も互換性の高いサーバー側設定は、TLS 1.2 または 1.3 上の ECDHE-RSA + AES-GCM です。</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">2 本指でビューをパン(タップでリモート側のスクロールに切替)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">2 本指でリモート側をスクロール(タップでビューのパンに切替)</string>
|
||||
<string name="rdp_hint_nla_required_title">サーバーがネットワーク レベル認証 (NLA) を要求しています</string>
|
||||
<string name="rdp_hint_nla_required_body">サーバーは NLA で認証するクライアントのみを受け入れる設定ですが、この接続プロファイルでは NLA がオフです。プロファイルで「Network Level Authentication (NLA)」をオンにするか、PC 側で要件を緩めてください: 設定 → システム → リモート デスクトップ → 詳細設定 →「Require devices to use Network Level Authentication」のチェックを外します。</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA はこの形式のユーザー名を使えません</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA は、ドメイン接頭辞とメールアドレスを組み合わせたユーザー名 (MicrosoftAccount\\you@example.com など) を拒否し、メールアドレスだけの場合は @ 以降をすべて切り捨てます。これは Microsoft アカウントに関する上流 sspi ライブラリの制限です。\n\nMicrosoft アカウントの PC では: このプロファイルで「Network Level Authentication (NLA)」をオフにし、PC 側で NLA なしの接続を許可し (リモート デスクトップ → 詳細設定)、ユーザー名に MicrosoftAccount\\you@example.com または you@example.com を使ってください。</string>
|
||||
<string name="rdp_hint_mixed_username_link">課題トラッカー</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rdp_status_connecting">연결 중…</string>
|
||||
<string name="rdp_status_connecting_hint">핸드셰이크 진행 중. 멈추면 설정에서 자세한 연결 로깅을 켜고 재시도하여 오류를 확인하세요.</string>
|
||||
<string name="rdp_status_waiting_for_frame">연결됨 — 첫 번째 프레임 대기 중…</string>
|
||||
<string name="rdp_status_connection_failed">연결 실패</string>
|
||||
<string name="rdp_action_close">닫기</string>
|
||||
<string name="rdp_action_cancel">취소</string>
|
||||
<string name="rdp_action_retry">재시도</string>
|
||||
<string name="rdp_cd_disconnect">연결 해제</string>
|
||||
<string name="rdp_cd_toggle_keyboard">키보드 전환</string>
|
||||
<string name="rdp_cd_reset_zoom">확대/축소 초기화</string>
|
||||
<string name="rdp_cd_fullscreen">전체 화면</string>
|
||||
<string name="rdp_cd_session_menu">세션 메뉴</string>
|
||||
<string name="rdp_cd_exit_fullscreen">전체 화면 종료</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">트랙패드 모드 켜짐 (직접 터치로 전환하려면 탭)</string>
|
||||
<string name="rdp_cd_input_mode_direct">직접 터치 모드 (트랙패드로 전환하려면 탭)</string>
|
||||
<string name="rdp_orientation_landscape_desc">가로 고정 (세로로 전환하려면 탭)</string>
|
||||
<string name="rdp_orientation_portrait_desc">세로 고정 (자동으로 전환하려면 탭)</string>
|
||||
<string name="rdp_orientation_auto_desc">자동 회전 (가로로 전환하려면 탭)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">서버가 암호화되지 않은 구형 RDP를 사용 중입니다</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven은 TLS로 암호화된 RDP만 지원합니다. 서버(Linux에서는 보통 xrdp)가 더 이상 사용되지 않는 STANDARD_RDP_SECURITY 프로토콜을 협상했습니다. 대개 서버의 TLS 인증서가 없거나 읽을 수 없기 때문입니다. 서버에서 /etc/xrdp/cert.pem과 /etc/xrdp/key.pem을 다시 생성한 다음 xrdp를 재시작하세요.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">서버 측 해결 방법 안내</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">NLA 중 서버가 TLS 세션을 거부했습니다</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">이는 예전에 v5.24.37에서 수정된 Haven 버그의 증상이었습니다. 더 새로운 빌드를 사용 중인데도 이 메시지가 보인다면, 서버가 CredSSP를 전혀 지원하지 않을 수 있습니다. 연결 프로필에서 Network Level Authentication 체크를 해제하고 다시 연결해 보세요.</string>
|
||||
<string name="rdp_hint_logon_failure_title">잘못된 사용자 이름 또는 비밀번호</string>
|
||||
<string name="rdp_hint_logon_failure_body">서버가 CredSSP를 정상적으로 완료하고 자격 증명을 거부했습니다. 사용자 이름(계정이 도메인에 가입되어 있다면 DOMAIN\\User 시도)과 비밀번호를 확인하세요.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">서버가 CredSSP 공개 키 해시를 거부했습니다</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop과 일부 xrdp 빌드는 CredSSP pub_key_auth 해시를 Haven의 ironrdp/sspi-rs와 다르게 계산합니다. TLS 핸드셰이크는 성공하지만 한 계층 위에서 NLA가 실패합니다.\n\n해결 방법: 이 연결의 프로필을 편집하고 \"Network Level Authentication (NLA)\"의 체크를 해제하세요. 그러면 RDP는 채널 설정 후에 인증하는 방식으로 대체되어, 일치하지 않는 해시를 거치지 않습니다.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">이슈 트래커</string>
|
||||
<string name="rdp_hint_time_skew_title">기기 시계가 서버와 다릅니다</string>
|
||||
<string name="rdp_hint_time_skew_body">기기 시계가 서버와 몇 분 이상 차이 나면 CredSSP가 세션을 거부합니다. 설정 → 날짜 및 시간 → 자동 설정을 확인하고 다시 연결하세요.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">서버가 Haven이 지원하지 않는 TLS 암호를 요구합니다</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven은 rustls/ring TLS 스택을 사용하며, Microsoft의 RDP 클라이언트(SChannel)나 OpenSSL보다 지원하는 암호 범위가 좁습니다. 가장 호환성이 좋은 서버 측 설정은 TLS 1.2 또는 1.3에서의 ECDHE-RSA + AES-GCM입니다.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">두 손가락으로 화면 이동 (원격 스크롤로 전환하려면 탭)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">두 손가락으로 원격 스크롤 (화면 이동으로 전환하려면 탭)</string>
|
||||
<string name="rdp_hint_nla_required_title">서버가 네트워크 수준 인증(NLA)을 요구합니다</string>
|
||||
<string name="rdp_hint_nla_required_body">서버는 NLA로 인증하는 클라이언트만 허용하도록 설정되어 있지만, 이 연결 프로필에서는 NLA가 꺼져 있습니다. 프로필에서 “Network Level Authentication (NLA)”을 켜거나, PC에서 요구 사항을 완화하세요: 설정 → 시스템 → 원격 데스크톱 → 고급 설정 → “Require devices to use Network Level Authentication” 체크 해제.</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA는 이 형식의 사용자 이름을 사용할 수 없습니다</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA는 도메인 접두사와 이메일 주소를 결합한 사용자 이름(예: MicrosoftAccount\\you@example.com)을 거부하며, 이메일만 입력하면 @ 뒤를 모두 잘라냅니다 — Microsoft 계정에 대한 상위 sspi 라이브러리의 제약입니다.\n\nMicrosoft 계정 PC의 경우: 이 프로필에서 “Network Level Authentication (NLA)” 체크를 해제하고, PC에서 NLA 없는 연결을 허용한 뒤(원격 데스크톱 → 고급 설정), 사용자 이름으로 MicrosoftAccount\\you@example.com 또는 you@example.com을 사용하세요.</string>
|
||||
<string name="rdp_hint_mixed_username_link">이슈 트래커</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">Conectando…</string>
|
||||
<string name="rdp_status_connecting_hint">Handshake em andamento. Se travar, ative o registro detalhado em Configurações e tente novamente para ver o erro subjacente.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Conectado — aguardando primeiro quadro…</string>
|
||||
<string name="rdp_status_connection_failed">Falha na conexão</string>
|
||||
<string name="rdp_action_close">Fechar</string>
|
||||
<string name="rdp_action_cancel">Cancelar</string>
|
||||
<string name="rdp_action_retry">Tentar novamente</string>
|
||||
<string name="rdp_cd_disconnect">Desconectar</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Alternar teclado</string>
|
||||
<string name="rdp_cd_reset_zoom">Redefinir zoom</string>
|
||||
<string name="rdp_cd_fullscreen">Tela cheia</string>
|
||||
<string name="rdp_cd_session_menu">Menu de sessão</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Sair da tela cheia</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Modo trackpad ativado (toque para toque direto)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Modo toque direto (toque para trackpad)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Fixar paisagem (toque para retrato)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Fixar retrato (toque para automático)</string>
|
||||
<string name="rdp_orientation_auto_desc">Rotação automática (toque para paisagem)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">O servidor está usando RDP antigo sem criptografia</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">O Haven só oferece suporte a RDP criptografado com TLS. Seu servidor (geralmente o xrdp no Linux) negociou o protocolo obsoleto STANDARD_RDP_SECURITY — normalmente porque o certificado TLS do servidor está ausente ou ilegível. Gere novamente /etc/xrdp/cert.pem e /etc/xrdp/key.pem no servidor e reinicie o xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Instruções de correção no servidor</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">O servidor rejeitou a sessão TLS durante a NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">Isso costumava ser o sintoma de um bug do Haven corrigido na v5.24.37 — se você está em uma versão mais nova e ainda vê isso, o servidor pode não falar CredSSP de jeito nenhum. Tente desmarcar Network Level Authentication no perfil de conexão e reconectar.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Usuário ou senha incorretos</string>
|
||||
<string name="rdp_hint_logon_failure_body">O servidor concluiu o CredSSP corretamente e rejeitou suas credenciais. Verifique o nome de usuário (tente DOMAIN\\User se a conta estiver associada a um domínio) e a senha.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">O servidor rejeitou o hash de chave pública do CredSSP</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">O gnome-remote-desktop no Linux e certas versões do xrdp calculam o hash pub_key_auth do CredSSP de forma diferente do ironrdp/sspi-rs do Haven — o handshake TLS é bem-sucedido, mas a NLA falha uma camada acima.\n\nSolução alternativa: edite o perfil desta conexão e desmarque \"Network Level Authentication (NLA)\". O RDP voltará a autenticar após a configuração do canal, o que não passa pelo hash incompatível.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Rastreador de problemas</string>
|
||||
<string name="rdp_hint_time_skew_title">O relógio do dispositivo difere do servidor</string>
|
||||
<string name="rdp_hint_time_skew_body">O CredSSP rejeita a sessão quando o relógio do dispositivo está a mais de alguns minutos de diferença do servidor. Verifique Configurações → Data e hora → Definir automaticamente e reconecte.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">O servidor exige cifras TLS que o Haven não oferece suporte</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">O Haven usa a pilha TLS rustls/ring, que cobre menos cifras do que o cliente RDP da Microsoft (SChannel) ou o OpenSSL. A configuração mais compatível no servidor é ECDHE-RSA + AES-GCM sobre TLS 1.2 ou 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">Dois dedos deslocam a visualização (toque para rolar o remoto)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Dois dedos rolam o remoto (toque para deslocar a visualização)</string>
|
||||
<string name="rdp_hint_nla_required_title">O servidor exige Autenticação em Nível de Rede (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">O servidor está configurado para aceitar apenas clientes que autenticam com NLA, e o NLA está desmarcado neste perfil de conexão. Marque “Network Level Authentication (NLA)” no perfil ou relaxe a exigência no PC: Configurações → Sistema → Área de Trabalho Remota → Configurações avançadas → desmarque “Require devices to use Network Level Authentication”.</string>
|
||||
<string name="rdp_hint_mixed_username_title">O NLA não aceita este formato de nome de usuário</string>
|
||||
<string name="rdp_hint_mixed_username_body">O NLA rejeita um nome de usuário que combina um prefixo de domínio com um endereço de e-mail (como MicrosoftAccount\\you@example.com) e, para um e-mail simples, trunca tudo depois do @ — uma limitação da biblioteca sspi upstream para contas Microsoft.\n\nPara um PC com conta Microsoft: desmarque “Network Level Authentication (NLA)” neste perfil, permita conexões sem NLA no PC (Área de Trabalho Remota → Configurações avançadas) e use MicrosoftAccount\\you@example.com ou apenas you@example.com como nome de usuário.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Rastreador de problemas</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rdp_status_connecting">Подключение…</string>
|
||||
<string name="rdp_status_connecting_hint">Выполняется рукопожатие. Если завис, включите подробный журнал подключений в Настройках и повторите попытку, чтобы увидеть причину ошибки.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Подключено — ожидание первого кадра…</string>
|
||||
<string name="rdp_status_connection_failed">Ошибка подключения</string>
|
||||
<string name="rdp_action_close">Закрыть</string>
|
||||
<string name="rdp_action_cancel">Отмена</string>
|
||||
<string name="rdp_action_retry">Повторить</string>
|
||||
<string name="rdp_cd_disconnect">Отключить</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Показать/скрыть клавиатуру</string>
|
||||
<string name="rdp_cd_reset_zoom">Сбросить масштаб</string>
|
||||
<string name="rdp_cd_fullscreen">Полный экран</string>
|
||||
<string name="rdp_cd_session_menu">Меню сессии</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Выйти из полного экрана</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Режим трекпада включён (нажмите для прямого касания)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Режим прямого касания (нажмите для трекпада)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Заблокировать альбомную (нажмите для переключения на портретную)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Заблокировать портретную (нажмите для переключения на авто)</string>
|
||||
<string name="rdp_orientation_auto_desc">Авто-поворот (нажмите для переключения на альбомную)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">Сервер использует устаревший незашифрованный RDP</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven поддерживает только RDP с шифрованием TLS. Ваш сервер (обычно xrdp в Linux) согласовал устаревший протокол STANDARD_RDP_SECURITY — как правило, потому что TLS-сертификат сервера отсутствует или нечитаем. Перегенерируйте /etc/xrdp/cert.pem и /etc/xrdp/key.pem на сервере, затем перезапустите xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Инструкции по исправлению на стороне сервера</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">Сервер отклонил сессию TLS во время NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">Раньше это было симптомом ошибки Haven, исправленной в v5.24.37 — если у вас более новая сборка, но вы всё равно видите это, сервер, возможно, вообще не поддерживает CredSSP. Попробуйте снять флажок Network Level Authentication в профиле подключения и переподключиться.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Неверное имя пользователя или пароль</string>
|
||||
<string name="rdp_hint_logon_failure_body">Сервер корректно завершил CredSSP и отклонил ваши учётные данные. Проверьте имя пользователя (попробуйте DOMAIN\\User, если учётная запись присоединена к домену) и пароль.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">Сервер отклонил хеш открытого ключа CredSSP</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop и некоторые сборки xrdp вычисляют хеш CredSSP pub_key_auth иначе, чем ironrdp/sspi-rs в Haven — рукопожатие TLS проходит успешно, но NLA отказывает уровнем выше.\n\nОбходной путь: отредактируйте профиль этого подключения и снимите флажок \"Network Level Authentication (NLA)\". RDP перейдёт к аутентификации после настройки канала, минуя несовпадающий хеш.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Трекер задач</string>
|
||||
<string name="rdp_hint_time_skew_title">Часы устройства отличаются от часов сервера</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP отклоняет сессию, когда часы устройства расходятся с часами сервера более чем на несколько минут. Проверьте Настройки → Дата и время → Устанавливать автоматически и переподключитесь.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">Сервер требует шифры TLS, которые Haven не поддерживает</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven использует TLS-стек rustls/ring, у которого охват шифров уже, чем у RDP-клиента Microsoft (SChannel) или OpenSSL. Наиболее совместимая настройка на стороне сервера — ECDHE-RSA + AES-GCM поверх TLS 1.2 или 1.3.</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">Два пальца перемещают вид (нажмите, чтобы прокручивать удалённый экран)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Два пальца прокручивают удалённый экран (нажмите, чтобы перемещать вид)</string>
|
||||
<string name="rdp_hint_nla_required_title">Сервер требует проверку подлинности на уровне сети (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">Сервер настроен принимать только клиентов, проходящих проверку по NLA, а в этом профиле подключения NLA не отмечен. Либо включите «Network Level Authentication (NLA)» в профиле, либо ослабьте требование на ПК: Параметры → Система → Удалённый рабочий стол → Дополнительные параметры → снимите флажок «Require devices to use Network Level Authentication».</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA не поддерживает такой формат имени пользователя</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA отклоняет имя пользователя, в котором префикс домена сочетается с адресом почты (например MicrosoftAccount\\you@example.com), а для обычного адреса обрезает всё после @ — это ограничение исходной библиотеки sspi для учётных записей Microsoft.\n\nДля ПК с учётной записью Microsoft: снимите флажок «Network Level Authentication (NLA)» в этом профиле, разрешите подключения без NLA на ПК (Удалённый рабочий стол → Дополнительные параметры) и используйте MicrosoftAccount\\you@example.com или просто you@example.com в качестве имени пользователя.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Трекер задач</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rdp_status_connecting">Повезивање…</string>
|
||||
<string name="rdp_status_connecting_hint">У току је успостављање везе. Ако се ово заблокира, да бисте видели шта је узрок, укључите детаљно вођење дневника повезивања у Подешавањима и покушајте поново.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Повезано — чека се на први кадар…</string>
|
||||
<string name="rdp_status_connection_failed">Повезивање није успело</string>
|
||||
<string name="rdp_action_close">Затвори</string>
|
||||
<string name="rdp_action_cancel">Откажи</string>
|
||||
<string name="rdp_action_retry">Покушај поново</string>
|
||||
<string name="rdp_cd_disconnect">Раскини везу</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Укљ./искљ. тастатуру</string>
|
||||
<string name="rdp_cd_reset_zoom">Ресетуј зумирање</string>
|
||||
<string name="rdp_cd_fullscreen">Пун екран</string>
|
||||
<string name="rdp_cd_session_menu">Мени сесије</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Напусти пун екран</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Укључен је режим трекпеда (тап за директни додир)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Режим директног додира (тап за трекпед)</string>
|
||||
<string name="rdp_cd_two_finger_viewport">Два прста померају приказ (тапните да скролујете удаљени)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Два прста скролују удаљени (тапните да померате приказ)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Закључај положено (тап да пређете на усправно)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Закључај усправно (тап да пређете на ауто)</string>
|
||||
<string name="rdp_orientation_auto_desc">Ауто ротација (тап да пређете на положено)</string>
|
||||
<string name="rdp_hint_legacy_rdp_title">Сервер користи застарели нешифровани RDP</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven подржава само TLS-шифровани RDP. Ваш сервер (обично xrdp на Линуксу) је испреговарао застарели STANDARD_RDP_SECURITY протокол — најчешће зато што недостаје или не може да се прочита серверов TLS сертификат. Поново генеришите /etc/xrdp/cert.pem и /etc/xrdp/key.pem на серверу, па поново покрените xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Упутства за исправку на страни сервера</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">Сервер је током NLA одбио TLS сесију</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">Ово је био симптом Haven бага исправљеног у v5.24.37 — ако користите новију изградњу и још увек видите ово, могуће је да сервер уопште не прича CredSSP. Пробајте да одштиклирате Network Level Authentication на профилу везе и поново успоставите везу.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Погрешно корисничко име или лозинка</string>
|
||||
<string name="rdp_hint_logon_failure_body">Сервер је чисто довршио CredSSP и одбио ваше информације за пријаву. Проверите корисничко име (покушајте са ДОМЕН\\\\Корисник ако је налог део домена) и лозинку.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">Сервер је одбио хеш CredSSP јавног кључа</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Линукс gnome-remote-desktop и одређене xrdp изградње израчунавају CredSSP pub_key_auth хеш на другачији начин у односу на Haven-ов ironrdp/sspi-rs — TLS руковање успева, али NLA не успева на једном слоју изнад. Привремено решење: уредите профил ове везе и одштиклирајте „Network Level Authentication (NLA)“. RDP ће након подешавања канала прећи на проверу идентитета, што не иде кроз хеш који се не подудара.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Пратилац проблема</string>
|
||||
<string name="rdp_hint_time_skew_title">Часовник уређаја се разликује од серверовог часовника</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP одбија сесију када се време часовника уређаја разликује за више од некоилико минута од серверовог часовника. Проверите Подешавања → Датум & време → Подеси аутоматски и поново се повежите.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">Сервер захтева TLS шифре које Haven не подржава</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven користи rustls/ring TLS стек који има мању покривеност метода шифрирања у односу на Microsoft-ов RDP клијент (SChannel) или OpenSSL. Најкомпатибилније подешавање на серверској страни је ECDHE-RSA + AES-GCM преко TLS 1.2 или 1.3.</string>
|
||||
<string name="rdp_hint_nla_required_title">Сервер захтева Network Level Authentication</string>
|
||||
<string name="rdp_hint_nla_required_body">Сервер је подешен тако да прихвата само клијенте који потврђују идентитет са NLA, а за овај профил везе NLA није штиклирано. Или у профилу штиклирајте „Network Level Authentication (NLA)“, или смањите захтев на рачунару: Подешавања → Систем → Удаљена радна површина → Напредна подешавања → одштиклирајте „Захтевати од уређаја да користе аутентификацију на мрежном нивоу за повезивање (препоручено)“.</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA не може да користи овај облик корисничког имена</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA одбија корисничко име које комбинује префикс домена са и-мејл адресом (као MicrosoftAccount\\\\ви@пример.com), и за прости и-мејл одсеца све након @ — узводно ограничење у sspi библиотеци за Microsoft налоге. У случају рачунара са Microsoft налогом: одштиклирајте „Network Level Authentication (NLA)“ за овај профил, дозволите на рачунару не-NLA везе (Удаљена радна површина → Напредна подешавања), и као корисничко име користите MicrosoftAccount\\\\ви@пример.com или само ви@пример.com.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Пратилац проблема</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- i18n sweep #210 -->
|
||||
<string name="rdp_status_connecting">连接中…</string>
|
||||
<string name="rdp_status_connecting_hint">握手进行中。如果卡住,请在设置中启用详细连接日志并重试以查看底层错误。</string>
|
||||
<string name="rdp_status_waiting_for_frame">已连接——等待首帧…</string>
|
||||
<string name="rdp_status_connection_failed">连接失败</string>
|
||||
<string name="rdp_action_close">关闭</string>
|
||||
<string name="rdp_action_cancel">取消</string>
|
||||
<string name="rdp_action_retry">重试</string>
|
||||
<string name="rdp_cd_disconnect">断开</string>
|
||||
<string name="rdp_cd_toggle_keyboard">切换键盘</string>
|
||||
<string name="rdp_cd_reset_zoom">重置缩放</string>
|
||||
<string name="rdp_cd_fullscreen">全屏</string>
|
||||
<string name="rdp_cd_session_menu">会话菜单</string>
|
||||
<string name="rdp_cd_exit_fullscreen">退出全屏</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">触控板模式已开启(点击切换为直接触摸)</string>
|
||||
<string name="rdp_cd_input_mode_direct">直接触摸模式(点击切换为触控板)</string>
|
||||
<string name="rdp_orientation_landscape_desc">锁定横屏(点击切换为竖屏)</string>
|
||||
<string name="rdp_orientation_portrait_desc">锁定竖屏(点击切换为自动)</string>
|
||||
<string name="rdp_orientation_auto_desc">自动旋转(点击切换为横屏)</string>
|
||||
|
||||
<!-- i18n sweep #210 (follow-up batch) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">服务器正在使用过时的未加密 RDP</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven 仅支持 TLS 加密的 RDP。你的服务器(Linux 上通常是 xrdp)协商了已弃用的 STANDARD_RDP_SECURITY 协议——通常是因为服务器的 TLS 证书缺失或无法读取。请在服务器上重新生成 /etc/xrdp/cert.pem 和 /etc/xrdp/key.pem,然后重启 xrdp。</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">服务器端修复说明</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">服务器在 NLA 期间拒绝了 TLS 会话</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">这曾经是已在 v5.24.37 中修复的 Haven 缺陷的症状——如果你使用的是更新的版本却仍看到此问题,服务器可能根本不支持 CredSSP。请尝试在连接配置中取消勾选 Network Level Authentication 并重新连接。</string>
|
||||
<string name="rdp_hint_logon_failure_title">用户名或密码错误</string>
|
||||
<string name="rdp_hint_logon_failure_body">服务器已干净地完成 CredSSP 并拒绝了你的凭据。请检查用户名(如果账户已加入域,请尝试 DOMAIN\\User)和密码。</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">服务器拒绝了 CredSSP 公钥哈希</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux 的 gnome-remote-desktop 和某些 xrdp 版本计算 CredSSP pub_key_auth 哈希的方式与 Haven 的 ironrdp/sspi-rs 不同——TLS 握手成功,但 NLA 在上一层失败。\n\n变通方法:编辑此连接的配置并取消勾选 \"Network Level Authentication (NLA)\"。RDP 将回退为在通道建立后进行身份验证,从而绕过不匹配的哈希。</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">问题跟踪器</string>
|
||||
<string name="rdp_hint_time_skew_title">设备时钟与服务器不一致</string>
|
||||
<string name="rdp_hint_time_skew_body">当设备时钟与服务器相差超过几分钟时,CredSSP 会拒绝会话。请检查设置 → 日期和时间 → 自动设置,然后重新连接。</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">服务器要求 Haven 不支持的 TLS 加密套件</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven 使用 rustls/ring TLS 栈,其加密套件覆盖范围比 Microsoft 的 RDP 客户端(SChannel)或 OpenSSL 更窄。兼容性最好的服务器端设置是基于 TLS 1.2 或 1.3 的 ECDHE-RSA + AES-GCM。</string>
|
||||
|
||||
<!-- Backfill 2026-07: strings added since the last i18n pass -->
|
||||
<string name="rdp_cd_two_finger_viewport">双指平移视图(点按切换为滚动远程端)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">双指滚动远程端(点按切换为平移视图)</string>
|
||||
<string name="rdp_hint_nla_required_title">服务器要求网络级别身份验证 (NLA)</string>
|
||||
<string name="rdp_hint_nla_required_body">服务器配置为仅接受使用 NLA 认证的客户端,而此连接配置中未勾选 NLA。请在配置中勾选“Network Level Authentication (NLA)”,或在电脑上放宽此要求:设置 → 系统 → 远程桌面 → 高级设置 → 取消勾选“Require devices to use Network Level Authentication”。</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA 无法使用这种格式的用户名</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA 会拒绝把域前缀和电子邮件地址组合在一起的用户名(例如 MicrosoftAccount\\you@example.com),而对于纯电子邮件地址,它会截断 @ 之后的全部内容——这是上游 sspi 库针对 Microsoft 账户的限制。\n\n对于使用 Microsoft 账户的电脑:在此配置中取消勾选“Network Level Authentication (NLA)”,在电脑上允许非 NLA 连接(远程桌面 → 高级设置),并使用 MicrosoftAccount\\you@example.com 或直接使用 you@example.com 作为用户名。</string>
|
||||
<string name="rdp_hint_mixed_username_link">问题追踪器</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="rdp_status_connecting">Connecting…</string>
|
||||
<string name="rdp_status_connecting_hint">Handshake in progress. If this hangs, enable verbose connection logging in Settings and retry to see the underlying error.</string>
|
||||
<string name="rdp_status_waiting_for_frame">Connected — waiting for first frame…</string>
|
||||
<string name="rdp_status_connection_failed">Connection failed</string>
|
||||
<string name="rdp_action_close">Close</string>
|
||||
<string name="rdp_action_cancel">Cancel</string>
|
||||
<string name="rdp_action_retry">Retry</string>
|
||||
<string name="rdp_cd_disconnect">Disconnect</string>
|
||||
<string name="rdp_cd_toggle_keyboard">Toggle keyboard</string>
|
||||
<string name="rdp_cd_reset_zoom">Reset zoom</string>
|
||||
<string name="rdp_cd_fullscreen">Fullscreen</string>
|
||||
<string name="rdp_cd_session_menu">Session menu</string>
|
||||
<string name="rdp_cd_exit_fullscreen">Exit fullscreen</string>
|
||||
<string name="rdp_cd_input_mode_trackpad_on">Trackpad mode on (tap for direct touch)</string>
|
||||
<string name="rdp_cd_input_mode_direct">Direct touch mode (tap for trackpad)</string>
|
||||
<string name="rdp_cd_two_finger_viewport">Two-finger pans the view (tap to scroll the remote)</string>
|
||||
<string name="rdp_cd_two_finger_scroll_on">Two-finger scrolls the remote (tap to pan the view)</string>
|
||||
<string name="rdp_orientation_landscape_desc">Lock landscape (tap to switch to portrait)</string>
|
||||
<string name="rdp_orientation_portrait_desc">Lock portrait (tap to switch to auto)</string>
|
||||
<string name="rdp_orientation_auto_desc">Auto rotate (tap to switch to landscape)</string>
|
||||
|
||||
<!-- Error hints (rdpErrorHint) -->
|
||||
<string name="rdp_hint_legacy_rdp_title">Server is using legacy unencrypted RDP</string>
|
||||
<string name="rdp_hint_legacy_rdp_body">Haven only supports TLS-encrypted RDP. Your server (commonly xrdp on Linux) negotiated the deprecated STANDARD_RDP_SECURITY protocol — usually because the server\'s TLS certificate is missing or unreadable. Regenerate /etc/xrdp/cert.pem and /etc/xrdp/key.pem on the server, then restart xrdp.</string>
|
||||
<string name="rdp_hint_legacy_rdp_link">Server-side fix instructions</string>
|
||||
<string name="rdp_hint_nla_internal_error_title">Server rejected the TLS session during NLA</string>
|
||||
<string name="rdp_hint_nla_internal_error_body">This used to be the symptom of a Haven bug fixed in v5.24.37 — if you\'re on a newer build and still see this, the server may not speak CredSSP at all. Try unticking Network Level Authentication on the connection profile and reconnecting.</string>
|
||||
<string name="rdp_hint_logon_failure_title">Wrong username or password</string>
|
||||
<string name="rdp_hint_logon_failure_body">The server completed CredSSP cleanly and rejected your credentials. Check the username (try DOMAIN\\User if the account is domain-joined) and password.</string>
|
||||
<string name="rdp_hint_pubkey_hash_title">Server rejected the CredSSP public-key hash</string>
|
||||
<string name="rdp_hint_pubkey_hash_body">Linux gnome-remote-desktop and certain xrdp builds compute the CredSSP pub_key_auth hash differently than Haven\'s ironrdp/sspi-rs — the TLS handshake succeeds but NLA fails one layer up.\n\nWorkaround: edit this connection\'s profile and uncheck \"Network Level Authentication (NLA)\". RDP will fall back to authenticating after channel setup, which doesn\'t go through the mismatched hash.</string>
|
||||
<string name="rdp_hint_pubkey_hash_link">Issue tracker</string>
|
||||
<string name="rdp_hint_time_skew_title">Device clock differs from server\'s</string>
|
||||
<string name="rdp_hint_time_skew_body">CredSSP rejects the session when the device clock is more than a few minutes off the server\'s. Check Settings → Date & time → Set automatically and reconnect.</string>
|
||||
<string name="rdp_hint_tls_ciphers_title">Server requires TLS ciphers Haven doesn\'t support</string>
|
||||
<string name="rdp_hint_tls_ciphers_body">Haven uses the rustls/ring TLS stack which has narrower cipher coverage than Microsoft\'s RDP client (SChannel) or OpenSSL. The most compatible server-side setting is ECDHE-RSA + AES-GCM over TLS 1.2 or 1.3.</string>
|
||||
<string name="rdp_hint_nla_required_title">Server requires Network Level Authentication</string>
|
||||
<string name="rdp_hint_nla_required_body">The server is configured to only accept clients that authenticate with NLA, and NLA is unticked on this connection profile. Either tick \"Network Level Authentication (NLA)\" in the profile, or relax the requirement on the PC: Settings → System → Remote Desktop → Advanced settings → untick \"Require devices to use Network Level Authentication\".</string>
|
||||
<string name="rdp_hint_mixed_username_title">NLA can\'t use this username form</string>
|
||||
<string name="rdp_hint_mixed_username_body">NLA rejects a username that combines a domain prefix with an email address (like MicrosoftAccount\\you@example.com), and for a plain email it truncates everything after the @ — an upstream limitation in the sspi library for Microsoft accounts.\n\nFor a Microsoft-account PC: untick \"Network Level Authentication (NLA)\" on this profile, allow non-NLA connections on the PC (Remote Desktop → Advanced settings), and use MicrosoftAccount\\you@example.com or just you@example.com as the username.</string>
|
||||
<string name="rdp_hint_mixed_username_link">Issue tracker</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,82 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import java.util.Collections
|
||||
|
||||
/**
|
||||
* #504: RDP input events must reach the session in the order the user made
|
||||
* them.
|
||||
*
|
||||
* They did not. Every key press, key release, button press and button release
|
||||
* was its own `launch(Dispatchers.IO)` — a multi-threaded pool with no
|
||||
* ordering guarantee between launches — so a release could overtake its own
|
||||
* press. A guest that receives release-then-press holds the key down, which is
|
||||
* the reporter's "last letter is repeating forever", and the same inversion on
|
||||
* a button is his "I have to press 20 times to minimize".
|
||||
*
|
||||
* The test is deliberately adversarial about it: the first event is slow and
|
||||
* the rest are not, so anything running them concurrently finishes them out of
|
||||
* order. Verified by mutation — switching the dispatcher back to
|
||||
* `Dispatchers.IO` fails it.
|
||||
*/
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class InputOrderingTest {
|
||||
|
||||
private val inputDispatcher = Dispatchers.IO.limitedParallelism(1)
|
||||
|
||||
@Test
|
||||
fun `input events arrive in the order they were submitted`() {
|
||||
val arrivals = Collections.synchronizedList(mutableListOf<Int>())
|
||||
runBlocking {
|
||||
val scope = CoroutineScope(coroutineContext)
|
||||
// Submitted from one thread, as real input is: it all originates on
|
||||
// the main thread.
|
||||
repeat(EVENTS) { i ->
|
||||
scope.launch(inputDispatcher) {
|
||||
// The first event is slow. On a pool, everything after it
|
||||
// overtakes it; on an ordered dispatcher, nothing can.
|
||||
if (i == 0) Thread.sleep(120)
|
||||
arrivals.add(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
assertEquals(
|
||||
"input was reordered — a key release can then precede its own press",
|
||||
(0 until EVENTS).toList(),
|
||||
arrivals.toList(),
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* The shape that actually bit: press then release, repeatedly. Out of
|
||||
* order, the guest is left holding the key.
|
||||
*/
|
||||
@Test
|
||||
fun `a press is never overtaken by its own release`() {
|
||||
val arrivals = Collections.synchronizedList(mutableListOf<String>())
|
||||
runBlocking {
|
||||
val scope = CoroutineScope(coroutineContext)
|
||||
repeat(20) { i ->
|
||||
scope.launch(inputDispatcher) {
|
||||
if (i % 2 == 0) Thread.sleep(5) // presses are the slow half
|
||||
arrivals.add(if (i % 2 == 0) "down$i" else "up${i - 1}")
|
||||
}
|
||||
}
|
||||
}
|
||||
arrivals.chunked(2).forEach { pair ->
|
||||
assertEquals("each pair must be down-then-up, got $pair", 2, pair.size)
|
||||
assert(pair[0].startsWith("down")) { "release arrived before its press: $pair" }
|
||||
assert(pair[1].startsWith("up")) { "release arrived before its press: $pair" }
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val EVENTS = 40
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* #504: Polish-programmers AltGr synthesis — non-ASCII letters become
|
||||
* AltGr(+Shift)+base-key sequences a scancodes-only server (VirtualBox
|
||||
* VRDP) delivers and the guest keymap resolves.
|
||||
*/
|
||||
class RdpAltGrSynthesisTest {
|
||||
|
||||
private fun record(ch: Char, klid: UInt = POLISH_PROGRAMMERS_KLID): List<Pair<Int, Boolean>> {
|
||||
val events = mutableListOf<Pair<Int, Boolean>>()
|
||||
var unicodeUsed = false
|
||||
typeRdpChar(
|
||||
ch = ch,
|
||||
sendKey = { sc, pressed -> events.add(sc to pressed) },
|
||||
sendUnicode = { unicodeUsed = true },
|
||||
layoutKlid = klid,
|
||||
)
|
||||
if (unicodeUsed) events.add(-1 to false)
|
||||
return events
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `lowercase polish letter rides AltGr around the base key`() {
|
||||
assertEquals(
|
||||
listOf(
|
||||
SC_ALTGR_PUBLIC to true,
|
||||
0x1E to true, 0x1E to false,
|
||||
SC_ALTGR_PUBLIC to false,
|
||||
),
|
||||
record('ą'),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `uppercase polish letter adds shift inside the AltGr hold`() {
|
||||
assertEquals(
|
||||
listOf(
|
||||
SC_ALTGR_PUBLIC to true,
|
||||
SC_SHIFT_L_PUBLIC to true,
|
||||
0x2C to true, 0x2C to false,
|
||||
SC_SHIFT_L_PUBLIC to false,
|
||||
SC_ALTGR_PUBLIC to false,
|
||||
),
|
||||
record('Ż'),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `every polish national letter maps, both cases`() {
|
||||
for (ch in "ąćęłńóśźż" + "ĄĆĘŁŃÓŚŹŻ") {
|
||||
val events = record(ch)
|
||||
assertEquals("no unicode fallback for $ch", false, events.any { it.first == -1 })
|
||||
assertEquals("AltGr framed for $ch", SC_ALTGR_PUBLIC, events.first().first)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ascii still uses the plain scancode path`() {
|
||||
val events = record('a')
|
||||
assertEquals(listOf(0x1E to true, 0x1E to false), events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `unlisted layout falls back to unicode`() {
|
||||
val events = record('ą', klid = 0x0409u)
|
||||
assertEquals(listOf(-1 to false), events)
|
||||
assertNull(altGrCharToRdpScancode('ą', 0x0409u))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `chars outside the overlay fall back to unicode under polish too`() {
|
||||
assertEquals(listOf(-1 to false), record('é'))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* #504 follow-up: base-remapped layouts (German QWERTZ, French AZERTY, UK).
|
||||
* The announced KLID makes the server resolve scancodes through that layout,
|
||||
* so each layout carries its own full char→position table; chars needing a
|
||||
* dead-key composition fall to unicode, never to the US table.
|
||||
*/
|
||||
class RdpBaseRemapTest {
|
||||
|
||||
private data class Typed(val events: List<Pair<Int, Boolean>>, val unicode: Boolean)
|
||||
|
||||
private fun type(ch: Char, klid: UInt): Typed {
|
||||
val events = mutableListOf<Pair<Int, Boolean>>()
|
||||
var unicode = false
|
||||
typeRdpChar(
|
||||
ch = ch,
|
||||
sendKey = { sc, pressed -> events.add(sc to pressed) },
|
||||
sendUnicode = { unicode = true },
|
||||
layoutKlid = klid,
|
||||
)
|
||||
return Typed(events, unicode)
|
||||
}
|
||||
|
||||
private fun plainTap(sc: Int) = listOf(sc to true, sc to false)
|
||||
|
||||
private fun shiftTap(sc: Int) = listOf(
|
||||
SC_SHIFT_L_PUBLIC to true, sc to true, sc to false, SC_SHIFT_L_PUBLIC to false,
|
||||
)
|
||||
|
||||
private fun altGrTap(sc: Int) = listOf(
|
||||
SC_ALTGR_PUBLIC to true, sc to true, sc to false, SC_ALTGR_PUBLIC to false,
|
||||
)
|
||||
|
||||
// --- German QWERTZ ---
|
||||
|
||||
@Test
|
||||
fun `german swaps y and z`() {
|
||||
assertEquals(plainTap(0x15), type('z', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(plainTap(0x2C), type('y', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(shiftTap(0x15), type('Z', GERMAN_QWERTZ_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `german umlauts sit on their own keys`() {
|
||||
assertEquals(plainTap(0x28), type('ä', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(shiftTap(0x28), type('Ä', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(plainTap(0x0C), type('ß', GERMAN_QWERTZ_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `german shifted digit row symbols`() {
|
||||
assertEquals(shiftTap(0x08), type('/', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(shiftTap(0x0B), type('=', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(shiftTap(0x0C), type('?', GERMAN_QWERTZ_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `german altgr characters`() {
|
||||
assertEquals(altGrTap(0x10), type('@', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(altGrTap(0x12), type('€', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(altGrTap(0x09), type('[', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(altGrTap(0x0C), type('\\', GERMAN_QWERTZ_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `german dead-key chars fall to unicode, not US positions`() {
|
||||
for (ch in charArrayOf('`', '^', '´')) {
|
||||
val typed = type(ch, GERMAN_QWERTZ_KLID)
|
||||
assertTrue("$ch should use unicode", typed.unicode)
|
||||
assertTrue("$ch must not emit scancodes", typed.events.isEmpty())
|
||||
}
|
||||
}
|
||||
|
||||
// --- French AZERTY ---
|
||||
|
||||
@Test
|
||||
fun `french remaps a q z w m`() {
|
||||
assertEquals(plainTap(0x10), type('a', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x1E), type('q', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x11), type('z', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x2C), type('w', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x27), type('m', FRENCH_AZERTY_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `french digits need shift and accents ride the plain row`() {
|
||||
assertEquals(shiftTap(0x02), type('1', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(shiftTap(0x0B), type('0', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x03), type('é', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x08), type('è', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x0A), type('ç', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x0B), type('à', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x28), type('ù', FRENCH_AZERTY_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `french altgr characters`() {
|
||||
assertEquals(altGrTap(0x0B), type('@', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(altGrTap(0x0A), type('^', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(altGrTap(0x12), type('€', FRENCH_AZERTY_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `french punctuation trio`() {
|
||||
assertEquals(plainTap(0x32), type(',', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(shiftTap(0x32), type('?', FRENCH_AZERTY_KLID).events)
|
||||
assertEquals(plainTap(0x35), type('!', FRENCH_AZERTY_KLID).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `french capital accents and dead keys fall to unicode`() {
|
||||
for (ch in charArrayOf('É', 'È', 'Ç', 'À', 'Ù', '~', '`')) {
|
||||
val typed = type(ch, FRENCH_AZERTY_KLID)
|
||||
assertTrue("$ch should use unicode", typed.unicode)
|
||||
assertTrue("$ch must not emit scancodes", typed.events.isEmpty())
|
||||
}
|
||||
}
|
||||
|
||||
// --- UK ---
|
||||
|
||||
@Test
|
||||
fun `uk swaps at and quote, keeps letters at US positions`() {
|
||||
assertEquals(shiftTap(0x28), type('@', UK_ENGLISH_KLID).events)
|
||||
assertEquals(shiftTap(0x03), type('"', UK_ENGLISH_KLID).events)
|
||||
assertEquals(plainTap(0x2B), type('#', UK_ENGLISH_KLID).events)
|
||||
assertEquals(plainTap(SC_ISO_102), type('\\', UK_ENGLISH_KLID).events)
|
||||
assertEquals(shiftTap(0x04), type('£', UK_ENGLISH_KLID).events)
|
||||
assertEquals(plainTap(0x1E), type('a', UK_ENGLISH_KLID).events)
|
||||
}
|
||||
|
||||
// --- Regressions on the existing paths ---
|
||||
|
||||
@Test
|
||||
fun `us default keeps the pre-existing mapping`() {
|
||||
assertEquals(plainTap(0x2C), type('z', 0x0409u).events)
|
||||
assertEquals(shiftTap(0x03), type('@', 0x0409u).events)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `polish overlay is untouched by the remap layer`() {
|
||||
val typed = type('ą', POLISH_PROGRAMMERS_KLID)
|
||||
assertEquals(
|
||||
listOf(
|
||||
SC_ALTGR_PUBLIC to true,
|
||||
0x1E to true, 0x1E to false,
|
||||
SC_ALTGR_PUBLIC to false,
|
||||
),
|
||||
typed.events,
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `control keys work in remapped layouts`() {
|
||||
assertEquals(plainTap(0x39), type(' ', GERMAN_QWERTZ_KLID).events)
|
||||
assertEquals(plainTap(0x1C), type('\n', FRENCH_AZERTY_KLID).events)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Pins rdpErrorHint's patterns to the EXACT error strings users reported —
|
||||
* hints die by pattern drift, so each case is a verbatim on-screen error.
|
||||
*/
|
||||
class RdpErrorHintTest {
|
||||
|
||||
/** #461: NLA off in Haven, required by Windows (HYBRID_REQUIRED_BY_SERVER). */
|
||||
@Test
|
||||
fun `negotiation FailureCode 5 maps to the NLA-required hint`() {
|
||||
val raw = "RDP negotiation failed: Error { context: \"negotiation failure\", " +
|
||||
"kind: Negotiation(NegotiationFailure(FailureCode(5))), source: None }"
|
||||
assertEquals(R.string.rdp_hint_nla_required_title, rdpErrorHint(raw)?.titleRes)
|
||||
}
|
||||
|
||||
/** #461: sspi-rs refuses MicrosoftAccount\you@example.com as MixedFormat. */
|
||||
@Test
|
||||
fun `MixedFormat invalid username maps to the Microsoft-account hint`() {
|
||||
val raw = "RDP connect finalize failed: Error { context: \"invalid username\", " +
|
||||
"kind: Custom, source: Some(MixedFormat) }"
|
||||
assertEquals(R.string.rdp_hint_mixed_username_title, rdpErrorHint(raw)?.titleRes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `unrelated errors still get no hint`() {
|
||||
assertNull(rdpErrorHint("Read PDU error: UnexpectedEof"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
package sh.haven.feature.rdp
|
||||
|
||||
import androidx.compose.ui.input.key.Key
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNotEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* #422: arrow keys were sent as bare Set-1 scancodes. Those values are the
|
||||
* *numpad* twins of the navigation cluster — the real keys are E0-prefixed —
|
||||
* so Haven pressed the wrong key on every server.
|
||||
*
|
||||
* (The marker was NOT what made VirtualBox drop connections — VRDP rejects
|
||||
* any lone fast-path scancode PDU because it never advertises fast-path
|
||||
* input; the native layer handles that separately with a slow-path input
|
||||
* fallback. The marker is still required to press the right key.)
|
||||
*
|
||||
* The native layer detects extended keys with `code and 0xE000 == 0xE000`
|
||||
* (ironrdp `Scancode::from_u16`) and sets KBDFLAGS_EXTENDED from it, so the
|
||||
* marker is the whole contract between these constants and the wire.
|
||||
*/
|
||||
class RdpScancodeTest {
|
||||
|
||||
private fun isExtended(code: Int) = (code and 0xE000) == 0xE000
|
||||
|
||||
/** Every key that is E0-prefixed on a real keyboard must carry the marker. */
|
||||
@Test
|
||||
fun `navigation cluster and Windows key are extended`() {
|
||||
val extended = mapOf(
|
||||
"Up" to SC_UP, "Down" to SC_DOWN, "Left" to SC_LEFT, "Right" to SC_RIGHT,
|
||||
"Home" to SC_HOME, "End" to SC_END, "PgUp" to SC_PGUP, "PgDn" to SC_PGDN,
|
||||
"Insert" to SC_INSERT, "Delete" to SC_DELETE, "LeftWin" to SC_WIN_L,
|
||||
)
|
||||
extended.forEach { (name, code) ->
|
||||
assertTrue("$name (0x${code.toString(16)}) must set the 0xE000 extended marker", isExtended(code))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The constants above are only half the story: the bug was in the
|
||||
* *mapping*, which sent both Alt keys to the same constant. This is the
|
||||
* test that fails on the shipped code.
|
||||
*/
|
||||
@Test
|
||||
fun `each right-hand modifier maps to its own scancode`() {
|
||||
assertEquals(SC_ALT_R, androidKeyToScancode(Key.AltRight))
|
||||
assertEquals(SC_CTRL_R, androidKeyToScancode(Key.CtrlRight))
|
||||
assertEquals(SC_SHIFT_R, androidKeyToScancode(Key.ShiftRight))
|
||||
assertEquals(SC_WIN_R, androidKeyToScancode(Key.MetaRight))
|
||||
|
||||
assertEquals(SC_ALT_L, androidKeyToScancode(Key.AltLeft))
|
||||
assertEquals(SC_CTRL_L, androidKeyToScancode(Key.CtrlLeft))
|
||||
assertEquals(SC_SHIFT_L, androidKeyToScancode(Key.ShiftLeft))
|
||||
assertEquals(SC_WIN_L, androidKeyToScancode(Key.MetaLeft))
|
||||
}
|
||||
|
||||
/**
|
||||
* #504: right-hand modifiers are separate keys, not aliases for the left
|
||||
* ones.
|
||||
*
|
||||
* A reporter ran `showkey` on his guest's console and reported AltGr
|
||||
* arriving as scancode 56 — that is 0x38, *left* Alt. Both Alt keys were
|
||||
* mapped to the same constant. On a Polish layout AltGr+o is ó, and the
|
||||
* guest was being told he had pressed a modifier that composes nothing, so
|
||||
* the character simply never appeared.
|
||||
*
|
||||
* The measurement is what made this findable: "56, six times" is a fact
|
||||
* about the wire, not a description of a symptom.
|
||||
*/
|
||||
@Test
|
||||
fun `right-hand modifiers differ from their left-hand twins`() {
|
||||
assertNotEquals("AltGr must not be sent as left Alt", SC_ALT_L, SC_ALT_R)
|
||||
assertNotEquals("right Ctrl must not be sent as left Ctrl", SC_CTRL_L, SC_CTRL_R)
|
||||
assertNotEquals("right Shift must not be sent as left Shift", SC_SHIFT_L, SC_SHIFT_R)
|
||||
assertNotEquals("right Win must not be sent as left Win", SC_WIN_L, SC_WIN_R)
|
||||
}
|
||||
|
||||
/**
|
||||
* Right Ctrl, Alt and Win are E0-prefixed. Right **Shift** is not — it is
|
||||
* its own base code, 0x36, and marking it extended would press something
|
||||
* else. That asymmetry is the easy thing to get wrong here.
|
||||
*/
|
||||
@Test
|
||||
fun `right Ctrl Alt and Win are extended, right Shift is not`() {
|
||||
assertTrue("AltGr (right Alt) is E0-prefixed", isExtended(SC_ALT_R))
|
||||
assertTrue("right Ctrl is E0-prefixed", isExtended(SC_CTRL_R))
|
||||
assertTrue("right Win is E0-prefixed", isExtended(SC_WIN_R))
|
||||
assertFalse("right Shift is a base scancode, not an extended one", isExtended(SC_SHIFT_R))
|
||||
assertEquals("right Shift is 0x36", 0x36, SC_SHIFT_R)
|
||||
}
|
||||
|
||||
/**
|
||||
* The low byte is what reaches the guest — `Scancode::from_u16` truncates
|
||||
* to `scancode as u8` and carries the extended bit separately. So AltGr
|
||||
* must be 0x38 *with* the marker, which is a different key from 0x38
|
||||
* without it.
|
||||
*/
|
||||
@Test
|
||||
fun `the extended modifiers keep the right base code`() {
|
||||
assertEquals("AltGr base code", 0x38, SC_ALT_R and 0xFF)
|
||||
assertEquals("right Ctrl base code", 0x1D, SC_CTRL_R and 0xFF)
|
||||
assertEquals("right Win base code", 0x5C, SC_WIN_R and 0xFF)
|
||||
}
|
||||
|
||||
/**
|
||||
* The other half of the contract: marking a key extended that is not
|
||||
* would press a different key just as wrongly, so the ordinary keys must
|
||||
* stay bare.
|
||||
*/
|
||||
@Test
|
||||
fun `character control and function keys are not extended`() {
|
||||
val plain = mapOf(
|
||||
"Escape" to SC_ESCAPE, "Backspace" to SC_BACKSPACE, "Tab" to SC_TAB,
|
||||
"Return" to SC_RETURN, "LeftCtrl" to SC_CTRL_L, "LeftShift" to SC_SHIFT_L,
|
||||
"LeftAlt" to SC_ALT_L, "F1" to SC_F1, "F12" to SC_F12,
|
||||
)
|
||||
plain.forEach { (name, code) ->
|
||||
assertTrue("$name (0x${code.toString(16)}) must NOT be marked extended", !isExtended(code))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The low byte is what actually reaches the wire as the scancode; the
|
||||
* marker must not have disturbed it. These are the Set-1 values for the
|
||||
* navigation cluster.
|
||||
*/
|
||||
@Test
|
||||
fun `the extended marker leaves the underlying scancode intact`() {
|
||||
assertEquals(0x48, SC_UP and 0xFF)
|
||||
assertEquals(0x50, SC_DOWN and 0xFF)
|
||||
assertEquals(0x4B, SC_LEFT and 0xFF)
|
||||
assertEquals(0x4D, SC_RIGHT and 0xFF)
|
||||
assertEquals(0x47, SC_HOME and 0xFF)
|
||||
assertEquals(0x4F, SC_END and 0xFF)
|
||||
assertEquals(0x49, SC_PGUP and 0xFF)
|
||||
assertEquals(0x51, SC_PGDN and 0xFF)
|
||||
assertEquals(0x52, SC_INSERT and 0xFF)
|
||||
assertEquals(0x53, SC_DELETE and 0xFF)
|
||||
assertEquals(0x5B, SC_WIN_L and 0xFF)
|
||||
}
|
||||
|
||||
/**
|
||||
* #507 — no numpad key was mapped at all, so every one of them fell through
|
||||
* to `else -> null` and reached the guest as nothing. Silent on a phone;
|
||||
* visible the moment someone attaches a real keyboard, which is the same
|
||||
* situation that produced the report.
|
||||
*/
|
||||
@Test
|
||||
fun `every numpad key maps to a scancode`() {
|
||||
val numpad = mapOf(
|
||||
"NumPad0" to Key.NumPad0, "NumPad1" to Key.NumPad1, "NumPad2" to Key.NumPad2,
|
||||
"NumPad3" to Key.NumPad3, "NumPad4" to Key.NumPad4, "NumPad5" to Key.NumPad5,
|
||||
"NumPad6" to Key.NumPad6, "NumPad7" to Key.NumPad7, "NumPad8" to Key.NumPad8,
|
||||
"NumPad9" to Key.NumPad9, "NumPadEnter" to Key.NumPadEnter,
|
||||
"NumPadDivide" to Key.NumPadDivide, "NumPadMultiply" to Key.NumPadMultiply,
|
||||
"NumPadSubtract" to Key.NumPadSubtract, "NumPadAdd" to Key.NumPadAdd,
|
||||
"NumPadDot" to Key.NumPadDot, "NumLock" to Key.NumLock,
|
||||
)
|
||||
val unmapped = numpad.filterValues { androidKeyToScancode(it) == null }.keys
|
||||
assertTrue("these numpad keys reach the guest as nothing: $unmapped", unmapped.isEmpty())
|
||||
}
|
||||
|
||||
/**
|
||||
* The subtle half. Numpad Enter and Divide ARE E0-prefixed; the rest of the
|
||||
* numpad is not. Getting this backwards is the #422 bug in mirror image —
|
||||
* there, navigation keys were sent bare and pressed their numpad twins.
|
||||
*/
|
||||
@Test
|
||||
fun `only numpad Enter and Divide are extended`() {
|
||||
assertTrue("numpad Enter is E0-prefixed", isExtended(SC_NUMPAD_ENTER))
|
||||
assertTrue("numpad Divide is E0-prefixed", isExtended(SC_NUMPAD_DIVIDE))
|
||||
|
||||
val bare = mapOf(
|
||||
"0" to SC_NUMPAD_0, "1" to SC_NUMPAD_1, "2" to SC_NUMPAD_2, "3" to SC_NUMPAD_3,
|
||||
"4" to SC_NUMPAD_4, "5" to SC_NUMPAD_5, "6" to SC_NUMPAD_6, "7" to SC_NUMPAD_7,
|
||||
"8" to SC_NUMPAD_8, "9" to SC_NUMPAD_9, "." to SC_NUMPAD_DOT,
|
||||
"+" to SC_NUMPAD_ADD, "-" to SC_NUMPAD_SUBTRACT, "*" to SC_NUMPAD_MULTIPLY,
|
||||
"NumLock" to SC_NUMLOCK,
|
||||
)
|
||||
bare.forEach { (name, code) ->
|
||||
assertFalse(
|
||||
"numpad $name must NOT be extended — the extended twin is the navigation key",
|
||||
isExtended(code),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Numpad Enter must not collapse onto Return, and the numpad digits must not
|
||||
* collapse onto the navigation cluster. Both would be silent: the key would
|
||||
* appear to work while pressing something else.
|
||||
*/
|
||||
@Test
|
||||
fun `numpad keys are distinct from the keys they share bare codes with`() {
|
||||
assertNotEquals("numpad Enter is not Return", SC_RETURN, SC_NUMPAD_ENTER)
|
||||
assertNotEquals("numpad 8 is not Up", SC_UP, SC_NUMPAD_8)
|
||||
assertNotEquals("numpad 2 is not Down", SC_DOWN, SC_NUMPAD_2)
|
||||
assertNotEquals("numpad 4 is not Left", SC_LEFT, SC_NUMPAD_4)
|
||||
assertNotEquals("numpad 6 is not Right", SC_RIGHT, SC_NUMPAD_6)
|
||||
assertNotEquals("numpad 7 is not Home", SC_HOME, SC_NUMPAD_7)
|
||||
assertNotEquals("numpad 1 is not End", SC_END, SC_NUMPAD_1)
|
||||
assertNotEquals("numpad 0 is not Insert", SC_INSERT, SC_NUMPAD_0)
|
||||
assertNotEquals("numpad . is not Delete", SC_DELETE, SC_NUMPAD_DOT)
|
||||
}
|
||||
|
||||
/**
|
||||
* #504 regression on v5.87.11+ — the focus fix moved hardware-key focus
|
||||
* off the hidden text field, whose IME InputConnection had been the only
|
||||
* path converting printable keypresses. From then on, any key absent from
|
||||
* androidKeyToScancode reached the guest as nothing: pawlosck's report is
|
||||
* the mapping table read back verbatim — numpad, F-keys, modifiers,
|
||||
* Enter/Esc/Backspace all work (mapped), letters and digits are dead
|
||||
* (unmapped). This test fails on the shipped code.
|
||||
*/
|
||||
@Test
|
||||
fun `every letter digit and punctuation key maps to a scancode`() {
|
||||
val printable = mapOf(
|
||||
"A" to Key.A, "M" to Key.M, "Z" to Key.Z,
|
||||
"One" to Key.One, "Zero" to Key.Zero,
|
||||
"Space" to Key.Spacebar, "Grave" to Key.Grave, "Minus" to Key.Minus,
|
||||
"Equals" to Key.Equals, "LeftBracket" to Key.LeftBracket,
|
||||
"RightBracket" to Key.RightBracket, "Backslash" to Key.Backslash,
|
||||
"Semicolon" to Key.Semicolon, "Apostrophe" to Key.Apostrophe,
|
||||
"Comma" to Key.Comma, "Period" to Key.Period, "Slash" to Key.Slash,
|
||||
)
|
||||
val unmapped = printable.filterValues { androidKeyToScancode(it) == null }.keys
|
||||
assertTrue("these keys reach the guest as nothing: $unmapped", unmapped.isEmpty())
|
||||
}
|
||||
|
||||
/**
|
||||
* The hardware-key table and the soft-keyboard char table describe the
|
||||
* same physical keyboard, so they must agree scancode-for-scancode. A
|
||||
* typo in one is invisible at the type level; this is what catches it.
|
||||
*/
|
||||
@Test
|
||||
fun `hardware key table agrees with the soft-keyboard char table`() {
|
||||
val letterKeys = listOf(
|
||||
Key.A, Key.B, Key.C, Key.D, Key.E, Key.F, Key.G, Key.H, Key.I,
|
||||
Key.J, Key.K, Key.L, Key.M, Key.N, Key.O, Key.P, Key.Q, Key.R,
|
||||
Key.S, Key.T, Key.U, Key.V, Key.W, Key.X, Key.Y, Key.Z,
|
||||
)
|
||||
('a'..'z').forEachIndexed { i, ch ->
|
||||
assertEquals(
|
||||
"letter '$ch': hardware and char tables disagree",
|
||||
asciiCharToRdpScancode(ch)!!.first,
|
||||
androidKeyToScancode(letterKeys[i]),
|
||||
)
|
||||
}
|
||||
val digitKeys = mapOf(
|
||||
'0' to Key.Zero, '1' to Key.One, '2' to Key.Two, '3' to Key.Three,
|
||||
'4' to Key.Four, '5' to Key.Five, '6' to Key.Six, '7' to Key.Seven,
|
||||
'8' to Key.Eight, '9' to Key.Nine,
|
||||
)
|
||||
digitKeys.forEach { (ch, key) ->
|
||||
assertEquals(
|
||||
"digit '$ch': hardware and char tables disagree",
|
||||
asciiCharToRdpScancode(ch)!!.first,
|
||||
androidKeyToScancode(key),
|
||||
)
|
||||
}
|
||||
val punctuation = mapOf(
|
||||
' ' to Key.Spacebar, '`' to Key.Grave, '-' to Key.Minus,
|
||||
'=' to Key.Equals, '[' to Key.LeftBracket, ']' to Key.RightBracket,
|
||||
'\\' to Key.Backslash, ';' to Key.Semicolon, '\'' to Key.Apostrophe,
|
||||
',' to Key.Comma, '.' to Key.Period, '/' to Key.Slash,
|
||||
)
|
||||
punctuation.forEach { (ch, key) ->
|
||||
assertEquals(
|
||||
"'$ch': hardware and char tables disagree",
|
||||
asciiCharToRdpScancode(ch)!!.first,
|
||||
androidKeyToScancode(key),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base scancodes on purpose: physical Shift/AltGr arrive as their own
|
||||
* modifier scancodes, so the guest composes shifted characters itself.
|
||||
* An extended marker here would press a different key entirely.
|
||||
*/
|
||||
@Test
|
||||
fun `printable keys are bare base scancodes`() {
|
||||
listOf(Key.A, Key.Z, Key.One, Key.Zero, Key.Spacebar, Key.Slash).forEach { key ->
|
||||
val code = androidKeyToScancode(key)!!
|
||||
assertFalse("0x${code.toString(16)} must not be extended", isExtended(code))
|
||||
}
|
||||
}
|
||||
|
||||
/** Every numpad scancode is its own key — a duplicate means two keys collide. */
|
||||
@Test
|
||||
fun `numpad scancodes are unique`() {
|
||||
val all = listOf(
|
||||
SC_NUMPAD_0, SC_NUMPAD_1, SC_NUMPAD_2, SC_NUMPAD_3, SC_NUMPAD_4,
|
||||
SC_NUMPAD_5, SC_NUMPAD_6, SC_NUMPAD_7, SC_NUMPAD_8, SC_NUMPAD_9,
|
||||
SC_NUMPAD_DOT, SC_NUMPAD_ADD, SC_NUMPAD_SUBTRACT, SC_NUMPAD_MULTIPLY,
|
||||
SC_NUMPAD_DIVIDE, SC_NUMPAD_ENTER, SC_NUMLOCK,
|
||||
)
|
||||
assertEquals("two numpad keys share a scancode", all.size, all.toSet().size)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user