mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
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:
1 parent
ab799e6938
commit
db8d1c9910
125 files changed
+4953
-263
No files matched your search
@@ -371,6 +371,7 @@ class MainActivity : ComponentActivity() {
|
||||
private var resolution by mutableStateOf(com.droiddeck.launcher.session.SessionDisplay.DEFAULT_RESOLUTION)
|
||||
private var fexPreset by mutableStateOf("")
|
||||
private var forceSsbs by mutableStateOf(false)
|
||||
private var steamClientArch by mutableStateOf("arm64")
|
||||
private var runSteamAtStartup by mutableStateOf(false)
|
||||
private var bootMovie by mutableStateOf(com.droiddeck.launcher.session.BootMovie.DROIDDECK_30)
|
||||
private var bootMovieSound by mutableStateOf(true)
|
||||
@@ -399,11 +400,13 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
private var romsDir by mutableStateOf<String?>(null)
|
||||
private var steamGames by mutableStateOf<List<Library.SteamGame>>(emptyList())
|
||||
private var steamGamesX64 by mutableStateOf(false)
|
||||
@Volatile private var componentSweepDone = false
|
||||
@Volatile private var componentSweepSession: String? = null
|
||||
private var emulatorList by mutableStateOf<List<Library.Emulator>>(emptyList())
|
||||
private var runningLabel by mutableStateOf<String?>(null)
|
||||
private var logsEnabled by mutableStateOf(true)
|
||||
private var vacDiagnostics by mutableStateOf(false)
|
||||
private var agentCommands by mutableStateOf(false)
|
||||
private var showRoms by mutableStateOf(false)
|
||||
private var homeAppSelected by mutableStateOf(false)
|
||||
@@ -724,7 +727,9 @@ class MainActivity : ComponentActivity() {
|
||||
theme = SessionPrefs.theme(this)
|
||||
frameGenLabel = getString(R.string.frame_gen_off)
|
||||
appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(this)
|
||||
steamGames = if (shortcutPicker) emptyList() else com.droiddeck.launcher.frontend.LibraryCache.load(this)
|
||||
val (cached, cachedX64) = com.droiddeck.launcher.frontend.LibraryCache.snapshot(this)
|
||||
steamGames = if (shortcutPicker) emptyList() else cached
|
||||
steamGamesX64 = cachedX64
|
||||
backActionsInverted = SessionPrefs.backActionsInverted(this)
|
||||
orientation = SessionPrefs.orientation(this)
|
||||
requestedOrientation = orientation
|
||||
@@ -761,8 +766,9 @@ class MainActivity : ComponentActivity() {
|
||||
busy = busy, stage = stage, percent = percent,
|
||||
desktopInstalled = desktopInstalled, desktopPresent = desktopPresent,
|
||||
offlineAccount = offlineAccount, offline = offline,
|
||||
frameGenLabel = frameGenLabel, romsDir = romsDir, logsEnabled = logsEnabled, agentCommands = agentCommands,
|
||||
steamGames = steamGames, emulators = emulatorList, running = runningLabel,
|
||||
frameGenLabel = frameGenLabel, romsDir = romsDir, logsEnabled = logsEnabled,
|
||||
vacDiagnostics = vacDiagnostics, agentCommands = agentCommands,
|
||||
steamGames = steamGames, steamGamesX64 = steamGamesX64, emulators = emulatorList, running = runningLabel,
|
||||
frameGen = FrameGen.mode(this),
|
||||
lossless = lossless,
|
||||
pageKey = if (showPerformance) "performance" else if (showComponents) "components" else if (showMapping) "controller-mapping" else null,
|
||||
@@ -911,6 +917,10 @@ class MainActivity : ComponentActivity() {
|
||||
SessionPrefs.setLogsEnabled(this, !SessionPrefs.logsEnabled(this))
|
||||
logsEnabled = SessionPrefs.logsEnabled(this)
|
||||
},
|
||||
onVacDiagnostics = {
|
||||
SessionPrefs.setVacDiagnostics(this, !SessionPrefs.vacDiagnostics(this))
|
||||
vacDiagnostics = SessionPrefs.vacDiagnostics(this)
|
||||
},
|
||||
onAgentCommands = {
|
||||
com.droiddeck.launcher.agent.AgentAccess.setCommandsEnabled(this, !com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this))
|
||||
agentCommands = com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this)
|
||||
@@ -1565,6 +1575,7 @@ class MainActivity : ComponentActivity() {
|
||||
fexPreset = if (mode == SessionService.MODE_STEAM) fexPreset else null,
|
||||
forceSsbs = forceSsbs,
|
||||
syncBackend = if (mode == SessionService.MODE_STEAM) SessionPrefs.syncBackendOf(fastSync, fsyncFirst, syncFallback) else null,
|
||||
steamClientArch = if (mode == SessionService.MODE_STEAM) steamClientArch else null,
|
||||
steamRepairQueued = steamRepairQueued,
|
||||
mangoapp = mangoapp,
|
||||
steamController = if (mode == SessionService.MODE_STEAM) steamController else null,
|
||||
@@ -1648,6 +1659,7 @@ class MainActivity : ComponentActivity() {
|
||||
syncFallback = SessionPrefs.syncFallback(this)
|
||||
},
|
||||
onSteamRepair = { steamRepairQueued = SteamRepair.queue(this) },
|
||||
onSteamClientArch = { id -> SessionPrefs.setSteamClientArch(this, id); steamClientArch = id; refresh() },
|
||||
onMangoapp = { on -> SessionPrefs.setMangoapp(this, on); mangoapp = on },
|
||||
onSteamController = { id -> SessionPrefs.setSteamController(this, id); steamController = id },
|
||||
onRunSteamAtStartup = { on ->
|
||||
@@ -1787,6 +1799,7 @@ class MainActivity : ComponentActivity() {
|
||||
fastSync = SessionPrefs.fastSync(this)
|
||||
fsyncFirst = SessionPrefs.fsyncFirst(this)
|
||||
syncFallback = SessionPrefs.syncFallback(this)
|
||||
steamClientArch = SessionPrefs.steamClientArch(this)
|
||||
steamRepairQueued = SteamRepair.queued(this)
|
||||
mangoapp = SessionPrefs.mangoapp(this)
|
||||
steamController = SessionPrefs.steamController(this)
|
||||
@@ -1863,6 +1876,12 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
private fun refresh() {
|
||||
// Until the scan finishes, the other client's games would launch in this one.
|
||||
val listX64 = SessionPrefs.activeSteamClientArch(this) == "x86_64"
|
||||
if (listX64 != steamGamesX64) {
|
||||
steamGamesX64 = listX64
|
||||
steamGames = steamGames.filterNot(Library::fromSteamClient)
|
||||
}
|
||||
if (!busy && LinuxRuntimeInstaller.isBusy()) followRuntimeOperation { LinuxRuntimeInstaller.attach(it) }
|
||||
if (showComponents) drivers.refreshDrivers()
|
||||
addedGamesArt = SessionPrefs.addedGamesArt(this)
|
||||
@@ -1876,6 +1895,7 @@ class MainActivity : ComponentActivity() {
|
||||
frameGenLabel = FrameGen.label(this)
|
||||
romsDir = SessionPrefs.romsDir(this).takeIf { it.isNotEmpty() }
|
||||
logsEnabled = SessionPrefs.logsEnabled(this)
|
||||
vacDiagnostics = SessionPrefs.vacDiagnostics(this)
|
||||
agentCommands = com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this)
|
||||
runningLabel = if (SessionState.running) when (SessionState.mode) {
|
||||
SessionService.MODE_DESKTOP -> getString(R.string.rail_desktop)
|
||||
@@ -1902,9 +1922,11 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
val games = if (ready) Library.launchableGames(this) else emptyList()
|
||||
val scannedArch = SessionPrefs.activeSteamClientArch(this)
|
||||
val scannedX64 = scannedArch == "x86_64"
|
||||
val games = if (ready) Library.launchableGames(this, arch = scannedArch) else emptyList()
|
||||
val all = games.distinctBy { it.gameId }
|
||||
if (ready) com.droiddeck.launcher.frontend.LibraryCache.save(this, all)
|
||||
if (ready && scanGeneration == libraryScanGeneration) com.droiddeck.launcher.frontend.LibraryCache.save(this, all, scannedX64)
|
||||
val endedSession = SessionState.sessionId.takeIf { !SessionState.running && it != null && it != componentSweepSession }
|
||||
if (ready && (!componentSweepDone || endedSession != null)) {
|
||||
componentSweepDone = true
|
||||
@@ -1914,6 +1936,7 @@ class MainActivity : ComponentActivity() {
|
||||
ui.post {
|
||||
if (scanGeneration == libraryScanGeneration) {
|
||||
val current = steamGames.filter { it.library != Library.ADDED }.associateBy { it.appId }
|
||||
steamGamesX64 = scannedX64
|
||||
steamGames = all.map { g ->
|
||||
val newer = current[g.appId]
|
||||
if (newer != null && g.library != Library.ADDED && steamArtRefreshes[g.appId] != artRefreshesAtStart[g.appId]) g.withArt(newer.art, newer.hero, newer.icon) else g
|
||||
|
||||
@@ -1211,7 +1211,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
com.droiddeck.launcher.frontend.Library.nameForProgram(program)?.let { getString(R.string.session_starting_named, it) }
|
||||
?: getString(R.string.session_starting_program)
|
||||
}
|
||||
else -> getString(R.string.load_starting_steam)
|
||||
else -> if (com.droiddeck.launcher.session.SessionPrefs.activeSteamClientArch(this) == "x86_64") getString(R.string.load_starting_steam_x64)
|
||||
else getString(R.string.load_starting_steam)
|
||||
}
|
||||
|
||||
private fun shareCurrentSessionLogs() {
|
||||
|
||||
@@ -51,25 +51,29 @@ object LogRedactor {
|
||||
@Volatile
|
||||
private var accounts: List<Learned> = emptyList()
|
||||
|
||||
fun learnAccounts(loginUsers: java.io.File) {
|
||||
val found = ArrayList<Learned>()
|
||||
try {
|
||||
if (loginUsers.isFile) {
|
||||
val kv = Regex("\"(AccountName|PersonaName)\"\\s+\"([^\"]*)\"")
|
||||
kv.findAll(loginUsers.readText()).map { it.groupValues[2].trim() }.filter { it.length >= 3 }.distinct().forEach { name ->
|
||||
val needs = name.lowercase().takeIf { name.all { it.code < 0x80 } }
|
||||
found += Learned(Regex("(?i)(?<![A-Za-z0-9_])" + Regex.escape(name) + "(?![A-Za-z0-9_])"), needs)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return
|
||||
fun learnAccounts(vararg loginUsers: java.io.File) {
|
||||
val names = LinkedHashSet<String>()
|
||||
val kv = Regex("\"(AccountName|PersonaName)\"\\s+\"([^\"]*)\"")
|
||||
var unread = false
|
||||
for (file in loginUsers) {
|
||||
if (!file.isFile) continue
|
||||
val text = try { file.readText() } catch (e: Exception) { unread = true; continue }
|
||||
kv.findAll(text).map { it.groupValues[2].trim() }.filter { it.length >= 3 }.forEach { names += it }
|
||||
}
|
||||
accounts = found
|
||||
val learned = names.map { name ->
|
||||
val needs = name.lowercase().takeIf { name.all { it.code < 0x80 } }
|
||||
Learned(Regex("(?i)(?<![A-Za-z0-9_])" + Regex.escape(name) + "(?![A-Za-z0-9_])"), needs)
|
||||
}
|
||||
// A file that could not be read keeps the names learned from it before.
|
||||
accounts = if (unread) (accounts + learned).distinctBy { it.regex.pattern } else learned
|
||||
}
|
||||
|
||||
fun learnFromRuntime(root: java.io.File) {
|
||||
learnOwnAddresses(java.io.File(root, "etc/droiddeck-net"))
|
||||
learnAccounts(java.io.File(root, "root/.local/share/Steam/config/loginusers.vdf"))
|
||||
learnAccounts(
|
||||
java.io.File(root, "root/.local/share/Steam/config/loginusers.vdf"),
|
||||
java.io.File(root, "root/.droiddeck-x64/.local/share/Steam/config/loginusers.vdf"),
|
||||
)
|
||||
}
|
||||
|
||||
@Volatile
|
||||
|
||||
@@ -139,6 +139,10 @@ object AddedGames {
|
||||
"appxmanifest.xml" to Regex("<Application\\b[^>]*?\\bExecutable\\s*=\\s*\"([^\"]+)\"", RegexOption.IGNORE_CASE),
|
||||
)
|
||||
|
||||
/** The card's Steam libraries: the arm64 client's steamapps and the x86-64 client's own folder beside it. */
|
||||
internal fun isSteamLibraryFolder(name: String): Boolean =
|
||||
name.equals("steamapps", ignoreCase = true) || name == com.droiddeck.launcher.session.GameStorage.X64_CARD_DIR
|
||||
|
||||
fun scan(context: Context): List<Game> {
|
||||
val out = ArrayList<Game>()
|
||||
GamesFolderMigration.run(context)
|
||||
@@ -151,7 +155,7 @@ object AddedGames {
|
||||
if (!dir.isDirectory) { Log.w(TAG, "$dir is not a folder; skipped"); continue }
|
||||
val steamInstalls = steamInstallDirs(dir)
|
||||
for (folder in dir.listFiles { f -> f.isDirectory }?.sortedBy { it.name.lowercase() } ?: emptyList()) {
|
||||
if (folder.name.lowercase() in steamInstalls || folder.name.equals("steamapps", ignoreCase = true)) continue
|
||||
if (folder.name.lowercase() in steamInstalls || isSteamLibraryFolder(folder.name)) continue
|
||||
if (folder.path in removed) continue
|
||||
if (folder.name == "Games" && StoreInstallRoot.roots(context).any { it.absolutePath == folder.absolutePath }) continue
|
||||
scanGame(context, folder, out)
|
||||
@@ -211,7 +215,7 @@ object AddedGames {
|
||||
val base = canonical(dir)
|
||||
if (!inside(path, base)) continue
|
||||
val first = path.removePrefix("$base/").substringBefore('/')
|
||||
File(dir, first).takeIf { it.isDirectory && first != "steamapps" }?.let { return it }
|
||||
File(dir, first).takeIf { it.isDirectory && !isSteamLibraryFolder(first) }?.let { return it }
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -271,7 +275,7 @@ object AddedGames {
|
||||
)
|
||||
for (dir in dirs.distinctBy { it.absolutePath }) {
|
||||
for (folder in dir.listFiles { f -> f.isDirectory }.orEmpty()) {
|
||||
if (folder.path in removed || folder.name.equals("steamapps", ignoreCase = true)) continue
|
||||
if (folder.path in removed || isSteamLibraryFolder(folder.name)) continue
|
||||
if (folder.name == "Games" && StoreInstallRoot.roots(context).any { it.absolutePath == folder.absolutePath }) continue
|
||||
out.add(canonical(folder))
|
||||
}
|
||||
@@ -312,7 +316,7 @@ object AddedGames {
|
||||
val autoName = sidecar?.title ?: identifiedName(folder, found) ?: folder.name
|
||||
val crc = CRC32().apply { update(("\"${foundGuest.replaceFirst(Regex("^$LIBRARY/"), "$LEGACY_LIBRARY/")}\"" + autoName).toByteArray()) }.value
|
||||
val appId = SessionPrefs.addedGameAppId(context, folder.path, crc or 0x80000000L)
|
||||
val config = accountConfig(File(LinuxRuntime.rootDir(context), "root/.local/share/Steam"))
|
||||
val config = accountConfig(SessionPrefs.activeSteamRoot(context))
|
||||
val record = config?.let { shortcutRecord(it, appId) }
|
||||
val rev = record?.optInt("rev", 0) ?: 0
|
||||
if (sidecar == null && record != null) adoptSteamEdits(context, folder, record)
|
||||
@@ -348,7 +352,7 @@ object AddedGames {
|
||||
}.getOrNull()
|
||||
|
||||
fun inSteam(context: Context, appId: Long): Boolean =
|
||||
accountConfig(File(LinuxRuntime.rootDir(context), "root/.local/share/Steam"))?.let { shortcutRecord(it, appId) } != null
|
||||
accountConfig(SessionPrefs.activeSteamRoot(context))?.let { shortcutRecord(it, appId) } != null
|
||||
|
||||
private fun shortcutRecord(config: File, appId: Long): JSONObject? = runCatching {
|
||||
JSONObject(File(config, ".droiddeck-shortcuts.json").readText()).optJSONObject("games")?.optJSONObject(appId.toString())
|
||||
|
||||
@@ -26,6 +26,7 @@ object AddedGamesPublisher {
|
||||
fun republish(context: Context) {
|
||||
val games = AddedGames.scan(context)
|
||||
AddedGames.writeListing(context, games)
|
||||
LibraryCache.save(context, Library.launchableGames(context, added = games))
|
||||
val arch = com.droiddeck.launcher.session.SessionPrefs.activeSteamClientArch(context)
|
||||
LibraryCache.save(context, Library.launchableGames(context, added = games, arch = arch), arch == "x86_64")
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ object GameFileSync {
|
||||
|
||||
@Synchronized private fun sync(context: Context, folder: File) {
|
||||
check(LinuxRuntime.isInstalled(context)) { context.getString(R.string.game_sync_err_runtime) }
|
||||
check(File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps").isDirectory) { context.getString(R.string.game_sync_err_steam_library) }
|
||||
check(File(SessionPrefs.activeSteamRoot(context), "steamapps").isDirectory) { context.getString(R.string.game_sync_err_steam_library) }
|
||||
val storage = GameStorage.effective(context)
|
||||
val storageSetting = SessionPrefs.gameStorage(context)
|
||||
val previousStorage = prefs(context).getString("storagePath", null)
|
||||
|
||||
@@ -25,7 +25,7 @@ object GamesFolderMigration {
|
||||
var n = 0
|
||||
val steamInstalls = AddedGames.steamInstallDirs(root.host)
|
||||
for (folder in root.host.listFiles { f -> f.isDirectory }?.sortedBy { it.name.lowercase() }.orEmpty()) {
|
||||
if (folder.name.equals("steamapps", ignoreCase = true) || folder.name.lowercase() in steamInstalls) continue
|
||||
if (AddedGames.isSteamLibraryFolder(folder.name) || folder.name.lowercase() in steamInstalls) continue
|
||||
if (folder.absolutePath in storeRoots || StoreGameSidecar.read(folder) != null) continue
|
||||
if (folder.path in entries) continue
|
||||
val picked = SessionPrefs.addedGameExe(context, folder.path).takeIf { it.isNotEmpty() }?.let { File(it) }?.takeIf { it.isFile }
|
||||
|
||||
@@ -74,11 +74,14 @@ object Library {
|
||||
private val LAST_PLAYED = Regex("^\\s*\"LastPlayed\"\\s*\"(\\d+)\"", RegexOption.MULTILINE)
|
||||
private val INSTALL_DIR = Regex("^\\s*\"installdir\"\\s*\"([^\"]*)\"", RegexOption.MULTILINE)
|
||||
|
||||
internal fun steamLibraries(context: Context): List<Pair<File, String>> {
|
||||
val root = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam")
|
||||
internal fun steamLibraries(context: Context, arch: String = SessionPrefs.activeSteamClientArch(context)): List<Pair<File, String>> {
|
||||
val root = SessionPrefs.steamRoot(context, arch)
|
||||
// The session gives the x86-64 client only its card folder; the games folders stay the arm64 client's.
|
||||
val card = GameStorage.effective(context)
|
||||
if (arch == "x86_64") return listOfNotNull(root to "internal", card?.let { File(it.path, GameStorage.X64_CARD_DIR) to it.label })
|
||||
return listOfNotNull(
|
||||
root to "internal",
|
||||
GameStorage.effective(context)?.let { File(it.path) to it.label },
|
||||
card?.let { File(it.path) to it.label },
|
||||
) + GameStorage.gamesFolderLibraries(context).map { it.host to it.label }
|
||||
}
|
||||
|
||||
@@ -98,10 +101,10 @@ object Library {
|
||||
.firstOrNull { it.isDirectory }
|
||||
}
|
||||
|
||||
fun steamGames(context: Context, strictRead: Boolean = false): List<SteamGame> {
|
||||
val root = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam")
|
||||
fun steamGames(context: Context, strictRead: Boolean = false, arch: String = SessionPrefs.activeSteamClientArch(context)): List<SteamGame> {
|
||||
val root = SessionPrefs.steamRoot(context, arch)
|
||||
val cache = File(root, "appcache/librarycache")
|
||||
val libraries = steamLibraries(context)
|
||||
val libraries = steamLibraries(context, arch)
|
||||
val roots = libraries.map { it.first }
|
||||
val out = LinkedHashMap<Int, SteamGame>()
|
||||
for ((library, label) in libraries) {
|
||||
@@ -134,19 +137,24 @@ object Library {
|
||||
}
|
||||
|
||||
fun steamLibraryArt(context: Context): List<Pair<Int, File>> {
|
||||
val cache = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/appcache/librarycache")
|
||||
val cache = File(SessionPrefs.activeSteamRoot(context), "appcache/librarycache")
|
||||
return cache.listFiles().orEmpty().mapNotNull { dir ->
|
||||
val appId = dir.name.toIntOrNull()?.takeIf { it !in NOT_GAMES } ?: return@mapNotNull null
|
||||
steamCacheImage(cache, appId, STEAM_CAPSULES)?.let { appId to it }
|
||||
}
|
||||
}
|
||||
|
||||
fun launchableGames(context: Context, strictRead: Boolean = false, added: List<AddedGames.Game>? = null): List<SteamGame> {
|
||||
val roots = steamLibraries(context).map { it.first }
|
||||
fun fromSteamClient(g: SteamGame): Boolean = g.library != ADDED && g.source == SOURCE_STEAM
|
||||
|
||||
fun launchableGames(
|
||||
context: Context, strictRead: Boolean = false, added: List<AddedGames.Game>? = null,
|
||||
arch: String = SessionPrefs.activeSteamClientArch(context),
|
||||
): List<SteamGame> {
|
||||
val roots = steamLibraries(context, arch).map { it.first }
|
||||
val list = added ?: AddedGames.scan(context)
|
||||
var steam = steamGames(context, strictRead)
|
||||
val targets = steam.filter { it.library != ADDED && it.source == SOURCE_STEAM }.map { SteamGrid.target(it, context) } + list.map { SteamGrid.target(it, context) }
|
||||
if (runCatching { SteamGrid.sync(context, targets) }.getOrDefault(false)) steam = steamGames(context, strictRead)
|
||||
var steam = steamGames(context, strictRead, arch)
|
||||
val targets = steam.filter(::fromSteamClient).map { SteamGrid.target(it, context) } + list.map { SteamGrid.target(it, context) }
|
||||
if (runCatching { SteamGrid.sync(context, targets) }.getOrDefault(false)) steam = steamGames(context, strictRead, arch)
|
||||
return (steam + list.map { g -> addedGame(context, g, roots) }).distinctBy { it.gameId }
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,14 @@ object LibraryCache {
|
||||
private const val TAG = "LibraryCache"
|
||||
private fun file(context: Context) = File(context.filesDir, "library-cache.json")
|
||||
|
||||
fun load(context: Context): List<Library.SteamGame> = runCatching {
|
||||
/** The cached games and whether they are the x86-64 client's; a cache written as a bare list is arm64's. */
|
||||
@Synchronized
|
||||
fun snapshot(context: Context): Pair<List<Library.SteamGame>, Boolean> = runCatching {
|
||||
val f = file(context)
|
||||
if (!f.isFile) return emptyList()
|
||||
val array = JSONArray(f.readText())
|
||||
if (!f.isFile) return Pair(emptyList(), false)
|
||||
val text = f.readText().trim()
|
||||
val (array, x64) = if (text.startsWith("{")) JSONObject(text).let { it.getJSONArray("games") to (it.optString("client") == "x86_64") }
|
||||
else JSONArray(text) to false
|
||||
List(array.length()) { i ->
|
||||
val o = array.getJSONObject(i)
|
||||
Library.SteamGame(
|
||||
@@ -24,11 +28,18 @@ object LibraryCache {
|
||||
source = o.optString("source").ifEmpty { if (o.getString("library") == Library.ADDED) Library.ADDED else Library.SOURCE_STEAM },
|
||||
storeId = o.optString("storeId").ifEmpty { null },
|
||||
)
|
||||
}
|
||||
}.getOrElse { e -> Log.w(TAG, "unreadable, ignored: ${e.message}"); emptyList() }
|
||||
} to x64
|
||||
}.getOrElse { e -> Log.w(TAG, "unreadable, ignored: ${e.message}"); Pair(emptyList(), false) }
|
||||
|
||||
fun save(context: Context, games: List<Library.SteamGame>) {
|
||||
fun load(context: Context): List<Library.SteamGame> = snapshot(context).first
|
||||
|
||||
fun listedX64(context: Context): Boolean = snapshot(context).second
|
||||
|
||||
/** Without [x64] the list keeps the client already recorded. */
|
||||
@Synchronized
|
||||
fun save(context: Context, games: List<Library.SteamGame>, x64: Boolean? = null) {
|
||||
runCatching {
|
||||
val client = x64 ?: listedX64(context)
|
||||
val array = JSONArray()
|
||||
for (g in games) array.put(
|
||||
JSONObject().put("appId", g.appId).put("name", g.name).put("library", g.library).put("gameId", g.gameId)
|
||||
@@ -38,8 +49,12 @@ object LibraryCache {
|
||||
)
|
||||
val f = file(context)
|
||||
val tmp = File(f.path + ".tmp")
|
||||
tmp.writeText(array.toString())
|
||||
tmp.renameTo(f)
|
||||
tmp.writeText(JSONObject().put("client", if (client) "x86_64" else "arm64").put("games", array).toString())
|
||||
if (!tmp.renameTo(f)) {
|
||||
tmp.delete()
|
||||
f.delete()
|
||||
Log.w(TAG, "not saved: rename failed; cache dropped so the next start scans")
|
||||
}
|
||||
}.onFailure { e -> Log.w(TAG, "not saved: ${e.message}") }
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,16 @@ object SessionInstalls {
|
||||
STATE.find(text)?.groupValues?.get(1)?.toIntOrNull() == 4, file.parentFile!!)
|
||||
}.getOrNull()
|
||||
|
||||
internal fun steamappsDirs(context: Context): List<File> = listOfNotNull(
|
||||
File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps"),
|
||||
GameStorage.effective(context)?.let { File(it.path, "steamapps") },
|
||||
internal fun steamappsDirs(context: Context): List<File> = (
|
||||
if (com.droiddeck.launcher.session.SessionPrefs.activeSteamClientArch(context) == "x86_64")
|
||||
listOfNotNull(
|
||||
File(com.droiddeck.launcher.session.SessionPrefs.activeSteamRoot(context), "steamapps"),
|
||||
GameStorage.x64CardLibrary(context)?.let { File(it, "steamapps") },
|
||||
)
|
||||
else listOfNotNull(
|
||||
File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps"),
|
||||
GameStorage.effective(context)?.let { File(it.path, "steamapps") },
|
||||
)
|
||||
).filter { it.isDirectory }
|
||||
|
||||
internal class Watch(private val dirs: () -> List<File>) {
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.droiddeck.launcher.frontend
|
||||
import android.content.Context
|
||||
import android.util.AtomicFile
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import java.io.DataInputStream
|
||||
@@ -20,7 +19,7 @@ object SteamAppInfo {
|
||||
|
||||
class Info(val name: String, val sharedDepots: List<String>)
|
||||
|
||||
fun appinfoFile(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/appcache/appinfo.vdf")
|
||||
fun appinfoFile(context: Context) = File(com.droiddeck.launcher.session.SessionPrefs.activeSteamRoot(context), "appcache/appinfo.vdf")
|
||||
|
||||
@Synchronized
|
||||
fun info(context: Context, appId: Int, appinfo: File = appinfoFile(context)): Info? {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Context
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.stores.SteamLiveShortcuts
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
|
||||
object SteamGameArt {
|
||||
@@ -35,7 +35,7 @@ object SteamGameArt {
|
||||
}
|
||||
|
||||
fun describe(context: Context, game: Library.SteamGame): List<AddedGameArt.SlotState> {
|
||||
val cache = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/appcache/librarycache")
|
||||
val cache = File(SessionPrefs.activeSteamRoot(context), "appcache/librarycache")
|
||||
val own = withOverrides(context, game)
|
||||
return AddedGameArt.Slot.values().map { slot ->
|
||||
chosenFile(context, game.appId, slot)?.let {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
@@ -28,8 +27,7 @@ object SteamGrid {
|
||||
}
|
||||
|
||||
internal fun dir(context: Context): File? {
|
||||
val root = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam")
|
||||
return AddedGames.accountConfig(root)?.let { File(it, "grid") }
|
||||
return AddedGames.accountConfig(SessionPrefs.activeSteamRoot(context))?.let { File(it, "grid") }
|
||||
}
|
||||
|
||||
private fun files(grid: File, id: Long, slot: AddedGameArt.Slot): List<File> =
|
||||
@@ -37,13 +35,18 @@ object SteamGrid {
|
||||
|
||||
private fun signature(file: File?) = if (file == null) "" else "${file.length()}:${file.lastModified()}"
|
||||
|
||||
private fun sigFile(target: Target, slot: AddedGameArt.Slot) = File(target.artDir, "grid-${slot.key}")
|
||||
/** Each Steam client has its own grid folder, so what was last seen there is kept per client. */
|
||||
private fun sigName(context: Context, key: String) =
|
||||
if (SessionPrefs.activeSteamClientArch(context) == "x86_64") "grid-x86_64-$key" else "grid-$key"
|
||||
|
||||
private fun recorded(target: Target, slot: AddedGameArt.Slot): String? = sigFile(target, slot).takeIf { it.isFile }?.readText()
|
||||
private fun sigFile(context: Context, target: Target, slot: AddedGameArt.Slot) = File(target.artDir, sigName(context, slot.key))
|
||||
|
||||
private fun record(target: Target, slot: AddedGameArt.Slot, value: String) {
|
||||
private fun recorded(context: Context, target: Target, slot: AddedGameArt.Slot): String? =
|
||||
sigFile(context, target, slot).takeIf { it.isFile }?.readText()
|
||||
|
||||
private fun record(context: Context, target: Target, slot: AddedGameArt.Slot, value: String) {
|
||||
target.artDir.mkdirs()
|
||||
sigFile(target, slot).writeText(value)
|
||||
sigFile(context, target, slot).writeText(value)
|
||||
}
|
||||
|
||||
private fun writtenByDroidDeck(grid: File): Set<String> = runCatching {
|
||||
@@ -59,7 +62,7 @@ object SteamGrid {
|
||||
val grid = dir(context) ?: return true
|
||||
if (file == null) {
|
||||
if (files(grid, target.id, slot).map { it.delete() }.any { !it }) return false
|
||||
record(target, slot, "")
|
||||
record(context, target, slot, "")
|
||||
return true
|
||||
}
|
||||
val ext = file.extension.lowercase().let { if (it == "jpeg") "jpg" else it }
|
||||
@@ -73,12 +76,12 @@ object SteamGrid {
|
||||
return false
|
||||
}
|
||||
if (files(grid, target.id, slot).filter { it != dst }.map { it.delete() }.any { !it }) return false
|
||||
record(target, slot, signature(placed))
|
||||
record(context, target, slot, signature(placed))
|
||||
return true
|
||||
}
|
||||
|
||||
private const val POSITION = "logo-position"
|
||||
private const val POSITION_SIG = "grid-json"
|
||||
private const val POSITION_SIG = "json"
|
||||
|
||||
private fun positionFile(grid: File, id: Long) = File(grid, "$id.json")
|
||||
|
||||
@@ -87,11 +90,12 @@ object SteamGrid {
|
||||
/** The logo position chosen here (or taken over from Steam) for a game; null when Steam's own default applies. */
|
||||
fun position(target: Target): LogoPosition.Value? = positionIn(File(target.artDir, POSITION))
|
||||
|
||||
private fun positionRecorded(target: Target): String? = File(target.artDir, POSITION_SIG).takeIf { it.isFile }?.readText()
|
||||
private fun positionRecorded(context: Context, target: Target): String? =
|
||||
File(target.artDir, sigName(context, POSITION_SIG)).takeIf { it.isFile }?.readText()
|
||||
|
||||
private fun recordPosition(target: Target, value: String) {
|
||||
private fun recordPosition(context: Context, target: Target, value: String) {
|
||||
target.artDir.mkdirs()
|
||||
File(target.artDir, POSITION_SIG).writeText(value)
|
||||
File(target.artDir, sigName(context, POSITION_SIG)).writeText(value)
|
||||
}
|
||||
|
||||
private fun storePosition(target: Target, value: LogoPosition.Value?): Boolean {
|
||||
@@ -115,7 +119,7 @@ object SteamGrid {
|
||||
val next = if (value == null) existing?.let(LogoPosition::without) else LogoPosition.toJson(value, existing ?: JSONObject())
|
||||
if (next == null) {
|
||||
if (file.isFile && !file.delete()) return false
|
||||
recordPosition(target, "")
|
||||
recordPosition(context, target, "")
|
||||
return true
|
||||
}
|
||||
grid.mkdirs()
|
||||
@@ -125,7 +129,7 @@ object SteamGrid {
|
||||
tmp.delete()
|
||||
return false
|
||||
}
|
||||
recordPosition(target, signature(file))
|
||||
recordPosition(context, target, signature(file))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -140,16 +144,16 @@ object SteamGrid {
|
||||
if (hasUnknownPosition(file)) return
|
||||
val theirs = positionIn(file)
|
||||
val now = if (theirs != null) signature(file) else ""
|
||||
val before = positionRecorded(target)
|
||||
val before = positionRecorded(context, target)
|
||||
val own = position(target)
|
||||
when {
|
||||
before == null && own != null && theirs == null -> placePosition(context, target, own)
|
||||
before == null || now != before -> {
|
||||
// Recorded only once the local side agrees, so a failed take-over is tried again on the next scan.
|
||||
if (theirs != null) {
|
||||
if (own == theirs || storePosition(target, theirs)) recordPosition(target, now)
|
||||
if (own == theirs || storePosition(target, theirs)) recordPosition(context, target, now)
|
||||
} else {
|
||||
if (own == null || storePosition(target, null)) recordPosition(target, "")
|
||||
if (own == null || storePosition(target, null)) recordPosition(context, target, "")
|
||||
}
|
||||
}
|
||||
own != null && own != theirs -> placePosition(context, target, own)
|
||||
@@ -169,20 +173,20 @@ object SteamGrid {
|
||||
val present = files(grid, target.id, slot)
|
||||
val theirs = present.filter { it.name !in ours }.maxByOrNull { it.lastModified() }
|
||||
val now = signature(theirs)
|
||||
val before = recorded(target, slot)
|
||||
val before = recorded(context, target, slot)
|
||||
when {
|
||||
before == null && own != null && theirs == null -> write(context, target, slot, own)
|
||||
before == null || now != before -> {
|
||||
if (theirs != null) {
|
||||
if (own != null && own.length() == theirs.length() && own.readBytes().contentEquals(theirs.readBytes())) record(target, slot, now)
|
||||
if (own != null && own.length() == theirs.length() && own.readBytes().contentEquals(theirs.readBytes())) record(context, target, slot, now)
|
||||
else if (AddedGameArt.store(target.artDir, slot, AddedGameArt.Option(AddedGameArt.STEAM, theirs.path, theirs.path))) {
|
||||
target.setSource(slot, AddedGameArt.STEAM + "|steam-client")
|
||||
record(target, slot, now)
|
||||
record(context, target, slot, now)
|
||||
changed = true
|
||||
}
|
||||
} else {
|
||||
if (own != null && present.isEmpty()) { own.delete(); target.setSource(slot, ""); changed = true }
|
||||
record(target, slot, "")
|
||||
record(context, target, slot, "")
|
||||
}
|
||||
}
|
||||
own != null && theirs != null && now == before && own.length() != theirs.length() -> write(context, target, slot, own)
|
||||
|
||||
@@ -154,7 +154,9 @@ object Lossless {
|
||||
private fun steamDll(context: Context): File? {
|
||||
val libraries = listOfNotNull(
|
||||
File(LinuxRuntime.rootDir(context), "root/.local/share/Steam"),
|
||||
File(LinuxRuntime.rootDir(context), "root/.droiddeck-x64/.local/share/Steam"),
|
||||
GameStorage.effective(context)?.path?.let(::File),
|
||||
GameStorage.x64CardLibrary(context),
|
||||
) + com.droiddeck.launcher.frontend.AddedGames.roots(context).map { it.host }
|
||||
return libraries.map { File(it, STEAM_DLL) }.filter { it.isFile }.maxByOrNull { it.lastModified() }
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ object SteamTouchConfig {
|
||||
null
|
||||
}
|
||||
|
||||
fun steamRoot(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam")
|
||||
fun steamRoot(context: Context) = com.droiddeck.launcher.session.SessionPrefs.activeSteamRoot(context)
|
||||
|
||||
fun configDir(context: Context): File? {
|
||||
val base = File(steamRoot(context), "steamapps/common/Steam Controller Configs")
|
||||
|
||||
@@ -22,7 +22,11 @@ object DeckyManager {
|
||||
private const val RELEASES = "https://api.github.com/repos/$REPOSITORY/releases?per_page=30"
|
||||
private const val PATH = "root/homebrew/services/PluginLoader"
|
||||
private const val VERSION = "root/homebrew/services/.droiddeck-decky-version"
|
||||
private const val CEF_REMOTE_DEBUG_MARKER = "root/.local/share/Steam/.cef-enable-remote-debugging"
|
||||
// droiddeck-session reads the marker from the root of the client it runs.
|
||||
private val CEF_REMOTE_DEBUG_MARKERS = listOf(
|
||||
"root/.local/share/Steam/.cef-enable-remote-debugging",
|
||||
"root/.droiddeck-x64/.local/share/Steam/.cef-enable-remote-debugging",
|
||||
)
|
||||
|
||||
@Volatile var downloadingBinary = false
|
||||
private set
|
||||
@@ -39,29 +43,34 @@ object DeckyManager {
|
||||
fun loader(context: Context) = File(LinuxRuntime.rootDir(context), PATH)
|
||||
fun supervisorEnabled(context: Context) = File(LinuxRuntime.rootDir(context), "root/.droiddeck-decky-enabled").isFile
|
||||
|
||||
private fun cefMarkers(context: Context, creating: Boolean = false) =
|
||||
CEF_REMOTE_DEBUG_MARKERS.map { File(LinuxRuntime.rootDir(context), it) }.filter { marker ->
|
||||
!creating || !marker.path.contains("/.droiddeck-x64/") ||
|
||||
com.droiddeck.launcher.storage.SteamStorage.x64ClientPresent(marker.parentFile ?: marker)
|
||||
}
|
||||
|
||||
fun syncCefMarker(context: Context) {
|
||||
val marker = File(LinuxRuntime.rootDir(context), CEF_REMOTE_DEBUG_MARKER)
|
||||
if (!supervisorEnabled(context)) {
|
||||
marker.delete()
|
||||
cefMarkers(context).forEach { it.delete() }
|
||||
return
|
||||
}
|
||||
runCatching {
|
||||
marker.parentFile?.mkdirs()
|
||||
marker.createNewFile()
|
||||
for (marker in cefMarkers(context, creating = true)) {
|
||||
runCatching {
|
||||
marker.parentFile?.mkdirs()
|
||||
marker.createNewFile()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setSupervisorEnabled(context: Context, enabled: Boolean) {
|
||||
val marker = File(LinuxRuntime.rootDir(context), "root/.droiddeck-decky-enabled")
|
||||
val cefMarker = File(LinuxRuntime.rootDir(context), CEF_REMOTE_DEBUG_MARKER)
|
||||
if (enabled) {
|
||||
marker.parentFile?.mkdirs()
|
||||
marker.writeText("enabled\n")
|
||||
cefMarker.parentFile?.mkdirs()
|
||||
cefMarker.createNewFile()
|
||||
cefMarkers(context, creating = true).forEach { it.parentFile?.mkdirs(); it.createNewFile() }
|
||||
} else {
|
||||
marker.delete()
|
||||
cefMarker.delete()
|
||||
cefMarkers(context).forEach { it.delete() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,11 +129,12 @@ object DeckyManager {
|
||||
if (!validElf(temp, release.machine)) { temp.delete(); return context.getString(R.string.deckymgr_not_elf) }
|
||||
if (SessionState.running) { temp.delete(); return context.getString(R.string.deckymgr_session_started_loader) }
|
||||
if (!temp.setExecutable(true, false)) { temp.delete(); return context.getString(R.string.deckymgr_loader_not_executable) }
|
||||
val cefMarker = File(LinuxRuntime.rootDir(context), CEF_REMOTE_DEBUG_MARKER)
|
||||
val cefReady = !supervisorEnabled(context) || cefMarker.isFile || runCatching {
|
||||
cefMarker.parentFile?.mkdirs()
|
||||
cefMarker.createNewFile() || cefMarker.isFile
|
||||
}.getOrDefault(false)
|
||||
val cefReady = !supervisorEnabled(context) || cefMarkers(context, creating = true).all { cefMarker ->
|
||||
cefMarker.isFile || runCatching {
|
||||
cefMarker.parentFile?.mkdirs()
|
||||
cefMarker.createNewFile() || cefMarker.isFile
|
||||
}.getOrDefault(false)
|
||||
}
|
||||
if (!cefReady) { temp.delete(); return context.getString(R.string.deckymgr_cef_failed) }
|
||||
val staged = File(target.parentFile, "PluginLoader.new")
|
||||
staged.delete()
|
||||
@@ -140,7 +150,7 @@ object DeckyManager {
|
||||
old.delete()
|
||||
File(target.parentFile, ".droiddeck-decky-version").writeText(release.tag + "\n")
|
||||
File(target.parentFile, ".droiddeck-decky-arch").writeText(if (release.machine == 183) "arm64\n" else "x86_64\n")
|
||||
if (!supervisorEnabled(context)) cefMarker.delete()
|
||||
if (!supervisorEnabled(context)) cefMarkers(context).forEach { it.delete() }
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -272,7 +282,7 @@ object DeckyManager {
|
||||
File(root, PATH).delete()
|
||||
File(root, VERSION).delete()
|
||||
File(root, "root/homebrew/services/.droiddeck-decky-arch").delete()
|
||||
File(root, CEF_REMOTE_DEBUG_MARKER).delete()
|
||||
CEF_REMOTE_DEBUG_MARKERS.forEach { File(root, it).delete() }
|
||||
if (wipeData) File(root, "root/homebrew").deleteRecursively()
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,11 @@ object GameStorage {
|
||||
}
|
||||
}
|
||||
|
||||
const val X64_CARD_DIR = "x86-64"
|
||||
const val X64_CARD_GUEST = "/mnt/droiddeck-sd/$X64_CARD_DIR"
|
||||
|
||||
fun x64CardLibrary(context: Context): File? = effective(context)?.let { File(it.path, X64_CARD_DIR) }
|
||||
|
||||
class Library(val host: File, val guest: String, val label: String)
|
||||
|
||||
fun gamesFolderLibraries(context: Context): List<Library> {
|
||||
|
||||
@@ -17,8 +17,13 @@ object OfflineMode {
|
||||
|
||||
private fun loginUsers(root: File) = File(root, "root/.local/share/Steam/config/loginusers.vdf")
|
||||
|
||||
private fun x64LoginUsers(root: File) = File(root, "root/.droiddeck-x64/.local/share/Steam/config/loginusers.vdf")
|
||||
|
||||
fun account(context: Context): String? {
|
||||
val file = loginUsers(LinuxRuntime.rootDir(context))
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
// Until its first start the x86-64 client has no sign-in; droiddeck-steam-x64 --sync-login copies the arm64 one.
|
||||
val file = x64LoginUsers(root).takeIf { SessionPrefs.activeSteamClientArch(context) == "x86_64" && it.isFile }
|
||||
?: loginUsers(root)
|
||||
val text = try {
|
||||
if (file.isFile) file.readText() else return null
|
||||
} catch (e: Exception) {
|
||||
@@ -36,7 +41,11 @@ object OfflineMode {
|
||||
}
|
||||
|
||||
fun apply(context: Context, root: File) {
|
||||
val file = loginUsers(root)
|
||||
applyTo(context, loginUsers(root))
|
||||
applyTo(context, x64LoginUsers(root))
|
||||
}
|
||||
|
||||
private fun applyTo(context: Context, file: File) {
|
||||
if (!file.isFile) return
|
||||
val want = if (enabled(context)) "1" else "0"
|
||||
try {
|
||||
|
||||
@@ -21,7 +21,45 @@ object SessionArtifacts {
|
||||
|
||||
const val SCRUBBED_TREE_MARKER = ".scrubbed-tree"
|
||||
|
||||
fun collect(context: Context, dir: File, reason: String) {
|
||||
private val collectingLock = java.util.concurrent.locks.ReentrantLock()
|
||||
private val collectingDone = collectingLock.newCondition()
|
||||
private val collecting = HashSet<File>()
|
||||
|
||||
/** Recovery leaves [dir] alone from the stop until [collect] has finished it. */
|
||||
fun collectionStarted(dir: File) {
|
||||
collectingLock.lock()
|
||||
try { collecting.add(dir) } finally { collectingLock.unlock() }
|
||||
}
|
||||
|
||||
private fun collectionDone(dir: File) {
|
||||
collectingLock.lock()
|
||||
try { collecting.remove(dir); collectingDone.signalAll() } finally { collectingLock.unlock() }
|
||||
}
|
||||
|
||||
private fun inFlight(dir: File): Boolean {
|
||||
collectingLock.lock()
|
||||
try { return dir in collecting } finally { collectingLock.unlock() }
|
||||
}
|
||||
|
||||
fun awaitCollections(timeoutMs: Long = 30_000) {
|
||||
collectingLock.lock()
|
||||
try {
|
||||
var left = java.util.concurrent.TimeUnit.MILLISECONDS.toNanos(timeoutMs)
|
||||
while (collecting.isNotEmpty() && left > 0) left = collectingDone.awaitNanos(left)
|
||||
} finally {
|
||||
collectingLock.unlock()
|
||||
}
|
||||
}
|
||||
|
||||
fun collect(context: Context, dir: File, reason: String, steamArch: String? = null) {
|
||||
try {
|
||||
collectNow(context, dir, reason, steamArch)
|
||||
} finally {
|
||||
collectionDone(dir)
|
||||
}
|
||||
}
|
||||
|
||||
private fun collectNow(context: Context, dir: File, reason: String, steamArch: String?) {
|
||||
try {
|
||||
val wayland = File(dir, "wayland.log")
|
||||
if (!wayland.exists()) {
|
||||
@@ -31,7 +69,8 @@ object SessionArtifacts {
|
||||
}
|
||||
LogRedactor.learnFromRuntime(LinuxRuntime.rootDir(context))
|
||||
val record = Record(dir)
|
||||
copySteamLogs(context, dir, record)
|
||||
copySteamLogs(context, dir, record, steamArch)
|
||||
VacDiagnostics.collect(context, dir)
|
||||
SessionLogCapture.dumpCrashBuffer(File(dir, "crash.log"))
|
||||
markScrubbed(scrubTree(record))
|
||||
SessionEvents.record("session.artifacts_collected", mapOf("reason" to reason), dir)
|
||||
@@ -149,8 +188,18 @@ object SessionArtifacts {
|
||||
return record
|
||||
}
|
||||
|
||||
private fun copySteamLogs(context: Context, dir: File, record: Record) {
|
||||
val logs = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/logs")
|
||||
private const val CLIENT_FILE = "steam-client.txt"
|
||||
|
||||
fun recordClient(dir: File, arch: String) {
|
||||
runCatching { File(dir, CLIENT_FILE).writeText("$arch\n") }
|
||||
}
|
||||
|
||||
/** The Steam client a session ran, when it recorded one. */
|
||||
internal fun recordedClient(dir: File): String? =
|
||||
runCatching { File(dir, CLIENT_FILE).readText().trim() }.getOrNull()?.takeIf { it == "arm64" || it == "x86_64" }
|
||||
|
||||
private fun copySteamLogs(context: Context, dir: File, record: Record, steamArch: String? = null) {
|
||||
val logs = File(steamArch?.let { SessionPrefs.steamRoot(context, it) } ?: SessionPrefs.activeSteamRoot(context), "logs")
|
||||
if (!logs.isDirectory) return
|
||||
val out = File(dir, "steam").apply { mkdirs() }
|
||||
logs.listFiles { f -> f.isFile && f.length() < 8L * 1024 * 1024 }?.forEach { src ->
|
||||
@@ -171,7 +220,7 @@ object SessionArtifacts {
|
||||
fun finishAbandoned(context: Context) {
|
||||
val parent = LinuxRuntime.logDir(context)
|
||||
val abandoned = parent.listFiles { f ->
|
||||
SessionPaths.isSessionFolder(f) && !File(f, COMPLETE_MARKER).exists()
|
||||
SessionPaths.isSessionFolder(f) && !File(f, COMPLETE_MARKER).exists() && !inFlight(f)
|
||||
}?.sortedWith(SessionPaths.chronological) ?: return
|
||||
if (abandoned.isEmpty()) return
|
||||
val current = SessionPaths.current()
|
||||
@@ -191,7 +240,10 @@ object SessionArtifacts {
|
||||
"session died of a crash, the entry is in there unless the device rebooted.\n"
|
||||
)
|
||||
val record = Record(dir)
|
||||
if (newest) copySteamLogs(context, dir, record)
|
||||
if (newest) {
|
||||
copySteamLogs(context, dir, record, recordedClient(dir))
|
||||
VacDiagnostics.collect(context, dir)
|
||||
}
|
||||
SessionLogCapture.dumpCrashBuffer(File(dir, "crash.log"))
|
||||
SessionEvents.record("session.artifacts_recovered", mapOf("newest" to newest), dir)
|
||||
markScrubbed(scrubTree(record))
|
||||
|
||||
@@ -72,6 +72,10 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-open-url" to "usr/local/bin/droiddeck-open-url",
|
||||
"usr/local/bin/droiddeck-steam-games" to "usr/local/bin/droiddeck-steam-games",
|
||||
"usr/local/bin/droiddeck-pad-defaults" to "usr/local/bin/droiddeck-pad-defaults",
|
||||
"usr/local/bin/droiddeck-steam-x64" to "usr/local/bin/droiddeck-steam-x64",
|
||||
"usr/local/bin/droiddeck-x64-arm-proton" to "usr/local/bin/droiddeck-x64-arm-proton",
|
||||
"usr/local/bin/droiddeck-x64-arm-webhelper" to "usr/local/bin/droiddeck-x64-arm-webhelper",
|
||||
"usr/local/bin/droiddeck-x64-webhelper" to "usr/local/bin/droiddeck-x64-webhelper",
|
||||
"usr/local/bin/droiddeck-steamvr" to "usr/local/bin/droiddeck-steamvr",
|
||||
"usr/local/bin/droiddeck-steamvr-settings" to "usr/local/bin/droiddeck-steamvr-settings",
|
||||
"usr/local/bin/droiddeck-steamvr-game" to "usr/local/bin/droiddeck-steamvr-game",
|
||||
@@ -194,13 +198,18 @@ object SessionFiles {
|
||||
Log.e(TAG, "could not write steam-compatibility-label")
|
||||
}
|
||||
|
||||
val startupMovieDir = File(root, "root/.local/share/Steam/config/uioverrides/movies")
|
||||
val startupMovie = BootMovie.prepare(context)
|
||||
val bigPictureMovieInstalled = startupMovie != null &&
|
||||
stageStartupMovie(startupMovie, startupMovieDir, "bigpicture_startup.webm")
|
||||
if (startupMovie != null) stageStartupMovie(startupMovie, startupMovieDir, "steam_os_startup.webm")
|
||||
if (bigPictureMovieInstalled) {
|
||||
ensureStartupMovieDefault(File(root, "root/.local/share/Steam/config/config.vdf"))
|
||||
// The x86-64 client's config is left alone until its first start creates it.
|
||||
val steamRoots = listOf(File(root, "root/.local/share/Steam"), File(root, "root/.droiddeck-x64/.local/share/Steam"))
|
||||
.filterIndexed { i, steam -> i == 0 || File(steam, "config").isDirectory }
|
||||
for (steam in steamRoots) {
|
||||
val startupMovieDir = File(steam, "config/uioverrides/movies")
|
||||
val bigPictureMovieInstalled = startupMovie != null &&
|
||||
stageStartupMovie(startupMovie, startupMovieDir, "bigpicture_startup.webm")
|
||||
if (startupMovie != null) stageStartupMovie(startupMovie, startupMovieDir, "steam_os_startup.webm")
|
||||
if (bigPictureMovieInstalled) {
|
||||
ensureStartupMovieDefault(File(steam, "config/config.vdf"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ object SessionLogShare {
|
||||
|
||||
private fun liveSteamLogs(context: Context, folder: File): List<File> {
|
||||
if (folder != SessionPaths.current() || File(folder, "steam").exists()) return emptyList()
|
||||
val logs = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/logs")
|
||||
val logs = File(SessionPrefs.activeSteamRoot(context), "logs")
|
||||
return logs.listFiles()?.filter { it.isFile && it.length() <= STEAM_LOG_MAX_BYTES }.orEmpty()
|
||||
}
|
||||
|
||||
|
||||
@@ -452,6 +452,12 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("storageDiagnostics", on).apply()
|
||||
}
|
||||
|
||||
fun vacDiagnostics(context: Context): Boolean =
|
||||
prefs(context).getBoolean("vac_diagnostics", false)
|
||||
|
||||
fun setVacDiagnostics(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("vac_diagnostics", on).apply()
|
||||
}
|
||||
|
||||
private fun resolutionCap(context: Context, mode: String): Int = prefs(context).getInt("resolutionCap.$mode", 720)
|
||||
|
||||
@@ -499,6 +505,23 @@ object SessionPrefs {
|
||||
.onFailure { android.util.Log.e("GameEnvironment", "Could not update game environment", it) }
|
||||
}
|
||||
|
||||
fun steamClientArch(context: Context): String = prefs(context).getString("steamClientArch", null) ?: "arm64"
|
||||
|
||||
fun setSteamClientArch(context: Context, id: String) {
|
||||
prefs(context).edit().putString("steamClientArch", id).apply()
|
||||
}
|
||||
|
||||
/** The running session's client, else the selected one: a changed setting applies from the next session. */
|
||||
fun activeSteamClientArch(context: Context): String =
|
||||
SessionState.steamClientArch?.takeIf { SessionState.running } ?: steamClientArch(context)
|
||||
|
||||
fun activeSteamRoot(context: Context): java.io.File = steamRoot(context, activeSteamClientArch(context))
|
||||
|
||||
fun steamRoot(context: Context, arch: String): java.io.File = java.io.File(
|
||||
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context),
|
||||
if (arch == "x86_64") "root/.droiddeck-x64/.local/share/Steam" else "root/.local/share/Steam",
|
||||
)
|
||||
|
||||
fun bootMovie(context: Context): String =
|
||||
prefs(context).getString("bootMovie", BootMovie.DROIDDECK_30) ?: BootMovie.DROIDDECK_30
|
||||
fun setBootMovie(context: Context, id: String) { prefs(context).edit().putString("bootMovie", id).apply() }
|
||||
|
||||
@@ -247,7 +247,10 @@ class SessionService : Service() {
|
||||
SessionState.programArgs = intent?.getStringArrayExtra(EXTRA_PROGRAM_ARGS)?.toList().orEmpty()
|
||||
SessionState.steamUi = intent?.getStringExtra(EXTRA_STEAM_UI)
|
||||
SessionState.steamUrl = intent?.getStringExtra(EXTRA_STEAM_URL)
|
||||
SessionState.running = true
|
||||
synchronized(stopLock) {
|
||||
SessionState.steamClientArch = null
|
||||
SessionState.running = true
|
||||
}
|
||||
if (SessionState.stopRequested) {
|
||||
stopSession(0)
|
||||
return START_NOT_STICKY
|
||||
@@ -268,9 +271,9 @@ class SessionService : Service() {
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
private fun collectSessionArtifacts(dir: File) {
|
||||
private fun collectSessionArtifacts(dir: File, steamArch: String?) {
|
||||
try {
|
||||
SessionArtifacts.collect(this, dir, "session stopped")
|
||||
SessionArtifacts.collect(this, dir, "session stopped", steamArch)
|
||||
} finally {
|
||||
SessionLogCapture.stopFor(dir)
|
||||
SessionPaths.release(this, dir)
|
||||
@@ -317,6 +320,10 @@ class SessionService : Service() {
|
||||
val runtimeDir = File(filesDir, ".wayland-rt").apply { mkdirs() }
|
||||
killStragglers()
|
||||
SessionFiles.stage(this, root)
|
||||
// Earlier sessions' reports still read the Steam logs and VAC marker this session replaces.
|
||||
SessionArtifacts.awaitCollections()
|
||||
SessionArtifacts.finishAbandoned(this)
|
||||
VacDiagnostics.arm(this)
|
||||
com.droiddeck.launcher.agent.AgentGuest.reset(this)
|
||||
com.droiddeck.launcher.stores.gog.GogComet.begin()
|
||||
com.droiddeck.launcher.stores.StoreLaunchRequests.start(this)
|
||||
@@ -579,6 +586,11 @@ class SessionService : Service() {
|
||||
guest.add("MESA_DISK_CACHE_DATABASE=1")
|
||||
guest.add("GLIBC_TUNABLES=glibc.pthread.rseq=0:glibc.malloc.top_pad=16777216")
|
||||
if (SessionState.mode == MODE_STEAM) guest.add("BL_MANGOAPP=" + (if (SessionPrefs.mangoapp(this)) "1" else "0"))
|
||||
SessionState.steamClientArch = if (steamHere) SessionPrefs.steamClientArch(this) else null
|
||||
SessionState.steamClientArch?.let { arch ->
|
||||
guest.add("BL_STEAM_CLIENT_ARCH=$arch")
|
||||
SessionPaths.current()?.let { SessionArtifacts.recordClient(it, arch) }
|
||||
}
|
||||
if (SessionState.mode == MODE_STEAM) {
|
||||
guest.add("BL_GAMESCOPE_STRETCH_16X9=" + (if (SessionPrefs.stretch16x9(this)) "1" else "0"))
|
||||
}
|
||||
@@ -823,6 +835,40 @@ class SessionService : Service() {
|
||||
}
|
||||
}
|
||||
}
|
||||
val x64Libraries = org.json.JSONArray()
|
||||
// Desktop mode offers the x86-64 client either way; droiddeck-steam-x64 drops library folders it is not given.
|
||||
val x64Here = SessionPrefs.steamClientArch(this) == "x86_64" ||
|
||||
(SessionState.mode == MODE_DESKTOP &&
|
||||
com.droiddeck.launcher.storage.SteamStorage.x64ClientPresent(SessionPrefs.steamRoot(this, "x86_64")))
|
||||
if (storageDiagnosticLibrary != null && library != null && x64Here) {
|
||||
val x64 = File(library.path, GameStorage.X64_CARD_DIR)
|
||||
val problem = GameStorage.prepare(this, x64.path)
|
||||
if (problem != null) {
|
||||
Log.w(TAG, "x86-64 steam library: $problem")
|
||||
} else try {
|
||||
val room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
||||
} else Int.MAX_VALUE
|
||||
val extra = SecondaryLibrary.binds(filesDir, x64, listOf(GameStorage.X64_CARD_GUEST)).drop(1)
|
||||
if (extra.size > room) {
|
||||
Log.w(TAG, "x86-64 steam library: $x64 needs ${extra.size} binds, $room left for the fast path; not a library this session")
|
||||
} else {
|
||||
binds.addAll(extra)
|
||||
x64Libraries.put(org.json.JSONObject().put("path", GameStorage.X64_CARD_GUEST).put("label", library.label.replace('"', ' ').replace('\\', ' ')))
|
||||
Log.i(TAG, "x86-64 steam library: $x64 -> ${GameStorage.X64_CARD_GUEST} (\"${library.label}\")")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "x86-64 steam library: $x64 private directories could not be prepared", e)
|
||||
}
|
||||
}
|
||||
try {
|
||||
val listing = File(filesDir, "session/steam-libraries-x64.json").apply { parentFile?.mkdirs() }
|
||||
listing.writeText(x64Libraries.toString())
|
||||
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
|
||||
guest.add(envAt, "BL_X64_STEAM_LIBRARIES=" + listing.path)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "x86-64 steam library: the list could not be written; internal storage alone this session", e)
|
||||
}
|
||||
try {
|
||||
val listing = File(filesDir, "session/steam-libraries.json").apply { parentFile?.mkdirs() }
|
||||
val json = org.json.JSONArray()
|
||||
@@ -1356,9 +1402,10 @@ class SessionService : Service() {
|
||||
private fun stopSession(status: Int) {
|
||||
cancelQueuedSteamGame()
|
||||
completeNativeSleep()
|
||||
synchronized(stopLock) {
|
||||
val (ended, endedArch) = synchronized(stopLock) {
|
||||
if (!SessionState.running) return
|
||||
SessionState.running = false
|
||||
SessionPaths.take() to SessionState.steamClientArch
|
||||
}
|
||||
xrActivityVisible = false
|
||||
updateDownloadMonitoring()
|
||||
@@ -1383,8 +1430,11 @@ class SessionService : Service() {
|
||||
SessionTerminal.clear(sessionGen)
|
||||
val controller = suspendController
|
||||
suspendController = null
|
||||
val ended = SessionPaths.take()
|
||||
if (ended != null) Thread({ collectSessionArtifacts(ended) }, "session-collect").start()
|
||||
if (ended != null) {
|
||||
VacDiagnostics.snapshot(this, ended)
|
||||
SessionArtifacts.collectionStarted(ended)
|
||||
Thread({ collectSessionArtifacts(ended, endedArch) }, "session-collect").start()
|
||||
}
|
||||
components.reversed().forEach {
|
||||
try {
|
||||
it.stop()
|
||||
@@ -1584,6 +1634,7 @@ class SessionService : Service() {
|
||||
downloadActive = steamDownloadMonitor.poll(
|
||||
LinuxRuntime.rootDir(this@SessionService),
|
||||
receivedBytes = TrafficStats.getUidRxBytes(android.os.Process.myUid()),
|
||||
client = SessionState.steamClientArch,
|
||||
)
|
||||
if (wasActive != downloadActive) refreshNotification()
|
||||
updateSuspendPolicy()
|
||||
|
||||
@@ -53,6 +53,8 @@ object SessionState {
|
||||
var steamUi: String? = null
|
||||
@Volatile
|
||||
var steamUrl: String? = null
|
||||
@Volatile
|
||||
var steamClientArch: String? = null
|
||||
// A Play SteamVR request can arrive while an existing session is visible.
|
||||
// Wake the status/launch effect even if no glasses surface has attached yet.
|
||||
var steamVr by mutableStateOf(false)
|
||||
|
||||
@@ -12,12 +12,13 @@ internal class SteamDownloadMonitor {
|
||||
private var previous = emptyMap<String, ManifestState>()
|
||||
private var lastProgressAt = 0L
|
||||
private var contentLogOffset = 0L
|
||||
private var contentLog: File? = null
|
||||
private val activeContentUpdates = mutableSetOf<String>()
|
||||
private var lastContentActivityAt = 0L
|
||||
private var lastReceivedBytes = -1L
|
||||
private var lastReceivedAt = 0L
|
||||
|
||||
fun poll(runtimeRoot: File, now: Long = System.currentTimeMillis(), receivedBytes: Long = -1L): Boolean {
|
||||
fun poll(runtimeRoot: File, now: Long = System.currentTimeMillis(), receivedBytes: Long = -1L, client: String? = null): Boolean {
|
||||
val current = manifests(runtimeRoot).associate { it.path to read(it) }
|
||||
val progressed = current.any { (path, state) ->
|
||||
state.incomplete && state.bytesDownloaded > (previous[path]?.bytesDownloaded ?: state.bytesDownloaded)
|
||||
@@ -27,7 +28,7 @@ internal class SteamDownloadMonitor {
|
||||
val manifestActive = progressed || lastProgressAt > 0L && now - lastProgressAt <= MANIFEST_PROGRESS_GRACE_MS &&
|
||||
current.values.any { it.incomplete }
|
||||
if (receiving(receivedBytes, now)) lastContentActivityAt = now
|
||||
return manifestActive || readContentActivity(runtimeRoot, now)
|
||||
return manifestActive || readContentActivity(runtimeRoot, now, client)
|
||||
}
|
||||
|
||||
private fun receiving(receivedBytes: Long, now: Long): Boolean {
|
||||
@@ -43,16 +44,19 @@ internal class SteamDownloadMonitor {
|
||||
previous = emptyMap()
|
||||
lastProgressAt = 0L
|
||||
contentLogOffset = 0L
|
||||
contentLog = null
|
||||
activeContentUpdates.clear()
|
||||
lastContentActivityAt = 0L
|
||||
lastReceivedBytes = -1L
|
||||
lastReceivedAt = 0L
|
||||
}
|
||||
|
||||
private fun readContentActivity(runtimeRoot: File, now: Long): Boolean {
|
||||
val log = File(runtimeRoot, "root/.local/share/Steam/logs/content_log.txt")
|
||||
private fun readContentActivity(runtimeRoot: File, now: Long, client: String?): Boolean {
|
||||
val homes = client?.let { listOf(if (it == "x86_64") STEAM_HOMES[1] else STEAM_HOMES[0]) } ?: STEAM_HOMES
|
||||
val log = homes.map { File(runtimeRoot, "$it/logs/content_log.txt") }.maxByOrNull { it.lastModified() }!!
|
||||
if (!log.isFile) return false
|
||||
if (log.length() < contentLogOffset) {
|
||||
if (log != contentLog || log.length() < contentLogOffset) {
|
||||
contentLog = log
|
||||
contentLogOffset = 0L
|
||||
activeContentUpdates.clear()
|
||||
lastContentActivityAt = 0L
|
||||
@@ -95,12 +99,15 @@ internal class SteamDownloadMonitor {
|
||||
}
|
||||
|
||||
private fun manifests(runtimeRoot: File): List<File> {
|
||||
val steamRoots = linkedSetOf(File(runtimeRoot, "root/.local/share/Steam"))
|
||||
val primary = steamRoots.first()
|
||||
val libraryFolders = File(primary, "steamapps/libraryfolders.vdf")
|
||||
runCatching {
|
||||
PATH.findAll(libraryFolders.readText()).forEach { match ->
|
||||
steamRoots += File(runtimeRoot, match.groupValues[1].removePrefix("/"))
|
||||
val steamRoots = linkedSetOf<File>()
|
||||
for (home in STEAM_HOMES) {
|
||||
val primary = File(runtimeRoot, home)
|
||||
steamRoots += primary
|
||||
val libraryFolders = File(primary, "steamapps/libraryfolders.vdf")
|
||||
runCatching {
|
||||
PATH.findAll(libraryFolders.readText()).forEach { match ->
|
||||
steamRoots += File(runtimeRoot, match.groupValues[1].removePrefix("/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
return steamRoots.flatMap { root ->
|
||||
@@ -126,6 +133,7 @@ internal class SteamDownloadMonitor {
|
||||
const val CONTENT_ACTIVITY_GRACE_MS = 90_000L
|
||||
const val MIN_RECEIVE_BYTES_PER_SEC = 64L * 1024L
|
||||
val PATH = Regex("\"path\"\\s+\"([^\"]+)\"")
|
||||
val STEAM_HOMES = listOf("root/.local/share/Steam", "root/.droiddeck-x64/.local/share/Steam")
|
||||
val CONTENT_UPDATE = Regex("""AppID (\d+) (App|Workshop|Shader) update changed : (.*)""")
|
||||
val CURRENT_RATE = Regex("""Current download rate: ([\d.]+) Mbps""")
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ object SteamRepair {
|
||||
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
|
||||
private fun request(context: Context) = File(home(context), ".bl-steam-repair")
|
||||
private fun unconfirmed(context: Context) = File(home(context), ".local/share/Steam/package/droiddeck-unconfirmed")
|
||||
private fun x64Unconfirmed(context: Context) = File(home(context), ".droiddeck-x64/.local/share/Steam/package/droiddeck-unconfirmed")
|
||||
|
||||
fun queued(context: Context): Boolean = request(context).exists()
|
||||
|
||||
@@ -16,6 +17,6 @@ object SteamRepair {
|
||||
}.isSuccess
|
||||
|
||||
fun clientShown(context: Context) {
|
||||
unconfirmed(context).delete()
|
||||
(if (SessionPrefs.activeSteamClientArch(context) == "x86_64") x64Unconfirmed(context) else unconfirmed(context)).delete()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.LogRedactor
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import java.io.File
|
||||
import java.io.RandomAccessFile
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Source games state VAC-secure or insecure only in their console, which reaches a file (console.log in the
|
||||
* mod folder) only with -condebug. The report quotes the lines it found and says inconclusive rather than guessing.
|
||||
*/
|
||||
object VacDiagnostics {
|
||||
private const val TAG = "VacDiagnostics"
|
||||
|
||||
/**
|
||||
* Checked by the launch wrapper. Lines: session start (epoch seconds), the Steam client it ran, then
|
||||
* "length<tab>canonical path" for each console.log already there.
|
||||
*/
|
||||
private const val MARKER = "root/.droiddeck-vac-diagnostics"
|
||||
|
||||
private const val LAUNCHES = "root/.droiddeck-vac-launches"
|
||||
|
||||
private const val CONSOLE_TAIL_BYTES = 4L * 1024 * 1024
|
||||
|
||||
private const val MAX_QUOTED = 40
|
||||
|
||||
private val INSECURE = Regex("insecure mode", RegexOption.IGNORE_CASE)
|
||||
// "Connecting to" is only an attempt: L4D2 refuses a VAC server with a dialog that never reaches the console.
|
||||
private val CONNECTED = Regex("^Connected to", RegexOption.IGNORE_CASE)
|
||||
private val ATTEMPTED = Regex("^Connecting to", RegexOption.IGNORE_CASE)
|
||||
private val NOTABLE = Regex("\\bVAC\\b|secure|Connected to|Connecting to|Disconnect|challenge|game coordinator", RegexOption.IGNORE_CASE)
|
||||
private val STEAM_VAC = Regex("\\bVAC\\b|anti-?cheat", RegexOption.IGNORE_CASE)
|
||||
|
||||
fun enabled(context: Context): Boolean = SessionPrefs.vacDiagnostics(context)
|
||||
|
||||
fun arm(context: Context) {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val marker = File(root, MARKER)
|
||||
try {
|
||||
File(root, LAUNCHES).delete()
|
||||
if (enabled(context)) {
|
||||
val arch = SessionPrefs.steamClientArch(context)
|
||||
// -condebug appends, so each console.log's length now is where this session's lines start.
|
||||
val sizes = consoleLogs(context, arch).joinToString("") { "${it.length()}\t${canonical(it)}\n" }
|
||||
marker.writeText("${System.currentTimeMillis() / 1000}\n$arch\n$sizes")
|
||||
} else marker.delete()
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not arm VAC diagnostics", e)
|
||||
}
|
||||
}
|
||||
|
||||
private const val SNAPSHOT_MARKER = ".vac-marker"
|
||||
private const val SNAPSHOT_LAUNCHES = ".vac-launches"
|
||||
|
||||
/** Call when a session stops, before the next [arm] replaces its marker and launch list. */
|
||||
fun snapshot(context: Context, dir: File) {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
try {
|
||||
File(root, MARKER).takeIf { it.isFile }?.copyTo(File(dir, SNAPSHOT_MARKER), overwrite = true) ?: return
|
||||
File(root, LAUNCHES).takeIf { it.isFile }?.copyTo(File(dir, SNAPSHOT_LAUNCHES), overwrite = true)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not keep this session's VAC diagnostics state", e)
|
||||
}
|
||||
}
|
||||
|
||||
fun collect(context: Context, dir: File) {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val kept = File(dir, SNAPSHOT_MARKER).takeIf { it.isFile }
|
||||
val marker = kept ?: File(root, MARKER)
|
||||
val launchList = if (kept != null) File(dir, SNAPSHOT_LAUNCHES) else File(root, LAUNCHES)
|
||||
if (!marker.isFile) return
|
||||
try {
|
||||
val armed = marker.readLines().map { it.trim() }
|
||||
val since = (armed.getOrNull(0)?.toLongOrNull() ?: 0L) * 1000 - 5_000
|
||||
val arch = armed.getOrNull(1)?.takeIf { it.isNotEmpty() } ?: SessionPrefs.steamClientArch(context)
|
||||
val armedSizes = armed.drop(2).mapNotNull { line ->
|
||||
val (size, path) = line.split('\t', limit = 2).takeIf { it.size == 2 } ?: return@mapNotNull null
|
||||
size.toLongOrNull()?.let { path to it }
|
||||
}.toMap()
|
||||
val out = File(dir, "vac").apply { mkdirs() }
|
||||
val consoles = consoleLogs(context, arch).filter { writtenThisSession(it, since, armedSizes) }
|
||||
val report = StringBuilder()
|
||||
report.appendLine("VAC diagnostics - ${now()}")
|
||||
report.appendLine("Read from the game's own console (-condebug) and the Steam client's logs.")
|
||||
report.appendLine()
|
||||
report.appendLine("== Client")
|
||||
report.appendLine(" Client this session: " + if (arch == "x86_64") "x86-64 (Valve's x86-64 client under FEX)" else "arm64")
|
||||
report.appendLine(" Files in its folder (/${SessionPrefs.steamRoot(context, arch).relativeTo(root).path}):")
|
||||
clientFiles(context, arch).forEach { report.appendLine(" $it") }
|
||||
report.appendLine()
|
||||
report.appendLine("== Game launches this session (from the launch wrapper)")
|
||||
val launches = launchList.takeIf { it.isFile }?.readLines().orEmpty().filter { it.isNotBlank() }
|
||||
if (launches.isEmpty()) report.appendLine(" none - no Windows game was launched through the client")
|
||||
launches.forEach { report.appendLine(" " + LogRedactor.redact(it)) }
|
||||
report.appendLine()
|
||||
report.appendLine("== Game consoles")
|
||||
if (consoles.isEmpty()) {
|
||||
report.appendLine(" No console.log was written this session. Only Source-engine games write one,")
|
||||
report.appendLine(" and only when started with -condebug (this setting adds it).")
|
||||
}
|
||||
val names = consoleNames(consoles)
|
||||
consoles.forEachIndexed { i, log ->
|
||||
val name = names[i]
|
||||
val lines = tail(log, armedSizes[canonical(log)] ?: 0L)
|
||||
File(out, "$name-console.log").bufferedWriter().use { w ->
|
||||
lines.forEach { w.write(LogRedactor.redact(it)); w.newLine() }
|
||||
}
|
||||
report.appendLine("-- $name (vac/$name-console.log)")
|
||||
report.appendLine(" Verdict: " + verdict(lines))
|
||||
lines.filter { NOTABLE.containsMatchIn(it) }.takeLast(MAX_QUOTED)
|
||||
.forEach { report.appendLine(" | " + LogRedactor.redact(it.trim())) }
|
||||
report.appendLine()
|
||||
}
|
||||
report.appendLine("== VAC in the Steam client's logs")
|
||||
val steamHits = File(dir, "steam").listFiles { f -> f.isFile }?.sortedBy { it.name }.orEmpty()
|
||||
.flatMap { f -> runCatching { f.readLines() }.getOrDefault(emptyList()).filter { STEAM_VAC.containsMatchIn(it) }.map { "${f.name}: ${it.trim()}" } }
|
||||
if (steamHits.isEmpty()) report.appendLine(" none - the client logged no VAC activity this session")
|
||||
steamHits.takeLast(MAX_QUOTED).forEach { report.appendLine(" $it") }
|
||||
File(dir, "vac.txt").writeText(report.toString())
|
||||
File(dir, SNAPSHOT_MARKER).delete()
|
||||
File(dir, SNAPSHOT_LAUNCHES).delete()
|
||||
Log.i(TAG, "VAC diagnostics: ${consoles.size} console log(s), ${steamHits.size} client VAC line(s), into $dir")
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "collecting VAC diagnostics", e)
|
||||
}
|
||||
}
|
||||
|
||||
private fun verdict(lines: List<String>): String = when {
|
||||
lines.any { INSECURE.containsMatchIn(it) } ->
|
||||
"INSECURE - the game started in insecure mode and cannot join VAC-secured servers until it restarts."
|
||||
lines.any { CONNECTED.containsMatchIn(it) } ->
|
||||
"No insecure notice, and the game connected to a server. Confirm with the server's own info that it is VAC-secured."
|
||||
lines.any { ATTEMPTED.containsMatchIn(it) } ->
|
||||
"NOT CONNECTED - the game tried a server and never got in. If the screen said \"Connection Blocked: " +
|
||||
"Please remove plug-ins ... VAC secured server\" (Left 4 Dead 2's wording), the game is insecure; " +
|
||||
"that dialog never reaches the console."
|
||||
else ->
|
||||
"Inconclusive - the game never connected to a server. Join a VAC-secured server, then check again."
|
||||
}
|
||||
|
||||
/** Source writes <game>/<mod>/console.log, Source 2 <game>/game/<mod>/console.log. */
|
||||
private fun consoleLogs(context: Context, arch: String): List<File> {
|
||||
val found = LinkedHashMap<String, File>()
|
||||
for (library in libraryRoots(context, arch)) {
|
||||
val games = File(library, "steamapps/common").listFiles { f -> f.isDirectory } ?: continue
|
||||
for (game in games) {
|
||||
val mods = (game.listFiles { f -> f.isDirectory }.orEmpty().toList() +
|
||||
File(game, "game").listFiles { f -> f.isDirectory }.orEmpty().toList())
|
||||
for (mod in mods) {
|
||||
val log = File(mod, "console.log")
|
||||
if (log.isFile) found[canonical(log)] = log
|
||||
}
|
||||
}
|
||||
}
|
||||
return found.values.toList()
|
||||
}
|
||||
|
||||
private fun libraryRoots(context: Context, arch: String): List<File> {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val steam = SessionPrefs.steamRoot(context, arch)
|
||||
val roots = mutableListOf(steam)
|
||||
(if (arch == "x86_64") GameStorage.x64CardLibrary(context) else GameStorage.effective(context)?.let { File(it.path) })
|
||||
?.let { roots.add(it) }
|
||||
runCatching {
|
||||
Regex("\"path\"\\s+\"([^\"]+)\"").findAll(File(steam, "steamapps/libraryfolders.vdf").readText()).forEach {
|
||||
roots.add(File(root, it.groupValues[1].removePrefix("/")))
|
||||
}
|
||||
}
|
||||
return roots.filter { it.isDirectory }.distinctBy { runCatching { it.canonicalPath }.getOrDefault(it.path) }
|
||||
}
|
||||
|
||||
/** Two libraries can hold the same game and mod folder; a repeated name takes a tag from the log's path. */
|
||||
internal fun consoleNames(logs: List<File>): List<String> {
|
||||
val used = HashSet<String>()
|
||||
return logs.map { log ->
|
||||
val base = consoleName(log)
|
||||
if (used.add(base)) base else "$base-%08x".format(canonical(log).hashCode()).also { used.add(it) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun consoleName(log: File): String {
|
||||
val mod = log.parentFile
|
||||
val game = mod?.parentFile?.let { if (it.name == "game") it.parentFile else it }
|
||||
return "${game?.name ?: "game"}-${mod?.name ?: "mod"}".replace(Regex("[^A-Za-z0-9._ +-]+"), "_")
|
||||
}
|
||||
|
||||
private fun canonical(file: File): String = runCatching { file.canonicalPath }.getOrDefault(file.path)
|
||||
|
||||
internal fun writtenThisSession(log: File, since: Long, armedSizes: Map<String, Long>): Boolean =
|
||||
log.lastModified() >= since && log.length() != armedSizes[canonical(log)]
|
||||
|
||||
internal fun tail(file: File, from: Long = 0L): List<String> = try {
|
||||
RandomAccessFile(file, "r").use { raf ->
|
||||
val length = raf.length()
|
||||
val since = from.takeIf { it <= length } ?: 0L
|
||||
val start = maxOf(since, length - CONSOLE_TAIL_BYTES)
|
||||
raf.seek(start)
|
||||
val bytes = ByteArray((length - start).toInt())
|
||||
raf.readFully(bytes)
|
||||
String(bytes, Charsets.UTF_8).lines().let { if (start > since) it.drop(1) else it }
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not read ${file.name}", e)
|
||||
emptyList()
|
||||
}
|
||||
|
||||
private fun clientFiles(context: Context, arch: String): List<String> {
|
||||
val steam = SessionPrefs.steamRoot(context, arch)
|
||||
return listOf(
|
||||
"linuxarm64/steamclient.so" to "arm64 Linux client",
|
||||
"linux64/steamclient.so" to "x86-64 Linux client",
|
||||
"ubuntu12_64/steamclient.so" to "x86-64 Linux client (ubuntu12_64)",
|
||||
"steamrt64/steamclient.so" to "x86-64 Linux client (steamrt64)",
|
||||
).map { (path, label) -> "$label: ${if (File(steam, path).isFile) "present" else "absent"} ($path)" }
|
||||
}
|
||||
|
||||
private fun now(): String = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(Date())
|
||||
}
|
||||
@@ -46,6 +46,10 @@ object SteamStorage {
|
||||
)
|
||||
}
|
||||
|
||||
/** The folder alone does not mean installed: Decky's CEF marker creates it. */
|
||||
fun x64ClientPresent(root: File): Boolean = File(root, "steamrt64/steam").isFile ||
|
||||
File(root, "package/droiddeck-installed").isFile || File(root, "steamapps").isDirectory
|
||||
|
||||
class Listing(val manifests: List<Manifest>, val otherIds: Set<Int>, val complete: Boolean) {
|
||||
val ids: Set<Int> get() = manifests.map { it.appId }.toSet() + otherIds
|
||||
}
|
||||
@@ -116,6 +120,17 @@ object SteamStorage {
|
||||
|
||||
fun compatToolName(compatibilityToolVdf: String): String? = COMPAT_NAME.find(compatibilityToolVdf)?.groupValues?.get(1)
|
||||
|
||||
private val ARM_IN_NAME = Regex("arm64|aarch64")
|
||||
|
||||
// The x86-64 client ignores tools named for arm64; droiddeck-steam-x64 names its wrappers with a64 instead.
|
||||
fun x64ToolName(name: String): String = name.replace(ARM_IN_NAME, "a64")
|
||||
|
||||
class ToolUse(val mappings: Map<String, String>, val installed: Set<String>, val x64: Boolean = false) {
|
||||
private fun key(tool: String) = if (x64) x64ToolName(tool) else tool
|
||||
fun games(tool: String): Int = mappings.count { (app, name) -> name == key(tool) && app in installed }
|
||||
fun isDefault(tool: String): Boolean = mappings["0"] == key(tool)
|
||||
}
|
||||
|
||||
fun leftoverId(name: String): Int? = name.toLongOrNull()?.takeIf { it in 1 until (1L shl 31) }?.toInt()
|
||||
|
||||
fun isStubPrefix(prefix: File): Boolean = prefix.walkTopDown().onEnter { !java.nio.file.Files.isSymbolicLink(it.toPath()) }
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.droiddeck.launcher.runtime.FlatpakManager
|
||||
import com.droiddeck.launcher.session.ComponentsManager
|
||||
import com.droiddeck.launcher.session.SecondaryLibrary
|
||||
import com.droiddeck.launcher.session.SessionPaths
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
|
||||
enum class Bucket { GAMES, GAME_DATA, TOOLS, COMPONENTS, STORES, DESKTOP, SYSTEM, DROIDDECK }
|
||||
@@ -18,13 +19,14 @@ enum class Bucket { GAMES, GAME_DATA, TOOLS, COMPONENTS, STORES, DESKTOP, SYSTEM
|
||||
class GameUsage(
|
||||
val appId: Int, val name: String, val art: File?, val library: String, val internal: Boolean, val lastPlayed: Long,
|
||||
val game: Long, val prefix: Long, val shaders: Long, val workshop: Long, val shaderDir: File?,
|
||||
val x64: Boolean = false,
|
||||
) {
|
||||
val data: Long get() = prefix + shaders + workshop
|
||||
val total: Long get() = game + data
|
||||
}
|
||||
|
||||
enum class ToolState { IN_USE, REQUIRED, UNUSED }
|
||||
enum class ToolReason { DEFAULT_PROTON, PROTON, FEX_RUNTIME, ARM_RUNTIME, REDISTRIBUTABLES, FEX, STEAM_TOOL, OLD_RUNTIME, X86_PROTON, CUSTOM, CUSTOM_UNKNOWN }
|
||||
enum class ToolReason { DEFAULT_PROTON, PROTON, FEX_RUNTIME, ARM_RUNTIME, REDISTRIBUTABLES, FEX, STEAM_TOOL, OLD_RUNTIME, X86_PROTON, CUSTOM, CUSTOM_UNKNOWN, X64_CLIENT }
|
||||
|
||||
class ToolUsage(
|
||||
val key: String, val name: String, val bytes: Long, val state: ToolState, val reason: ToolReason,
|
||||
@@ -87,31 +89,51 @@ object StorageScan {
|
||||
fun measure(file: File): Long = size(file).also { known[file.path] = it }
|
||||
}
|
||||
|
||||
fun steamRoot(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam")
|
||||
// Proton tools' files live only in the arm64 client's root; the x86-64 client has wrappers of them.
|
||||
fun steamRoot(context: Context) = SessionPrefs.steamRoot(context, "arm64")
|
||||
|
||||
fun scan(context: Context): StorageReport {
|
||||
val walker = Walker()
|
||||
val files = context.filesDir
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
val steamRoot = steamRoot(context)
|
||||
val libraries = Library.steamLibraries(context)
|
||||
val primary = runCatching { steamRoot.canonicalPath }.getOrDefault(steamRoot.path)
|
||||
val art = runCatching { Library.steamGames(context) }.getOrDefault(emptyList()).associateBy { it.appId }
|
||||
val x64Root = SessionPrefs.steamRoot(context, "x86_64").takeIf { SteamStorage.x64ClientPresent(it) }
|
||||
val clients = listOfNotNull("arm64", "x86_64".takeIf { x64Root != null })
|
||||
fun canonical(f: File) = runCatching { f.canonicalPath }.getOrDefault(f.path)
|
||||
val art = clients.associate { arch ->
|
||||
(arch == "x86_64") to runCatching { Library.steamGames(context, arch = arch) }.getOrDefault(emptyList()).associateBy { it.appId }
|
||||
}
|
||||
|
||||
class Lib(val root: File, val label: String, val internal: Boolean, val data: File, val listing: SteamStorage.Listing?) {
|
||||
class Lib(val root: File, val label: String, val internal: Boolean, val data: File, val listing: SteamStorage.Listing?, val x64: Boolean) {
|
||||
val manifests: List<SteamStorage.Manifest>? get() = listing?.manifests
|
||||
}
|
||||
val libs = libraries.map { (root, label) ->
|
||||
val internal = runCatching { root.canonicalPath }.getOrDefault(root.path) == primary
|
||||
val data = if (internal) root else SecondaryLibrary.privateRoot(files, root)
|
||||
Lib(root, label, internal, data, SteamStorage.manifests(root))
|
||||
val libs = clients.flatMap { arch ->
|
||||
val x64 = arch == "x86_64"
|
||||
val primary = canonical(SessionPrefs.steamRoot(context, arch))
|
||||
Library.steamLibraries(context, arch).map { (root, label) ->
|
||||
val internal = canonical(root) == primary
|
||||
val data = if (internal) root else SecondaryLibrary.privateRoot(files, root)
|
||||
// The x86-64 card folder and its steamapps appear only with that client's first session and library write.
|
||||
val listing = SteamStorage.manifests(root)
|
||||
?: SteamStorage.Listing(emptyList(), emptySet(), true).takeIf {
|
||||
x64 && (if (internal) !File(root, "steamapps").exists() else !root.exists() && root.parentFile?.isDirectory == true)
|
||||
}
|
||||
Lib(root, label, internal, data, listing, x64)
|
||||
}
|
||||
}
|
||||
val everyLibraryRead = libs.all { it.listing?.complete == true }
|
||||
val everyId = libs.flatMap { it.listing?.ids.orEmpty() }.toSet()
|
||||
val mappings = runCatching { SteamStorage.compatMappings(File(steamRoot, "config/config.vdf").readText()) }.getOrNull()
|
||||
val installedGames = libs.flatMap { it.manifests.orEmpty() }.filter { !SteamStorage.isTool(it) && it.installed }.map { it.appId.toString() }.toSet()
|
||||
fun gamesOn(tool: String) = mappings.orEmpty().count { (app, name) -> name == tool && app in installedGames }
|
||||
val defaultTool = mappings?.get("0")
|
||||
val clientIds = libs.groupBy { it.x64 }.mapValues { (_, own) -> own.flatMap { it.listing?.ids.orEmpty() }.toSet() }
|
||||
fun installedGames(x64: Boolean) = libs.filter { it.x64 == x64 }.flatMap { it.manifests.orEmpty() }
|
||||
.filter { !SteamStorage.isTool(it) && it.installed }.map { it.appId.toString() }.toSet()
|
||||
val armUse = runCatching { SteamStorage.compatMappings(File(steamRoot, "config/config.vdf").readText()) }.getOrNull()
|
||||
?.let { SteamStorage.ToolUse(it, installedGames(false)) }
|
||||
// An x86-64 client without a config.vdf has never mapped a game to anything.
|
||||
val x64Vdf = x64Root?.let { File(it, "config/config.vdf") }
|
||||
val x64Use = if (x64Vdf == null || !x64Vdf.exists()) SteamStorage.ToolUse(emptyMap(), emptySet(), x64 = true)
|
||||
else runCatching { SteamStorage.ToolUse(SteamStorage.compatMappings(x64Vdf.readText()), installedGames(true), x64 = true) }.getOrNull()
|
||||
val mappingsRead = armUse != null && x64Use != null
|
||||
val uses = listOfNotNull(armUse, x64Use)
|
||||
fun gamesOn(tool: String) = uses.sumOf { it.games(tool) }
|
||||
|
||||
val tools = LinkedHashMap<String, ToolUsage>()
|
||||
val games = ArrayList<GameUsage>()
|
||||
@@ -125,7 +147,7 @@ object StorageScan {
|
||||
).filter { it.exists() }
|
||||
val bytes = dirs.sumOf { walker.measure(it) }
|
||||
val kind = SteamStorage.kind(m)
|
||||
val (state, reason) = when (kind) {
|
||||
val (state, reason) = if (lib.x64) ToolState.REQUIRED to ToolReason.X64_CLIENT else when (kind) {
|
||||
SteamStorage.Kind.OLD_RUNTIME -> ToolState.UNUSED to ToolReason.OLD_RUNTIME
|
||||
SteamStorage.Kind.X86_PROTON -> ToolState.UNUSED to ToolReason.X86_PROTON
|
||||
SteamStorage.Kind.ARM_PROTON -> ToolState.IN_USE to (if (m.appId == SteamStorage.PROTON_ARM) ToolReason.DEFAULT_PROTON else ToolReason.PROTON)
|
||||
@@ -137,12 +159,13 @@ object StorageScan {
|
||||
else -> ToolReason.STEAM_TOOL
|
||||
}
|
||||
}
|
||||
val count = when (m.appId) {
|
||||
SteamStorage.PROTON_ARM -> gamesOn(SteamStorage.ARM_TOOL)
|
||||
SteamStorage.PROTON_11_ARM -> gamesOn(SteamStorage.ARM_11_TOOL)
|
||||
val count = when {
|
||||
lib.x64 -> 0
|
||||
m.appId == SteamStorage.PROTON_ARM -> gamesOn(SteamStorage.ARM_TOOL)
|
||||
m.appId == SteamStorage.PROTON_11_ARM -> gamesOn(SteamStorage.ARM_11_TOOL)
|
||||
else -> 0
|
||||
}
|
||||
val key = "app:${m.appId}"
|
||||
val key = if (lib.x64) "x64:app:${m.appId}" else "app:${m.appId}"
|
||||
val prior = tools[key]
|
||||
tools[key] = ToolUsage(
|
||||
key, m.name.ifEmpty { dir ?: m.appId.toString() }, bytes + (prior?.bytes ?: 0), state, reason, count,
|
||||
@@ -156,10 +179,10 @@ object StorageScan {
|
||||
val shaderDir = File(lib.data, "steamapps/shadercache/${m.appId}").takeIf { it.isDirectory }
|
||||
val shaders = shaderDir?.let { walker.measure(it) } ?: 0
|
||||
val workshop = File(lib.root, "steamapps/workshop/content/${m.appId}").takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0
|
||||
val known = art[m.appId]
|
||||
val known = art[lib.x64]?.get(m.appId)
|
||||
games.add(GameUsage(
|
||||
m.appId, known?.name ?: m.name, known?.art, lib.label, lib.internal, m.lastPlayed,
|
||||
gameBytes, prefix, shaders, workshop, shaderDir,
|
||||
gameBytes, prefix, shaders, workshop, shaderDir, lib.x64,
|
||||
))
|
||||
}
|
||||
}
|
||||
@@ -171,21 +194,22 @@ object StorageScan {
|
||||
!File(dir, "toolmanifest.vdf").isFile) return@forEach
|
||||
val name = runCatching { SteamStorage.compatToolName(File(dir, "compatibilitytool.vdf").readText()) }.getOrNull() ?: dir.name
|
||||
val count = gamesOn(name)
|
||||
val isDefault = defaultTool == name
|
||||
val isDefault = uses.any { it.isDefault(name) }
|
||||
tools["dir:${dir.name}"] = ToolUsage(
|
||||
"dir:${dir.name}", dir.name, bytes,
|
||||
when {
|
||||
mappings == null -> ToolState.REQUIRED
|
||||
!mappingsRead -> ToolState.REQUIRED
|
||||
count > 0 || isDefault -> ToolState.IN_USE
|
||||
else -> ToolState.UNUSED
|
||||
},
|
||||
if (mappings == null) ToolReason.CUSTOM_UNKNOWN else ToolReason.CUSTOM, count, isDefault, emptyList(), listOf(dir),
|
||||
if (!mappingsRead) ToolReason.CUSTOM_UNKNOWN else ToolReason.CUSTOM, count, isDefault, emptyList(), listOf(dir),
|
||||
)
|
||||
}
|
||||
|
||||
val leftovers = ArrayList<Leftover>()
|
||||
for (lib in libs) {
|
||||
if (!everyLibraryRead) break
|
||||
val everyId = clientIds[lib.x64].orEmpty()
|
||||
val prefixes = File(lib.data, "steamapps/compatdata").listFiles().orEmpty()
|
||||
.mapNotNull { f -> SteamStorage.leftoverId(f.name)?.takeIf { it !in everyId && f.isDirectory }?.let { it to f } }.toMap()
|
||||
val caches = File(lib.data, "steamapps/shadercache").listFiles().orEmpty()
|
||||
@@ -221,24 +245,26 @@ object StorageScan {
|
||||
File(lib.data, "steamapps/compatdata").listFiles().orEmpty().filter { it.isDirectory && SteamStorage.leftoverId(it.name) == null }
|
||||
}.sumOf { walker.measure(it) }
|
||||
|
||||
val apps = File(steamRoot, "steamapps")
|
||||
val clientRoots = listOfNotNull(steamRoot, x64Root)
|
||||
val apps = clientRoots.map { File(it, "steamapps") }
|
||||
val privateRoots = File(files, "steam-libraries").listFiles().orEmpty().filter { it.isDirectory }
|
||||
fun m(file: File): Long = if (file.exists()) walker.measure(file) else 0
|
||||
fun inApps(name: String): Long = apps.sumOf { m(File(it, name)) }
|
||||
val toolDirs = tools.values.flatMap { it.dirs }.distinctBy { it.path }
|
||||
val toolsInApps = toolDirs.filter { it.path.startsWith(apps.path + "/") }.sumOf { walker.known[it.path] ?: 0 }
|
||||
val toolsInApps = toolDirs.filter { d -> apps.any { d.path.startsWith(it.path + "/") } }.sumOf { walker.known[it.path] ?: 0 }
|
||||
val toolsPrivate = toolDirs.filter { d -> privateRoots.any { d.path.startsWith(it.path + "/") } }.sumOf { walker.known[it.path] ?: 0 }
|
||||
val compatTools = m(File(steamRoot, "compatibilitytools.d"))
|
||||
val installs = m(File(apps, "common")) + m(File(apps, "downloading")) + m(File(apps, "temp"))
|
||||
val compatTools = clientRoots.sumOf { m(File(it, "compatibilitytools.d")) }
|
||||
val installs = inApps("common") + inApps("downloading") + inApps("temp")
|
||||
val privatePrefixes = privateRoots.sumOf { m(File(it, "steamapps/compatdata")) }
|
||||
val privateShaders = privateRoots.sumOf { m(File(it, "steamapps/shadercache")) }
|
||||
val prefixes = m(File(apps, "compatdata")) + privatePrefixes
|
||||
val shaders = m(File(apps, "shadercache")) + privateShaders
|
||||
val workshop = m(File(apps, "workshop"))
|
||||
val prefixes = inApps("compatdata") + privatePrefixes
|
||||
val shaders = inApps("shadercache") + privateShaders
|
||||
val workshop = inApps("workshop")
|
||||
val stores = m(File(rootfs, "root/Games"))
|
||||
val flatpak = m(File(rootfs, "root/.local/share/flatpak"))
|
||||
val rootfsBytes = m(rootfs)
|
||||
val privateBytes = privateRoots.sumOf { m(it) }
|
||||
val system = rootfsBytes - installs - m(File(apps, "compatdata")) - m(File(apps, "shadercache")) - workshop -
|
||||
val system = rootfsBytes - installs - inApps("compatdata") - inApps("shadercache") - workshop -
|
||||
compatTools - stores - flatpak
|
||||
val componentBytes = m(componentsDir)
|
||||
val droiddeck = m(files) + m(context.cacheDir) - rootfsBytes - privateBytes - componentBytes +
|
||||
|
||||
@@ -134,13 +134,15 @@ object StorageState {
|
||||
}, "storage-$name").start()
|
||||
}
|
||||
|
||||
fun clearShaders(context: Context, appId: Int) = act(context, "shaders-$appId", { _, fresh ->
|
||||
val dir = fresh.games.firstOrNull { it.appId == appId }?.shaderDir ?: return@act false
|
||||
// A game can be installed in both Steam clients, and an id can be left over in several libraries.
|
||||
fun clearShaders(context: Context, appId: Int, x64: Boolean = false) = act(context, "shaders-$appId", { _, fresh ->
|
||||
val dir = fresh.games.firstOrNull { it.appId == appId && it.x64 == x64 }?.shaderDir ?: return@act false
|
||||
FileOps.delete(dir)
|
||||
})
|
||||
|
||||
fun removeLeftover(context: Context, appId: Int) = act(context, "leftover-$appId", { _, fresh ->
|
||||
val leftover = fresh.leftovers.firstOrNull { it.appId == appId } ?: return@act false
|
||||
fun removeLeftover(context: Context, l: Leftover) = act(context, "leftover-${l.appId}", { _, fresh ->
|
||||
val leftover = fresh.leftovers.firstOrNull { it.appId == l.appId && it.prefix?.path == l.prefix?.path && it.shaders?.path == l.shaders?.path }
|
||||
?: return@act false
|
||||
deleteLeftover(leftover)
|
||||
true
|
||||
})
|
||||
|
||||
@@ -58,7 +58,8 @@ object StoreInstalls {
|
||||
try {
|
||||
val games = AddedGames.scan(app)
|
||||
AddedGames.writeListing(app, games)
|
||||
LibraryCache.save(app, Library.launchableGames(app, added = games))
|
||||
val arch = SessionPrefs.activeSteamClientArch(app)
|
||||
LibraryCache.save(app, Library.launchableGames(app, added = games, arch = arch), arch == "x86_64")
|
||||
SteamLiveShortcuts.sync(app, games)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "registration: ${e.message}")
|
||||
|
||||
@@ -87,7 +87,12 @@ internal fun GamesPage(s: FrontEndState, a: FrontEndActions, selected: String, o
|
||||
}
|
||||
if (current == null || gameCount == 0) {
|
||||
Column(modifier = modifier.padding(horizontal = if (narrow) 16.dp else 22.dp, vertical = if (narrow) 12.dp else 18.dp)) {
|
||||
Rise(0) { PageHeader(stringResource(R.string.content_games)) { onAdd?.let { AddGameButton(it) } } }
|
||||
Rise(0) {
|
||||
PageHeader(stringResource(R.string.content_games)) {
|
||||
if (s.steamGamesX64) ClientTag()
|
||||
onAdd?.let { AddGameButton(it) }
|
||||
}
|
||||
}
|
||||
Rise(1) { Note(stringResource(if (s.shortcutPicker && s.shortcutLibraryScanning) R.string.game_shortcut_scanning else R.string.games_empty)) }
|
||||
if (!s.shortcutPicker) Rise(2) {
|
||||
Actions {
|
||||
@@ -102,7 +107,7 @@ internal fun GamesPage(s: FrontEndState, a: FrontEndActions, selected: String, o
|
||||
val host = rememberMenuHost()
|
||||
if (games.size == 1) {
|
||||
Column(modifier = modifier.verticalScroll(rememberScrollState()).padding(horizontal = if (narrow) 16.dp else 22.dp, vertical = if (narrow) 12.dp else 18.dp)) {
|
||||
if (onAdd != null) Rise(0) { GamesHeader(gameCount, onAdd, Modifier.padding(bottom = 10.dp)) }
|
||||
if (onAdd != null) Rise(0) { GamesHeader(gameCount, s.steamGamesX64, onAdd, Modifier.padding(bottom = 10.dp)) }
|
||||
Rise(0) {
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
GameHero(current, Modifier.weight(1f).heightIn(min = if (narrow) 190.dp else 250.dp)) {
|
||||
@@ -120,7 +125,7 @@ internal fun GamesPage(s: FrontEndState, a: FrontEndActions, selected: String, o
|
||||
}
|
||||
val pal = LocalPalette.current
|
||||
Row(modifier = modifier) {
|
||||
GameList(games, gameCount, current, onSelect = { onSelect("app:${it.appId}") }, onLaunch = launch, onAdd = onAdd,
|
||||
GameList(games, gameCount, s.steamGamesX64, current, onSelect = { onSelect("app:${it.appId}") }, onLaunch = launch, onAdd = onAdd,
|
||||
modifier = Modifier.width(if (narrow) 168.dp else 250.dp).fillMaxHeight())
|
||||
Box(Modifier.width(1.dp).fillMaxHeight().background(pal.line))
|
||||
Column(
|
||||
@@ -328,7 +333,7 @@ private fun ColumnScope.GameHeroCopy(g: Library.SteamGame, titleSize: androidx.c
|
||||
|
||||
@Composable
|
||||
private fun GameList(
|
||||
games: List<Library.SteamGame>, count: Int, current: Library.SteamGame,
|
||||
games: List<Library.SteamGame>, count: Int, x64: Boolean, current: Library.SteamGame,
|
||||
onSelect: (Library.SteamGame) -> Unit, onLaunch: (Library.SteamGame) -> Unit, onAdd: (() -> Unit)?, modifier: Modifier,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
@@ -336,7 +341,7 @@ private fun GameList(
|
||||
verticalArrangement = Arrangement.spacedBy(2.dp),
|
||||
modifier = modifier.verticalScroll(rememberScrollState()).padding(start = 12.dp, end = 10.dp, top = 16.dp, bottom = 16.dp),
|
||||
) {
|
||||
GamesHeader(count, onAdd, Modifier.padding(start = 6.dp, bottom = 10.dp))
|
||||
GamesHeader(count, x64, onAdd, Modifier.padding(start = 6.dp, bottom = 10.dp))
|
||||
val seen = remember { HashSet<Int>() }
|
||||
var settled by remember { androidx.compose.runtime.mutableStateOf(false) }
|
||||
for (g in games) key(g.appId) {
|
||||
@@ -352,15 +357,25 @@ private fun GameList(
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun GamesHeader(count: Int, onAdd: (() -> Unit)?, modifier: Modifier) {
|
||||
private fun GamesHeader(count: Int, x64: Boolean, onAdd: (() -> Unit)?, modifier: Modifier) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = modifier) {
|
||||
Text(stringResource(R.string.content_games), fontSize = 22.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1)
|
||||
Text(count.toString(), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
if (onAdd != null) AddGameButton(onAdd)
|
||||
val narrow = LocalNarrowPane.current
|
||||
Column(modifier) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Text(stringResource(R.string.content_games), fontSize = 22.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1)
|
||||
Text(count.toString(), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
if (x64 && !narrow) ClientTag()
|
||||
if (onAdd != null) AddGameButton(onAdd)
|
||||
}
|
||||
if (x64 && narrow) Box(Modifier.padding(top = 4.dp)) { ClientTag() }
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ClientTag() {
|
||||
Box(Modifier.testTag("games-client-x64")) { StateChip(stringResource(R.string.mode_client_arch_x64), ChipTone.PLAIN) }
|
||||
}
|
||||
|
||||
internal object GamesDialogState {
|
||||
var adding by androidx.compose.runtime.mutableStateOf(false)
|
||||
var summary by androidx.compose.runtime.mutableStateOf<Pair<List<com.droiddeck.launcher.frontend.AddedGames.Game>, Int>?>(null)
|
||||
|
||||
@@ -98,8 +98,10 @@ class FrontEndState(
|
||||
val frameGenLabel: String,
|
||||
val romsDir: String?,
|
||||
val logsEnabled: Boolean,
|
||||
val vacDiagnostics: Boolean = false,
|
||||
val agentCommands: Boolean = false,
|
||||
val steamGames: List<Library.SteamGame>,
|
||||
val steamGamesX64: Boolean = false,
|
||||
val emulators: List<Library.Emulator>,
|
||||
val running: String?,
|
||||
val frameGen: FrameGen.Mode = FrameGen.Mode.OFF,
|
||||
@@ -193,6 +195,7 @@ class FrontEndActions(
|
||||
val onFiles: () -> Unit,
|
||||
val onBrowseFiles: (File) -> Unit = {},
|
||||
val onLogs: () -> Unit,
|
||||
val onVacDiagnostics: () -> Unit = {},
|
||||
val onAgentCommands: () -> Unit = {},
|
||||
val onShareLogs: () -> Unit = {},
|
||||
val onClearLogs: () -> Unit = {},
|
||||
|
||||
@@ -436,6 +436,7 @@ internal fun SetupPanel(
|
||||
4 -> {
|
||||
SettingsGroup(stringResource(R.string.setup_tab_diagnostics)) {
|
||||
ToggleRow(host, "logs", stringResource(R.string.setup_logs), stringResource(R.string.setup_logs_hint), s.logsEnabled) { a.onLogs() }
|
||||
ToggleRow(host, "vacdiag", stringResource(R.string.setup_vac_diag), stringResource(R.string.setup_vac_diag_hint), s.vacDiagnostics) { a.onVacDiagnostics() }
|
||||
ToggleRow(host, "agent-commands", stringResource(R.string.setup_agent_commands), null, s.agentCommands) { a.onAgentCommands() }
|
||||
ActionRow(stringResource(R.string.setup_latest_logs), stringResource(R.string.drawer_logs_hint), stringResource(R.string.drawer_share_logs), a.onShareLogs,
|
||||
progress = com.droiddeck.launcher.session.SessionLogShare.progress)
|
||||
|
||||
@@ -80,6 +80,7 @@ class ModeSettings(
|
||||
val syncBackend: String? = null,
|
||||
val picturePosition: String? = null,
|
||||
val stretch16x9: Boolean? = null,
|
||||
val steamClientArch: String? = null,
|
||||
val steamRepairQueued: Boolean = false,
|
||||
val mangoapp: Boolean = true,
|
||||
val steamController: String? = null,
|
||||
@@ -130,6 +131,7 @@ class ModeSettingsActions(
|
||||
val onPicturePosition: (String) -> Unit = {},
|
||||
val onStretch16x9: (Boolean) -> Unit = {},
|
||||
val onSteamRepair: () -> Unit = {},
|
||||
val onSteamClientArch: (String) -> Unit = {},
|
||||
val onMangoapp: (Boolean) -> Unit = {},
|
||||
val onSteamController: (String) -> Unit = {},
|
||||
val onUnfoldedControls: (Boolean) -> Unit = {},
|
||||
@@ -148,6 +150,21 @@ class ModeSettingsActions(
|
||||
val onDismiss: () -> Unit,
|
||||
)
|
||||
|
||||
/** "2610 r3" from droiddeck-steam-x64's FEX_TAG line (fex-2610-r3), the build the x86-64 client downloads. */
|
||||
internal fun fexVersionOf(script: String): String? =
|
||||
Regex("""(?m)^FEX_TAG=fex-(\d+)-r(\d+)\s*$""").find(script)?.let { "${it.groupValues[1]} r${it.groupValues[2]}" }
|
||||
|
||||
@Composable
|
||||
private fun x64FexVersion(context: android.content.Context): String? = remember {
|
||||
runCatching {
|
||||
context.assets.open("linuxfs/usr/local/bin/droiddeck-steam-x64").bufferedReader().use { fexVersionOf(it.readText()) }
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun clientArchHint(hint: String, fex: String?): String =
|
||||
if (fex == null) hint else hint + " " + stringResource(R.string.mode_client_arch_fex, fex)
|
||||
|
||||
internal fun modeSheetTabs(steam: Boolean): List<String> =
|
||||
if (steam) listOf(SheetTab.STEAM, SheetTab.DISPLAY, SheetTab.CONTROLS, SheetTab.AUDIO, SheetTab.SESSION, SheetTab.LIBRARY)
|
||||
else listOf(SheetTab.DISPLAY, SheetTab.CONTROLS, SheetTab.SESSION)
|
||||
@@ -435,6 +452,12 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
) {
|
||||
SecondaryButton(stringResource(R.string.mode_steam_repair_button), enabled = !s.steamRepairQueued, onClick = a.onSteamRepair)
|
||||
}
|
||||
if (s.steamClientArch != null) ChoiceRow(
|
||||
host, "clientArch", stringResource(R.string.mode_client_arch),
|
||||
clientArchHint(stringResource(R.string.common_applies_next_session), x64FexVersion(LocalContext.current)),
|
||||
listOf("arm64" to stringResource(R.string.mode_client_arch_arm64), "x86_64" to stringResource(R.string.mode_client_arch_x64)), s.steamClientArch,
|
||||
onPick = a.onSteamClientArch,
|
||||
)
|
||||
}
|
||||
if (s.bootMovie != null) SettingsGroup(stringResource(R.string.boot_movie)) {
|
||||
ChoiceRow(
|
||||
|
||||
@@ -74,6 +74,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.AsyncImage
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.storage.Bucket
|
||||
import com.droiddeck.launcher.storage.CleanItem
|
||||
import com.droiddeck.launcher.storage.ComponentUsage
|
||||
@@ -469,7 +470,7 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn
|
||||
if (g.art != null) AsyncImage(model = g.art, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.size(42.dp))
|
||||
}
|
||||
Column(Modifier.weight(1.3f)) {
|
||||
Text(g.name, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
Text(gameName(g), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
Text(
|
||||
listOfNotNull(
|
||||
g.library.takeIf { !g.internal },
|
||||
@@ -499,9 +500,20 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Note(stringResource(R.string.storage_games_note))
|
||||
confirm?.let { g ->
|
||||
AlertDialog(
|
||||
// steam://uninstall reaches only the session's client, the selected one.
|
||||
val otherClient = g.x64 != (SessionPrefs.steamClientArch(LocalContext.current) == "x86_64")
|
||||
if (otherClient) AlertDialog(
|
||||
onDismissRequest = { confirm = null },
|
||||
title = { Text(stringResource(R.string.storage_uninstall_title, g.name)) },
|
||||
title = { Text(stringResource(R.string.storage_uninstall_title, gameName(g))) },
|
||||
text = { Text(stringResource(if (g.x64) R.string.storage_uninstall_in_x64 else R.string.storage_uninstall_in_arm64), fontSize = 14.sp) },
|
||||
confirmButton = {
|
||||
val ok = remember { FocusRequester() }
|
||||
LaunchedEffect(Unit) { runCatching { ok.requestFocus() } }
|
||||
FocusText(stringResource(R.string.common_ok), pal.signal, modifier = Modifier.focusRequester(ok)) { confirm = null }
|
||||
},
|
||||
) else AlertDialog(
|
||||
onDismissRequest = { confirm = null },
|
||||
title = { Text(stringResource(R.string.storage_uninstall_title, gameName(g))) },
|
||||
text = { Text(stringResource(R.string.storage_uninstall_body, gb(g.game)), fontSize = 14.sp) },
|
||||
confirmButton = { FocusText(stringResource(R.string.storage_open_steam), pal.signal) { confirm = null; a.onSteamUrl("steam://uninstall/${g.appId}") } },
|
||||
dismissButton = {
|
||||
@@ -513,6 +525,9 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun gameName(g: GameUsage): String = if (g.x64) stringResource(R.string.storage_game_x64, g.name) else g.name
|
||||
|
||||
@Composable
|
||||
private fun ToolsView(report: StorageReport, sessionRunning: Boolean, onBack: () -> Unit) {
|
||||
val ctx = LocalContext.current
|
||||
@@ -583,6 +598,7 @@ private fun toolDetail(t: ToolUsage): String = when (t.reason) {
|
||||
ToolReason.OLD_RUNTIME -> stringResource(R.string.storage_tool_old_runtime)
|
||||
ToolReason.X86_PROTON -> stringResource(R.string.storage_tool_x86_proton)
|
||||
ToolReason.CUSTOM_UNKNOWN -> stringResource(R.string.storage_tool_custom_unknown)
|
||||
ToolReason.X64_CLIENT -> stringResource(R.string.storage_tool_x64_client)
|
||||
ToolReason.CUSTOM -> when {
|
||||
t.isDefault -> stringResource(R.string.storage_tool_custom_default)
|
||||
t.games > 0 -> pluralStringResource(R.plurals.storage_tool_custom_games, t.games, t.games)
|
||||
@@ -722,8 +738,8 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack:
|
||||
if (games.isEmpty()) Text(stringResource(R.string.storage_no_games), fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(16.dp))
|
||||
games.forEachIndexed { i, g ->
|
||||
ItemRow(
|
||||
g.name, stringResource(R.string.storage_data_parts, gb(g.prefix), gb(g.shaders), gb(g.workshop)), g.data, i == games.lastIndex,
|
||||
action = { SecondaryButton(stringResource(R.string.storage_clear_shaders), compact = true, enabled = !busy && g.shaders >= ONE_MB) { StorageState.clearShaders(ctx, g.appId) } },
|
||||
gameName(g), stringResource(R.string.storage_data_parts, gb(g.prefix), gb(g.shaders), gb(g.workshop)), g.data, i == games.lastIndex,
|
||||
action = { SecondaryButton(stringResource(R.string.storage_clear_shaders), compact = true, enabled = !busy && g.shaders >= ONE_MB) { StorageState.clearShaders(ctx, g.appId, g.x64) } },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -759,7 +775,7 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack:
|
||||
ConfirmDialog(
|
||||
stringResource(R.string.storage_remove_title, stringResource(R.string.storage_steam_app, l.appId)),
|
||||
stringResource(R.string.storage_leftover_confirm, gb(l.bytes)), stringResource(R.string.storage_remove),
|
||||
onConfirm = { StorageState.removeLeftover(ctx, l.appId) }, onDismiss = { confirm = null },
|
||||
onConfirm = { StorageState.removeLeftover(ctx, l) }, onDismiss = { confirm = null },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2436,6 +2436,17 @@
|
||||
<string name="stores_sync_gog_unreachable">تعذّر الاتصال بـ GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">تعذّر قراءة مكتبتك على GOG</string>
|
||||
<string name="stores_registering">جارٍ التسجيل في Steam…</string>
|
||||
<string name="mode_client_arch">عميل Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">تشخيص VAC</string>
|
||||
<string name="setup_vac_diag_hint">تسجّل ألعاب Source وحدة التحكم الخاصة بها (-condebug)؛ ويذكر vac.txt في سجلات الجلسة إن كانت آمنة أو غير آمنة</string>
|
||||
<string name="load_starting_steam_x64">جارٍ تشغيل Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">يستخدمه عميل Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">هذه النسخة موجودة في عميل Steam x86-64. اختر x86-64 في عميل Steam، ثم ألغِ تثبيتها هنا.</string>
|
||||
<string name="storage_uninstall_in_arm64">هذه النسخة موجودة في عميل Steam ARM64. اختر ARM64 في عميل Steam، ثم ألغِ تثبيتها هنا.</string>
|
||||
<string name="drawer_page_glasses">النظارة</string>
|
||||
<string name="glasses_open">نظارة VITURE</string>
|
||||
<string name="glasses_control">التحكم في النظارة</string>
|
||||
|
||||
@@ -2384,6 +2384,17 @@
|
||||
<string name="stores_sync_gog_unreachable">No se pudo conectar con GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">No se pudo leer tu biblioteca de GOG</string>
|
||||
<string name="stores_registering">Registrando con Steam…</string>
|
||||
<string name="mode_client_arch">Cliente de Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnóstico de VAC</string>
|
||||
<string name="setup_vac_diag_hint">Los juegos Source registran su consola (-condebug); vac.txt en los registros de sesión dice si es seguro o no</string>
|
||||
<string name="load_starting_steam_x64">Iniciando Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Lo usa el cliente de Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Esta copia está en el cliente de Steam x86-64. Elige x86-64 en Cliente de Steam y desinstálala aquí.</string>
|
||||
<string name="storage_uninstall_in_arm64">Esta copia está en el cliente de Steam ARM64. Elige ARM64 en Cliente de Steam y desinstálala aquí.</string>
|
||||
<string name="drawer_page_glasses">Gafas</string>
|
||||
<string name="glasses_open">Gafas VITURE</string>
|
||||
<string name="glasses_control">Control de las gafas</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Неуспешно свързване с GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Библиотеката ви в GOG не можа да се прочете</string>
|
||||
<string name="stores_registering">Регистриране в Steam…</string>
|
||||
<string name="mode_client_arch">Клиент на Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Диагностика на VAC</string>
|
||||
<string name="setup_vac_diag_hint">Игрите на Source записват конзолата си (-condebug); vac.txt в дневниците на сесията показва дали играта е защитена от VAC</string>
|
||||
<string name="load_starting_steam_x64">Стартиране на Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Използва се от клиента на Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Това копие е в клиента на Steam x86-64. Изберете x86-64 в „Клиент на Steam“, след което го деинсталирайте тук.</string>
|
||||
<string name="storage_uninstall_in_arm64">Това копие е в клиента на Steam ARM64. Изберете ARM64 в „Клиент на Steam“, след което го деинсталирайте тук.</string>
|
||||
<string name="drawer_page_glasses">Очила</string>
|
||||
<string name="glasses_open">Очила VITURE</string>
|
||||
<string name="glasses_control">Управление на очилата</string>
|
||||
|
||||
@@ -2386,6 +2386,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Nepodařilo se spojit s GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Vaši knihovnu GOG se nepodařilo načíst</string>
|
||||
<string name="stores_registering">Registrace ve Steamu…</string>
|
||||
<string name="mode_client_arch">Klient Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostika VAC</string>
|
||||
<string name="setup_vac_diag_hint">Hry na Source zaznamenávají svou konzoli (-condebug); vac.txt v protokolech relace uvádí, zda je hra chráněna VAC</string>
|
||||
<string name="load_starting_steam_x64">Spouštění Steamu x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Používá klient Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Tato kopie je v klientovi Steam x86-64. V nastavení Klient Steam vyberte x86-64 a pak ji odinstalujte tady.</string>
|
||||
<string name="storage_uninstall_in_arm64">Tato kopie je v klientovi Steam ARM64. V nastavení Klient Steam vyberte ARM64 a pak ji odinstalujte tady.</string>
|
||||
<string name="drawer_page_glasses">Brýle</string>
|
||||
<string name="glasses_open">Brýle VITURE</string>
|
||||
<string name="glasses_control">Ovládání brýlí</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Kunne ikke oprette forbindelse til GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Dit GOG-bibliotek kunne ikke læses</string>
|
||||
<string name="stores_registering">Registrerer hos Steam…</string>
|
||||
<string name="mode_client_arch">Steam-klient</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnostik</string>
|
||||
<string name="setup_vac_diag_hint">Source-spil logger deres konsol (-condebug); vac.txt i sessionslogs viser, om det er sikret eller ej</string>
|
||||
<string name="load_starting_steam_x64">Starter Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Bruges af x86-64-Steam-klienten</string>
|
||||
<string name="storage_uninstall_in_x64">Denne kopi ligger i x86-64-Steam-klienten. Vælg x86-64 under Steam-klient, og afinstaller den så her.</string>
|
||||
<string name="storage_uninstall_in_arm64">Denne kopi ligger i ARM64-Steam-klienten. Vælg ARM64 under Steam-klient, og afinstaller den så her.</string>
|
||||
<string name="drawer_page_glasses">Brille</string>
|
||||
<string name="glasses_open">VITURE-brille</string>
|
||||
<string name="glasses_control">Brillestyring</string>
|
||||
|
||||
@@ -2322,6 +2322,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOG konnte nicht erreicht werden</string>
|
||||
<string name="stores_sync_gog_unreadable">Deine GOG-Bibliothek konnte nicht gelesen werden</string>
|
||||
<string name="stores_registering">Wird bei Steam registriert…</string>
|
||||
<string name="mode_client_arch">Steam-Client</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-Diagnose</string>
|
||||
<string name="setup_vac_diag_hint">Source-Spiele protokollieren ihre Konsole (-condebug); vac.txt in den Sitzungslogs zeigt gesichert oder ungesichert</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 wird gestartet</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Wird vom x86-64-Steam-Client verwendet</string>
|
||||
<string name="storage_uninstall_in_x64">Diese Kopie liegt im x86-64-Steam-Client. Wähle x86-64 unter Steam-Client und deinstalliere sie dann hier.</string>
|
||||
<string name="storage_uninstall_in_arm64">Diese Kopie liegt im ARM64-Steam-Client. Wähle ARM64 unter Steam-Client und deinstalliere sie dann hier.</string>
|
||||
<string name="drawer_page_glasses">Brille</string>
|
||||
<string name="glasses_open">VITURE-Brille</string>
|
||||
<string name="glasses_control">Brillensteuerung</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Δεν ήταν δυνατή η σύνδεση με το GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Δεν ήταν δυνατή η ανάγνωση της βιβλιοθήκης σας στο GOG</string>
|
||||
<string name="stores_registering">Εγγραφή στο Steam…</string>
|
||||
<string name="mode_client_arch">Πελάτης Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Διαγνωστικά VAC</string>
|
||||
<string name="setup_vac_diag_hint">Τα παιχνίδια Source καταγράφουν την κονσόλα τους (-condebug)· το vac.txt στα αρχεία καταγραφής συνεδρίας δείχνει αν είναι ασφαλές ή όχι</string>
|
||||
<string name="load_starting_steam_x64">Εκκίνηση του Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Χρησιμοποιείται από τον πελάτη Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Αυτό το αντίγραφο βρίσκεται στον πελάτη Steam x86-64. Επιλέξτε x86-64 στο «Πελάτης Steam» και, στη συνέχεια, απεγκαταστήστε το εδώ.</string>
|
||||
<string name="storage_uninstall_in_arm64">Αυτό το αντίγραφο βρίσκεται στον πελάτη Steam ARM64. Επιλέξτε ARM64 στο «Πελάτης Steam» και, στη συνέχεια, απεγκαταστήστε το εδώ.</string>
|
||||
<string name="drawer_page_glasses">Γυαλιά</string>
|
||||
<string name="glasses_open">Γυαλιά VITURE</string>
|
||||
<string name="glasses_control">Έλεγχος γυαλιών</string>
|
||||
|
||||
@@ -2497,6 +2497,17 @@
|
||||
<string name="drawer_component_downloads">Descargar componentes</string>
|
||||
<string name="drawer_component_downloads_hint">Las descargas se comparten con la página Componentes. Elige arriba una versión descargada para usarla al iniciar el próximo juego.</string>
|
||||
<string name="drawer_component_choose_download">Elige una versión para descargar</string>
|
||||
<string name="mode_client_arch">Cliente de Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnóstico de VAC</string>
|
||||
<string name="setup_vac_diag_hint">Los juegos Source registran su consola (-condebug); vac.txt en los registros dice si es seguro o no</string>
|
||||
<string name="load_starting_steam_x64">Iniciando Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Lo usa el cliente de Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Esta copia está en el cliente de Steam x86-64. Elige x86-64 en Cliente de Steam y desinstálala aquí.</string>
|
||||
<string name="storage_uninstall_in_arm64">Esta copia está en el cliente de Steam ARM64. Elige ARM64 en Cliente de Steam y desinstálala aquí.</string>
|
||||
<string name="mode_zram">Compresión zRAM</string>
|
||||
<string name="mode_zram_hint">Mientras se ejecuta un juego, la memoria del cliente de Steam se comprime en la zram del dispositivo, lo que deja más RAM para el juego. Se aplica la próxima vez que se inicie Steam.</string>
|
||||
<string name="mode_zram_unsupported">No disponible: este dispositivo no tiene swap activo, o su kernel es anterior a la 5.4.</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOG:iin ei saatu yhteyttä</string>
|
||||
<string name="stores_sync_gog_unreadable">GOG-kirjastoasi ei voitu lukea</string>
|
||||
<string name="stores_registering">Rekisteröidytään Steamiin…</string>
|
||||
<string name="mode_client_arch">Steam-asiakasohjelma</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnostiikka</string>
|
||||
<string name="setup_vac_diag_hint">Source-pelit kirjaavat konsolinsa (-condebug); istunnon lokien vac.txt kertoo, onko suojattu vai ei</string>
|
||||
<string name="load_starting_steam_x64">Käynnistetään Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">x86-64-Steam-asiakasohjelman käytössä</string>
|
||||
<string name="storage_uninstall_in_x64">Tämä kopio on x86-64-Steam-asiakasohjelmassa. Valitse x86-64 kohdassa Steam-asiakasohjelma ja poista sen asennus sitten täältä.</string>
|
||||
<string name="storage_uninstall_in_arm64">Tämä kopio on ARM64-Steam-asiakasohjelmassa. Valitse ARM64 kohdassa Steam-asiakasohjelma ja poista sen asennus sitten täältä.</string>
|
||||
<string name="drawer_page_glasses">Lasit</string>
|
||||
<string name="glasses_open">VITURE-lasit</string>
|
||||
<string name="glasses_control">Lasien hallinta</string>
|
||||
|
||||
@@ -2355,6 +2355,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Impossible de contacter GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Impossible de lire votre bibliothèque GOG</string>
|
||||
<string name="stores_registering">Enregistrement auprès de Steam…</string>
|
||||
<string name="mode_client_arch">Client Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostic VAC</string>
|
||||
<string name="setup_vac_diag_hint">Les jeux Source journalisent leur console (-condebug) ; vac.txt dans les journaux de session indique sécurisé ou non sécurisé</string>
|
||||
<string name="load_starting_steam_x64">Démarrage de Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Utilisé par le client Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Cette copie se trouve dans le client Steam x86-64. Choisissez x86-64 sous Client Steam, puis désinstallez-la ici.</string>
|
||||
<string name="storage_uninstall_in_arm64">Cette copie se trouve dans le client Steam ARM64. Choisissez ARM64 sous Client Steam, puis désinstallez-la ici.</string>
|
||||
<string name="drawer_page_glasses">Lunettes</string>
|
||||
<string name="glasses_open">Lunettes VITURE</string>
|
||||
<string name="glasses_control">Contrôle des lunettes</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOG से कनेक्ट नहीं हो सका</string>
|
||||
<string name="stores_sync_gog_unreadable">आपकी GOG लाइब्रेरी पढ़ी नहीं जा सकी</string>
|
||||
<string name="stores_registering">Steam में रजिस्टर हो रहा है…</string>
|
||||
<string name="mode_client_arch">Steam क्लाइंट</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC डायग्नोस्टिक्स</string>
|
||||
<string name="setup_vac_diag_hint">Source गेम अपना कंसोल लॉग करते हैं (-condebug); सेशन लॉग में vac.txt बताता है कि सुरक्षित है या नहीं</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 शुरू हो रहा है</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">x86-64 Steam क्लाइंट इसका उपयोग करता है</string>
|
||||
<string name="storage_uninstall_in_x64">यह कॉपी x86-64 Steam क्लाइंट में है। Steam क्लाइंट में x86-64 चुनें, फिर इसे यहाँ अनइंस्टॉल करें।</string>
|
||||
<string name="storage_uninstall_in_arm64">यह कॉपी ARM64 Steam क्लाइंट में है। Steam क्लाइंट में ARM64 चुनें, फिर इसे यहाँ अनइंस्टॉल करें।</string>
|
||||
<string name="drawer_page_glasses">चश्मा</string>
|
||||
<string name="glasses_open">VITURE चश्मा</string>
|
||||
<string name="glasses_control">चश्मे का कंट्रोल</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Nem sikerült csatlakozni a GOG-hoz</string>
|
||||
<string name="stores_sync_gog_unreadable">A GOG-könyvtáradat nem sikerült beolvasni</string>
|
||||
<string name="stores_registering">Regisztráció a Steamnél…</string>
|
||||
<string name="mode_client_arch">Steam-kliens</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnosztika</string>
|
||||
<string name="setup_vac_diag_hint">A Source-játékok naplózzák a konzoljukat (-condebug); a munkamenet-naplókban lévő vac.txt mutatja, hogy védett-e</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 indítása</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Az x86-64-es Steam-kliens használja</string>
|
||||
<string name="storage_uninstall_in_x64">Ez a példány az x86-64 Steam-kliensben van. Válassza az x86-64 lehetőséget a Steam-kliens beállításnál, majd itt távolítsa el.</string>
|
||||
<string name="storage_uninstall_in_arm64">Ez a példány az ARM64 Steam-kliensben van. Válassza az ARM64 lehetőséget a Steam-kliens beállításnál, majd itt távolítsa el.</string>
|
||||
<string name="drawer_page_glasses">Szemüveg</string>
|
||||
<string name="glasses_open">VITURE szemüveg</string>
|
||||
<string name="glasses_control">Szemüveg vezérlése</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Tidak dapat menghubungi GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Pustaka GOG kamu tidak dapat dibaca</string>
|
||||
<string name="stores_registering">Mendaftar ke Steam…</string>
|
||||
<string name="mode_client_arch">Klien Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostik VAC</string>
|
||||
<string name="setup_vac_diag_hint">Game Source mencatat konsolnya (-condebug); vac.txt di log sesi menunjukkan aman atau tidak</string>
|
||||
<string name="load_starting_steam_x64">Memulai Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Digunakan oleh klien Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Salinan ini ada di klien Steam x86-64. Pilih x86-64 di Klien Steam, lalu hapus instalasinya di sini.</string>
|
||||
<string name="storage_uninstall_in_arm64">Salinan ini ada di klien Steam ARM64. Pilih ARM64 di Klien Steam, lalu hapus instalasinya di sini.</string>
|
||||
<string name="drawer_page_glasses">Kacamata</string>
|
||||
<string name="glasses_open">Kacamata VITURE</string>
|
||||
<string name="glasses_control">Kontrol kacamata</string>
|
||||
|
||||
@@ -2347,6 +2347,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Impossibile contattare GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Impossibile leggere la tua libreria GOG</string>
|
||||
<string name="stores_registering">Registrazione su Steam…</string>
|
||||
<string name="mode_client_arch">Client Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostica VAC</string>
|
||||
<string name="setup_vac_diag_hint">I giochi Source registrano la console (-condebug); vac.txt nei log della sessione indica se è protetto o no</string>
|
||||
<string name="load_starting_steam_x64">Avvio di Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Usato dal client Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Questa copia è nel client Steam x86-64. Scegli x86-64 in Client Steam, poi disinstallala qui.</string>
|
||||
<string name="storage_uninstall_in_arm64">Questa copia è nel client Steam ARM64. Scegli ARM64 in Client Steam, poi disinstallala qui.</string>
|
||||
<string name="drawer_page_glasses">Occhiali</string>
|
||||
<string name="glasses_open">Occhiali VITURE</string>
|
||||
<string name="glasses_control">Controllo degli occhiali</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOGに接続できませんでした</string>
|
||||
<string name="stores_sync_gog_unreadable">GOGのライブラリを読み込めませんでした</string>
|
||||
<string name="stores_registering">Steamに登録中…</string>
|
||||
<string name="mode_client_arch">Steamクライアント</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC診断</string>
|
||||
<string name="setup_vac_diag_hint">Sourceゲームはコンソールを記録します(-condebug)。セッションログのvac.txtで保護の有無がわかります</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64を起動中</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">x86-64 Steamクライアントが使用</string>
|
||||
<string name="storage_uninstall_in_x64">このコピーはx86-64のSteamクライアントにあります。Steamクライアントでx86-64を選んでから、ここでアンインストールしてください。</string>
|
||||
<string name="storage_uninstall_in_arm64">このコピーはARM64のSteamクライアントにあります。SteamクライアントでARM64を選んでから、ここでアンインストールしてください。</string>
|
||||
<string name="drawer_page_glasses">グラス</string>
|
||||
<string name="glasses_open">VITURE グラス</string>
|
||||
<string name="glasses_control">グラスの制御</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOG에 연결할 수 없습니다</string>
|
||||
<string name="stores_sync_gog_unreadable">GOG 라이브러리를 읽을 수 없습니다</string>
|
||||
<string name="stores_registering">Steam에 등록 중…</string>
|
||||
<string name="mode_client_arch">Steam 클라이언트</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC 진단</string>
|
||||
<string name="setup_vac_diag_hint">Source 게임은 콘솔을 기록합니다(-condebug). 세션 로그의 vac.txt에서 보안 여부를 확인할 수 있습니다</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 시작 중</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">x86-64 Steam 클라이언트에서 사용</string>
|
||||
<string name="storage_uninstall_in_x64">이 사본은 x86-64 Steam 클라이언트에 있습니다. Steam 클라이언트에서 x86-64를 선택한 다음 여기에서 제거하세요.</string>
|
||||
<string name="storage_uninstall_in_arm64">이 사본은 ARM64 Steam 클라이언트에 있습니다. Steam 클라이언트에서 ARM64를 선택한 다음 여기에서 제거하세요.</string>
|
||||
<string name="drawer_page_glasses">안경</string>
|
||||
<string name="glasses_open">VITURE 안경</string>
|
||||
<string name="glasses_control">안경 제어</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Tidak dapat menyambung ke GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Pustaka GOG anda tidak dapat dibaca</string>
|
||||
<string name="stores_registering">Mendaftar dengan Steam…</string>
|
||||
<string name="mode_client_arch">Klien Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostik VAC</string>
|
||||
<string name="setup_vac_diag_hint">Permainan Source merekodkan konsolnya (-condebug); vac.txt dalam log sesi menunjukkan selamat atau tidak</string>
|
||||
<string name="load_starting_steam_x64">Memulakan Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Digunakan oleh klien Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Salinan ini berada dalam klien Steam x86-64. Pilih x86-64 di bawah Klien Steam, kemudian nyahpasangnya di sini.</string>
|
||||
<string name="storage_uninstall_in_arm64">Salinan ini berada dalam klien Steam ARM64. Pilih ARM64 di bawah Klien Steam, kemudian nyahpasangnya di sini.</string>
|
||||
<string name="drawer_page_glasses">Cermin mata</string>
|
||||
<string name="glasses_open">Cermin mata VITURE</string>
|
||||
<string name="glasses_control">Kawalan cermin mata</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Kunne ikke nå GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Kunne ikke lese GOG-biblioteket ditt</string>
|
||||
<string name="stores_registering">Registrerer hos Steam…</string>
|
||||
<string name="mode_client_arch">Steam-klient</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnostikk</string>
|
||||
<string name="setup_vac_diag_hint">Source-spill logger konsollen sin (-condebug); vac.txt i sesjonsloggene viser om det er sikret eller ikke</string>
|
||||
<string name="load_starting_steam_x64">Starter Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Brukes av x86-64-Steam-klienten</string>
|
||||
<string name="storage_uninstall_in_x64">Denne kopien ligger i x86-64-Steam-klienten. Velg x86-64 under Steam-klient, og avinstaller den så her.</string>
|
||||
<string name="storage_uninstall_in_arm64">Denne kopien ligger i ARM64-Steam-klienten. Velg ARM64 under Steam-klient, og avinstaller den så her.</string>
|
||||
<string name="drawer_page_glasses">Briller</string>
|
||||
<string name="glasses_open">VITURE-briller</string>
|
||||
<string name="glasses_control">Brillestyring</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Kan GOG niet bereiken</string>
|
||||
<string name="stores_sync_gog_unreadable">Je GOG-bibliotheek kon niet worden gelezen</string>
|
||||
<string name="stores_registering">Registreren bij Steam…</string>
|
||||
<string name="mode_client_arch">Steam-client</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnose</string>
|
||||
<string name="setup_vac_diag_hint">Source-games leggen hun console vast (-condebug); vac.txt in de sessielogs vermeldt beveiligd of onbeveiligd</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 wordt gestart</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Gebruikt door de x86-64-Steam-client</string>
|
||||
<string name="storage_uninstall_in_x64">Deze kopie staat in de x86-64-Steam-client. Kies x86-64 bij Steam-client en verwijder hem daarna hier.</string>
|
||||
<string name="storage_uninstall_in_arm64">Deze kopie staat in de ARM64-Steam-client. Kies ARM64 bij Steam-client en verwijder hem daarna hier.</string>
|
||||
<string name="drawer_page_glasses">Bril</string>
|
||||
<string name="glasses_open">VITURE-bril</string>
|
||||
<string name="glasses_control">Brilbediening</string>
|
||||
|
||||
@@ -2386,6 +2386,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Nie udało się połączyć z GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Nie udało się wczytać Twojej biblioteki GOG</string>
|
||||
<string name="stores_registering">Rejestrowanie w Steam…</string>
|
||||
<string name="mode_client_arch">Klient Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnostyka VAC</string>
|
||||
<string name="setup_vac_diag_hint">Gry na Source zapisują swoją konsolę (-condebug); vac.txt w logach sesji pokazuje, czy gra jest chroniona przez VAC</string>
|
||||
<string name="load_starting_steam_x64">Uruchamianie Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Używane przez klienta Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Ta kopia jest w kliencie Steam x86-64. Wybierz x86-64 w ustawieniu Klient Steam, a potem odinstaluj ją tutaj.</string>
|
||||
<string name="storage_uninstall_in_arm64">Ta kopia jest w kliencie Steam ARM64. Wybierz ARM64 w ustawieniu Klient Steam, a potem odinstaluj ją tutaj.</string>
|
||||
<string name="drawer_page_glasses">Okulary</string>
|
||||
<string name="glasses_open">Okulary VITURE</string>
|
||||
<string name="glasses_control">Sterowanie okularami</string>
|
||||
|
||||
@@ -2347,6 +2347,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Não foi possível contactar a GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Não foi possível ler a tua biblioteca da GOG</string>
|
||||
<string name="stores_registering">A registar na Steam…</string>
|
||||
<string name="mode_client_arch">Cliente Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnóstico do VAC</string>
|
||||
<string name="setup_vac_diag_hint">Os jogos Source registam a consola (-condebug); o vac.txt nos registos da sessão indica se está seguro ou não</string>
|
||||
<string name="load_starting_steam_x64">A iniciar o Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Usado pelo cliente Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Esta cópia está no cliente Steam x86-64. Escolha x86-64 em Cliente Steam e depois desinstale-a aqui.</string>
|
||||
<string name="storage_uninstall_in_arm64">Esta cópia está no cliente Steam ARM64. Escolha ARM64 em Cliente Steam e depois desinstale-a aqui.</string>
|
||||
<string name="drawer_page_glasses">Óculos</string>
|
||||
<string name="glasses_open">Óculos VITURE</string>
|
||||
<string name="glasses_control">Controlo dos óculos</string>
|
||||
|
||||
@@ -2347,6 +2347,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Não foi possível conectar à GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Não foi possível ler sua biblioteca da GOG</string>
|
||||
<string name="stores_registering">Registrando na Steam…</string>
|
||||
<string name="mode_client_arch">Cliente Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnóstico do VAC</string>
|
||||
<string name="setup_vac_diag_hint">Jogos Source registram o console (-condebug); o vac.txt nos logs da sessão informa se está seguro ou não</string>
|
||||
<string name="load_starting_steam_x64">Iniciando o Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Usado pelo cliente Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Esta cópia está no cliente Steam x86-64. Escolha x86-64 em Cliente Steam e depois desinstale-a aqui.</string>
|
||||
<string name="storage_uninstall_in_arm64">Esta cópia está no cliente Steam ARM64. Escolha ARM64 em Cliente Steam e depois desinstale-a aqui.</string>
|
||||
<string name="drawer_page_glasses">Óculos</string>
|
||||
<string name="glasses_open">Óculos VITURE</string>
|
||||
<string name="glasses_control">Controle dos óculos</string>
|
||||
|
||||
@@ -2361,6 +2361,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Nu s-a putut contacta GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Biblioteca ta GOG nu a putut fi citită</string>
|
||||
<string name="stores_registering">Se înregistrează la Steam…</string>
|
||||
<string name="mode_client_arch">Client Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Diagnosticare VAC</string>
|
||||
<string name="setup_vac_diag_hint">Jocurile Source își înregistrează consola (-condebug); vac.txt din jurnalele sesiunii arată dacă e securizat sau nu</string>
|
||||
<string name="load_starting_steam_x64">Se pornește Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Folosit de clientul Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Această copie este în clientul Steam x86-64. Alege x86-64 la Client Steam, apoi dezinstaleaz-o aici.</string>
|
||||
<string name="storage_uninstall_in_arm64">Această copie este în clientul Steam ARM64. Alege ARM64 la Client Steam, apoi dezinstaleaz-o aici.</string>
|
||||
<string name="drawer_page_glasses">Ochelari</string>
|
||||
<string name="glasses_open">Ochelari VITURE</string>
|
||||
<string name="glasses_control">Controlul ochelarilor</string>
|
||||
|
||||
@@ -2380,6 +2380,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Не удалось связаться с GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Не удалось прочитать вашу библиотеку GOG</string>
|
||||
<string name="stores_registering">Регистрация в Steam…</string>
|
||||
<string name="mode_client_arch">Клиент Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Диагностика VAC</string>
|
||||
<string name="setup_vac_diag_hint">Игры на Source записывают консоль (-condebug); vac.txt в журналах сессии показывает, защищена ли игра VAC</string>
|
||||
<string name="load_starting_steam_x64">Запуск Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Используется клиентом Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Эта копия находится в клиенте Steam x86-64. Выберите x86-64 в пункте «Клиент Steam», затем удалите её здесь.</string>
|
||||
<string name="storage_uninstall_in_arm64">Эта копия находится в клиенте Steam ARM64. Выберите ARM64 в пункте «Клиент Steam», затем удалите её здесь.</string>
|
||||
<string name="drawer_page_glasses">Очки</string>
|
||||
<string name="glasses_open">Очки VITURE</string>
|
||||
<string name="glasses_control">Управление очками</string>
|
||||
|
||||
@@ -2336,6 +2336,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Det gick inte att nå GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Det gick inte att läsa ditt GOG-bibliotek</string>
|
||||
<string name="stores_registering">Registrerar hos Steam…</string>
|
||||
<string name="mode_client_arch">Steam-klient</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC-diagnostik</string>
|
||||
<string name="setup_vac_diag_hint">Source-spel loggar sin konsol (-condebug); vac.txt i sessionsloggarna visar om det är säkrat eller inte</string>
|
||||
<string name="load_starting_steam_x64">Startar Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Används av x86-64-Steam-klienten</string>
|
||||
<string name="storage_uninstall_in_x64">Den här kopian finns i x86-64-Steam-klienten. Välj x86-64 under Steam-klient och avinstallera den sedan här.</string>
|
||||
<string name="storage_uninstall_in_arm64">Den här kopian finns i ARM64-Steam-klienten. Välj ARM64 under Steam-klient och avinstallera den sedan här.</string>
|
||||
<string name="drawer_page_glasses">Glasögon</string>
|
||||
<string name="glasses_open">VITURE-glasögon</string>
|
||||
<string name="glasses_control">Glasögonstyrning</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">เชื่อมต่อกับ GOG ไม่ได้</string>
|
||||
<string name="stores_sync_gog_unreadable">ไม่สามารถอ่านคลังเกม GOG ของคุณได้</string>
|
||||
<string name="stores_registering">กำลังลงทะเบียนกับ Steam…</string>
|
||||
<string name="mode_client_arch">ไคลเอนต์ Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">การวินิจฉัย VAC</string>
|
||||
<string name="setup_vac_diag_hint">เกม Source บันทึกคอนโซลของเกม (-condebug); vac.txt ในล็อกเซสชันบอกว่าปลอดภัยหรือไม่</string>
|
||||
<string name="load_starting_steam_x64">กำลังเริ่ม Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">ใช้โดยไคลเอนต์ Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">สำเนานี้อยู่ในไคลเอนต์ Steam x86-64 เลือก x86-64 ในไคลเอนต์ Steam แล้วถอนการติดตั้งที่นี่</string>
|
||||
<string name="storage_uninstall_in_arm64">สำเนานี้อยู่ในไคลเอนต์ Steam ARM64 เลือก ARM64 ในไคลเอนต์ Steam แล้วถอนการติดตั้งที่นี่</string>
|
||||
<string name="drawer_page_glasses">แว่นตา</string>
|
||||
<string name="glasses_open">แว่นตา VITURE</string>
|
||||
<string name="glasses_control">การควบคุมแว่นตา</string>
|
||||
|
||||
@@ -2322,6 +2322,17 @@
|
||||
<string name="stores_sync_gog_unreachable">GOG\'a bağlanılamadı</string>
|
||||
<string name="stores_sync_gog_unreadable">GOG kitaplığın okunamadı</string>
|
||||
<string name="stores_registering">Steam\'e kaydediliyor…</string>
|
||||
<string name="mode_client_arch">Steam istemcisi</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC tanılaması</string>
|
||||
<string name="setup_vac_diag_hint">Source oyunları konsollarını kaydeder (-condebug); oturum günlüklerindeki vac.txt güvenli olup olmadığını gösterir</string>
|
||||
<string name="load_starting_steam_x64">Steam x86-64 başlatılıyor</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">x86-64 Steam istemcisi tarafından kullanılıyor</string>
|
||||
<string name="storage_uninstall_in_x64">Bu kopya x86-64 Steam istemcisinde. Steam istemcisi altında x86-64 seçin, ardından burada kaldırın.</string>
|
||||
<string name="storage_uninstall_in_arm64">Bu kopya ARM64 Steam istemcisinde. Steam istemcisi altında ARM64 seçin, ardından burada kaldırın.</string>
|
||||
<string name="drawer_page_glasses">Gözlük</string>
|
||||
<string name="glasses_open">VITURE gözlüğü</string>
|
||||
<string name="glasses_control">Gözlük kontrolü</string>
|
||||
|
||||
@@ -2386,6 +2386,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Не вдалося з\'єднатися з GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Не вдалося прочитати вашу бібліотеку GOG</string>
|
||||
<string name="stores_registering">Реєстрація в Steam…</string>
|
||||
<string name="mode_client_arch">Клієнт Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Діагностика VAC</string>
|
||||
<string name="setup_vac_diag_hint">Ігри на Source записують свою консоль (-condebug); vac.txt у журналах сеансу показує, чи захищена гра VAC</string>
|
||||
<string name="load_starting_steam_x64">Запуск Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Використовується клієнтом Steam x86-64</string>
|
||||
<string name="storage_uninstall_in_x64">Ця копія в клієнті Steam x86-64. Виберіть x86-64 у пункті «Клієнт Steam», потім видаліть її тут.</string>
|
||||
<string name="storage_uninstall_in_arm64">Ця копія в клієнті Steam ARM64. Виберіть ARM64 у пункті «Клієнт Steam», потім видаліть її тут.</string>
|
||||
<string name="drawer_page_glasses">Окуляри</string>
|
||||
<string name="glasses_open">Окуляри VITURE</string>
|
||||
<string name="glasses_control">Керування окулярами</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Không thể kết nối với GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Không thể đọc thư viện GOG của bạn</string>
|
||||
<string name="stores_registering">Đang đăng ký với Steam…</string>
|
||||
<string name="mode_client_arch">Client Steam</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">Chẩn đoán VAC</string>
|
||||
<string name="setup_vac_diag_hint">Game Source ghi lại console (-condebug); vac.txt trong log phiên cho biết có an toàn hay không</string>
|
||||
<string name="load_starting_steam_x64">Đang khởi động Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Được client Steam x86-64 sử dụng</string>
|
||||
<string name="storage_uninstall_in_x64">Bản này nằm trong client Steam x86-64. Chọn x86-64 trong Client Steam, rồi gỡ cài đặt tại đây.</string>
|
||||
<string name="storage_uninstall_in_arm64">Bản này nằm trong client Steam ARM64. Chọn ARM64 trong Client Steam, rồi gỡ cài đặt tại đây.</string>
|
||||
<string name="drawer_page_glasses">Kính</string>
|
||||
<string name="glasses_open">Kính VITURE</string>
|
||||
<string name="glasses_control">Điều khiển kính</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">无法连接到 GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">无法读取你的 GOG 游戏库</string>
|
||||
<string name="stores_registering">正在向 Steam 注册…</string>
|
||||
<string name="mode_client_arch">Steam 客户端</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC 诊断</string>
|
||||
<string name="setup_vac_diag_hint">Source 游戏会记录控制台(-condebug);会话日志中的 vac.txt 会显示是否安全</string>
|
||||
<string name="load_starting_steam_x64">正在启动 Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">由 x86-64 Steam 客户端使用</string>
|
||||
<string name="storage_uninstall_in_x64">此副本位于 x86-64 Steam 客户端中。请在“Steam 客户端”中选择 x86-64,然后在此处卸载。</string>
|
||||
<string name="storage_uninstall_in_arm64">此副本位于 ARM64 Steam 客户端中。请在“Steam 客户端”中选择 ARM64,然后在此处卸载。</string>
|
||||
<string name="drawer_page_glasses">眼镜</string>
|
||||
<string name="glasses_open">VITURE 眼镜</string>
|
||||
<string name="glasses_control">眼镜控制</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">無法連線至 GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">無法讀取你的 GOG 遊戲庫</string>
|
||||
<string name="stores_registering">正在向 Steam 註冊…</string>
|
||||
<string name="mode_client_arch">Steam 用戶端</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC 診斷</string>
|
||||
<string name="setup_vac_diag_hint">Source 遊戲會記錄主控台(-condebug);會話記錄中的 vac.txt 會顯示是否安全</string>
|
||||
<string name="load_starting_steam_x64">正在啟動 Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">由 x86-64 Steam 用戶端使用</string>
|
||||
<string name="storage_uninstall_in_x64">此副本位於 x86-64 Steam 用戶端中。請在「Steam 用戶端」中選擇 x86-64,然後在此解除安裝。</string>
|
||||
<string name="storage_uninstall_in_arm64">此副本位於 ARM64 Steam 用戶端中。請在「Steam 用戶端」中選擇 ARM64,然後在此解除安裝。</string>
|
||||
<string name="drawer_page_glasses">眼鏡</string>
|
||||
<string name="glasses_open">VITURE 眼鏡</string>
|
||||
<string name="glasses_control">眼鏡控制</string>
|
||||
|
||||
@@ -2311,6 +2311,17 @@
|
||||
<string name="stores_sync_gog_unreachable">無法連線到 GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">無法讀取你的 GOG 遊戲庫</string>
|
||||
<string name="stores_registering">正在向 Steam 註冊…</string>
|
||||
<string name="mode_client_arch">Steam 用戶端</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC 診斷</string>
|
||||
<string name="setup_vac_diag_hint">Source 遊戲會記錄主控台(-condebug);工作階段日誌中的 vac.txt 會顯示是否安全</string>
|
||||
<string name="load_starting_steam_x64">正在啟動 Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">由 x86-64 Steam 用戶端使用</string>
|
||||
<string name="storage_uninstall_in_x64">此副本位於 x86-64 Steam 用戶端中。請在「Steam 用戶端」中選擇 x86-64,然後在此解除安裝。</string>
|
||||
<string name="storage_uninstall_in_arm64">此副本位於 ARM64 Steam 用戶端中。請在「Steam 用戶端」中選擇 ARM64,然後在此解除安裝。</string>
|
||||
<string name="drawer_page_glasses">眼鏡</string>
|
||||
<string name="glasses_open">VITURE 眼鏡</string>
|
||||
<string name="glasses_control">眼鏡控制</string>
|
||||
|
||||
@@ -2386,6 +2386,17 @@
|
||||
<string name="stores_sync_gog_unreachable">Couldn\'t reach GOG</string>
|
||||
<string name="stores_sync_gog_unreadable">Could not read your GOG library</string>
|
||||
<string name="stores_registering">Registering with Steam…</string>
|
||||
<string name="mode_client_arch">Steam client</string>
|
||||
<string name="mode_client_arch_fex">FEX %1$s</string>
|
||||
<string name="mode_client_arch_arm64">ARM64</string>
|
||||
<string name="mode_client_arch_x64">x86-64</string>
|
||||
<string name="setup_vac_diag">VAC diagnostics</string>
|
||||
<string name="setup_vac_diag_hint">Source games log their console (-condebug); vac.txt in the session logs says secure or insecure</string>
|
||||
<string name="load_starting_steam_x64">Starting Steam x86-64</string>
|
||||
<string name="storage_game_x64">%1$s · x86-64</string>
|
||||
<string name="storage_tool_x64_client">Used by the x86-64 Steam client</string>
|
||||
<string name="storage_uninstall_in_x64">This copy is in the x86-64 Steam client. Choose x86-64 under Steam client, then uninstall it here.</string>
|
||||
<string name="storage_uninstall_in_arm64">This copy is in the ARM64 Steam client. Choose ARM64 under Steam client, then uninstall it here.</string>
|
||||
<string name="drawer_page_glasses">Glasses</string>
|
||||
<string name="glasses_open">VITURE glasses</string>
|
||||
<string name="glasses_control">Glasses control</string>
|
||||
|
||||
@@ -147,4 +147,23 @@ class LogRedactorTest {
|
||||
val once = LogRedactor.redactForShare("resolver: 192.168.0.1")
|
||||
assertEquals(once, LogRedactor.redactForShare(once))
|
||||
}
|
||||
|
||||
@Test fun learnedAccountsComeFromBothClients() {
|
||||
val root = java.nio.file.Files.createTempDirectory("redactor").toFile()
|
||||
try {
|
||||
val arm = java.io.File(root, "root/.local/share/Steam/config/loginusers.vdf")
|
||||
arm.parentFile.mkdirs()
|
||||
arm.writeText("\"users\" { \"7656\" { \"AccountName\" \"armplayer\" \"PersonaName\" \"Arm Persona\" } }")
|
||||
LogRedactor.learnFromRuntime(root)
|
||||
assertEquals("hi <redacted:account> and <redacted:account>", LogRedactor.redact("hi armplayer and Arm Persona"))
|
||||
val x64 = java.io.File(root, "root/.droiddeck-x64/.local/share/Steam/config/loginusers.vdf")
|
||||
x64.parentFile.mkdirs()
|
||||
x64.writeText("\"users\" { \"7656\" { \"AccountName\" \"x64player\" } }")
|
||||
LogRedactor.learnFromRuntime(root)
|
||||
assertEquals("<redacted:account> <redacted:account>", LogRedactor.redact("armplayer x64player"))
|
||||
} finally {
|
||||
LogRedactor.learnAccounts()
|
||||
root.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,30 @@ class AddedGamesScanTest {
|
||||
assertEquals(listOf("Example"), AddedGames.scan(app).map { it.name })
|
||||
}
|
||||
|
||||
private fun cardWithX8664Library(): File {
|
||||
val card = tmp.newFolder("Card")
|
||||
File(card, "Example").mkdirs()
|
||||
File(card, "Example/Example.exe").writeText("game")
|
||||
File(card, "x86-64/steamapps/common/FlatOut").mkdirs()
|
||||
File(card, "x86-64/steamapps/common/FlatOut/FlatOut.exe").writeText("steam game")
|
||||
return card
|
||||
}
|
||||
|
||||
@Test fun theX8664ClientsCardLibraryIsNotAGame() {
|
||||
val card = cardWithX8664Library()
|
||||
SessionPrefs.setGameStorage(app, card.path, "Card")
|
||||
assertEquals(listOf("Example"), AddedGames.scan(app).map { it.name })
|
||||
assertTrue(AddedGames.isSteamLibraryFolder("x86-64"))
|
||||
assertFalse(AddedGames.isSteamLibraryFolder("x86-64 games"))
|
||||
}
|
||||
|
||||
@Test fun anOldGamesFolderHoldingTheX8664LibraryDoesNotMigrateItAsAGame() {
|
||||
val card = cardWithX8664Library()
|
||||
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
|
||||
SessionPrefs.setAddedGamesDirs(app, listOf(card.path))
|
||||
assertEquals(listOf("Example"), AddedGames.scan(app).map { it.name })
|
||||
}
|
||||
|
||||
@Test fun aStorePackageLaunchesTheExecutableItDeclares() {
|
||||
val game = tmp.newFolder("Minecraft Dungeons")
|
||||
File(game, "Dungeons.exe").writeText("unreal bootstrap")
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import org.junit.Assert.assertEquals
|
||||
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 LibraryArchTest {
|
||||
private val app get() = RuntimeEnvironment.getApplication()
|
||||
|
||||
@Test fun aScanReadsTheClientItWasGivenNotTheSelectedOne() {
|
||||
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
|
||||
SessionPrefs.setSteamClientArch(app, "arm64")
|
||||
val apps = File(SessionPrefs.steamRoot(app, "x86_64"), "steamapps").apply { mkdirs() }
|
||||
File(apps, "appmanifest_440.acf").writeText("\"AppState\"\n{\n\t\"appid\"\t\t\"440\"\n\t\"name\"\t\t\"Team Fortress 2\"\n\t\"StateFlags\"\t\t\"4\"\n}\n")
|
||||
assertEquals(listOf("Team Fortress 2"), Library.launchableGames(app, added = emptyList(), arch = "x86_64").map { it.name })
|
||||
assertEquals(emptyList<String>(), Library.launchableGames(app, added = emptyList(), arch = "arm64").map { it.name })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
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 LibraryCacheClientTest {
|
||||
private val app get() = RuntimeEnvironment.getApplication()
|
||||
private val games = listOf(Library.SteamGame(440, "Team Fortress 2", null, "Steam library"))
|
||||
|
||||
@Test fun aCacheFromBeforeTheClientWasRecordedIsArm64s() {
|
||||
java.io.File(app.filesDir, "library-cache.json").writeText("""[{"appId":440,"name":"Team Fortress 2","library":"Steam library","gameId":440}]""")
|
||||
val (games, x64) = LibraryCache.snapshot(app)
|
||||
assertEquals(listOf("Team Fortress 2"), games.map { it.name })
|
||||
assertFalse(x64)
|
||||
}
|
||||
|
||||
@Test fun theListAndItsClientAreOneFile() {
|
||||
LibraryCache.save(app, games, x64 = true)
|
||||
assertEquals(listOf("library-cache.json"), app.filesDir.list().orEmpty().filter { it.startsWith("library-cache") })
|
||||
assertEquals(listOf("Team Fortress 2") to true, LibraryCache.snapshot(app).let { (g, x) -> g.map { it.name } to x })
|
||||
}
|
||||
|
||||
@Test fun theListsClientIsKeptUntilAListForAnotherIsSaved() {
|
||||
LibraryCache.save(app, games, x64 = true)
|
||||
assertTrue(LibraryCache.listedX64(app))
|
||||
LibraryCache.save(app, emptyList())
|
||||
assertTrue(LibraryCache.listedX64(app))
|
||||
LibraryCache.save(app, games, x64 = false)
|
||||
assertFalse(LibraryCache.listedX64(app))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class LibraryFromSteamClientTest {
|
||||
@Test fun onlyTheClientsOwnInstallsAreDroppedOnASwitch() {
|
||||
val games = listOf(
|
||||
Library.SteamGame(440, "Team Fortress 2", null, "Steam library"),
|
||||
Library.SteamGame(1, "God of War", null, Library.ADDED, gameId = 9_000_000_001L),
|
||||
Library.SteamGame(2, "Store game", null, "Games", gameId = 9_000_000_002L, source = "gog"),
|
||||
)
|
||||
assertEquals(listOf("God of War", "Store game"), games.filterNot(Library::fromSteamClient).map { it.name })
|
||||
}
|
||||
}
|
||||
@@ -129,6 +129,23 @@ class SteamGridTest {
|
||||
assertNull(SteamGameArt.chosenFile(app, 620, AddedGameArt.Slot.BACKGROUND))
|
||||
}
|
||||
|
||||
@Test fun theOtherClientsEmptyGridGetsTheChoiceInsteadOfDroppingIt() {
|
||||
File(LinuxRuntime.rootDir(app), "root/.local/share/Steam/userdata/123/config").mkdirs()
|
||||
val picked = image("mine.png", 12)
|
||||
SteamGameArt.choose(app, game(), AddedGameArt.Slot.COVER, AddedGameArt.Option(AddedGameArt.FILE, picked.path, picked.path))
|
||||
assertFalse(SteamGrid.sync(app, listOf(target())))
|
||||
|
||||
val x64 = File(SessionPrefs.steamRoot(app, "x86_64"), "userdata/123/config").apply { mkdirs() }
|
||||
SessionPrefs.setSteamClientArch(app, "x86_64")
|
||||
assertFalse(SteamGrid.sync(app, listOf(target())))
|
||||
assertEquals(12L, SteamGameArt.chosenFile(app, 620, AddedGameArt.Slot.COVER)?.length())
|
||||
assertEquals(12L, File(x64, "grid/620p.png").length())
|
||||
|
||||
SessionPrefs.setSteamClientArch(app, "arm64")
|
||||
assertFalse(SteamGrid.sync(app, listOf(target())))
|
||||
assertEquals(12L, File(grid, "620p.png").length())
|
||||
}
|
||||
|
||||
@Test fun aChoiceMadeHereIsNotTakenBackAsASteamChange() {
|
||||
File(LinuxRuntime.rootDir(app), "root/.local/share/Steam/userdata/123/config").mkdirs()
|
||||
val picked = image("mine.png", 12)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,23 @@ class SteamStorageTest {
|
||||
assertEquals("GE-Proton11-9-aarch64", SteamStorage.compatToolName(vdf))
|
||||
}
|
||||
|
||||
@Test fun countsToolUseInBothClients() {
|
||||
assertEquals("GE-Proton11-9-a64", SteamStorage.x64ToolName("GE-Proton11-9-aarch64"))
|
||||
assertEquals("droiddeck-proton-a64", SteamStorage.x64ToolName("droiddeck-proton-arm64"))
|
||||
assertEquals("GE-Proton10-1", SteamStorage.x64ToolName("GE-Proton10-1"))
|
||||
val arm = SteamStorage.ToolUse(mapOf("0" to "droiddeck-proton-arm64", "10" to "GE-Proton11-9-aarch64", "20" to "GE-Proton11-9-aarch64"), setOf("10"))
|
||||
val x64 = SteamStorage.ToolUse(
|
||||
mapOf("0" to "GE-Proton11-9-a64", "30" to "GE-Proton11-9-a64", "40" to "droiddeck-direct", "50" to "GE-Proton11-9-aarch64"),
|
||||
setOf("30", "40", "50"), x64 = true,
|
||||
)
|
||||
assertEquals(1, arm.games("GE-Proton11-9-aarch64"))
|
||||
assertEquals(1, x64.games("GE-Proton11-9-aarch64"))
|
||||
assertFalse(arm.isDefault("GE-Proton11-9-aarch64"))
|
||||
assertTrue(x64.isDefault("GE-Proton11-9-aarch64"))
|
||||
assertTrue(arm.isDefault("droiddeck-proton-arm64"))
|
||||
assertFalse(x64.isDefault("droiddeck-proton-arm64"))
|
||||
}
|
||||
|
||||
@Test fun listingCountsPendingDownloadsAndUnreadableManifests() {
|
||||
val library = tmp.newFolder("lib")
|
||||
val apps = File(library, "steamapps").apply { mkdirs() }
|
||||
@@ -117,6 +134,19 @@ class SteamStorageTest {
|
||||
assertNull(SteamStorage.manifests(File(library, "missing")))
|
||||
}
|
||||
|
||||
@Test fun anEmptyX64FolderIsNoClient() {
|
||||
val root = tmp.newFolder("x64")
|
||||
File(root, ".cef-enable-remote-debugging").createNewFile()
|
||||
assertFalse(SteamStorage.x64ClientPresent(root))
|
||||
assertFalse(SteamStorage.x64ClientPresent(File(root, "missing")))
|
||||
File(root, "package").mkdirs()
|
||||
File(root, "package/droiddeck-installed").writeText("1\n")
|
||||
assertTrue(SteamStorage.x64ClientPresent(root))
|
||||
val bare = tmp.newFolder("x64-steamapps")
|
||||
File(bare, "steamapps").mkdirs()
|
||||
assertTrue(SteamStorage.x64ClientPresent(bare))
|
||||
}
|
||||
|
||||
@Test fun leftoverIdsSkipTheSharedPrefixAndShortcuts() {
|
||||
assertNull(SteamStorage.leftoverId("0"))
|
||||
assertNull(SteamStorage.leftoverId("3207321049"))
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.droiddeck.launcher.storage
|
||||
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
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 StorageScanTest {
|
||||
private val app get() = RuntimeEnvironment.getApplication()
|
||||
|
||||
@Test fun eachClientsLeftoversAreCheckedAgainstItsOwnGames() {
|
||||
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
|
||||
val arm = SessionPrefs.steamRoot(app, "arm64")
|
||||
val x64 = SessionPrefs.steamRoot(app, "x86_64")
|
||||
File(arm, "steamapps/compatdata/10").mkdirs()
|
||||
File(arm, "steamapps/appmanifest_10.acf").writeText("\"appid\" \"10\"\n\"StateFlags\" \"4\"\n\"installdir\" \"Example\"\n")
|
||||
val removed = File(x64, "steamapps/compatdata/10").apply { mkdirs() }
|
||||
File(removed, "user.reg").writeText("x")
|
||||
|
||||
val report = StorageScan.scan(app)
|
||||
assertTrue(report.leftoversChecked)
|
||||
assertEquals(listOf(removed.path), report.leftovers.map { it.prefix?.path })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class FexVersionTest {
|
||||
@Test fun readsTheTagTheLauncherPins() {
|
||||
assertEquals("2610 r3", fexVersionOf("#!/bin/bash\nset -eu\nFEX_TAG=fex-2610-r3\nFEX_SHA256=abc\n"))
|
||||
}
|
||||
|
||||
@Test fun nothingWithoutAPinnedTag() {
|
||||
assertNull(fexVersionOf("FEX_TAG=\$1\n"))
|
||||
assertNull(fexVersionOf("# FEX_TAG=fex-2610-r3\n"))
|
||||
}
|
||||
|
||||
@Test fun theShippedLauncherHasOne() {
|
||||
val script = java.io.File("../tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64").takeIf { it.isFile }
|
||||
?: java.io.File("tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64")
|
||||
assertEquals(true, fexVersionOf(script.readText()) != null)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.test.assertCountEquals
|
||||
import androidx.compose.ui.test.onAllNodesWithTag
|
||||
import com.droiddeck.launcher.frontend.Library
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34], qualifiers = "w1200dp-h752dp-land", application = android.app.Application::class)
|
||||
class GamesClientTagTest {
|
||||
@get:Rule val compose = createRobolectricComposeRule()
|
||||
|
||||
private val two = listOf(
|
||||
Library.SteamGame(440, "Team Fortress 2", null, "Steam library"),
|
||||
Library.SteamGame(70, "Half-Life", null, "Steam library"),
|
||||
)
|
||||
|
||||
@Test fun theArm64ClientsListHasNoTag() {
|
||||
show(two, x64 = false)
|
||||
compose.onAllNodesWithTag("games-client-x64").assertCountEquals(0)
|
||||
}
|
||||
|
||||
@Test fun theX8664ClientsListIsTagged() {
|
||||
show(two, x64 = true)
|
||||
compose.onAllNodesWithTag("games-client-x64").assertCountEquals(1)
|
||||
}
|
||||
|
||||
@Test fun anEmptyX8664LibraryIsTaggedToo() {
|
||||
show(emptyList(), x64 = true)
|
||||
compose.onAllNodesWithTag("games-client-x64").assertCountEquals(1)
|
||||
}
|
||||
|
||||
@Test fun aNarrowPaneStillShowsTheTag() {
|
||||
show(two, x64 = true, narrow = true)
|
||||
compose.onAllNodesWithTag("games-client-x64").assertCountEquals(1)
|
||||
}
|
||||
|
||||
private fun show(games: List<Library.SteamGame>, x64: Boolean, narrow: Boolean = false) {
|
||||
compose.mainClock.autoAdvance = false
|
||||
compose.setContent {
|
||||
DroidDeckTheme {
|
||||
CompositionLocalProvider(LocalFrontFocus provides FrontFocus(), LocalNarrowPane provides narrow) {
|
||||
FocusGlideHost {
|
||||
GamesPage(FrontEndState(
|
||||
installed = "r9", ready = true, available = null, busy = false, stage = "", percent = -1,
|
||||
desktopInstalled = true, offlineAccount = null, offline = false, frameGenLabel = "",
|
||||
romsDir = null, logsEnabled = false, steamGames = games, steamGamesX64 = x64, emulators = emptyList(), running = null,
|
||||
), FrontEndActions(
|
||||
onPlay = {}, onPlaySteamVr = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
onWirelessAdbPair = { _, _, _, _ -> }, onWirelessAdbApply = { _, _, _, _ -> },
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
), selected = "app:440", onSelect = {}, modifier = Modifier.fillMaxSize())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
compose.mainClock.advanceTimeBy(2_000)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user