mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
fix: Steam starts on ROMs that refuse the Android ID read (#1421)
On a Redmi K70 (Android 14), tapping Steam drops straight back to the main screen. The session thread dies while writing the guest network link: ``` java.lang.IllegalArgumentException: Illegal char: - at offset 8 at android.provider.Settings$Secure.getStringForUser(Settings.java:6486) at com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent.describe(LinuxNetworkLinkComponent.kt:281) ``` The guest MAC is seeded from `ANDROID_ID`. That ROM throws from the read, which had no guard. A failed read now uses the same fallback seed as a missing ID. Devices that can read it keep the MAC they have now. - `SeededMacTest`: stable MAC from an ID, and a read that throws the ROM's exception falls back instead of crashing. - REDMAGIC NP06J: the guest MAC is the same before and after the change (`16:4e:5b:53:e9:ef`). ## Credits Reported by lc666 on Discord.
This commit is contained in:
2 files changed
+31
-7
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotEquals
|
||||
import org.junit.Test
|
||||
|
||||
class SeededMacTest {
|
||||
@Test
|
||||
fun theAndroidIdSeedsAStableLocalMac() {
|
||||
val mac = LinuxNetworkLinkComponent.seededMac { "0123456789abcdef" }
|
||||
assertEquals(mac, LinuxNetworkLinkComponent.seededMac { "0123456789abcdef" })
|
||||
assertNotEquals(mac, LinuxNetworkLinkComponent.seededMac { null })
|
||||
assertEquals(0x02, mac.substringBefore(':').toInt(16) and 0x03)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aRomThatThrowsOnTheAndroidIdReadFallsBackToTheDefaultSeed() {
|
||||
val mac = LinuxNetworkLinkComponent.seededMac { throw IllegalArgumentException("Illegal char: - at offset 8") }
|
||||
assertEquals(LinuxNetworkLinkComponent.seededMac { null }, mac)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user