Fatih'sMG4 — ABRP telemetry for an MG4 EH32 on SWI69

A fork of malys/EVABRPUploader (itself a fork of Leon Kernan's ABRP_Uploader)
carrying the changes that make it work on this car. History starts here: the
tree is what matters, and the upstream projects are where the earlier work
belongs.

EVHardware is vendored rather than tracked as a submodule, so one clone
builds.

Telemetry. SOC, battery power and range read as unavailable on SWI69 because
the vendor fallbacks were gated to SWI68 alone, while the property ids they
use are the ones this car publishes — the gates now admit SWI69. Tyre
pressure, the odometer and charge status come from the vendor block too,
since the generic properties for all three are declared here and never
publish. Tyre pressure is confirmed on the vehicle; the other two are not
yet.

Vehicle page. Every signal the car answers, in a table. One that it does not
publish shows a dash: an unimplemented VHAL property returns zero, and
"0 °C" would read as a measurement.

Wi-Fi page. Joins a network the unit already has saved, so a phone hotspot
does not need a trip into Settings on every drive. Tried on the upload tick
and from a button, skipped while already associated. This leans on the unit
being API 28 and the build being platform-signed — getConfiguredNetworks and
enableNetwork are closed to ordinary apps from API 29 — and fails quietly
where that does not hold.

The OTA updater points at this repository. An APK from upstream is signed
with a different key, which Android will not install over a platform-signed
build.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TCFDONMEZ
2026-09-22 10:45:00 +03:00
co-authored by Claude
commit 2fd7b2dde1
245 changed files with 35594 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EVSuite tokens - LIGHT theme. See DESIGN.md section Colors.
Generated by tools/sync-tokens.mjs and identical in all six apps: edit
tools/tokens/colors.light.xml, not this copy, and re-check the ratios.
Contrast: this screen is read in daylight, usually through a reflection. Every
text colour clears 7:1 (AAA) on every surface it can land on, not the 4.5:1 AA
minimum, which collapses as soon as outside brightness rises. The AAA floor
applies to the light theme too - a badly contrasted light theme is no more
readable than a badly contrasted dark one. -->
<resources>
<color name="ev_background">#FFF2F4F7</color>
<color name="ev_surface">#FFFFFFFF</color>
<color name="ev_surface_raised">#FFE4E8ED</color>
<!-- Card border. Without it, surface and surface_raised merge in sunlight.
4.07:1 on ev_surface - above the 3:1 floor for non-text UI (WCAG 1.4.11),
which the previous #4A525B (2.25:1) did not clear. -->
<color name="ev_outline">#FF737F8F</color>
<color name="ev_text_primary">#FF101418</color>
<!-- 7.22:1 worst case (on ev_surface_raised). -->
<color name="ev_text_secondary">#FF414B55</color>
<!-- A deep cyan, not the dark theme's pale one: a pale cyan on white falls to
1.5:1 and disappears outright in daylight. 7.69:1 worst case. -->
<color name="ev_accent">#FF044C63</color>
<color name="ev_on_accent">#FFFFFFFF</color>
<!-- Status. Never the sole carrier of meaning: a text label always accompanies
the colour. -->
<color name="ev_ok">#FF09501F</color>
<color name="ev_warn">#FF6B3A00</color>
<color name="ev_error">#FF8F0F18</color>
<!-- Pressed: an alpha veil over the surface, not a different hue, so a pressed
card still reads as the same card. -->
<color name="ev_pressed">#14000000</color>
<color name="ev_pressed_strong">#29000000</color>
<!-- Launcher icon tile. The same in light and dark: it is the suite's mark, not
a surface. See DESIGN.md section Iconography. -->
<color name="ev_icon_tile">#FF2A2A2A</color>
</resources>
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EVSuite tokens - metrics. See DESIGN.md sections Layout and Typography.
Generated by tools/sync-tokens.mjs and identical in all six apps. App-specific
dimensions are declared alongside, in dimens_app.xml, with the reason. -->
<resources>
<!-- Vehicle screen: 12.8", ~70 cm from the driver, used while driving, sometimes
in full sun, by fingers that aim badly. Everything is larger than on a
hand-held phone. DPI is user-adjustable per app on this platform, so nothing
assumes a pixel size. -->
<dimen name="touch_target">72dp</dimen>
<dimen name="spacing_xs">4dp</dimen>
<dimen name="spacing_sm">8dp</dimen>
<dimen name="spacing_md">16dp</dimen>
<dimen name="spacing_lg">24dp</dimen>
<!-- One radius across the whole suite: it is what makes six apps written by
different hands read as one. -->
<dimen name="ev_corner">12dp</dimen>
<!-- Text sizes. The floor is text_label: below 16sp, contrast no longer
compensates for reflection and reading distance. -->
<dimen name="text_display">32sp</dimen>
<dimen name="text_title">26sp</dimen>
<dimen name="text_body">20sp</dimen>
<dimen name="text_secondary">17sp</dimen>
<dimen name="text_label">16sp</dimen>
</resources>
+122
View File
@@ -0,0 +1,122 @@
<resources>
<string name="app_name">Fatih\'sMG4</string>
<!-- Main screen -->
<string name="tab_abrp">ABRP</string>
<string name="tab_service">Upload Service</string>
<string name="tab_vehicle">Araç</string>
<string name="tab_wifi">Wi-Fi</string>
<string name="tab_log">Log</string>
<!-- Wi-Fi page -->
<string name="wifi_card_title">Wi-Fi Bağlantısı</string>
<string name="wifi_current">Bağlı ağ</string>
<string name="wifi_state">Durum</string>
<string name="wifi_connect_now">Şimdi Bağlan</string>
<string name="wifi_auto_label">Arka planda otomatik bağlan</string>
<string name="wifi_auto_hint">Yükleme servisi çalışırken bağlantı koptuğunda kayıtlı ağlara kendi kendine bağlanmayı dener.</string>
<string name="wifi_saved_title">Kayıtlı Ağlar</string>
<string name="wifi_saved_empty">Kayıtlı ağ okunamadı</string>
<string name="wifi_not_connected">Bağlı değil</string>
<!-- Vehicle page -->
<string name="vehicle_live_data">Canlı Araç Verileri</string>
<string name="vehicle_tires">Lastik Basınçları</string>
<string name="vehicle_row_soc">Şarj (SOC)</string>
<string name="vehicle_row_range">Menzil</string>
<string name="vehicle_row_power">Güç</string>
<string name="vehicle_row_speed">Hız</string>
<string name="vehicle_row_odometer">Kilometre</string>
<string name="vehicle_row_batt_temp">Batarya Sıcaklığı</string>
<string name="vehicle_row_ext_temp">Dış Sıcaklık</string>
<string name="vehicle_row_cabin_temp">Kabin Sıcaklığı</string>
<string name="vehicle_row_hvac">Klima Ayarı</string>
<string name="vehicle_row_capacity">Batarya Kapasitesi</string>
<string name="vehicle_row_soe">Kalan Enerji</string>
<string name="vehicle_row_charging">Şarj Durumu</string>
<string name="vehicle_tire_fl">Ön Sol</string>
<string name="vehicle_tire_fr">Ön Sağ</string>
<string name="vehicle_tire_rl">Arka Sol</string>
<string name="vehicle_tire_rr">Arka Sağ</string>
<string name="card_config">Configuration</string>
<string name="hint_api_key">ABRP API Key</string>
<string name="default_abrp_api_key" translatable="false">8cfc314b-03cd-4efe-ab7d-4431cd8f2e2d</string>
<string name="helper_api_key">Default: open-source ABRP telemetry key. You may replace it with your own.</string>
<string name="api_key_required">Enter your ABRP API key first</string>
<string name="hint_token">ABRP User Token</string>
<string name="helper_token">Find your token in the ABRP app: Settings → Connections → Generic (Manual Entry)</string>
<string name="desc_toggle_api_key">Show or hide API key</string>
<string name="desc_toggle_token">Show or hide user token</string>
<string name="btn_save">Save</string>
<string name="btn_test">Test Connection</string>
<string name="btn_import">Import file</string>
<!-- Config file import -->
<string name="import_ok">Config imported — press Test to verify</string>
<string name="import_err_read">Could not read that file</string>
<string name="import_err_empty">No ABRP settings found in that file</string>
<string name="import_err_not_found">No config file found. Copy it to %1$s</string>
<!-- Connection test -->
<string name="conn_testing">Testing…</string>
<string name="conn_ok">Connected — API responding OK</string>
<string name="conn_err_auth">Auth failed — check your API key and token</string>
<string name="perm_denied_location">Location denied — telemetry will have no position. Grant it in Settings to send GPS to ABRP.</string>
<string name="perm_denied_car">Vehicle data denied — no battery %%, speed or range will be sent. Grant it in Settings.</string>
<string name="perm_denied_all">Location and vehicle data denied — only a timestamp will be sent. Grant both in Settings.</string>
<string name="conn_err_no_internet">No internet connection</string>
<string name="conn_err_timeout">Connection timed out</string>
<string name="conn_err_http">Server error (HTTP %1$d)</string>
<string name="token_required">Enter your ABRP token first</string>
<string name="card_service">Upload Service</string>
<string name="label_upload_enabled">Enable background uploading</string>
<string name="label_autostart">Start automatically with the car</string>
<string name="hint_autostart">Uploading resumes on its own when the head unit powers up. Turn this off to start it by hand from this screen.</string>
<string name="status_stopped">Service not running</string>
<!-- Cadence configuration -->
<string name="label_frequency">Upload frequency</string>
<string name="hint_frequency">Applies while driving. Parked and unplugged, the app backs off to one upload every 15 minutes on its own.</string>
<string name="label_boost_low_soc">Upload more often at low battery</string>
<string name="label_low_soc_threshold">Low battery threshold (%)</string>
<plurals name="interval_seconds">
<item quantity="one">Every %1$d second</item>
<item quantity="other">Every %1$d seconds</item>
</plurals>
<plurals name="interval_minutes">
<item quantity="one">Every %1$d minute</item>
<item quantity="other">Every %1$d minutes</item>
</plurals>
<!-- Service state -->
<string name="state_stopped">Stopped</string>
<string name="state_starting">Starting…</string>
<string name="state_running">Running</string>
<string name="state_error">In error — last %1$d uploads failed</string>
<!-- Call log -->
<string name="label_call_log">Recent uploads</string>
<string name="call_log_empty">No upload attempted yet.</string>
<string name="status_starting">Starting…</string>
<string name="status_running_no_upload">Running — waiting for first upload</string>
<string name="status_last_upload">Last upload: %1$s (%2$s)</string>
<string name="status_ok">OK</string>
<!-- Notification -->
<string name="notif_channel_name">ABRP Upload Service</string>
<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="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_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>
<string name="about_version_unknown">unknown</string>
<string name="about_close">Close</string>
</resources>
+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Per-app styles (not synced by tools/sync-tokens.mjs — see styles_ev.xml for the
shared set). -->
<resources>
<!-- Icon-over-label nav tab, identical to EVProfile's and EVTasker's. The tabs
share the bar's width equally, so the label has to shrink rather than push its
neighbours around: hence autoSize and a single line. Selected state is
View.isSelected, set by MainActivity.markCurrentPage, read by the
res/color/nav_tab_*.xml selectors — no color is ever set from code. -->
<style name="Widget.EV.NavTab" parent="Widget.Material3.Button.OutlinedButton">
<item name="android:minWidth">0dp</item>
<item name="android:minHeight">0dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
<item name="android:paddingStart">@dimen/spacing_xs</item>
<item name="android:paddingEnd">@dimen/spacing_xs</item>
<item name="android:paddingTop">@dimen/spacing_xs</item>
<item name="android:paddingBottom">@dimen/spacing_xs</item>
<item name="android:maxLines">1</item>
<item name="android:textStyle">bold</item>
<item name="android:letterSpacing">0.02</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/nav_tab_foreground</item>
<item name="autoSizeTextType">uniform</item>
<item name="autoSizeMinTextSize">12sp</item>
<item name="autoSizeMaxTextSize">@dimen/text_label</item>
<item name="iconGravity">top</item>
<item name="iconSize">28dp</item>
<item name="iconPadding">@dimen/spacing_xs</item>
<item name="iconTint">@color/nav_tab_foreground</item>
<item name="backgroundTint">@color/nav_tab_background</item>
<item name="strokeColor">@color/nav_tab_stroke</item>
<item name="strokeWidth">1dp</item>
<item name="cornerRadius">@dimen/ev_corner</item>
<item name="elevation">0dp</item>
</style>
<!-- Vehicle page. A label/value table: the label takes the slack (stretchColumns=0)
and the value is right-aligned so the numbers line up down the column, which
is what makes a reading legible at a glance from the driver's seat. -->
<style name="DataRow" parent="">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingTop">@dimen/spacing_sm</item>
<item name="android:paddingBottom">@dimen/spacing_sm</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="DataLabel" parent="Text.EV.Body">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">@color/ev_text_secondary</item>
</style>
<style name="DataValue" parent="Text.EV.Body">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingStart">@dimen/spacing_md</item>
<item name="android:gravity">end</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/ev_text_primary</item>
<!-- Placeholder, replaced on the first refresh tick. A dash, never a zero:
see the note at the top of pane_vehicle.xml. -->
<item name="android:text">—</item>
</style>
</resources>
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EVSuite - component styles. See DESIGN.md section Components.
Generated by tools/sync-tokens.mjs: identical in all six apps, edit only
tools/tokens/styles.xml. The application theme itself stays in values/themes.xml,
because its name changes from one app to the next.
These styles carry the same names everywhere, so a screen can move between
repositories without being renamed. -->
<resources>
<!-- Dialogs inherit the same contrast as everything else: without this they fall
back to Material's default palette, an indoor grey-mauve that is the first
thing to wash out in sunlight. -->
<style name="ThemeOverlay.EV.Dialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="colorSurface">@color/ev_surface_raised</item>
<item name="colorOnSurface">@color/ev_text_primary</item>
<item name="colorOnSurfaceVariant">@color/ev_text_secondary</item>
<item name="android:textColorPrimary">@color/ev_text_primary</item>
<item name="buttonBarPositiveButtonStyle">@style/Widget.EV.DialogButton</item>
<item name="buttonBarNegativeButtonStyle">@style/Widget.EV.DialogButton</item>
</style>
<!-- 72dp touch target: the finger aims badly on the road and the screen is far
away. This is the minimum used everywhere in the suite, including where
Material offers something much smaller. -->
<style name="Widget.EV.Button" parent="Widget.Material3.Button">
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.EV.Button</item>
<item name="android:minHeight">@dimen/touch_target</item>
<item name="android:textSize">@dimen/text_body</item>
<item name="android:paddingStart">@dimen/spacing_lg</item>
<item name="android:paddingEnd">@dimen/spacing_lg</item>
</style>
<style name="Widget.EV.Button.Outlined" parent="Widget.Material3.Button.OutlinedButton">
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.EV.Button</item>
<item name="android:minHeight">@dimen/touch_target</item>
<item name="android:textSize">@dimen/text_body</item>
<item name="android:paddingStart">@dimen/spacing_lg</item>
<item name="android:paddingEnd">@dimen/spacing_lg</item>
</style>
<!-- Dialog buttons are the smallest thing in any app and the easiest to miss:
pulled up to the same target as the rest. -->
<style name="Widget.EV.DialogButton" parent="Widget.Material3.Button.TextButton.Dialog">
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.EV.Button</item>
<item name="android:minHeight">@dimen/touch_target</item>
<item name="android:minWidth">140dp</item>
<item name="android:textSize">@dimen/text_body</item>
</style>
<!-- A switch that needs a precise tap is a switch that gets missed at 90 km/h. -->
<style name="Widget.EV.Switch" parent="Widget.Material3.CompoundButton.MaterialSwitch">
<item name="android:minHeight">@dimen/touch_target</item>
<item name="android:textSize">@dimen/text_body</item>
<item name="android:textColor">@color/ev_text_primary</item>
</style>
<!-- The only tracked type in the suite. The tracking is what lets it work at the
16sp floor without shouting. -->
<style name="Text.EV.SectionHeader" parent="TextAppearance.Material3.LabelLarge">
<item name="android:textSize">@dimen/text_label</item>
<item name="android:textColor">@color/ev_accent</item>
<item name="android:letterSpacing">0.12</item>
<item name="android:textStyle">bold</item>
</style>
<!-- One Display element per screen: two 32sp numbers competing for attention are
two glances, and the glance is the budget. -->
<style name="Text.EV.Display" parent="TextAppearance.Material3.HeadlineSmall">
<item name="android:textSize">@dimen/text_display</item>
<item name="android:textColor">@color/ev_text_primary</item>
</style>
<style name="Text.EV.Title" parent="TextAppearance.Material3.TitleLarge">
<item name="android:textSize">@dimen/text_title</item>
<item name="android:textColor">@color/ev_text_primary</item>
</style>
<style name="Text.EV.Body" parent="TextAppearance.Material3.BodyLarge">
<item name="android:textSize">@dimen/text_body</item>
<item name="android:textColor">@color/ev_text_primary</item>
</style>
<style name="Text.EV.Secondary" parent="TextAppearance.Material3.BodyMedium">
<item name="android:textSize">@dimen/text_secondary</item>
<item name="android:textColor">@color/ev_text_secondary</item>
</style>
<!-- The suite radius applied to buttons. Material3 buttons are fully rounded by
default, which reads as a different design language from every card and dialog
around them. This lived in EVSwipe only, in a generated file, so the first sync
deleted it — one radius across the suite has to be a token, not a local edit. -->
<style name="ShapeAppearanceOverlay.EV.Button" parent="">
<item name="cornerSize">@dimen/ev_corner</item>
</style>
</resources>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- DayNight, not a forced dark theme: the suite follows the vehicle's day/night
setting. Dark is still the mode that matters - a light background filling the
windscreen at night is glare - which is why the light palette was raised to
the same 7:1 floor as the dark one rather than the other way round.
Shared component styles live in styles_ev.xml. -->
<style name="Theme.EVABRPUploader" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/ev_accent</item>
<item name="colorOnPrimary">@color/ev_on_accent</item>
<item name="colorSurface">@color/ev_surface</item>
<item name="colorSurfaceContainer">@color/ev_surface_raised</item>
<item name="android:colorBackground">@color/ev_background</item>
<item name="android:windowBackground">@color/ev_background</item>
<item name="colorError">@color/ev_error</item>
<item name="android:statusBarColor">@color/ev_background</item>
<!-- Material3's "on surface" is a grey-mauve that is comfortable indoors and
too weak in full sun: a hard contrast is imposed instead. -->
<item name="colorOnSurface">@color/ev_text_primary</item>
<item name="colorOnSurfaceVariant">@color/ev_text_secondary</item>
<item name="colorOnBackground">@color/ev_text_primary</item>
<item name="colorOutline">@color/ev_outline</item>
<item name="android:textColorPrimary">@color/ev_text_primary</item>
<item name="android:textColorSecondary">@color/ev_text_secondary</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.EV.Dialog</item>
</style>
</resources>