feat: optional x86-64 Steam client (Valve's Linux client under FEX) beside the arm64 one (#152)

An opt-in second Steam client (Steam settings, Steam client: x86-64): Valve's
x86-64 Linux client, unchanged, runs under FEX in its own home with its own
game library and the same sign-in. Linux builds run directly, so titles such
as Team Fortress 2 and Half-Life use their Linux versions; Windows games use
DroidDeck-Proton as on arm64. The arm64 client stays the default.

- droiddeck-steam-x64: FEX and the x86-64 rootfs from DroidDeck-Components
  (sha256-pinned), client install and sync from Valve's CDN, sign-in shared
  with the arm64 client, its web helper on the GPU (ANGLE GL over FEX's GL
  thunk, zink, Turnip), Proton wrappers for the arm64 client's tools,
  DroidDeck direct for Linux builds, SD-card library (x86-64/ beside the
  arm64 one), repair.
- FEX 2610 built by build-fex.yml with thunks and three patches: an openat2
  fallback without openat2 (proot), newer-clang thunkgen, MAP_32BIT
  exhaustion returning ENOMEM. libblsession resolves RESOLVE_IN_ROOT paths
  inside the root.
- Session: x86-64 gating, shortcuts and compatibility tools per client,
  logs from the client that ran.
- App: client setting with the FEX version, an x86-64 chip on the Games
  header, the active client's library, art, storage, downloads, repair,
  Offline Mode, Decky, desktop mode, optional VAC diagnostics; per-client
  state for art, the content log, repair and leftovers.
- Strings in every locale.
- Review fixes: the library cache is saved only by the newest scan; an
  abandoned session's Steam logs come from the client it recorded; distinct
  VAC console names; FEXInterpreter in CPU pinning; clearer VAC hint in
  pl, ru, uk, cs and bg.
This commit is contained in:
The412Banner authored and GitHub committed 2026-10-17 23:57:52 -04:00
1 parent ab799e6938
commit db8d1c9910
125 files changed
+4953 -263

No files matched your search

@@ -0,0 +1,20 @@
package com.droiddeck.launcher.session
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
class SessionClientRecordTest {
@get:Rule val tmp = TemporaryFolder()
@Test fun aSessionFolderKeepsTheClientItRan() {
val dir = tmp.newFolder("2026-10-18-01-steam")
assertNull(SessionArtifacts.recordedClient(dir))
SessionArtifacts.recordClient(dir, "x86_64")
assertEquals("x86_64", SessionArtifacts.recordedClient(dir))
java.io.File(dir, "steam-client.txt").writeText("something else\n")
assertNull(SessionArtifacts.recordedClient(dir))
}
}
@@ -24,6 +24,21 @@ class SteamDownloadMonitorTest {
}
}
@Test fun followsTheX8664ClientsOwnLibrary() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
val steam = File(root, "root/.droiddeck-x64/.local/share/Steam")
val manifest = manifest(steam, "49520", downloaded = 10, total = 100, flags = 6)
val monitor = SteamDownloadMonitor()
assertFalse(monitor.poll(root, now = 1_000L))
manifest.writeText(appManifest(downloaded = 20, total = 100, flags = 6))
assertTrue(monitor.poll(root, now = 3_000L))
} finally {
root.deleteRecursively()
}
}
@Test fun findsDownloadsInAdditionalSteamLibraries() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
@@ -67,6 +82,51 @@ class SteamDownloadMonitorTest {
}
}
@Test fun theOtherClientsLogIsReadFromItsStart() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
File(root, "root/.local/share/Steam/logs/content_log.txt").apply {
check(parentFile?.mkdirs() != false)
writeText("[2026-10-06 14:00:00] Client version: 1\n" + "[2026-10-06 14:00:01] nothing to download\n".repeat(20))
setLastModified(10_000L)
}
val monitor = SteamDownloadMonitor()
assertFalse(monitor.poll(root, now = 1_000L))
File(root, "root/.droiddeck-x64/.local/share/Steam/logs/content_log.txt").apply {
check(parentFile?.mkdirs() != false)
writeText("[2026-10-06 14:44:17] AppID 44 App update changed : Running Update,Downloading,Staging,\n" +
"[2026-10-06 14:44:18] Current download rate: 0.000 Mbps\n".repeat(30))
setLastModified(20_000L)
}
assertTrue(monitor.poll(root, now = 2_000L))
} finally {
root.deleteRecursively()
}
}
@Test fun theRunningClientsLogIsFollowedWhenTheOtherOneIsNewer() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
File(root, "root/.local/share/Steam/logs/content_log.txt").apply {
check(parentFile?.mkdirs() != false)
writeText("[2026-10-06 14:44:17] AppID 44 App update changed : Running Update,Downloading,Staging,\n")
setLastModified(10_000L)
}
File(root, "root/.droiddeck-x64/.local/share/Steam/logs/content_log.txt").apply {
check(parentFile?.mkdirs() != false)
writeText("[2026-10-06 14:00:00] Client version: 1\n")
setLastModified(20_000L)
}
val monitor = SteamDownloadMonitor()
assertTrue(monitor.poll(root, now = 1_000L, client = "arm64"))
assertTrue(monitor.poll(root, now = 2_000L, client = "arm64"))
assertFalse(SteamDownloadMonitor().poll(root, now = 1_000L, client = "x86_64"))
} finally {
root.deleteRecursively()
}
}
@Test fun receivedTrafficBridgesSteamRateLines() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
@@ -0,0 +1,43 @@
package com.droiddeck.launcher.session
import com.droiddeck.launcher.runtime.LinuxRuntime
import java.io.File
import org.junit.After
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class SteamRepairTest {
private val app get() = RuntimeEnvironment.getApplication()
@Before @After fun idle() {
SessionState.running = false
SessionState.steamClientArch = null
}
private fun marker(home: String) = File(LinuxRuntime.rootDir(app), "root/$home/package/droiddeck-unconfirmed").apply {
parentFile?.mkdirs()
writeText("tracked\nstart\nstart\n")
}
@Test fun aShownClientClearsOnlyItsOwnUnconfirmedStarts() {
val arm = marker(".local/share/Steam")
val x64 = marker(".droiddeck-x64/.local/share/Steam")
SteamRepair.clientShown(app)
assertFalse(arm.exists())
assertTrue(x64.exists())
marker(".local/share/Steam")
SessionPrefs.setSteamClientArch(app, "x86_64")
SteamRepair.clientShown(app)
assertTrue(arm.exists())
assertFalse(x64.exists())
}
}
@@ -0,0 +1,57 @@
package com.droiddeck.launcher.session
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class VacDiagnosticsTest {
@Test fun tailReadsOnlyWhatThisSessionAppended() {
val log = java.io.File.createTempFile("console", ".log")
try {
log.writeText("You are in insecure mode.\nConnected to 1.2.3.4\n")
val armed = log.length()
log.appendText("Connecting to 5.6.7.8\n")
assertEquals(listOf("Connecting to 5.6.7.8", ""), VacDiagnostics.tail(log, armed))
} finally {
log.delete()
}
}
@Test fun theSameGameInTwoLibrariesGetsTwoConsoleNames() {
val a = java.io.File("/lib1/steamapps/common/Team Fortress 2/tf/console.log")
val b = java.io.File("/lib2/steamapps/common/Team Fortress 2/tf/console.log")
val c = java.io.File("/lib1/steamapps/common/Half-Life 2/hl2/console.log")
val names = VacDiagnostics.consoleNames(listOf(a, b, c))
assertEquals("Team Fortress 2-tf", names[0])
assertTrue(names[1].startsWith("Team Fortress 2-tf-") && names[1] != names[0])
assertEquals("Half-Life 2-hl2", names[2])
assertEquals(names, VacDiagnostics.consoleNames(listOf(a, b, c)))
}
@Test fun tailReadsAllOfAReplacedFile() {
val log = java.io.File.createTempFile("console", ".log")
try {
log.writeText("new\n")
assertEquals(listOf("new", ""), VacDiagnostics.tail(log, 1000L))
} finally {
log.delete()
}
}
@Test fun onlyConsoleLogsThisSessionWroteAreReported() {
val log = java.io.File.createTempFile("console", ".log")
try {
log.writeText("Connected to 1.2.3.4\n")
val since = log.lastModified() - 5_000
val armed = mapOf(log.canonicalPath to log.length())
assertFalse(VacDiagnostics.writtenThisSession(log, since, armed))
log.appendText("Connecting to 5.6.7.8\n")
assertTrue(VacDiagnostics.writtenThisSession(log, since, armed))
assertTrue(VacDiagnostics.writtenThisSession(log, since, emptyMap()))
assertFalse(VacDiagnostics.writtenThisSession(log, log.lastModified() + 1_000, emptyMap()))
} finally {
log.delete()
}
}
}