From 92fe646a8842d15d0045ced51179b4cfd323defa Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Sun, 22 Nov 2026 05:57:51 -0600 Subject: [PATCH 1/5] K2GO-593 fix(install): Cancel stops the module install and its download Cancel sent SIGTERM, proot stayed up and Ansible kept downloading. Now the runrole proot gets SIGKILL by pid, so the kernel ends all its processes. The revert removes the partial Ansible files, and the queue records the cancel. --- .../org/appdevforall/k2go/PRootEngine.java | 39 ++++++++++++ .../install/presentation/InstallService.java | 28 +++++---- .../presentation/ModuleQueueRepository.java | 2 + .../presentation/ModuleQueueState.java | 28 +++++++-- .../presentation/ModuleQueueStateTest.java | 61 +++++++++++++++++++ 5 files changed, 142 insertions(+), 16 deletions(-) create mode 100644 controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java diff --git a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java index 3dd58866b..916f6f482 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java @@ -408,6 +408,45 @@ public void killProcess() { final Process p = currentProcess; if (p == null) return; p.destroy(); + reap(p); + } + + /** + * K2GO-593: stop the command and every box process it started. {@link #killProcess} sends + * SIGTERM, and proot does not exit on it: it stays until its guests end, so a cancelled runrole + * kept downloading. SIGKILL ends proot, and PTRACE_O_EXITKILL (K2GO-544) then makes the kernel + * kill all its guests. + */ + public void forceKill() { + final Process p = currentProcess; + if (p == null) return; + // Not destroyForcibly(): on the device it left proot running, the same as destroy(). + int pid = pidOf(p); + if (pid > 0) { + android.os.Process.sendSignal(pid, android.os.Process.SIGNAL_KILL); + Log.i(TAG, "K2GO-593: SIGKILL sent to proot pid " + pid); + } else { + Log.w(TAG, "K2GO-593: proot pid unknown; falling back to destroy()"); + p.destroy(); + } + reap(p); + } + + /** The pid of a child process, or -1 if unknown. Process.pid() is API 33+, minSdk is 24. */ + static int pidOf(Process p) { + java.util.regex.Matcher m = + java.util.regex.Pattern.compile("pid=(\\d+)").matcher(String.valueOf(p)); + if (m.find()) return Integer.parseInt(m.group(1)); + try { + java.lang.reflect.Field f = p.getClass().getDeclaredField("pid"); + f.setAccessible(true); + return f.getInt(p); + } catch (Exception e) { + return -1; + } + } + + private static void reap(final Process p) { // Reap the child off the caller's thread so it does not linger as a // zombie / hold proot mounts. Process.waitFor(timeout) is API 26+ and // minSdk is 24, so we drain on the shared io() executor instead of diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java index a442b4a7b..f35b5968a 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java @@ -953,8 +953,10 @@ private void installNextModule() { "cd /opt/iiab/iiab && ./runrole " + roleName; // K2GO-464: refresh the stale rootfs apt index before the runrole, or a pinned dep 404s as the // box ages. Best-effort (short timeout, || true) so an offline/local-only install still runs. + // K2GO-593: a Cancel SIGKILLs the runrole, also during dpkg; finish any interrupted dpkg first. final String installCmd = - "apt-get -o Acquire::http::Timeout=10 -o Acquire::https::Timeout=10 update || true ; " + runroleCmd; + "DEBIAN_FRONTEND=noninteractive dpkg --configure -a || true ; " + + "apt-get -o Acquire::http::Timeout=10 -o Acquire::https::Timeout=10 update || true ; " + runroleCmd; // K2GO-394: the runrole (post-processing) as a deferred step. For maps it runs only AFTER the // base maps are downloaded through dash-node (the gate below); other modules run it at once. @@ -1074,7 +1076,9 @@ private void revertModuleInLocalVars(String module, Runnable then) { if (prootEngine == null) prootEngine = new PRootEngine(); String revertCmd = "sed -i -E '/^[[:space:]]*" + module + "_(install|enabled)[[:space:]]*:/d' /etc/iiab/local_vars.yml && " + "echo '" + module + "_install: False' >> /etc/iiab/local_vars.yml && " + - "echo '" + module + "_enabled: False' >> /etc/iiab/local_vars.yml"; + "echo '" + module + "_enabled: False' >> /etc/iiab/local_vars.yml ; " + + // K2GO-593: a killed runrole leaves its task dirs (a partial download) behind. + "rm -rf /root/.ansible/tmp/ansible-tmp-*"; prootEngine.executeInContainer(this, debianRootfs.getAbsolutePath(), revertCmd, new PRootEngine.OutputListener() { @Override public void onOutputLine(String line) { } @Override public void onProcessExit(int exitCode) { then.run(); } @@ -1140,10 +1144,8 @@ private void stopModuleStallWatch() { * unset so that callback runs (the cancel path suppresses it). {@code gen} drops a kill queued for * a module that has since ended. * - *

Known limit (shared with doCancel): killProcess SIGKILLs proot, orphaning its in-container - * child. Low impact by the role's own flags -- aria2c self-exits (max-tries=5, timeout=60) and the - * meta4 fetch just idles a socket; neither firehoses disk, so recovery works regardless. Reap the - * orphan (reuse EnvironmentProcess's /proc sweep) only if a retry-conflict is ever observed. + *

