Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion .github/scripts/install-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,71 @@ enhanced_unconfirmed() { # $1 style
if [ $ok = 1 ] && grep -q "unconfirmed" "$OUT/ui-unconfirmed-$slug.xml"; then log "enhanced unconfirmed ($1): shown"
else log "enhanced unconfirmed ($1): FAILED ($(tail -1 "$OUT/deep-unconfirmed-$slug.txt" 2>/dev/null | cut -c1-120))"; FAIL=1; fi
}
# The top bar on a 360dp-wide phone, where the app name, time and the car and style buttons are
# tightest, for the design check: the name and the time should be the same size and both whole.
shot_360dp() { # $1 style slug
local W; W=$(adb shell wm size | grep -o '[0-9]*x' | head -1 | tr -d x)
[ -n "$W" ] || return 0
adb shell wm density $((W * 160 / 360)); sleep 5; tap_tab Dashboard > /dev/null; sleep 1; scroll_top; shot "14e-360dp-$1"
adb shell wm density reset; sleep 5; tap_tab Dashboard > /dev/null; sleep 1; scroll_top
}
# The same in a style with a narrow heading font (Race telemetry's is condensed), with two cars set.
top_bar_360dp() { # $1 style
local slug; slug=$(echo "$1" | tr ' A-Z' '-a-z')
app_front; disconnect_app; close_trip || true
if tap_text "Style"; then sleep 1; for i in 1 2 3 4 5 6; do tap_text "$1" && break; adb shell input swipe 540 1800 540 700 300; sleep 1; done; sleep 3; fi
adb shell am force-stop $PKG; sleep 2
timeout 60 adb shell am start -W -n $PKG/.HomeActivity > /dev/null 2>&1; sleep 4
shot_360dp "$slug"
}
# Your cars (the car switcher), for the design check: debug builds are given two cars without the
# car sheet (demo_car, and demo_car_add to start a second car first). Then the car button's list,
# a switch to the other car, and Add a car closed without saving, which must leave both cars as they were.
car_switcher() { # $1 style, $2 "add" to also try Add a car
local slug; slug=$(echo "$1" | tr ' A-Z' '-a-z')
app_front; disconnect_app; close_trip || true
if tap_text "Style"; then sleep 1; for i in 1 2 3 4 5 6; do tap_text "$1" && break; adb shell input swipe 540 1800 540 700 300; sleep 1; done; sleep 3; fi
adb shell am force-stop $PKG; sleep 2
timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car Subaru,2018,Forester --ez demo_cars_clear true > /dev/null 2>&1; sleep 4
adb shell am force-stop $PKG; sleep 2
timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car Mazda,2006,Tribute --ez demo_car_add true > /dev/null 2>&1; sleep 4
adb shell am force-stop $PKG; sleep 2
timeout 60 adb shell am start -W -n $PKG/.HomeActivity > /dev/null 2>&1; sleep 4
tap_tab Dashboard > /dev/null; sleep 1; scroll_top; shot "14a-car-button-$slug"
if [ "${2:-}" = add ]; then shot_360dp "$slug"; fi
local ok=0
if tap_id carSwitchButton; then
sleep 2; shot "14b-your-cars-$slug"
adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-cars-$slug.xml" 2>/dev/null
if grep -q "2006 Mazda Tribute" "$OUT/ui-cars-$slug.xml" && grep -q "2018 Subaru Forester" "$OUT/ui-cars-$slug.xml" && tap_contains "2018 Subaru Forester"; then
sleep 5; tap_tab Dashboard > /dev/null; sleep 1; scroll_top; shot "14c-switched-$slug"
adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-switched-$slug.xml" 2>/dev/null
grep -q "Chosen: 2018 Subaru Forester" "$OUT/ui-switched-$slug.xml" && ok=1
fi
fi
if [ $ok = 1 ] && [ "${2:-}" = add ]; then
ok=0
if tap_id carSwitchButton && sleep 2 && tap_text "Add a car"; then
sleep 2; shot "14d-add-car-$slug"
# Back closes the car sheet without saving (a second Back only if the first just hid the keyboard).
adb shell input keyevent KEYCODE_BACK; sleep 2
tap_id carSwitchButton || { adb shell input keyevent KEYCODE_BACK; sleep 2; tap_id carSwitchButton; } && {
sleep 2; adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-cars-after-add-$slug.xml" 2>/dev/null
grep -q "2006 Mazda Tribute" "$OUT/ui-cars-after-add-$slug.xml" && grep -q "2018 Subaru Forester" "$OUT/ui-cars-after-add-$slug.xml" \
&& ! grep -q "Car not chosen yet" "$OUT/ui-cars-after-add-$slug.xml" && ok=1
adb shell input keyevent KEYCODE_BACK; sleep 1
}
fi
fi
if [ $ok = 1 ]; then log "car switcher ($1): OK"; else log "car switcher ($1): FAILED"; FAIL=1; fi
}
if adb shell dumpsys package $PKG 2>/dev/null | grep -m1 "pkgFlags=" | grep -q DEBUGGABLE; then
enhanced_unconfirmed "Pit lane"; enhanced_unconfirmed "Asphalt"
car_switcher "Pit lane"; top_bar_360dp "Race telemetry"; car_switcher "Asphalt" add
# Back to no car chosen, as the rest of the tour expects.
app_front; disconnect_app; close_trip || true
adb shell am force-stop $PKG; sleep 2
timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car none > /dev/null 2>&1; sleep 4
timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car none --ez demo_cars_clear true > /dev/null 2>&1; sleep 4
# Diagnostics lays out its sections before that extra clears the car, so Car and connection
# (open while no car is chosen) started closed: open the app once more with no car chosen.
adb shell am force-stop $PKG; sleep 2
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Every change to OBD2 Reader, newest first. Each GitHub release shows the entry for its version.

