mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix: keep verified Steam navigation
This commit is contained in:
1 parent
3ccf8ca01a
commit
ea8feebea7
6 files changed
+6
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
object SteamSessionUrl {
|
||||
private val allowed = Regex("steam://(?:open/downloads|nav/library|uninstall/[1-9][0-9]{0,9})")
|
||||
private val allowed = Regex("steam://(?:open/downloads|uninstall/[1-9][0-9]{0,9})")
|
||||
|
||||
fun isSupported(url: String): Boolean = allowed.matches(url)
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ internal fun SteamClientMaintenanceActions(actions: FrontEndActions) {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
SecondaryButton("Open Steam downloads") { actions.onSteamUrl("steam://open/downloads") }
|
||||
SecondaryButton("Open Steam library") { actions.onSteamUrl("steam://nav/library") }
|
||||
}
|
||||
Text("In Steam, open this game’s Properties → Installed Files → Verify integrity.",
|
||||
fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
|
||||
@@ -7,9 +7,9 @@ import org.junit.Test
|
||||
class SteamSessionUrlTest {
|
||||
@Test
|
||||
fun onlySupportedSteamNavigationRoutesAreAccepted() {
|
||||
listOf("steam://open/downloads", "steam://nav/library", "steam://uninstall/12345")
|
||||
listOf("steam://open/downloads", "steam://uninstall/12345")
|
||||
.forEach { assertTrue(it, SteamSessionUrl.isSupported(it)) }
|
||||
listOf("steam://open/settings", "steam://uninstall/0", "steam://uninstall/01",
|
||||
listOf("steam://open/settings", "steam://nav/library", "steam://uninstall/0", "steam://uninstall/01",
|
||||
"steam://open/downloads\n--exec", "https://example.com")
|
||||
.forEach { assertFalse(it, SteamSessionUrl.isSupported(it)) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user