commit 231575f74c17f739b01d95a2dc5e78b68e2993ac equwal <13551856+equwal@users.noreply.github.com> 2026-10-04 02:20:02 -0700 Stop after the F-Droid answer for F-Droid installs, watch Rebind on F-Droid, add icon.png, disclose the checks
app/src/main/java/dev/equwal/inkupdate/Checker.kt | 3 ++- app/src/main/java/dev/equwal/inkupdate/Decide.kt | 10 +++++++++- app/src/main/java/dev/equwal/inkupdate/Watched.kt | 2 +- app/src/test/java/dev/equwal/inkupdate/DecideTest.kt | 8 ++++++++ fastlane/metadata/android/en-US/full_description.txt | 7 +++++-- fastlane/metadata/android/en-US/images/icon.png | Bin 0 -> 18265 bytes 6 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/dev/equwal/inkupdate/Checker.kt b/app/src/main/java/dev/equwal/inkupdate/Checker.kt index 02ed24a..5956956 100644 --- a/app/src/main/java/dev/equwal/inkupdate/Checker.kt +++ b/app/src/main/java/dev/equwal/inkupdate/Checker.kt @@ -94,7 +94,8 @@ object Checker { // Two cases make the GitHub request waste: F-Droid already has a newer // build, and the Play store updates the app by itself. val github = - if (fdroidWins || app.installer == Decide.PLAY_PACKAGE) GithubAnswer.None + if (fdroidWins || app.installer == Decide.PLAY_PACKAGE || + Decide.fromFdroidClient(app.installer)) GithubAnswer.None else askGithub(w) return Decide.source( diff --git a/app/src/main/java/dev/equwal/inkupdate/Decide.kt b/app/src/main/java/dev/equwal/inkupdate/Decide.kt index 7fb02c4..a346639 100644 --- a/app/src/main/java/dev/equwal/inkupdate/Decide.kt +++ b/app/src/main/java/dev/equwal/inkupdate/Decide.kt @@ -77,13 +77,20 @@ object Decide { /** The package name of the Play store client. */ const val PLAY_PACKAGE = "com.android.vending" + /** F-Droid and its common clients. They update the app themselves. */ + val FDROID_CLIENTS = setOf("org.fdroid.fdroid", "org.fdroid.basic", "com.machiav3lli.fdroid") + + fun fromFdroidClient(installer: String?): Boolean = installer in FDROID_CLIENTS + /** * Where the update comes from. The order is F-Droid, Google Play, GitHub. * * 1. F-Droid holds a newer build: take it. The F-Droid client updates the * app by itself after the person opens the page once. * 2. The Play store installed the app: the Play store updates it. Stop. - * 3. GitHub holds a newer release: take it. + * 3. A F-Droid client installed the app: it updates the app. Stop. F-Droid + * builds lag behind GitHub, and the app must not offer a sideload then. + * 4. GitHub holds a newer release: take it. * * @param installer the package that installed the app, from the system. */ @@ -98,6 +105,7 @@ object Decide { return Result.Update(FDROID, fdroid.versionName, fdroid.page, null) } if (installer == PLAY_PACKAGE) return Result.LeftToPlay + if (fromFdroidClient(installer)) return Result.UpToDate if (github is GithubAnswer.Found) { val theirs = Version.parse(github.tag) diff --git a/app/src/main/java/dev/equwal/inkupdate/Watched.kt b/app/src/main/java/dev/equwal/inkupdate/Watched.kt index d55132d..fee7d96 100644 --- a/app/src/main/java/dev/equwal/inkupdate/Watched.kt +++ b/app/src/main/java/dev/equwal/inkupdate/Watched.kt @@ -43,7 +43,7 @@ object Watch { Watched( title = "Rebind", pkg = "dev.equwal.assistkey", - fdroidId = null, + fdroidId = "dev.equwal.assistkey", repo = "equwal/rebind", preferAsset = "full" ), diff --git a/app/src/test/java/dev/equwal/inkupdate/DecideTest.kt b/app/src/test/java/dev/equwal/inkupdate/DecideTest.kt index 613ea39..8605ff3 100644 --- a/app/src/test/java/dev/equwal/inkupdate/DecideTest.kt +++ b/app/src/test/java/dev/equwal/inkupdate/DecideTest.kt @@ -50,6 +50,14 @@ class DecideTest { assertEquals(Result.LeftToPlay, r) } + @Test + fun fdroidClientInstallNeverOffersGithub() { + val r = Decide.source( + "org.fdroid.fdroid", FdroidAnswer.NotThere, githubNewer(), 1L, "0.1.0" + ) + assertEquals(Result.UpToDate, r) + } + /** The Play store does not beat a newer build on F-Droid. */ @Test fun fdroidStillWinsOverPlay() { diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 1a21981..5be8852 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -16,8 +16,11 @@ installed the app, Google Play updates it, and Ink Update stops there. Then GitHub: the app reads the last ten releases and takes the newest one that is not a draft. -Tap "Check now" to look. Turn on "Check once a day" for a daily check that -lives through a restart. +If an F-Droid client installed the app, Ink Update stops after the F-Droid +answer and never offers a GitHub download. + +The app checks once when you first open it. Tap "Check now" to look again. +The daily check is on by default. Turn off "Check once a day" to stop it. The app sends no identifier, no account, no advertisement and no analytics. It contacts two hosts, f-droid.org and api.github.com. Each one sees your IP diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 0000000..8de7f2c Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