K2GO-593: forceKill SIGKILLs proot, and PTRACE_O_EXITKILL (K2GO-544) makes the kernel kill + * its box processes too, so no orphan keeps working after the kill. */ private void hardStallKill(final String moduleKey, final int gen) { if (gen != moduleStallGen || finished || cancelled || moduleStallKilled) return; @@ -1151,7 +1153,7 @@ private void hardStallKill(final String moduleKey, final int gen) { log("[Stall] '" + moduleKey + "' made no progress for " + (MODULE_HARD_STALL_MS / 1000) + "s; killing the runrole so it fails through to Retry"); stopModuleStallWatch(); - if (prootEngine != null) prootEngine.killProcess(); + if (prootEngine != null) prootEngine.forceKill(); // K2GO-593: SIGTERM did not end proot } /** @@ -1702,22 +1704,26 @@ private void doCancel() { } if (moduleMode) { // ADFA-4898 P5: user-confirmed cancel of a running module install. Kill the in-flight runrole - // (proot runs with --kill-on-exit, so its container children go with it), roll back that + // and its box processes (forceKill below), roll back that // module's speculative _install so a cancel is not left looking installed, and surface it // as failed so the existing per-module Retry is offered immediately. Ordering mirrors // finishModuleQueue: clear InstallGuard BEFORE postDone so the server-restart observer (the // server was pdsm-stopped for the runroles) is not raced by teardown's later clear. final String cur = ModuleQueueRepository.get().current().currentModule; stopModuleStallWatch(); // ADFA-4898 P4 - if (prootEngine != null) prootEngine.killProcess(); + // K2GO-593: SIGKILL, not SIGTERM. On SIGTERM proot stayed up and the runrole kept downloading. + if (prootEngine != null) prootEngine.forceKill(); if (failedModules == null) failedModules = new java.util.ArrayList<>(); + // K2GO-593: the user stopped it, so it is not an error; only earlier real failures notify. + final java.util.List realFailures = new java.util.ArrayList<>(failedModules); + if (cur != null) realFailures.remove(cur); if (cur != null && !failedModules.contains(cur)) failedModules.add(cur); final java.util.List failedSnapshot = new java.util.ArrayList<>(failedModules); final Runnable finishCancel = () -> { persistClearQueue(); org.appdevforall.k2go.InstallGuard.end(this); - ModuleQueueRepository.get().postDone(failedSnapshot); - if (!failedSnapshot.isEmpty()) InstallNotifications.postModuleFailure(this, failedSnapshot); + ModuleQueueRepository.get().postCanceled(failedSnapshot, cur); + if (!realFailures.isEmpty()) InstallNotifications.postModuleFailure(this, realFailures); teardown(); }; if (cur != null) revertModuleInLocalVars(cur, finishCancel); // best-effort rollback, then finish diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java index 08cc7c77c..5f7e01db4 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueRepository.java @@ -78,6 +78,8 @@ public boolean isInstalling(String moduleKey) { /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ public void postRunning(String currentModule, int remaining, int percent, long etaSeconds) { post(ModuleQueueState.running(currentModule, remaining, percent, etaSeconds)); } public void postDone(List failedModules) { stalled.postValue(false); post(ModuleQueueState.done(failedModules)); } + /** K2GO-593: the batch ended on a user Cancel of {@code canceledModule}. */ + public void postCanceled(List failedModules, String canceledModule) { stalled.postValue(false); post(ModuleQueueState.done(failedModules, canceledModule)); } public void postIdle() { stalled.postValue(false); post(ModuleQueueState.idle()); } private synchronized void post(ModuleQueueState s) { diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java index 834f17427..e02136ef8 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/ModuleQueueState.java @@ -43,11 +43,17 @@ public enum Phase { IDLE, RUNNING, DONE } public final long etaSeconds; /** Modules whose runrole failed in this batch. Only meaningful on DONE. */ public final List failedModules; + /** + * K2GO-593: the module the user stopped with Cancel, or null. It is also in + * {@link #failedModules} (it did not install, so Retry is offered); this only says why, so the + * UI shows "Canceled" instead of an error. Only meaningful on DONE. + */ + public final String canceledModule; /** Monotonic sequence for one-shot effects (finish/fail snackbars exactly once). */ public final long seq; private ModuleQueueState(Phase phase, String currentModule, int remaining, int percent, - long etaSeconds, List failedModules, long seq) { + long etaSeconds, List failedModules, String canceledModule, long seq) { this.phase = phase; this.currentModule = currentModule; this.remaining = Math.max(0, remaining); @@ -56,6 +62,7 @@ private ModuleQueueState(Phase phase, String currentModule, int remaining, int p this.failedModules = failedModules != null ? Collections.unmodifiableList(failedModules) : Collections.emptyList(); + this.canceledModule = canceledModule; this.seq = seq; } @@ -83,8 +90,13 @@ public boolean didFail(String moduleKey) { return phase == Phase.DONE && failedModules.contains(moduleKey); } + /** K2GO-593: true when the user stopped {@code moduleKey} with Cancel in the batch that just ended. */ + public boolean wasCanceled(String moduleKey) { + return phase == Phase.DONE && canceledModule != null && canceledModule.equals(moduleKey); + } + public static ModuleQueueState idle() { - return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, ETA_UNKNOWN, null, 0L); + return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, ETA_UNKNOWN, null, null, 0L); } /** Running with no determinate progress (indeterminate spinner). */ @@ -99,14 +111,20 @@ public static ModuleQueueState running(String currentModule, int remaining, int /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ public static ModuleQueueState running(String currentModule, int remaining, int percent, long etaSeconds) { - return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, etaSeconds, null, 0L); + return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, etaSeconds, null, null, 0L); } public static ModuleQueueState done(List failedModules) { - return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, ETA_UNKNOWN, failedModules, 0L); + return done(failedModules, null); + } + + /** K2GO-593: the batch ended because the user canceled {@code canceledModule} (also in failedModules). */ + public static ModuleQueueState done(List failedModules, String canceledModule) { + return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, ETA_UNKNOWN, failedModules, + canceledModule, 0L); } ModuleQueueState withSeq(long seq) { - return new ModuleQueueState(phase, currentModule, remaining, percent, etaSeconds, failedModules, seq); + return new ModuleQueueState(phase, currentModule, remaining, percent, etaSeconds, failedModules, canceledModule, seq); } } diff --git a/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java b/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java new file mode 100644 index 000000000..90947052e --- /dev/null +++ b/controller/app/src/test/java/org/appdevforall/k2go/install/presentation/ModuleQueueStateTest.java @@ -0,0 +1,61 @@ +/* + * ============================================================================ + * Name : ModuleQueueStateTest.java + * Author : AppDevForAll + * Copyright : Copyright (c) 2026 AppDevForAll + * Description : K2GO-593. A user Cancel ends the batch with the module in the + * failed list (Retry stays offered) and marked as canceled, so + * the UI can tell a user stop from an error. + * ============================================================================ + */ +package org.appdevforall.k2go.install.presentation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; + +import org.junit.Test; + +public class ModuleQueueStateTest { + + @Test + public void canceledModuleIsFailedAndCanceled() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo"), "forgejo"); + assertTrue(st.didFail("forgejo")); + assertTrue(st.wasCanceled("forgejo")); + assertTrue(st.hasFailures()); + } + + @Test + public void realFailureIsNotCanceled() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo")); + assertTrue(st.didFail("forgejo")); + assertFalse(st.wasCanceled("forgejo")); + assertNull(st.canceledModule); + } + + @Test + public void onlyTheCanceledModuleReadsCanceled() { + ModuleQueueState st = ModuleQueueState.done(Arrays.asList("matomo", "forgejo"), "forgejo"); + assertTrue(st.didFail("matomo")); + assertFalse(st.wasCanceled("matomo")); + assertTrue(st.wasCanceled("forgejo")); + } + + @Test + public void canceledOnlyMeansSomethingOnDone() { + assertFalse(ModuleQueueState.running("forgejo", 0).wasCanceled("forgejo")); + assertFalse(ModuleQueueState.idle().wasCanceled("forgejo")); + } + + @Test + public void sequenceKeepsTheCanceledModule() { + ModuleQueueState st = ModuleQueueState.done(Collections.singletonList("forgejo"), "forgejo").withSeq(7L); + assertEquals(7L, st.seq); + assertTrue(st.wasCanceled("forgejo")); + } +} From 71a8993a70676b5a0543a84625d8c4197ce591b2 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Sun, 22 Nov 2026 05:57:52 -0600 Subject: [PATCH 2/5] K2GO-593 fix(ui): a canceled module shows Canceled, the stopped install says so The module list, the setup screen and the module screen show "Canceled" for a user stop. The header says the install stopped, and the seed row hides when Forgejo did not install. Two new strings in all locales. --- .../k2go/redesign/ModuleHubFragment.java | 4 ++++ .../k2go/redesign/ModuleInstallFragment.java | 3 ++- .../k2go/redesign/SetupProgressActivity.java | 23 +++++++++++++------ .../k2go/setup/domain/SetupUiState.java | 8 ++++--- .../app/src/main/res/values-ar/strings.xml | 2 ++ .../app/src/main/res/values-az/strings.xml | 2 ++ .../app/src/main/res/values-bg/strings.xml | 2 ++ .../app/src/main/res/values-bn/strings.xml | 2 ++ .../app/src/main/res/values-cs/strings.xml | 2 ++ .../app/src/main/res/values-de/strings.xml | 2 ++ .../app/src/main/res/values-el/strings.xml | 2 ++ .../app/src/main/res/values-es/strings.xml | 2 ++ .../app/src/main/res/values-fa/strings.xml | 2 ++ .../app/src/main/res/values-fr/strings.xml | 2 ++ .../app/src/main/res/values-gu/strings.xml | 2 ++ .../app/src/main/res/values-hi/strings.xml | 2 ++ .../app/src/main/res/values-hu/strings.xml | 2 ++ .../app/src/main/res/values-in/strings.xml | 2 ++ .../app/src/main/res/values-it/strings.xml | 2 ++ .../app/src/main/res/values-ja/strings.xml | 2 ++ .../app/src/main/res/values-ko/strings.xml | 2 ++ .../app/src/main/res/values-lt/strings.xml | 2 ++ .../app/src/main/res/values-nl/strings.xml | 2 ++ .../app/src/main/res/values-no/strings.xml | 2 ++ .../app/src/main/res/values-pl/strings.xml | 2 ++ .../app/src/main/res/values-pt/strings.xml | 2 ++ .../app/src/main/res/values-ro/strings.xml | 2 ++ .../src/main/res/values-ru-rRU/strings.xml | 2 ++ .../app/src/main/res/values-sk/strings.xml | 2 ++ .../app/src/main/res/values-sr/strings.xml | 2 ++ .../app/src/main/res/values-sw/strings.xml | 2 ++ .../app/src/main/res/values-ta/strings.xml | 2 ++ .../app/src/main/res/values-tr/strings.xml | 2 ++ .../app/src/main/res/values-uk/strings.xml | 2 ++ .../app/src/main/res/values-vi/strings.xml | 2 ++ .../app/src/main/res/values-yo/strings.xml | 2 ++ .../src/main/res/values-zh-rCN/strings.xml | 2 ++ .../app/src/main/res/values/strings.xml | 4 ++++ .../k2go/setup/domain/SetupUiStateTest.java | 12 +++++++++- 39 files changed, 108 insertions(+), 12 deletions(-) diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java index c7881a1d7..e2eecfc57 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleHubFragment.java @@ -496,15 +496,19 @@ private View cardRow(final ModuleCards.Card c, final boolean isInstalled, // already there cannot meaningfully be waiting to be installed, and if a stale wishlist // entry survived an install, saying "Scheduled" over it would be the older lie again. boolean scheduled = !isInstalled && !unknown && ModuleWishlist.contains(requireContext(), c.key()); + boolean canceled = failed && org.appdevforall.k2go.install.presentation.ModuleQueueRepository.get() + .current().wasCanceled(c.key()); // K2GO-385 (PR3): a lifecycle state is a read-only STATUS -- dot + text, semantic colour, no // ripple (the shared K2GoStatusBadge) -- not an outlined pill that reads like a button. LinearLayout pill = K2GoStatusBadge.create(requireContext(), isInstalled ? getString(R.string.k2go_mod_phase_done) + : canceled ? getString(R.string.k2go_mod_phase_canceled) // K2GO-593 : failed ? getString(R.string.k2go_mod_phase_failed) : unknown ? getString(R.string.k2go_state_no_answer) : scheduled ? getString(R.string.k2go_mod_scheduled) : getString(R.string.k2go_state_not_installed), isInstalled ? R.color.k2go_leaf + : canceled ? R.color.k2go_muted : failed ? R.color.k2go_clay : unknown ? R.color.k2go_amber_text : scheduled ? R.color.k2go_teal : R.color.k2go_muted); diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java index 95280d433..51fbc90da 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleInstallFragment.java @@ -133,7 +133,8 @@ private void updateStatus() { // failedModules.contains(...); routed through the shared atom so the three can't drift apart. if (mq.didFail(key)) { terminalDone = true; - status.setText(getString(R.string.k2go_mod_phase_failed)); + status.setText(getString(mq.wasCanceled(key) // K2GO-593: a user stop is not an error + ? R.string.k2go_mod_phase_canceled : R.string.k2go_mod_phase_failed)); return; } if (mq.phase == ModuleQueueState.Phase.DONE) { diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java index d05950bb5..cfe3992c4 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java @@ -387,6 +387,13 @@ private boolean forgejoSeedInSession() { * short-circuit on isComplete would be wrong right after a Retry, which re-banks the marker while * the repository is still FAILED until the service reopens the session: that window must read as * active so the pipeline keeps tracking the retried seed instead of stopping the poll. */ + /** K2GO-593: the Forgejo role of this module run failed or was canceled, so its seed never + * starts. Read only in a module-install flow; a post-install seed run must not read a stale + * queue verdict. */ + private static boolean forgejoRoleFailedHere(boolean moduleShown) { + return moduleShown && ModuleQueueRepository.get().current().didFail("forgejo"); + } + private boolean forgejoSeedActive() { return org.appdevforall.k2go.forgejo.data.ForgejoInstallPrefs.isSeedPending(this) || org.appdevforall.k2go.forgejo.presentation.ForgejoSeedRepository.get().isRunning(); @@ -480,7 +487,7 @@ private void render() { // K2GO-423: the Forgejo seed row, after the content rows (the seed runs after the role). Shown // once it is imminent (module server up) or already has a session, so it does not sit as // "Queued" through the whole runrole while the module row already tells that story. - if (forgejoSeedInSession() + if (forgejoSeedInSession() && !forgejoRoleFailedHere(moduleShown) // K2GO-593: no seed follows then && (serverObservedUp() || postInstallSeed || org.appdevforall.k2go.forgejo.presentation.ForgejoSeedRepository.get().hasSession())) { sections.addView(forgejoSeedRow()); @@ -544,7 +551,7 @@ private void render() { && (moduleShown || postInstallSeed) // The forgejo runrole failing releases the gate ONLY in a module-install flow; a // post-install seed run (postInstallSeed) must not read a stale/unrelated queue verdict. - && !(moduleShown && mq.didFail("forgejo")); + && !forgejoRoleFailedHere(moduleShown); // ADFA-4900/4842: failed proot runroles count as failures too (Finish, not a false success). // On DONE the queue's failedModules covers maps + modules; before DONE, a start-timeout counts. // ADFA-4954: ModuleQueueRepository is process-scoped, so a DONE phase left by an @@ -589,9 +596,8 @@ private void render() { boolean moduleFlow = moduleInSession(); // ADFA-4898: the module batch reached its terminal with at least one runrole failed. The server // itself came up (so this is NOT moduleServerFailed), and a green "Adding your content" here read - // the failed batch as a clean success. Keep the SAME amber "installing" header it had before the - // failure — no new copy — and let the failure + Retry surface per-module below (hub pill + detail), - // not in this batch-level header. + // the failed batch as a clean success. K2GO-593: the amber header now says the install stopped + // (it said "installing" while nothing ran); the failure + Retry still surface per-module below. boolean moduleFailed = moduleFlow && prootFailed > 0; // Amber "working" while a module install runs, its post-DONE restart is pending, or the batch // ended with a failed module (kept on the same amber install line, never a green success). @@ -674,6 +680,7 @@ private int statusStringRes(SetupUiState.StatusMessage m) { case SLOW: return R.string.k2go_setup_slow; case STARTING: return R.string.k2go_setup_starting; case INSTALLING: return R.string.install_busy_modules; + case STOPPED: return R.string.k2go_setup_modules_stopped; // K2GO-593 case WAITING_FOR_NETWORK: return R.string.k2go_setup_waiting_network; // K2GO-408 case ADDING: default: return R.string.k2go_setup_adding; @@ -1108,14 +1115,16 @@ private View moduleRow(String key) { TextView sub = new TextView(this); sub.setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodySmall); String state; - if (failed) state = getString(R.string.k2go_mod_phase_failed); + boolean canceled = failed && mq.wasCanceled(key); // K2GO-593: a user stop is not an error + if (canceled) state = getString(R.string.k2go_mod_phase_canceled); + else if (failed) state = getString(R.string.k2go_mod_phase_failed); else if (done) state = getString(R.string.k2go_setup_state_done); else if (running) state = mq.percent >= 0 // ADFA-5228: show the % when determinate ? getString(R.string.k2go_mod_phase_installing) + " " + mq.percent + "%" : getString(R.string.k2go_mod_phase_installing); else state = getString(R.string.k2go_mod_phase_queued); sub.setText(state); - sub.setTextColor(ContextCompat.getColor(this, failed ? R.color.k2go_amber_text : R.color.k2go_muted)); + sub.setTextColor(ContextCompat.getColor(this, failed && !canceled ? R.color.k2go_amber_text : R.color.k2go_muted)); col.addView(sub); addRowProgressBar(col, mq, running); // ADFA-5228 row.addView(col, new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)); diff --git a/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java b/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java index 00f2c3ecf..7ebf5f16c 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/setup/domain/SetupUiState.java @@ -19,7 +19,7 @@ public final class SetupUiState { public enum StatusTone { NEUTRAL, WAITING } /** The status line message (mapped to a string resource by the Activity). */ - public enum StatusMessage { STARTING, SLOW, ADDING, INSTALLING, WAITING_FOR_NETWORK } + public enum StatusMessage { STARTING, SLOW, ADDING, INSTALLING, WAITING_FOR_NETWORK, STOPPED } /** The bottom-controls mode (mapped to show()/scheduleRedirect()/cancelRedirect() by the Activity). */ /** FINISH_PARTIAL (K2GO-475): Finish plus a note, never the auto-redirect, so the user reads it. */ @@ -58,7 +58,7 @@ public static SetupUiState from(Inputs in) { if (in.batchServerSlow) message = StatusMessage.SLOW; // could not bring services up in time else if (in.batchServerSettling) message = StatusMessage.STARTING; // reconciler is (re)starting the server else if (in.moduleFlow && !in.batchServerUp) message = StatusMessage.INSTALLING; // runroles in flight - else if (in.moduleFailed) message = StatusMessage.INSTALLING; // keep the amber install header on a failed batch + else if (in.moduleFailed) message = StatusMessage.STOPPED; // K2GO-593: the batch ended; nothing installs now else if (in.moduleFlow) message = StatusMessage.ADDING; // module done + server up else if (!in.servicesReady) message = in.slowByPolls ? StatusMessage.SLOW : StatusMessage.STARTING; else message = StatusMessage.ADDING; @@ -70,7 +70,9 @@ public static SetupUiState from(Inputs in) { else if (in.failure) controls = Controls.FINISH_FAILURE; else controls = Controls.RUNNING; - return new SetupUiState(tone, message, amberWaiting, controls, in.runInBackgroundEnabled); + // K2GO-593: a stopped batch keeps the amber dot, but no animated dots: nothing runs now. + boolean animate = amberWaiting && message != StatusMessage.STOPPED; + return new SetupUiState(tone, message, animate, controls, in.runInBackgroundEnabled); } /** The inputs the rule reads, gathered by the Activity from its live sources. */ diff --git a/controller/app/src/main/res/values-ar/strings.xml b/controller/app/src/main/res/values-ar/strings.xml index 01c4ee81a..65f865344 100644 --- a/controller/app/src/main/res/values-ar/strings.xml +++ b/controller/app/src/main/res/values-ar/strings.xml @@ -1700,4 +1700,6 @@ إيقاف التذكيرات إبقاء التذكيرات كلمات مرور المسؤول التي يستخدمها K2Go للبطاقات: اقرأ كتابًا، وخذ دورة، واستضف الشيفرة. غيّرها هنا ليبقى التطبيق والصندوق متوافقين. + أُلغي + توقّف التثبيت. تحقّق من كل وحدة أدناه. diff --git a/controller/app/src/main/res/values-az/strings.xml b/controller/app/src/main/res/values-az/strings.xml index b26e166b1..dd0e0bc82 100644 --- a/controller/app/src/main/res/values-az/strings.xml +++ b/controller/app/src/main/res/values-az/strings.xml @@ -1716,4 +1716,6 @@ Xatırlatmaları dayandır Xatırlatmaları saxla K2Go-nun Kitab oxu, Kurs keç və Kodu saxla üçün istifadə etdiyi admin parolları. Tətbiq və qutu uyğun qalsın deyə onları burada dəyişin. + Ləğv edildi + Quraşdırma dayandı. Aşağıda hər modulu yoxlayın. diff --git a/controller/app/src/main/res/values-bg/strings.xml b/controller/app/src/main/res/values-bg/strings.xml index 87343adb2..b135da92a 100644 --- a/controller/app/src/main/res/values-bg/strings.xml +++ b/controller/app/src/main/res/values-bg/strings.xml @@ -1703,4 +1703,6 @@ Спри напомнянията Запази напомнянията Администраторски пароли, които K2Go използва за Прочети книга, Запиши се на курс и Хостинг на код. Сменяйте ги тук, за да остават приложението и кутията в синхрон. + Отменено + Инсталирането спря. Проверете всеки модул по-долу. diff --git a/controller/app/src/main/res/values-bn/strings.xml b/controller/app/src/main/res/values-bn/strings.xml index fdee51b37..1f9048937 100644 --- a/controller/app/src/main/res/values-bn/strings.xml +++ b/controller/app/src/main/res/values-bn/strings.xml @@ -1709,4 +1709,6 @@ অনুস্মারক বন্ধ করুন অনুস্মারক রাখুন অ্যাডমিন পাসওয়ার্ড, যা K2Go একটি বই পড়ুন, একটি কোর্স করুন এবং কোড হোস্ট করুন-এর জন্য ব্যবহার করে। অ্যাপ ও বক্স যাতে মিলে থাকে, তাই এগুলো এখানে বদলান। + বাতিল করা হয়েছে + ইনস্টল বন্ধ হয়েছে। নিচে প্রতিটি মডিউল দেখুন। diff --git a/controller/app/src/main/res/values-cs/strings.xml b/controller/app/src/main/res/values-cs/strings.xml index 2cceccbc0..2ac467046 100644 --- a/controller/app/src/main/res/values-cs/strings.xml +++ b/controller/app/src/main/res/values-cs/strings.xml @@ -1705,4 +1705,6 @@ Vypnout připomenutí Ponechat připomenutí Hesla správce, která K2Go používá pro Přečíst knihu, Absolvovat kurz a Hostovat kód. Měň je zde, aby aplikace a box zůstaly v souladu. + Zrušeno + Instalace se zastavila. Zkontrolujte níže každý modul. diff --git a/controller/app/src/main/res/values-de/strings.xml b/controller/app/src/main/res/values-de/strings.xml index 8f9dc1920..6a0c97d11 100644 --- a/controller/app/src/main/res/values-de/strings.xml +++ b/controller/app/src/main/res/values-de/strings.xml @@ -1696,4 +1696,6 @@ Erinnerungen beenden Erinnerungen behalten Admin-Passwörter, die K2Go für Ein Buch lesen, Einen Kurs belegen und Code hosten verwendet. Ändere sie hier, damit App und Box synchron bleiben. + Abgebrochen + Die Installation wurde beendet. Prüfen Sie unten jedes Modul. diff --git a/controller/app/src/main/res/values-el/strings.xml b/controller/app/src/main/res/values-el/strings.xml index 586684ef6..1994c5fa8 100644 --- a/controller/app/src/main/res/values-el/strings.xml +++ b/controller/app/src/main/res/values-el/strings.xml @@ -1703,4 +1703,6 @@ Διακοπή υπενθυμίσεων Διατήρηση υπενθυμίσεων Κωδικοί διαχειριστή που χρησιμοποιεί το K2Go για Διάβασε ένα βιβλίο, Παρακολούθησε ένα μάθημα και Φιλοξενία κώδικα. Άλλαξέ τους εδώ, ώστε η εφαρμογή και το κουτί να μένουν συγχρονισμένα. + Ακυρώθηκε + Η εγκατάσταση σταμάτησε. Ελέγξτε παρακάτω κάθε module. diff --git a/controller/app/src/main/res/values-es/strings.xml b/controller/app/src/main/res/values-es/strings.xml index 80742ec4e..19b6c3eac 100644 --- a/controller/app/src/main/res/values-es/strings.xml +++ b/controller/app/src/main/res/values-es/strings.xml @@ -1773,4 +1773,6 @@ Dejar de recordar Mantener recordatorios Contraseñas de administrador que K2Go usa para Leer un libro, Tomar un curso y Aloja tu código. Cámbialas aquí para que la app y la caja estén sincronizadas. + Cancelado + La instalación se detuvo. Revise cada módulo abajo. diff --git a/controller/app/src/main/res/values-fa/strings.xml b/controller/app/src/main/res/values-fa/strings.xml index 36bc535af..7b398873e 100644 --- a/controller/app/src/main/res/values-fa/strings.xml +++ b/controller/app/src/main/res/values-fa/strings.xml @@ -1696,4 +1696,6 @@ توقف یادآوری‌ها حفظ یادآوری‌ها رمزهای عبور مدیر که K2Go برای خواندن یک کتاب، گذراندن یک دوره و میزبانی کد استفاده می‌کند. آن‌ها را اینجا تغییر دهید تا برنامه و جعبه هماهنگ بمانند. + لغو شد + نصب متوقف شد. هر ماژول را در پایین بررسی کنید. diff --git a/controller/app/src/main/res/values-fr/strings.xml b/controller/app/src/main/res/values-fr/strings.xml index f297ec46d..0050d40c2 100644 --- a/controller/app/src/main/res/values-fr/strings.xml +++ b/controller/app/src/main/res/values-fr/strings.xml @@ -1784,4 +1784,6 @@ Arrêter les rappels Garder les rappels Mots de passe administrateur que K2Go utilise pour Lire un livre, Suivre un cours et Héberger le code. Changez-les ici pour que l\'app et le boîtier restent synchronisés. + Annulé + L\'installation s\'est arrêtée. Vérifiez chaque module ci-dessous. diff --git a/controller/app/src/main/res/values-gu/strings.xml b/controller/app/src/main/res/values-gu/strings.xml index 3027bd59c..f8bc4072d 100644 --- a/controller/app/src/main/res/values-gu/strings.xml +++ b/controller/app/src/main/res/values-gu/strings.xml @@ -1709,4 +1709,6 @@ રિમાઇન્ડર બંધ કરો રિમાઇન્ડર રાખો એડમિન પાસવર્ડ, જે K2Go પુસ્તક વાંચો, કોર્સ કરો અને કોડ હોસ્ટ કરો માટે વાપરે છે. ઍપ અને બૉક્સ સુમેળમાં રહે તે માટે તેમને અહીં બદલો. + રદ કર્યું + ઇન્સ્ટૉલ અટકી ગયું. નીચે દરેક મૉડ્યુલ તપાસો. diff --git a/controller/app/src/main/res/values-hi/strings.xml b/controller/app/src/main/res/values-hi/strings.xml index a40f635cb..bb870ae91 100644 --- a/controller/app/src/main/res/values-hi/strings.xml +++ b/controller/app/src/main/res/values-hi/strings.xml @@ -1773,4 +1773,6 @@ रिमाइंडर बंद करें रिमाइंडर रखें K2Go इन कार्डों के लिए ये एडमिन पासवर्ड उपयोग करता है: किताब पढ़ें, कोर्स करें और कोड होस्ट करें। इन्हें यहीं बदलें, ताकि ऐप और बॉक्स में तालमेल बना रहे। + रद्द किया गया + इंस्टॉल रुक गया। नीचे हर मॉड्यूल देखें। diff --git a/controller/app/src/main/res/values-hu/strings.xml b/controller/app/src/main/res/values-hu/strings.xml index 73ad7337f..93127778c 100644 --- a/controller/app/src/main/res/values-hu/strings.xml +++ b/controller/app/src/main/res/values-hu/strings.xml @@ -1696,4 +1696,6 @@ Emlékeztetők leállítása Emlékeztetők megtartása A K2Go ezekhez használja ezeket a rendszergazdai jelszavakat: Könyv olvasása, Kurzus elvégzése és Kód tárolása. Itt módosítsa őket, hogy az alkalmazás és a doboz összhangban maradjon. + Megszakítva + A telepítés leállt. Alább ellenőrizze az egyes modulokat. diff --git a/controller/app/src/main/res/values-in/strings.xml b/controller/app/src/main/res/values-in/strings.xml index 563487ffa..faba74be5 100644 --- a/controller/app/src/main/res/values-in/strings.xml +++ b/controller/app/src/main/res/values-in/strings.xml @@ -1702,4 +1702,6 @@ Hentikan pengingat Tetap ingatkan Kata sandi admin yang digunakan K2Go untuk Baca buku, Ikuti kursus, dan Hosting kode. Ubah di sini agar aplikasi dan kotak tetap selaras. + Dibatalkan + Pemasangan berhenti. Periksa setiap modul di bawah. diff --git a/controller/app/src/main/res/values-it/strings.xml b/controller/app/src/main/res/values-it/strings.xml index 79d938a6e..3e8968dac 100644 --- a/controller/app/src/main/res/values-it/strings.xml +++ b/controller/app/src/main/res/values-it/strings.xml @@ -1697,4 +1697,6 @@ Interrompi promemoria Mantieni promemoria Password di amministratore che K2Go usa per Leggere un libro, Seguire un corso e Ospita il codice. Cambiale qui, così l\'app e il server restano allineati. + Annullata + L\'installazione si è interrotta. Controlla ogni modulo qui sotto. diff --git a/controller/app/src/main/res/values-ja/strings.xml b/controller/app/src/main/res/values-ja/strings.xml index b6169ffb5..13056c274 100644 --- a/controller/app/src/main/res/values-ja/strings.xml +++ b/controller/app/src/main/res/values-ja/strings.xml @@ -1696,4 +1696,6 @@ リマインダーを停止 リマインダーを続ける K2Goが「本を読む」「コースを受ける」「コードをホスト」で使う管理者パスワードです。アプリとボックスの状態をそろえるため、ここで変更してください。 + キャンセルしました + インストールが停止しました。下の各モジュールを確認してください。 diff --git a/controller/app/src/main/res/values-ko/strings.xml b/controller/app/src/main/res/values-ko/strings.xml index 6eb9f8d4c..37b4cf395 100644 --- a/controller/app/src/main/res/values-ko/strings.xml +++ b/controller/app/src/main/res/values-ko/strings.xml @@ -1696,4 +1696,6 @@ 알림 중지 알림 유지 K2Go가 책 읽기, 코스 수강, 코드 호스팅에 사용하는 관리자 비밀번호입니다. 앱과 박스가 서로 맞도록 여기에서 변경하세요. + 취소됨 + 설치가 중지되었습니다. 아래에서 각 모듈을 확인하세요. diff --git a/controller/app/src/main/res/values-lt/strings.xml b/controller/app/src/main/res/values-lt/strings.xml index 9368d7358..e32fac085 100644 --- a/controller/app/src/main/res/values-lt/strings.xml +++ b/controller/app/src/main/res/values-lt/strings.xml @@ -1715,4 +1715,6 @@ Išjungti priminimus Palikti priminimus Administratoriaus slaptažodžiai, kuriuos K2Go naudoja šioms kortelėms: Skaityti knygą, Baigti kursą ir Talpinti kodą. Keiskite juos čia, kad programa ir serveris liktų suderinti. + Atšaukta + Diegimas sustojo. Patikrinkite kiekvieną modulį žemiau. diff --git a/controller/app/src/main/res/values-nl/strings.xml b/controller/app/src/main/res/values-nl/strings.xml index 094c28bda..cbe64f252 100644 --- a/controller/app/src/main/res/values-nl/strings.xml +++ b/controller/app/src/main/res/values-nl/strings.xml @@ -1696,4 +1696,6 @@ Herinneringen stoppen Herinneringen houden Beheerderswachtwoorden die K2Go gebruikt voor Een boek lezen, Een cursus volgen en Code hosten. Wijzig ze hier, zodat de app en de box gelijk blijven. + Geannuleerd + De installatie is gestopt. Controleer hieronder elke module. diff --git a/controller/app/src/main/res/values-no/strings.xml b/controller/app/src/main/res/values-no/strings.xml index 6fd14deb6..c8e6a0df3 100644 --- a/controller/app/src/main/res/values-no/strings.xml +++ b/controller/app/src/main/res/values-no/strings.xml @@ -1706,4 +1706,6 @@ Slå av påminnelser Behold påminnelser Administratorpassord som K2Go bruker for Les en bok, Ta et kurs og Vert for kode. Endre dem her, slik at appen og boksen holder seg i takt. + Avbrutt + Installasjonen stoppet. Sjekk hver modul nedenfor. diff --git a/controller/app/src/main/res/values-pl/strings.xml b/controller/app/src/main/res/values-pl/strings.xml index 6d6cb50b5..11dacba56 100644 --- a/controller/app/src/main/res/values-pl/strings.xml +++ b/controller/app/src/main/res/values-pl/strings.xml @@ -1708,4 +1708,6 @@ Wyłącz przypomnienia Zachowaj przypomnienia Hasła administratora, których K2Go używa dla kart: Przeczytaj książkę, Weź udział w kursie i Hostuj kod. Zmieniaj je tutaj, aby aplikacja i serwer pozostały zgodne. + Anulowano + Instalacja została zatrzymana. Sprawdź poniżej każdy moduł. diff --git a/controller/app/src/main/res/values-pt/strings.xml b/controller/app/src/main/res/values-pt/strings.xml index bad32d6fc..b10886bc9 100644 --- a/controller/app/src/main/res/values-pt/strings.xml +++ b/controller/app/src/main/res/values-pt/strings.xml @@ -1776,4 +1776,6 @@ Parar lembretes Manter lembretes Senhas de administrador que o K2Go usa para Ler um livro, Fazer um curso e Hospedar código. Altere-as aqui para que a app e o servidor fiquem em sintonia. + Cancelado + A instalação parou. Verifique cada módulo abaixo. diff --git a/controller/app/src/main/res/values-ro/strings.xml b/controller/app/src/main/res/values-ro/strings.xml index 693de96cf..819f9adae 100644 --- a/controller/app/src/main/res/values-ro/strings.xml +++ b/controller/app/src/main/res/values-ro/strings.xml @@ -1697,4 +1697,6 @@ Oprește mementourile Păstrează mementourile Parolele de administrator pe care K2Go le folosește pentru Cărți, Cursuri și Găzduiește cod. Schimbă-le aici, ca aplicația și serverul să rămână sincronizate. + Anulată + Instalarea s-a oprit. Verifică fiecare modul de mai jos. diff --git a/controller/app/src/main/res/values-ru-rRU/strings.xml b/controller/app/src/main/res/values-ru-rRU/strings.xml index 437aa9576..a35a6018c 100644 --- a/controller/app/src/main/res/values-ru-rRU/strings.xml +++ b/controller/app/src/main/res/values-ru-rRU/strings.xml @@ -1774,4 +1774,6 @@ Отключить напоминания Оставить напоминания Пароли администратора, которые K2Go использует для разделов Книги, Курсы и Хостинг кода. Меняйте их здесь, чтобы приложение и сервер оставались согласованными. + Отменено + Установка остановлена. Проверьте каждый модуль ниже. diff --git a/controller/app/src/main/res/values-sk/strings.xml b/controller/app/src/main/res/values-sk/strings.xml index 57ae1adf1..46277a617 100644 --- a/controller/app/src/main/res/values-sk/strings.xml +++ b/controller/app/src/main/res/values-sk/strings.xml @@ -1705,4 +1705,6 @@ Vypnúť pripomienky Ponechať pripomienky Heslá správcu, ktoré K2Go používa pre Knihy, Kurzy a Hostovať kód. Meňte ich tu, aby aplikácia a server zostali v súlade. + Zrušené + Inštalácia sa zastavila. Skontrolujte nižšie každý modul. diff --git a/controller/app/src/main/res/values-sr/strings.xml b/controller/app/src/main/res/values-sr/strings.xml index d5e0aba90..f857c1892 100644 --- a/controller/app/src/main/res/values-sr/strings.xml +++ b/controller/app/src/main/res/values-sr/strings.xml @@ -1710,4 +1710,6 @@ Искључи подсетнике Задржи подсетнике Администраторске лозинке које K2Go користи за Књиге, Курсеве и Хостуј код. Мењајте их овде, да би апликација и сервер остали усклађени. + Отказано + Инсталација је заустављена. Проверите сваки модул испод. diff --git a/controller/app/src/main/res/values-sw/strings.xml b/controller/app/src/main/res/values-sw/strings.xml index 296e2b667..179c62f1a 100644 --- a/controller/app/src/main/res/values-sw/strings.xml +++ b/controller/app/src/main/res/values-sw/strings.xml @@ -1716,4 +1716,6 @@ Zima vikumbusho Endelea na vikumbusho Manenosiri ya msimamizi ambayo K2Go inatumia kwa Vitabu, Kozi na Pangisha msimbo. Yabadilishe hapa, ili programu na kisanduku vibaki sawa. + Imeghairiwa + Usakinishaji umesimama. Kagua kila moduli hapa chini. diff --git a/controller/app/src/main/res/values-ta/strings.xml b/controller/app/src/main/res/values-ta/strings.xml index 2ebab797a..ca562d73d 100644 --- a/controller/app/src/main/res/values-ta/strings.xml +++ b/controller/app/src/main/res/values-ta/strings.xml @@ -1716,4 +1716,6 @@ நினைவூட்டல்களை நிறுத்து நினைவூட்டல்களை வைத்திரு புத்தகங்கள், பாடநெறிகள் மற்றும் குறியீட்டை ஹோஸ்ட் செய் ஆகியவற்றுக்கு K2Go பயன்படுத்தும் நிர்வாகி கடவுச்சொற்கள். செயலியும் பெட்டியும் ஒத்திசைவாக இருக்க, அவற்றை இங்கே மாற்றவும். + ரத்துசெய்யப்பட்டது + நிறுவல் நின்றது. கீழே ஒவ்வொரு தொகுதியையும் சரிபார்க்கவும். diff --git a/controller/app/src/main/res/values-tr/strings.xml b/controller/app/src/main/res/values-tr/strings.xml index 1765c395c..f8f7f91f6 100644 --- a/controller/app/src/main/res/values-tr/strings.xml +++ b/controller/app/src/main/res/values-tr/strings.xml @@ -1696,4 +1696,6 @@ Hatırlatmaları durdur Hatırlatmaları sürdür K2Go uygulamasının Kitaplar, Kurslar ve Kodu barındır için kullandığı yönetici parolaları. Uygulama ve sunucu uyumlu kalsın diye parolaları burada değiştirin. + İptal edildi + Kurulum durdu. Aşağıdaki her modülü kontrol edin. diff --git a/controller/app/src/main/res/values-uk/strings.xml b/controller/app/src/main/res/values-uk/strings.xml index c0b76b247..cb3b1fb2a 100644 --- a/controller/app/src/main/res/values-uk/strings.xml +++ b/controller/app/src/main/res/values-uk/strings.xml @@ -1698,4 +1698,6 @@ Вимкнути нагадування Залишити нагадування Паролі адміністратора, які K2Go використовує для розділів Книги, Курси та Хостинг коду. Змінюйте їх тут, щоб застосунок і сервер залишалися узгодженими. + Скасовано + Встановлення зупинилося. Перевірте кожен модуль нижче. diff --git a/controller/app/src/main/res/values-vi/strings.xml b/controller/app/src/main/res/values-vi/strings.xml index 849d1e858..63687b15f 100644 --- a/controller/app/src/main/res/values-vi/strings.xml +++ b/controller/app/src/main/res/values-vi/strings.xml @@ -1695,4 +1695,6 @@ Dừng lời nhắc Giữ lời nhắc Mật khẩu quản trị mà K2Go dùng cho Sách, Khóa học và Lưu trữ mã. Hãy đổi chúng ở đây để ứng dụng và hộp luôn khớp nhau. + Đã hủy + Quá trình cài đặt đã dừng. Hãy kiểm tra từng mô-đun bên dưới. diff --git a/controller/app/src/main/res/values-yo/strings.xml b/controller/app/src/main/res/values-yo/strings.xml index 0763b6b8f..2a8d332ea 100644 --- a/controller/app/src/main/res/values-yo/strings.xml +++ b/controller/app/src/main/res/values-yo/strings.xml @@ -1715,4 +1715,6 @@ Dá ìránnilétí dúró Pa ìránnilétí mọ́ Àwọn ọ̀rọ̀ìgbaniwọlé alábòójútó tí K2Go ń lò fún Àwọn ìwé, Àwọn ẹ̀kọ́ àti Gbàlejò kóòdù. Yí wọn padà níbí, kí áàpù àti àpótí náà lè wà ní ìbámu. + Ti fagilé + Fífi sórí ẹ̀rọ ti dúró. Ṣàyẹ̀wò módù kọ̀ọ̀kan nísàlẹ̀. diff --git a/controller/app/src/main/res/values-zh-rCN/strings.xml b/controller/app/src/main/res/values-zh-rCN/strings.xml index 569c69c55..afe3f95b1 100644 --- a/controller/app/src/main/res/values-zh-rCN/strings.xml +++ b/controller/app/src/main/res/values-zh-rCN/strings.xml @@ -1696,4 +1696,6 @@ 停止提醒 保留提醒 K2Go 用于图书、课程和托管代码的管理员密码。请在这里更改,让应用和盒子保持一致。 + 已取消 + 安装已停止。请检查下方的每个模块。 diff --git a/controller/app/src/main/res/values/strings.xml b/controller/app/src/main/res/values/strings.xml index 4505df057..b04948e3e 100644 --- a/controller/app/src/main/res/values/strings.xml +++ b/controller/app/src/main/res/values/strings.xml @@ -1904,4 +1904,8 @@ Stop reminders Keep reminders Admin passwords that K2Go uses for Books, Courses and Host code. Change them here, so the app and the box stay in step. + + Canceled + + The install stopped. Check each module below. diff --git a/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java b/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java index 4db575f62..e2e1fb141 100644 --- a/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java +++ b/controller/app/src/test/java/org/appdevforall/k2go/setup/domain/SetupUiStateTest.java @@ -61,9 +61,19 @@ public void moduleInFlightShowsInstalling() { } @Test - public void failedModuleKeepsInstallingHeader() { + public void failedModuleShowsStoppedHeader() { + // K2GO-593: the batch ended (server up again); "installing" would say work still runs. SetupUiState ui = new SetupUiState.Inputs() .moduleFlow(true).batchServerUp(true).moduleFailed(true).build(); + assertEquals(SetupUiState.StatusMessage.STOPPED, ui.message); + assertEquals(SetupUiState.StatusTone.WAITING, ui.tone); + assertFalse(ui.animate); // nothing runs, so no animated dots + } + + @Test + public void failedModuleBeforeServerUpStillInstalling() { + SetupUiState ui = new SetupUiState.Inputs() + .moduleFlow(true).batchServerUp(false).moduleFailed(true).build(); assertEquals(SetupUiState.StatusMessage.INSTALLING, ui.message); } From 459ac301d67f77d4347021bb404b6b785a1a37a3 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Sun, 22 Nov 2026 07:07:34 -0600 Subject: [PATCH 3/5] K2GO-593 fix(install): Retry asks before it uses mobile data Retry started the install directly and downloaded on mobile data with no question. It now asks the same question as "Install now". --- .../k2go/redesign/ModuleDetailFragment.java | 8 ++-- .../k2go/redesign/ModuleRetry.java | 48 +++++++++++++++---- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java index 0d0f8f516..681e21559 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleDetailFragment.java @@ -225,11 +225,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c // — where the batch we just re-fired shows its rows, progress and log. NOT onBackPressed: // that dropped the user on the hub, which during an install only shows "Adding content" // with no route to the progress (the bug seen retrying from Module management). - schedule.setOnClickListener(v -> { - if (ModuleRetry.fire(v, c.key())) { - startActivity(new android.content.Intent(requireContext(), SetupProgressActivity.class)); - } - }); + schedule.setOnClickListener(v -> ModuleRetry.fire(v, c.key(), () -> { + if (isAdded()) startActivity(new android.content.Intent(requireContext(), SetupProgressActivity.class)); + })); schedule.setVisibility(View.VISIBLE); installNowBtn.setText(R.string.k2go_setup_back); installNowBtn.setOnClickListener(v -> requireActivity().getOnBackPressedDispatcher().onBackPressed()); diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java index f44d3e9cc..a191253e9 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java @@ -12,13 +12,18 @@ */ package org.appdevforall.k2go.redesign; +import android.app.Activity; import android.content.Context; +import android.content.ContextWrapper; import android.view.View; +import androidx.annotation.Nullable; + import java.util.Collections; import org.appdevforall.k2go.env.EnvironmentLock; import org.appdevforall.k2go.install.presentation.InstallService; +import org.appdevforall.k2go.networkpolicy.presentation.NetworkPolicyGate; import org.appdevforall.k2go.system.data.SystemDoor; import org.appdevforall.k2go.system.domain.OperationDispatcher; import org.appdevforall.k2go.util.BusyMessage; @@ -28,21 +33,27 @@ public final class ModuleRetry { private ModuleRetry() {} + /** Same as {@link #fire(View, String, Runnable)} with no start callback. */ + public static void fire(View anchor, String moduleKey) { + fire(anchor, moduleKey, null); + } + /** * Re-fire the install of a single module that failed. Two gates, the same the wishlist drain uses: * the environment lock (something else owns the rootfs) and the system door (the box may run a * stopped-class op right now). Either refusal shows a busy snackbar on {@code anchor} and does - * nothing. + * nothing. K2GO-593: then the same mobile data question as "Install now", because a retry + * downloads again. * - * @return true if the retry was actually started (caller may navigate on that), false if a gate - * swallowed it or the inputs were null. + * @param onStarted run on the main thread once the retry really starts (the caller may navigate + * then); not run when a gate refuses or the user declines mobile data. */ - public static boolean fire(View anchor, String moduleKey) { - if (anchor == null || moduleKey == null) return false; + public static void fire(View anchor, String moduleKey, @Nullable Runnable onStarted) { + if (anchor == null || moduleKey == null) return; Context ctx = anchor.getContext(); if (EnvironmentLock.isHeld(ctx)) { Snackbars.make(anchor, BusyMessage.resFor(ctx)).show(); - return false; + return; } // ADFA-4898: ask the same door the wishlist drain asks before starting stopped-class runroles — // the box must be in a state that may run them (not NO_SYSTEM / DAMAGED / mid-op). This is the @@ -52,15 +63,32 @@ public static boolean fire(View anchor, String moduleKey) { // clean; and a single small file read on a deliberate tap is within the per-screen I/O budget. if (!OperationDispatcher.mayRunStopped(SystemDoor.dispatch(ctx, moduleKey))) { Snackbars.make(anchor, BusyMessage.resFor(ctx)).show(); - return false; + return; } // K2GO-430: a retry starts the install directly (not via openModuleIndex), so gate the dash-node // dependency here too. If the box dash-node is below the module's minimum, the gate shows the // "update the dashboard first" dialog and the retry does not fire. if (!org.appdevforall.k2go.dependency.presentation.DashNodeGate.allowInstall(ctx, moduleKey)) { - return false; + return; + } + final Runnable start = () -> { + InstallService.retryModules(ctx, Collections.singletonList(moduleKey)); + if (onStarted != null) onStarted.run(); + }; + Activity act = activityOf(ctx); + if (act == null) { // no window to ask in: start only when no question is needed + if (org.appdevforall.k2go.networkpolicy.data.NetworkCostAdmission.allowsHeavyStartNow(ctx)) start.run(); + return; + } + NetworkPolicyGate.guardHeavyStart(act, start); + } + + @Nullable + private static Activity activityOf(Context ctx) { + while (ctx instanceof ContextWrapper) { + if (ctx instanceof Activity) return (Activity) ctx; + ctx = ((ContextWrapper) ctx).getBaseContext(); } - InstallService.retryModules(ctx, Collections.singletonList(moduleKey)); - return true; + return null; } } From e63106c5a8a2d2dd5f953004012916c29487eec7 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Mon, 23 Nov 2026 00:26:15 -0600 Subject: [PATCH 4/5] K2GO-593 fix(install): review fixes for Cancel Kill only a proot that still runs (an ended command's pid can be reused). dpkg recovery does not wait on a conffile prompt. A cancel during pdsm stop cancels the first module, and a real failure still notifies. --- .../main/java/org/appdevforall/k2go/PRootEngine.java | 12 +++++++++++- .../k2go/install/presentation/InstallService.java | 7 ++++--- .../k2go/redesign/SetupProgressActivity.java | 5 +++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java index 916f6f482..d403a0582 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/PRootEngine.java @@ -419,7 +419,7 @@ public void killProcess() { */ public void forceKill() { final Process p = currentProcess; - if (p == null) return; + if (p == null || !isAlive(p)) return; // an ended command's pid can belong to another process now // Not destroyForcibly(): on the device it left proot running, the same as destroy(). int pid = pidOf(p); if (pid > 0) { @@ -432,6 +432,16 @@ public void forceKill() { reap(p); } + /** Process.isAlive() is API 26+, minSdk is 24: exitValue() throws while the process runs. */ + private static boolean isAlive(Process p) { + try { + p.exitValue(); + return false; + } catch (IllegalThreadStateException running) { + return true; + } + } + /** The pid of a child process, or -1 if unknown. Process.pid() is API 33+, minSdk is 24. */ static int pidOf(Process p) { java.util.regex.Matcher m = diff --git a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java index f35b5968a..a459d7177 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/install/presentation/InstallService.java @@ -955,7 +955,7 @@ private void installNextModule() { // box ages. Best-effort (short timeout, || true) so an offline/local-only install still runs. // K2GO-593: a Cancel SIGKILLs the runrole, also during dpkg; finish any interrupted dpkg first. final String installCmd = - "DEBIAN_FRONTEND=noninteractive dpkg --configure -a || true ; " + "DEBIAN_FRONTEND=noninteractive dpkg --force-confdef --force-confold --configure -a < /dev/null || true ; " + "apt-get -o Acquire::http::Timeout=10 -o Acquire::https::Timeout=10 update || true ; " + runroleCmd; // K2GO-394: the runrole (post-processing) as a deferred step. For maps it runs only AFTER the @@ -1709,14 +1709,15 @@ private void doCancel() { // as failed so the existing per-module Retry is offered immediately. Ordering mirrors // finishModuleQueue: clear InstallGuard BEFORE postDone so the server-restart observer (the // server was pdsm-stopped for the runroles) is not raced by teardown's later clear. - final String cur = ModuleQueueRepository.get().current().currentModule; + // K2GO-593: during pdsm stop no module is current yet; the cancel stops the first one. + final String running = ModuleQueueRepository.get().current().currentModule; + final String cur = running != null ? running : (moduleQueue != null ? moduleQueue.peek() : null); stopModuleStallWatch(); // ADFA-4898 P4 // K2GO-593: SIGKILL, not SIGTERM. On SIGTERM proot stayed up and the runrole kept downloading. if (prootEngine != null) prootEngine.forceKill(); if (failedModules == null) failedModules = new java.util.ArrayList<>(); // K2GO-593: the user stopped it, so it is not an error; only earlier real failures notify. final java.util.List realFailures = new java.util.ArrayList<>(failedModules); - if (cur != null) realFailures.remove(cur); if (cur != null && !failedModules.contains(cur)) failedModules.add(cur); final java.util.List failedSnapshot = new java.util.ArrayList<>(failedModules); final Runnable finishCancel = () -> { diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java index cfe3992c4..48c543bf3 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/SetupProgressActivity.java @@ -1243,8 +1243,9 @@ private void retryForgejoSeed() { /** * ADFA-4898 P5: strong confirmation before cancelling a running module install, then send - * ACTION_CANCEL. The service kills the runrole (proot --kill-on-exit), rolls back the speculative - * flag and marks the module failed; the base system is untouched and the server restarts. + * ACTION_CANCEL. The service SIGKILLs the runrole proot, so the kernel ends its box processes + * (K2GO-593), rolls back the speculative flag and marks the module canceled; the base system is + * untouched and the server restarts. */ private void confirmCancelModule() { // K2GO-385: cancel-running-install confirm -> the shared BrandDialog (destructive). From 734db7a96ab4f10b47dd18e4ada980c5c78aeab0 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Sun, 22 Nov 2026 18:57:41 -0600 Subject: [PATCH 5/5] K2GO-593 fix(install): Retry records the online allowance it got With Keep offline, "Allow only this time" on Retry now counts for the run, as on the start path, so the module download does not ask a second time. --- .../java/org/appdevforall/k2go/redesign/ModuleRetry.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java index a191253e9..f118b6d81 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/ModuleRetry.java @@ -72,6 +72,11 @@ public static void fire(View anchor, String moduleKey, @Nullable Runnable onStar return; } final Runnable start = () -> { + // K2GO-588/593: the gate let this retry connect, also "Allow only this time" with Keep + // offline; record it as the start path does, so the run's download does not ask again. + org.appdevforall.k2go.networkpolicy.data.OnlineAllowance.allow("maps".equals(moduleKey) + ? org.appdevforall.k2go.system.domain.ContentType.MAPS.key() + : org.appdevforall.k2go.networkpolicy.data.OnlineAllowance.MODULES); InstallService.retryModules(ctx, Collections.singletonList(moduleKey)); if (onStarted != null) onStarted.run(); };