## 2.5.25 (1 December 2026)
- **Switch between your cars.** A new car button at the top of the home screen, next to the style button, lists your cars. Tap one to switch to it, and the app takes that car's own settings: the car itself, where it was sold, its protocol, its VIN if you typed one in, the adapter you use with it, and its Dashboard tiles, graphs, custom readings and Android Auto readings. Units and styles stay the same for all your cars. **Add a car** opens the car sheet for the new one; **Edit cars** gives a car a nickname or removes it. Code history was already kept for each car. Suggested by a user with five cars.
- **Backups keep all your cars.** A backup now holds each car's settings too, with each car's VIN only if you choose to include it. A Bluetooth adapter stays on the phone it was paired with, as before.

## 2.5.24 (1 December 2026)
- **Transmission temperature for Nissan and Infiniti.** Enhanced diagnostics now shows the CVT or automatic transmission fluid temperature on Nissans and Infinitis that give it, from the transmission computer on most cars up to about 2020, and on the 2021 and later X-Trail (Rogue).
- **Transmission and oil temperature for Hyundai, Kia and Genesis.** Enhanced diagnostics now shows the transmission fluid temperature on older and newer models, and the engine oil temperature.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ After the first time, it reconnects by itself. Help is also inside the app, unde
- **Deeper checks:** readiness monitors, self-test results, and codes from ABS, power steering and other modules (on CAN cars, and on 1996–2007 Fords and Mazdas). Airbag modules are never asked. On Fords and Mazdas it can also read the second network on pins 3 and 11, with adapters that support it such as OBDLink MX+. On 1996–2000 Volvo 850, S70, V70, C70 and XC70 it reads Volvo's own modules and the true mileage stored in the instrument cluster.
- **VIN:** reads your car's VIN. You can enter the one on your plate if they differ. **VIN details** shows the model, trim, body, engine, drive, transmission and where it was built, from NHTSA's vPIC data inside the app, and can fill in your car choice from it. **Hide VIN** (hidden by default) keeps it off the screen, reports, shared files and logs, or hides just the last six characters. Tap the hidden VIN to see it on screen; tap again to hide it.
- **What your car reports:** every reading your car offers, grouped by part of the car with its value now.
- **Your cars:** add each car you own and switch between them with the car button at the top of the home screen. Each car keeps its own adapter, protocol, Dashboard tiles, graphs and readings; units and styles are the same for all.
- **Back up and restore:** settings, history and recorded drives in one file you keep, to move to a new phone. Routes and VIN only if you choose.
- **Record and replay:** save what your car answers to the app's requests in a plain text file on your phone (VIN left out unless you choose to show it), then replay it later without the car, like the demo car. Handy for bug reports.

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/obdreader/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ open class MainActivity : AppCompatActivity() {
// And about once a day in the background, so a new version is announced even when the app isn't open.
com.obdreader.app.session.UpdateCheckJob.schedule(applicationContext)
findViewById<View>(R.id.themeButton).setOnClickListener { showThemePicker() }
findViewById<View>(R.id.carSwitchButton).setOnClickListener { showCarSwitcher() }
shrinkClockAmPm()
findViewById<View>(R.id.logShare).setOnClickListener {
offerFile(Exports.adapterLog(this, ObdSession.fullLog(), ObdSession.state.value), "OBD2 Reader adapter log")
}
Expand Down Expand Up @@ -1073,6 +1075,7 @@ open class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
startStyleWatch()
updateCarSwitch() // the adapter shown for the chosen car may have changed while connecting
showBatteryNight() // the overnight readings may have moved on while the app was away
Updater.showPrompt = { confirm -> showInstallPrompt(confirm) }
Updater.waitingPrompt?.let { Updater.waitingPrompt = null; showInstallPrompt(it) }
Expand Down
16 changes: 13 additions & 3 deletions app/src/main/java/com/obdreader/app/MainCar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,20 @@ internal fun MainActivity.updateCarSetting() {
val car = savedCar()
carSetting.text = car?.label ?: getString(R.string.car_not_set)
findViewById<View>(R.id.carExpect).visibility = if (car != null && CarSupport.expectations(car).isNotEmpty()) View.VISIBLE else View.GONE
updateCarSwitch()
}
/**
* Debug builds: the test tour chooses a car without the car sheet ("Subaru,2018,Forester"), so it
* can check readings only some cars get, or clears it again ("none"). Commas, because adb passes the
* can check readings only some cars get, or clears it again ("none"), and the car switcher gets two
* cars to list (demo_car_add, demo_cars_clear). Commas, because adb passes the
* extra through a shell, where "|" would split the command. Release builds ignore it.
*/
internal fun MainActivity.demoCarIfAsked(intent: android.content.Intent?) {
if ((applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) == 0 || intent?.hasExtra("demo_car") != true) return
// demo_cars_clear empties the list of cars first; demo_car_add starts a new car (as Add a car does) for demo_car to fill in.
if (intent.getBooleanExtra("demo_cars_clear", false)) prefs.edit().remove(com.obdreader.app.obd.CarProfiles.PREF).remove(com.obdreader.app.obd.CarProfiles.ACTIVE).commit()
if (intent.getBooleanExtra("demo_car_add", false)) com.obdreader.app.session.CarGarage.addCar(prefs)
intent.removeExtra("demo_cars_clear"); intent.removeExtra("demo_car_add")
val parts = intent.getStringExtra("demo_car").orEmpty().split(",").map { it.trim() }
intent.removeExtra("demo_car")
val year = parts.getOrNull(1)?.toIntOrNull()
Expand All @@ -92,10 +98,12 @@ internal fun MainActivity.demoCarIfAsked(intent: android.content.Intent?) {
}
/** No car chosen yet, and the user hasn't said theirs isn't listed. */
internal fun MainActivity.needsCar(): Boolean = savedCar() == null && !prefs.getBoolean(PREF_CAR_ASKED, false)
internal fun MainActivity.showCarPicker(firstRun: Boolean = false, prefill: VehicleCatalog.Car? = null, onDone: (() -> Unit)? = null) {
/** [onCancel] runs when the sheet is closed without Save or Clear. */
internal fun MainActivity.showCarPicker(firstRun: Boolean = false, prefill: VehicleCatalog.Car? = null, onDone: (() -> Unit)? = null, onCancel: (() -> Unit)? = null) {
val sheet = BottomSheetDialog(this)
carPickerShowing = true
sheet.setOnDismissListener { carPickerShowing = false }
var answered = false
sheet.setOnDismissListener { carPickerShowing = false; if (!answered) onCancel?.invoke() }
val view = layoutInflater.inflate(R.layout.sheet_car, null)
view.applyTitleFonts()
if (firstRun) {
Expand Down Expand Up @@ -195,6 +203,7 @@ internal fun MainActivity.showCarPicker(firstRun: Boolean = false, prefill: Vehi
refreshResult()

view.findViewById<View>(R.id.carSave).setOnClickListener {
answered = true
val car = carNow()
prefs.edit()
.putString(PREF_CAR_MAKE, car.make)
Expand All @@ -220,6 +229,7 @@ internal fun MainActivity.showCarPicker(firstRun: Boolean = false, prefill: Vehi
if (!showExpectations(car, after)) after()
}
view.findViewById<View>(R.id.carClear).setOnClickListener {
answered = true
prefs.edit().remove(PREF_CAR_MAKE).remove(PREF_CAR_YEAR).remove(PREF_CAR_MODEL).remove(PREF_CAR_ENGINE)
.putBoolean(PREF_CAR_ASKED, true).apply()
updateCarSetting()
Expand Down
Loading