[Android Head-Units] homer.ali:
Hi everyone,

I recently caved and bought one of the tesla style PX6 headunits from ali-express.

While the unit seems nice, it is unfortunately NOT an MTC head unit and so the mods that I had for my previous headunits do not work-- including the various steering wheel key mods out there.

As a result I started working on my own and have made quite a bit of progress, but I just need some help getting to the finish line.

Problem: factory steering wheel control app only allows for very limited actions in response to key presses.

Required end result: a user-customizable method of capturing steering wheel key presses and translating them into actions in android.

Current process in factory system: (fairly similar to the MTC headunits)

Key pressed on steering wheel ---> resistance value changes>>>MCU picks up this value and sends serial data to tablet--->App named "Eventcenter.apk" (com.szchoiceway.eventcenter) ---->protected method called startprocessCmdThread (runs on a loop and waits for serial data)----->private processCmd which then reads the serial data and determines (amongst other things) if it is a steering wheel command event---->private onCmdWheelEvent method which puts the byte data in an intent with action "com.choiceway.eventcenter.EventUtils.STEER_WHEEL_INFOR"

in the extras "EventUtils.STEER_WHEEL_INFOR_WPARAM" and "EventUtils.STEER_WHEEL_INFOR_LARAM"

where LPARAM is the actual byte data and wparam is either 4 or 3 (likely keydown vs key up event)

It then broadcasts this intent with permission: com.szchoiceway.permission.broadcast

This intent is picked up by the relevant "choiceway" app like for example the navisettings app which registers a receiver for this intent when you're in the steering wheel study activity and assigns the steering wheel key to one of very limited, pre-defined actions.

While listening for this intent would have been ideal to be able to assign your own actions to steering wheel key presses, unfortunately, the presence of a declared permission makes it impossible to do so without declaring this same permission in your app manifest. And since android 5.0, two apps cannot declare the same permission in their manifest unless they share the same signature.

As a result, in the process above the only solution i can see is either

1) we modify the relevant system apps to NOT require that permission when broadcasting an intent

or

2) create an xposed (or magisk?) module which hooks into the method calls above to capture the direct byte data being put into the intent extras and broadcast it's own intent/perform our desired system actions.

or

3) something else I haven't thought of

I have been trying to do this but have not been able to compile/sign any of the above mentioned apps after making my modifications.

I know xposed modules can do what i'm looking for but since this tablet runs android 9.0, it would have to use edxposed which i'm not as familiar with. Does anyone know if using edxposed is capable of hooking into the above method calls?

Alternatively can magisk modules hook into this method? I've never written a magisk module before so i'm not sure what the capabilities are.

Are there any other solutions you guys can think off in this process to getting this working?

thanks!