Repository navigation
The gear reading on every car: straight from the car's system service when the map has none - #489
Open
VysseCodes wants to merge 1 commit into
Open
VysseCodes wants to merge 1 commit into
VysseCodes wants to merge 1 commit into
Conversation
… when the map has none
HMG-API read "in P" through the hook map's framework.system_service.gear_p_status,
so a car with no map had no gear reading. That point is a stock Binder service:
com.hkmc.micom.system (com.hkmc.Service.SYSTEM_SERVICE), ISystemService
.getGearPStatus. Its transaction number is 36 (0x24) in all 21 stock frameworks
we have (Kia and Hyundai; US, CA, KOR; 250818 to 260903; the Ioniq 6 too), and
its implementation (SystemService) returns a field with no permission check.
Hub.gearP: the map's point when there is one, else a direct transact on that
service (no map, hook or patched file). read("gear.park") and the commands'
park() use it, also with no map. lib.sh stock_gear_park reads the same with
toolbox's service call, for the installer and boot scripts when the vehicle
service isn't running: 1, 0, or nothing.
Tested off-car: install/common/test.sh (stock_gear_park: P, not P, no service,
a failing call), commands-test.sh (212), homewifi-test.sh (157); javac clean.
Not on a car yet: service call com.hkmc.micom.system 36 in P and in D.
VysseCodes
added a commit
that referenced
this pull request
Dec 2, 2026
With no gear reading, an error or hmgapid not answering, the app could open mid-drive. It now opens only on gear.park 1 from HMG-API's vehicle service or, when that gives no reading, a 1 from the car's own system service (lib.sh stock_gear_park, #489: no map needed, so cars without a map get it too, used once the installed lib.sh has it). "Not in P" from the vehicle service wins over the other. Otherwise it waits, and tries again at the next start. Tested off-car: install/common/test.sh in sh and bash (no reading at all: not opened; the car's service P / not P; the vehicle service's "not in P" wins).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
HMG-API reads "in P" through the hook map (
framework.system_service.gear_p_status). A car with no map, like the US EV6 on 260903 before #488, has no gear reading at all. That leaves two things with nothing to go on:Finding
That point is a method on a stock Binder service, not obfuscated app code:
com.hkmc.micom.system(com.hkmc.Service.SYSTEM_SERVICE), interfacecom.hkmc.micom.ISystemService, methodgetGearPStatus(), 1 in Pframework/automotive.odex): Kia and Hyundai; US, Canada, Korea; builds from 250818 to 260903, the Ioniq 6 included; the same 100-method interface everywhereautomotive-service.odex,SystemService.getGearPStatus) returns a field (mGearPStatus), with no permission checkSo any root or system process can read it with
service call com.hkmc.micom.system 36, with no map, no hook and no patched file. It's a read through the car's own service, as the project's rules ask for vehicle access.Change
Hub.gearP()(vehicle service): the map's point when the map has it, else a directtransact(36)on the stock service.read("gear.park")and the commands'park()use it, with or without a map, sohmgapid vehicle gear.parkanswers on every car.lib.shstock_gear_park: the same reading with toolbox'sservice call, for the installer and boot scripts when the vehicle service isn't running (early in boot, or no mod reading the car). It prints1,0, or nothing for no reading.Fixes / unblocks
gear.parkreadings work on cars without a map (the gear half; power still comes from the map)Tested
Off-car:
install/common/test.sh:stock_gear_parkin P, not in P, the service not there, a failing call; it asks forcom.hkmc.micom.system 36core/runtime/commands-test.sh(212),core/runtime/homewifi-test.sh(157);javaccleanNot on a car yet. Before merging:
adb shell service call com.hkmc.micom.system 36once in P (expectParcel(00000000 00000001 …)) and once in D (… 00000000 …), on a car with a map and on one without.