Skip to content

Commit 7ac1fe2

Browse files
K2GO-377 chore(backup): the user's backup file takes the product name too
The suggested filename kept the iiab-oa_ prefix the built artifacts just left behind, so the app would have written backups under one name while the bucket held another. It is only ever a suggestion for the SAF picker: nothing reads it back, and a restore identifies an archive by the manifest inside it, so backups already written under the old name keep restoring unchanged.
1 parent 870066f commit 7ac1fe2

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/backup/domain/BackupEngine.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@ public final class BackupEngine {
2929

3030
private BackupEngine() {}
3131

32-
/** Suggested external filename: {@code iiab-oa_YYYY.DDD_<epochSecs>_<arch>.tar.gz}. */
32+
/**
33+
* Suggested external filename: {@code k2go_YYYY.DDD_<epochSecs>_<arch>.tar.gz}.
34+
*
35+
* <p>K2GO-377: the prefix follows the built rootfs artifacts onto the product's own name. It is
36+
* only ever a suggestion for the SAF picker — nothing reads it back, and a restore identifies an
37+
* archive by the manifest inside it, so backups written under the old name keep working.
38+
*/
3339
public static String suggestedFileName(Context ctx) {
3440
java.util.Calendar c = java.util.Calendar.getInstance();
3541
int year = c.get(java.util.Calendar.YEAR);
3642
int day = c.get(java.util.Calendar.DAY_OF_YEAR);
3743
String abi = org.iiab.controller.deploy.data.RootfsManifest.appAbiId();
3844
String arch = abi != null && abi.contains("64") ? "aarch64" : "armhf";
39-
return String.format(java.util.Locale.US, "iiab-oa_%04d.%03d_%d_%s.tar.gz",
45+
return String.format(java.util.Locale.US, "k2go_%04d.%03d_%d_%s.tar.gz",
4046
year, day, System.currentTimeMillis() / 1000L, arch);
4147
}
4248

‎controller/app/src/test/java/org/iiab/controller/deploy/domain/ExtractProgressTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public void ordinaryNamesAreStillShown() {
3232
public void shortHexLikeWordsAreNotMistakenForDigests() {
3333
assertEquals("deadbeef.conf", ExtractProgress.fileLabel("etc/deadbeef.conf"));
3434
assertEquals("facade.png", ExtractProgress.fileLabel("share/facade.png"));
35-
assertEquals("iiab-oa_2026.224_standard.tar.gz",
36-
ExtractProgress.fileLabel("downloads/iiab-oa_2026.224_standard.tar.gz"));
35+
assertEquals("k2go_2026.224_standard.tar.gz",
36+
ExtractProgress.fileLabel("downloads/k2go_2026.224_standard.tar.gz"));
3737
}
3838

3939
/** Fails open: a name we cannot classify is shown, never hidden on a guess. */

‎controller/app/src/test/java/org/iiab/controller/download/domain/MetalinkFileTest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public class MetalinkFileTest {
2121
private static final String META4 =
2222
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2323
+ "<metalink xmlns=\"urn:ietf:params:xml:ns:metalink\" version=\"4.0\">\n"
24-
+ " <file name=\"iiab-oa_2026.192_standard_17dd521_arm64-v8a.tar.gz\">\n"
24+
+ " <file name=\"k2go_2026.192_standard_17dd521_arm64-v8a.tar.gz\">\n"
2525
+ " <size>1453144579</size>\n"
2626
+ " <hash type=\"sha-256\">" + FILE_HASH + "</hash>\n"
2727
+ " <pieces type=\"sha-256\" length=\"1048576\">\n"
2828
+ " <hash type=\"sha-256\">" + FIRST_PIECE_HASH + "</hash>\n"
2929
+ " <hash type=\"sha-256\">67c19c9e0509ff1aaeb104fce7498f53f02052acb18a241409b6d58c9c114142</hash>\n"
3030
+ " </pieces>\n"
31-
+ " <url>https://iiab.switnet.org/android/rootfs/iiab-oa_2026.192_standard_17dd521_arm64-v8a.tar.gz</url>\n"
32-
+ " <url>https://mirror2.example.org/iiab-oa_2026.192_standard_17dd521_arm64-v8a.tar.gz</url>\n"
31+
+ " <url>https://pub-d64c885cef6c42db8c7925144d73d0ee.r2.dev/k2go_2026.192_standard_17dd521_arm64-v8a.tar.gz</url>\n"
32+
+ " <url>https://mirror2.example.org/k2go_2026.192_standard_17dd521_arm64-v8a.tar.gz</url>\n"
3333
+ " </file>\n"
3434
+ "</metalink>\n";
3535

@@ -40,7 +40,7 @@ private MetalinkFile parse() throws Exception {
4040
}
4141

4242
@Test public void parsesFileName() throws Exception {
43-
assertEquals("iiab-oa_2026.192_standard_17dd521_arm64-v8a.tar.gz", parse().fileName());
43+
assertEquals("k2go_2026.192_standard_17dd521_arm64-v8a.tar.gz", parse().fileName());
4444
}
4545

4646
@Test public void parsesSize() throws Exception {

0 commit comments

Comments
 (0)