Skip to content

Commit 6aa0c53

Browse files
malysclaude
andcommitted
fix(battery): keep CP-087 stores through R8, Diagnostics stops crashing
BatteryDigestStore and AdviceJournal persist with Gson but had no keep rule. The minified build lost the envelopes' generic signatures, Gson returned LinkedTreeMap entries, and the Diagnostics report threw a ClassCastException as soon as a digest existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 08038dd commit 6aa0c53

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.
8181

8282
### Fixed
8383

84+
- **The Diagnostics page opens again on a release build.** The battery digest and the advice
85+
history (CP-087) were saved with Gson but had no keep rule, so the minified build read their
86+
entries back as maps and the report crashed as soon as a digest existed. Files written by the
87+
broken build are set aside once and a new history starts.
8488
- **The eco voice can be heard, and checked.** The coach now waits for the vehicle voice service
8589
to bind before speaking instead of asking it in the same instant it starts binding, and speaks
8690
on its own worker thread. Turning the voice on says a test line at once; if neither the car's

‎app/proguard-rules.pro‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,14 @@
3636
# where the capture and the trip history read fine. A validation drive costs a drive.
3737
-keep class com.evsuite.chargepilot.ValidationArtifact { *; }
3838
-keep class com.evsuite.chargepilot.ValidationArtifact$Answer { *; }
39+
40+
# CP-087's two stores, left out like CP-055's artifact was. Unkept, R8 dropped the generic
41+
# signature of each envelope's list, Gson read the entries back as maps, and the first one
42+
# touched threw a ClassCastException: the Diagnostics page died as soon as a digest existed.
43+
# The enums are kept too, since their persisted names are the schema.
44+
-keep class com.evsuite.hardware.telemetry.BatteryDigest { *; }
45+
-keep class com.evsuite.hardware.telemetry.BatteryDigestStore$Envelope { *; }
46+
-keep class com.evsuite.hardware.telemetry.CalibrationVerdict { *; }
47+
-keep class com.evsuite.chargepilot.AdviceEntry { *; }
48+
-keep class com.evsuite.chargepilot.AdviceKind { *; }
49+
-keep class com.evsuite.chargepilot.AdviceJournal$Envelope { *; }

0 commit comments

Comments
 (0)