feat: turn the OTA updater back on, behind a button in the top bar
OtaUpdater was complete and unreachable: upstream's UpdateHook returned false and had an empty checkInBackground, so nothing ever called the downloader or the installer. That seam was suspended for an audit of the published suite; this fork ships its own builds from its own repository, signed with the platform key the head unit already trusts, so it is live here. The release URL and the About link now point at this repository. An APK from anywhere else is signed with a different key, and OtaUpdater.install checks the archive's certificate against the running app's before calling pm install -r — a mismatch is deleted rather than installed. The refresh button sits outside the tab row, next to About, so it cannot read as a sixth page. It disables itself for the duration: the check, the download and the install are one background pass, and a second press would start a second download of the same APK. The result goes to a toast because the check is reachable from every page and no one page owns the answer. The stable flavour gains a matching no-op overload. It still contains no updater at all — the class is absent from that APK rather than disabled — and the overload exists only so the shared UI compiles in both flavours. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Refresh, for the update check in the top bar. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -8,8s3.58,8 8,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z" />
|
||||
</vector>
|
||||
@@ -92,8 +92,21 @@
|
||||
android:text="@string/tab_log"
|
||||
app:icon="@drawable/ic_tab_log" />
|
||||
|
||||
<!-- About opens a dialog, not a page: it stays a plain button so it cannot be
|
||||
mistaken for a fourth destination of the pager. -->
|
||||
<!-- Neither of these is a destination: they stay plain buttons, outside the tab
|
||||
row, so they cannot be mistaken for pages of the pager. -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/update_button"
|
||||
style="@style/Widget.EV.Button.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:contentDescription="@string/update_check"
|
||||
app:icon="@drawable/ic_refresh"
|
||||
app:iconPadding="0dp"
|
||||
android:minWidth="0dp"
|
||||
android:paddingStart="@dimen/spacing_md"
|
||||
android:paddingEnd="@dimen/spacing_md" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/about_button"
|
||||
style="@style/Widget.EV.Button.Outlined"
|
||||
|
||||
@@ -109,11 +109,13 @@
|
||||
<string name="notif_channel_desc">Shows vehicle telemetry upload status</string>
|
||||
<string name="notif_title">ABRP Uploader</string>
|
||||
<string name="notif_action_stop">Stop</string>
|
||||
<string name="update_check">Güncelleme kontrol et</string>
|
||||
<string name="update_checking">Kontrol ediliyor…</string>
|
||||
<string name="about_action">About</string>
|
||||
<string name="about_title">Fatih\'sMG4 Hakkında</string>
|
||||
<string name="about_version">Version %1$s</string>
|
||||
<string name="about_attribution">Fork of malys / EVABRPUploader\nand Leon Kernan / ABRP_Uploader</string>
|
||||
<string name="about_repository">github.com/fatihdonmezdev/EVABRP</string>
|
||||
<string name="about_repository">github.com/fatihdonmezdev/MG4ABRP</string>
|
||||
<string name="about_made_with_love">MG4 EH32 · SWI69</string>
|
||||
<string name="about_logo_description">EVABRPUploader logo</string>
|
||||
<string name="about_qr_description">QR code for the project repository</string>
|
||||
|
||||
Reference in New Issue
Block a user