Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## Unreleased
- **Xbox sign-in with an account that has no Xbox profile (test266, Saleh: "you can't sign out to start fresh"):** the sign-in kept the Microsoft account even when Xbox network refused it, so it ended "Signed in" with no gamertag, and signing in again went straight back to the same account because the phone's browser was still signed in to it. Now:
- **Handheld:** "Open the page" opens Microsoft's page inside MoonCast, with the code already filled in and no Microsoft account remembered (a fresh start every time). It closes by itself once you're signed in; Close goes back to the code. Sign out forgets that page's account too.
- Right after the sign-in MoonCast asks Xbox network about the account. If it has no Xbox profile, is a child account not yet in a family, or can't use Xbox network in its country, nothing is kept and the card says so in plain words ("This Microsoft account has no Xbox profile. Sign in with the account you use on your Xbox."). If Xbox network can't be reached, the sign-in is kept and it says it couldn't check.
- Someone already in that state sees Settings, Xbox: "Signed in, no Xbox profile", and Sign out is picked in its question. Same words on the TV, which gets the same check (its sign-in is shared with the handheld).
- **TV code card:** next to the big code there's now a QR code (made on the TV, no QR service) that a phone camera opens as microsoft.com/link with the code already filled in, and a line: "To use a different Microsoft account, open the page in a private browser window." (the TV can't clear another device's browser).
- **Xbox closed as soon as it connected (Odin, beta 3, Saleh):** libwebrtc hands MoonCast's low-latency H.264 decoder wrapper a null `DecodeInfo` with a frame; the Kotlin override declared it non-null, so the first frame threw (`NullPointerException … LowLatencyDecoder.decode, parameter info`) and the player closed. The parameter is nullable now and is passed on as is.

