View Single Post
      02-11-2022, 04:13 PM   #4127
RedErik
Colonel
RedErik's Avatar
Scotland
1024
Rep
2,367
Posts

Drives: E63 645Ci
Join Date: Oct 2019
Location: Inverness

iTrader: (0)

Garage List
2004 E63 645Ci  [0.00]
Quote:
Originally Posted by Pondaire View Post
Not a problem! We'll just continue the conversation here for people that are interested in it.

I had to roll back to the no-Xposed system version because of the delayed boot. I just could not take it anymore lol.
Dexpatcher is not an option, since I cannot figure it out either, so what I'm going to do is try and attempt to patch things through smali. It's been a while, but I should be able to "noop" (block out/replace) specific functions/methods.

In regards to the iDrive keyboard. I have figured out something that kind of works, so you don't necessarily need to change anything. I was able to create a profile on Tasker that does a few things:

This works by reading the logcat. There is a message that says something like "iCanCar_button == x" from EventService, where x is a number for the specific button. If you rotate the button clockwise (CW), it will be different than counter-clockwise (CCW), left, right or push.
If you rotate 1x CW, 1x CCW, 1x CW, 1x CCW in this specific order within 0.7 seconds, it will launch the "recent apps". If you do it again, it will click recent apps again (thus going to the "last app")
If you rotate 1x CW, 1x CCW, 1x CW, 1x CCW, 1x CW in this specific order within 0.7 seconds, it will launch the "split screen" feature.
It uses the "Autoinput" plugin to know when the keyboard is out, or text entry element is selected. You can probably do it without this plugin, but being that you can get it for free after a day or two, it's just the easiest way to do it.
Once the keyboard is out, it uses a java function from the Google API to send DPAD events. It uses android.permission.INJECT_EVENTS for this. Only some (system) apps are allowed to use this, but the easiest way is to use Lucky Patcher to enable all the "Patch to Android" signature verification bypass.
Then the Tasker profile is exported as an app through "App Tasker Factory". In the options to export it, you can add permissions, and that's when you add the android.permission.INJECT_EVENTS. This way you don't need to modify the main Tasker app.

Link to the tasker profile is shown below and also attached to this post. If you use the one in this post, make sure to change the extension of the file from .txt to .xml (I couldn't upload it otherwise).
Profile Tasker
Nice work! And kudos to you for attempting smali modification.

As for the keyboard I still want to implement BroadcastRecevier so the keyboard reacts to your controller natively without any delay. This also ensure that the app is user friendly and it only require one toggle in setting to enable that for anyone using similar unit to yours.

You don't have to necessarily use Autoinput plugin to know what's going on with my keyboard. I've implemented Broadcast service that any app can pick up to find out what's going on:

There are for states:
`rotary keyboard` - keyboard open in rotary mode
`touch keyboard` - keyboard open in touch mode
`hidden` - keyboard closed (hidden)
`destroyed` - keyboard service stopped app needs to be relaunched
Package name is `com.rederik.idrivekeyboard`
Intent `com.rederik.idrivekeyboard.KEYBOARD_STATE_CHANGE`

I will try to work on update this weekend to implement support for your unit.
Appreciate 1