Files
mg4/release-notes.sh
TCFDONMEZandClaude 2fd7b2dde1 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>
2026-09-22 10:45:00 +03:00

62 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Extracts one version's section from CHANGELOG.md (Keep a Changelog format) for use
# as GitHub release notes.
#
# Usage:
# release-notes.sh <version> Section for "## [<version>]" — exact match, leading "v" stripped
# release-notes.sh --latest Section for the newest "## [" entry — used by the unstable
# channel, whose build version never matches a heading exactly
set -euo pipefail
changelog="${CHANGELOG_FILE:-CHANGELOG.md}"
[ -f "$changelog" ] || { echo "::error::$changelog not found" >&2; exit 1; }
mode="${1:?usage: release-notes.sh <version>|--latest}"
if [ "$mode" = "--latest" ]; then
want_latest=1
version=""
else
want_latest=0
version="${mode#v}"
fi
section=$(awk -v ver="$version" -v want_latest="$want_latest" '
/^## \[/ {
if (want_latest == "1") {
if (latest_started && latest_has_content) {
printf "%s", latest_section
latest_emitted = 1
exit
}
latest_started = 1
latest_section = ""
latest_has_content = 0
next
}
if (found) exit
prefix = "## [" ver "]"
if (substr($0, 1, length(prefix)) == prefix) found = 1
next
}
want_latest == "1" && latest_started {
latest_section = latest_section $0 ORS
if ($0 !~ /^[[:space:]]*$/) latest_has_content = 1
next
}
found { print }
END {
if (want_latest == "1" && !latest_emitted && latest_started && latest_has_content)
printf "%s", latest_section
}
' "$changelog")
# Trim leading/trailing blank lines.
section=$(printf '%s\n' "$section" | sed -e '/./,$!d' -e ':a' -e '/^\n*$/{$d;N;ba' -e '}')
if [ -z "$section" ]; then
echo "::error::No changelog section found for '$mode' in $changelog" >&2
exit 1
fi
printf '%s\n' "$section"