## 1.0-beta3 (2026-10-24)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,10 @@ class HandheldHomeActivity : Activity() {
info(list, "Touchpad", "Select + Start")
}
"xbox" -> {
if (Xbox.signedIn(this)) action(list, "xbox", "Xbox network", "Signed in" + (Xbox.gamertag(this)?.let { " as $it" } ?: ""), "Sign out") {
if (Xbox.noProfile(this)) action(list, "xbox", "Xbox network", "Signed in, no Xbox profile. Sign out, then sign in with the account you use on your Xbox", "Sign out") {
confirm("Sign out of Xbox?", "This Microsoft account has no Xbox profile. Sign out to start fresh with another account.", "Sign out", yesPicked = true) {
Xbox.signOut(this); xboxes = emptyList(); render(force = true) } }
else if (Xbox.signedIn(this)) action(list, "xbox", "Xbox network", "Signed in" + (Xbox.gamertag(this)?.let { " as $it" } ?: ""), "Sign out") {
confirm("Sign out of Xbox?", "Your Xbox consoles leave this device until you sign in again.", "Sign out") {
Xbox.signOut(this); xboxes = emptyList(); render(force = true) } }
else action(list, "xbox", "Xbox network", "Sign in once to play your Xbox here, at home or away", "Sign in") { xboxSignIn() }
Expand Down Expand Up @@ -2249,36 +2252,47 @@ class HandheldHomeActivity : Activity() {
val code = sw.text("", 80, sw.ink, 800).apply { letterSpacing = 0.12f; gravity = Gravity.CENTER }
card.addView(code, sw.lp(-1, -2).apply { topMargin = sw.px(26); bottomMargin = sw.px(10) })
var url: String? = null
buttons(card, listOf("Cancel" to {}, "Open the page" to {
url?.let { u -> try { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(u))) } catch (e: Exception) { toast("Open $u in a browser") } }
// the page opens inside MoonCast with no remembered Microsoft account, the code already filled in
buttons(card, listOf("Cancel" to { com.limelight.home.XboxSignInActivity.close() }, "Open the page" to {
url?.let { u -> startActivity(Intent(this, com.limelight.home.XboxSignInActivity::class.java)
.putExtra(com.limelight.home.XboxSignInActivity.EXTRA_URL, u)) }
Unit
}), keepOpenLast = true)
showOverlay("xbox", card)
Thread {
try {
val dc = Xbox.startSignIn()
runOnUiThread {
url = dc.url
sub.text = "Open ${dc.url.removePrefix("https://").removePrefix("www.")} (here or on another device), enter this code, and sign in with your Xbox account."
url = Xbox.linkUrl(dc)
sub.text = "Open the page (here, or ${dc.url.removePrefix("https://").removePrefix("www.")} on another device), enter this code, and sign in with the account you use on your Xbox."
code.text = dc.userCode
}
val end = System.currentTimeMillis() + dc.expiresIn * 1000L
while (System.currentTimeMillis() < end && overlayKind == "xbox") {
Thread.sleep(dc.interval * 1000L)
if (overlayKind != "xbox") return@Thread
if (Xbox.pollSignIn(this, dc)) {
com.limelight.home.XboxSignInActivity.close()
val list = try { Xbox.refreshConsoles(this) } catch (e: Exception) { emptyList() }
runOnUiThread {
xboxes = list
if (overlayKind == "xbox") hideOverlay()
toast("Signed in to Xbox" + (Xbox.gamertag(this)?.let { " as $it" } ?: "") +
toast(if (Xbox.unverified(this)) "Signed in, but Xbox network couldn't be reached to check the account. Try Find my Xbox in a moment"
else "Signed in to Xbox" + (Xbox.gamertag(this)?.let { " as $it" } ?: "") +
if (list.isEmpty()) ". No console found yet" else ". Found " + list.joinToString { it.name })
render(force = true)
}
return@Thread
}
}
runOnUiThread { if (overlayKind == "xbox") { sub.text = "The code expired. Cancel and try again."; code.text = "" } }
} catch (e: Xbox.ProfileError) {
// the account can't use Xbox: nothing is kept, and the next try starts with no account remembered
com.limelight.home.XboxSignInActivity.close()
runOnUiThread {
if (overlayKind == "xbox") { sub.text = e.message; code.text = "" }
render(force = true)
}
} catch (e: Exception) {
runOnUiThread { if (overlayKind == "xbox") sub.text = "Sign-in didn't work: ${e.message?.take(120) ?: e.javaClass.simpleName}" }
}
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@
android:theme="@style/StreamTheme"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard|navigation|uiMode|density|smallestScreenSize|screenLayout" />
<!-- Microsoft's device-code page for the handheld's Xbox sign-in, with no remembered account -->
<activity
android:name=".home.XboxSignInActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard|navigation|uiMode|density|smallestScreenSize|screenLayout" />
<activity
android:name=".PcView"
android:exported="true"
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/assets/licences/qrcodegen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
QR Code generator library
Copyright (c) Project Nayuki. (MIT License)
https://www.nayuki.io/page/qr-code-generator-library

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
- The Software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the Software or the use or other dealings in the
Software.
1 change: 1 addition & 0 deletions app/src/main/java/com/limelight/home/Licences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ object Licences {
Part("More", "JmDNS", "Finding PCs on the network", "Apache-2.0", "apache-2.0.txt", "https://github.com/jmdns/jmdns"),
Part("More", "JCodec", "Reading video stream settings", "BSD-2-Clause", "jcodec.txt", "https://github.com/jcodec/jcodec"),
Part("More", "Shield Controller Extensions", "Rumble and battery on NVIDIA Shield controllers", "MIT", "shield-controller-extensions.txt", "https://github.com/cgutman/ShieldControllerExtensions"),
Part("More", "QR Code generator (Project Nayuki)", "The QR code on the TV's Xbox sign-in", "MIT", "qrcodegen.txt", "https://www.nayuki.io/page/qr-code-generator-library"),
Part("More", "Figtree", "The menus' font", "OFL-1.1", "figtree.txt", "https://github.com/erikdkennedy/figtree"),
Part("More", "Unbounded", "The headings' font", "OFL-1.1", "unbounded.txt", "https://github.com/googlefonts/unbounded"),
)
Expand Down
Loading