fix(epic): say the sign-in waits for Confirm and why Epic calls it Fortnite instead of showing the code

This commit is contained in:
Kurt Himebauch committed 2026-11-16 10:04:22 -05:00
1 parent d415782c56
commit de92fef457
35 files changed
+50 -5

No files matched your search

@@ -31,6 +31,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.droiddeck.launcher.core.AppLanguage
@@ -45,6 +46,8 @@ import java.lang.ref.WeakReference
class DeviceCodeActivity : ComponentActivity() {
private var code by mutableStateOf("")
private var label by mutableStateOf("")
private var message by mutableStateOf<String?>(null)
private var note by mutableStateOf<String?>(null)
private var agent = true
private var url = ""
private var display: Int? = null
@@ -98,6 +101,8 @@ class DeviceCodeActivity : ComponentActivity() {
url = intent.getStringExtra(EXTRA_URL).orEmpty()
label = intent.getStringExtra(EXTRA_LABEL) ?: getString(R.string.agent_step_github)
agent = intent.getBooleanExtra(EXTRA_AGENT, true)
message = intent.getStringExtra(EXTRA_MESSAGE)
note = intent.getStringExtra(EXTRA_NOTE)
display = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it > 0 }
if (agent) copy()
}
@@ -136,9 +141,12 @@ class DeviceCodeActivity : ComponentActivity() {
verticalArrangement = Arrangement.spacedBy(if (inPip) 2.dp else 16.dp),
) {
Text(label, style = MaterialTheme.typography.labelLarge, color = colors.onSurfaceVariant)
FitText(code, maxSize = if (inPip) 40.sp else 56.sp, fontWeight = FontWeight.Bold, color = accent,
val shown = message
if (shown != null) FitText(shown, maxSize = if (inPip) 22.sp else 32.sp, fontWeight = FontWeight.Bold, color = accent,
modifier = Modifier.fillMaxWidth())
Text(Uri.parse(url).let { it.host + it.path }, style = MaterialTheme.typography.labelMedium, color = colors.onSurfaceVariant, maxLines = 1)
else FitText(code, maxSize = if (inPip) 40.sp else 56.sp, fontWeight = FontWeight.Bold, color = accent,
modifier = Modifier.fillMaxWidth())
Text(note ?: Uri.parse(url).let { it.host + it.path }, style = MaterialTheme.typography.labelMedium, color = colors.onSurfaceVariant, maxLines = 2, textAlign = TextAlign.Center)
if (!inPip) Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
PrimaryButton(stringResource(R.string.fm_copy), onClick = ::copy)
SecondaryButton(stringResource(R.string.common_close), onClick = ::finish)
@@ -153,14 +161,17 @@ class DeviceCodeActivity : ComponentActivity() {
private const val EXTRA_DISPLAY = "display"
private const val EXTRA_LABEL = "label"
private const val EXTRA_AGENT = "agent"
private const val EXTRA_MESSAGE = "message"
private const val EXTRA_NOTE = "note"
private var current: WeakReference<DeviceCodeActivity>? = null
/** False when this device cannot float a window, so the caller opens the page itself. */
fun show(context: Context, code: String, url: String, display: Int, label: String? = null): Boolean {
/** [message] replaces the code for a page whose link already carries it; [note] replaces the address line. */
fun show(context: Context, code: String, url: String, display: Int, label: String? = null, message: String? = null, note: String? = null): Boolean {
if (!PairingGuideActivity.canFloat(context)) return false
val intent = Intent(context, DeviceCodeActivity::class.java)
.putExtra(EXTRA_CODE, code).putExtra(EXTRA_URL, url).putExtra(EXTRA_DISPLAY, display)
.putExtra(EXTRA_AGENT, label == null).also { if (label != null) it.putExtra(EXTRA_LABEL, label) }
.putExtra(EXTRA_AGENT, label == null).also { if (label != null) it.putExtra(EXTRA_LABEL, label); if (message != null) it.putExtra(EXTRA_MESSAGE, message); if (note != null) it.putExtra(EXTRA_NOTE, note) }
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return runCatching {
if (display > 0) context.startActivity(intent, ActivityOptions.makeBasic().setLaunchDisplayId(display).toBundle())
@@ -46,7 +46,8 @@ internal object EpicDeviceLogin {
Log.w(TAG, "device sign-in did not start: ${start?.optString("error").orEmpty().ifEmpty { "no answer" }}")
return fail(app, mine)
}
val floated = main.await { DeviceCodeActivity.show(app, userCode, url, 0, Store.EPIC.label) }
val floated = main.await { DeviceCodeActivity.show(app, userCode, url, 0, Store.EPIC.label,
app.getString(R.string.upd_stage_confirm), app.getString(R.string.epic_sign_in_fortnite_note)) }
if (!floated && !openBrowser(app, url)) return fail(app, mine)
val intervalMs = start!!.optLong("interval", 10).coerceAtLeast(1) * 1000
val deadline = System.currentTimeMillis() + start.optLong("expiresIn", 600) * 1000
+1
View File
@@ -1736,6 +1736,7 @@
<string name="upd_stage_downloading">جارٍ التنزيل</string>
<string name="upd_stage_installing">جارٍ التثبيت</string>
<string name="upd_stage_confirm">في انتظار تأكيدك</string>
<string name="epic_sign_in_fortnite_note">تسمي صفحة Epic تسجيل الدخول هذا Fortnite</string>
<string name="upd_failed">فشل التحديث</string>
<string name="upd_not_offered">لم يعرض Android تثبيت التحديث</string>
@@ -1765,6 +1765,7 @@
<string name="upd_stage_downloading">Descargando</string>
<string name="upd_stage_installing">Instalando</string>
<string name="upd_stage_confirm">Esperando tu confirmación</string>
<string name="epic_sign_in_fortnite_note">La página de Epic llama a este inicio de sesión Fortnite</string>
<string name="upd_failed">La actualización falló</string>
<string name="upd_not_offered">Android no ofreció instalar la actualización</string>
<string name="decky_install_failed">Falló la instalación de Decky: %1$s</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Изтегляне</string>
<string name="upd_stage_installing">Инсталиране</string>
<string name="upd_stage_confirm">Изчакване на потвърждение от теб</string>
<string name="epic_sign_in_fortnite_note">Страницата на Epic нарича този вход Fortnite</string>
<string name="upd_failed">Актуализацията се провали</string>
<string name="upd_not_offered">Android не предложи инсталирането на актуализацията</string>
+1
View File
@@ -1710,6 +1710,7 @@
<string name="upd_stage_downloading">Stahování</string>
<string name="upd_stage_installing">Instalování</string>
<string name="upd_stage_confirm">Čeká na vaše potvrzení</string>
<string name="epic_sign_in_fortnite_note">Stránka Epicu toto přihlášení nazývá Fortnite</string>
<string name="upd_failed">Aktualizace se nezdařila</string>
<string name="upd_not_offered">Android nenabídl instalaci aktualizace</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Downloader</string>
<string name="upd_stage_installing">Installerer</string>
<string name="upd_stage_confirm">Venter på din bekræftelse</string>
<string name="epic_sign_in_fortnite_note">Epics side kalder dette login Fortnite</string>
<string name="upd_failed">Opdateringen mislykkedes</string>
<string name="upd_not_offered">Android tilbød ikke at installere opdateringen</string>
+1
View File
@@ -1676,6 +1676,7 @@
<string name="upd_stage_downloading">Herunterladen</string>
<string name="upd_stage_installing">Installieren</string>
<string name="upd_stage_confirm">Warte auf deine Bestätigung</string>
<string name="epic_sign_in_fortnite_note">Epics Seite nennt diese Anmeldung Fortnite</string>
<string name="upd_failed">Das Update ist fehlgeschlagen</string>
<string name="upd_not_offered">Android hat die Installation des Updates nicht angeboten</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Λήψη</string>
<string name="upd_stage_installing">Εγκατάσταση</string>
<string name="upd_stage_confirm">Περιμένει να επιβεβαιώσετε</string>
<string name="epic_sign_in_fortnite_note">Η σελίδα της Epic ονομάζει αυτή τη σύνδεση Fortnite</string>
<string name="upd_failed">Η ενημέρωση απέτυχε</string>
<string name="upd_not_offered">Το Android δεν πρότεινε την εγκατάσταση της ενημέρωσης</string>
+1
View File
@@ -1697,6 +1697,7 @@
<string name="upd_stage_downloading">Descargando</string>
<string name="upd_stage_installing">Instalando</string>
<string name="upd_stage_confirm">Esperando tu confirmación</string>
<string name="epic_sign_in_fortnite_note">La página de Epic llama a este inicio de sesión Fortnite</string>
<string name="upd_failed">La actualización falló</string>
<string name="upd_not_offered">Android no ofreció instalar la actualización</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Latausta</string>
<string name="upd_stage_installing">Asennusta</string>
<string name="upd_stage_confirm">Odotetaan vahvistustasi</string>
<string name="epic_sign_in_fortnite_note">Epicin sivu kutsuu tätä kirjautumista nimellä Fortnite</string>
<string name="upd_failed">Päivitys epäonnistui</string>
<string name="upd_not_offered">Android ei tarjonnut päivityksen asentamista</string>
+1
View File
@@ -1696,6 +1696,7 @@
<string name="upd_stage_downloading">Téléchargement</string>
<string name="upd_stage_installing">Installation</string>
<string name="upd_stage_confirm">En attente de votre confirmation</string>
<string name="epic_sign_in_fortnite_note">La page d\'Epic appelle cette connexion Fortnite</string>
<string name="upd_failed">La mise à jour a échoué</string>
<string name="upd_not_offered">Android n\'a pas proposé d\'installer la mise à jour</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">डाउनलोड हो रहा है</string>
<string name="upd_stage_installing">इंस्टॉल हो रहा है</string>
<string name="upd_stage_confirm">आपकी पुष्टि का इंतज़ार हो रहा है</string>
<string name="epic_sign_in_fortnite_note">Epic का पेज इस साइन-इन को Fortnite कहता है</string>
<string name="upd_failed">अपडेट विफल रहा</string>
<string name="upd_not_offered">Android ने अपडेट इंस्टॉल करने का विकल्प नहीं दिया</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Letöltés</string>
<string name="upd_stage_installing">Telepítés</string>
<string name="upd_stage_confirm">Megerősítésre várakozás</string>
<string name="epic_sign_in_fortnite_note">Az Epic oldala ezt a bejelentkezést Fortnite-nak nevezi</string>
<string name="upd_failed">A frissítés sikertelen</string>
<string name="upd_not_offered">Az Android nem ajánlotta fel a frissítés telepítését</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">Mengunduh</string>
<string name="upd_stage_installing">Menginstal</string>
<string name="upd_stage_confirm">Menunggu konfirmasi Anda</string>
<string name="epic_sign_in_fortnite_note">Halaman Epic menyebut proses masuk ini Fortnite</string>
<string name="upd_failed">Pembaruan gagal</string>
<string name="upd_not_offered">Android tidak menawarkan untuk menginstal pembaruan</string>
+1
View File
@@ -1688,6 +1688,7 @@
<string name="upd_stage_downloading">Download</string>
<string name="upd_stage_installing">Installazione</string>
<string name="upd_stage_confirm">In attesa della tua conferma</string>
<string name="epic_sign_in_fortnite_note">La pagina di Epic chiama questo accesso Fortnite</string>
<string name="upd_failed">Aggiornamento non riuscito</string>
<string name="upd_not_offered">Android non ha proposto di installare l\'aggiornamento</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">ダウンロード中</string>
<string name="upd_stage_installing">インストール中</string>
<string name="upd_stage_confirm">確認を待機中</string>
<string name="epic_sign_in_fortnite_note">Epic のページではこのサインインが Fortnite と表示されます</string>
<string name="upd_failed">アップデートに失敗しました</string>
<string name="upd_not_offered">Androidがアップデートのインストールを表示しませんでした</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">다운로드 중</string>
<string name="upd_stage_installing">설치 중</string>
<string name="upd_stage_confirm">확인 대기 중</string>
<string name="epic_sign_in_fortnite_note">Epic 페이지에는 이 로그인이 Fortnite로 표시됩니다</string>
<string name="upd_failed">업데이트 실패</string>
<string name="upd_not_offered">Android에서 업데이트 설치를 진행하지 않았습니다</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">Memuat turun</string>
<string name="upd_stage_installing">Memasang</string>
<string name="upd_stage_confirm">Menunggu pengesahan anda</string>
<string name="epic_sign_in_fortnite_note">Halaman Epic memanggil log masuk ini Fortnite</string>
<string name="upd_failed">Kemas kini gagal</string>
<string name="upd_not_offered">Android tidak menawarkan untuk memasang kemas kini</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Laster ned</string>
<string name="upd_stage_installing">Installerer</string>
<string name="upd_stage_confirm">Venter på at du bekrefter</string>
<string name="epic_sign_in_fortnite_note">Epics side kaller denne påloggingen Fortnite</string>
<string name="upd_failed">Oppdateringen mislyktes</string>
<string name="upd_not_offered">Android tilbød ikke å installere oppdateringen</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Downloaden</string>
<string name="upd_stage_installing">Installeren</string>
<string name="upd_stage_confirm">Wachten op je bevestiging</string>
<string name="epic_sign_in_fortnite_note">Epics pagina noemt deze aanmelding Fortnite</string>
<string name="upd_failed">De update is mislukt</string>
<string name="upd_not_offered">Android heeft niet aangeboden om de update te installeren</string>
+1
View File
@@ -1710,6 +1710,7 @@
<string name="upd_stage_downloading">Pobieranie</string>
<string name="upd_stage_installing">Instalowanie</string>
<string name="upd_stage_confirm">Oczekiwanie na Twoje potwierdzenie</string>
<string name="epic_sign_in_fortnite_note">Strona Epic nazywa to logowanie Fortnite</string>
<string name="upd_failed">Aktualizacja nie powiodła się</string>
<string name="upd_not_offered">Android nie zaproponował instalacji aktualizacji</string>
@@ -1688,6 +1688,7 @@
<string name="upd_stage_downloading">A transferir</string>
<string name="upd_stage_installing">A instalar</string>
<string name="upd_stage_confirm">A aguardar a sua confirmação</string>
<string name="epic_sign_in_fortnite_note">A página da Epic chama a este início de sessão Fortnite</string>
<string name="upd_failed">A atualização falhou</string>
<string name="upd_not_offered">O Android não ofereceu a instalação da atualização</string>
+1
View File
@@ -1696,6 +1696,7 @@
<string name="upd_stage_downloading">Baixando</string>
<string name="upd_stage_installing">Instalando</string>
<string name="upd_stage_confirm">Aguardando sua confirmação</string>
<string name="epic_sign_in_fortnite_note">A página da Epic chama este login de Fortnite</string>
<string name="upd_failed">A atualização falhou</string>
<string name="upd_not_offered">O Android não ofereceu a instalação da atualização</string>
+1
View File
@@ -1697,6 +1697,7 @@
<string name="upd_stage_downloading">Se descarcă</string>
<string name="upd_stage_installing">Se instalează</string>
<string name="upd_stage_confirm">Se așteaptă confirmarea ta</string>
<string name="epic_sign_in_fortnite_note">Pagina Epic numește această conectare Fortnite</string>
<string name="upd_failed">Actualizarea a eșuat</string>
<string name="upd_not_offered">Android nu a oferit instalarea actualizării</string>
+1
View File
@@ -1710,6 +1710,7 @@
<string name="upd_stage_downloading">Загрузка</string>
<string name="upd_stage_installing">Установка</string>
<string name="upd_stage_confirm">Ожидание вашего подтверждения</string>
<string name="epic_sign_in_fortnite_note">На странице Epic этот вход называется Fortnite</string>
<string name="upd_failed">Ошибка обновления</string>
<string name="upd_not_offered">Android не предложил установить обновление</string>
+1
View File
@@ -1684,6 +1684,7 @@
<string name="upd_stage_downloading">Laddar ned</string>
<string name="upd_stage_installing">Installerar</string>
<string name="upd_stage_confirm">Väntar på att du bekräftar</string>
<string name="epic_sign_in_fortnite_note">Epics sida kallar den här inloggningen Fortnite</string>
<string name="upd_failed">Uppdateringen misslyckades</string>
<string name="upd_not_offered">Android erbjöd inte att installera uppdateringen</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">กำลังดาวน์โหลด</string>
<string name="upd_stage_installing">กำลังติดตั้ง</string>
<string name="upd_stage_confirm">กำลังรอให้คุณยืนยัน</string>
<string name="epic_sign_in_fortnite_note">หน้าของ Epic เรียกการลงชื่อเข้าใช้นี้ว่า Fortnite</string>
<string name="upd_failed">การอัปเดตล้มเหลว</string>
<string name="upd_not_offered">Android ไม่ได้เสนอให้ติดตั้งอัปเดต</string>
+1
View File
@@ -1676,6 +1676,7 @@
<string name="upd_stage_downloading">İndiriliyor</string>
<string name="upd_stage_installing">Yükleniyor</string>
<string name="upd_stage_confirm">Onayınız bekleniyor</string>
<string name="epic_sign_in_fortnite_note">Epic\'in sayfası bu girişi Fortnite olarak adlandırır</string>
<string name="upd_failed">Güncelleme başarısız oldu</string>
<string name="upd_not_offered">Android güncellemeyi yüklemeyi önermedi</string>
+1
View File
@@ -1710,6 +1710,7 @@
<string name="upd_stage_downloading">Завантаження</string>
<string name="upd_stage_installing">Встановлення</string>
<string name="upd_stage_confirm">Очікування вашого підтвердження</string>
<string name="epic_sign_in_fortnite_note">На сторінці Epic цей вхід називається Fortnite</string>
<string name="upd_failed">Не вдалося оновити</string>
<string name="upd_not_offered">Android не запропонував встановити оновлення</string>
+1
View File
@@ -1672,6 +1672,7 @@
<string name="upd_stage_downloading">Đang tải</string>
<string name="upd_stage_installing">Đang cài</string>
<string name="upd_stage_confirm">Đang chờ bạn xác nhận</string>
<string name="epic_sign_in_fortnite_note">Trang của Epic gọi lần đăng nhập này là Fortnite</string>
<string name="upd_failed">Cập nhật thất bại</string>
<string name="upd_not_offered">Android không đề nghị cài bản cập nhật</string>
@@ -1755,6 +1755,7 @@
<string name="upd_stage_downloading">正在下载</string>
<string name="upd_stage_installing">正在安装</string>
<string name="upd_stage_confirm">等待你确认</string>
<string name="epic_sign_in_fortnite_note">Epic 页面会将此登录显示为 Fortnite</string>
<string name="upd_failed">更新失败</string>
<string name="upd_not_offered">Android 未提供安装此更新的选项</string>
@@ -1671,6 +1671,7 @@
<string name="upd_stage_downloading">正在下載</string>
<string name="upd_stage_installing">正在安裝</string>
<string name="upd_stage_confirm">正在等待你確認</string>
<string name="epic_sign_in_fortnite_note">Epic 頁面會將此登入顯示為 Fortnite</string>
<string name="upd_failed">更新失敗</string>
<string name="upd_not_offered">Android 沒有提供安裝更新的選項</string>
@@ -1671,6 +1671,7 @@
<string name="upd_stage_downloading">正在下載</string>
<string name="upd_stage_installing">正在安裝</string>
<string name="upd_stage_confirm">等待你確認</string>
<string name="epic_sign_in_fortnite_note">Epic 頁面會將此登入顯示為 Fortnite</string>
<string name="upd_failed">更新失敗</string>
<string name="upd_not_offered">Android 未提供安裝此更新的選項</string>
+1
View File
@@ -1846,6 +1846,7 @@
<string name="upd_stage_downloading">Downloading</string>
<string name="upd_stage_installing">Installing</string>
<string name="upd_stage_confirm">Waiting for you to confirm</string>
<string name="epic_sign_in_fortnite_note">Epic\'s page calls this sign-in Fortnite</string>
<string name="upd_failed">The update failed</string>
<string name="upd_not_offered">Android didn\'t offer to install the update</string>