yashsingh1/xdaforums huggingface dataset:
[FYT Android Head Units] surfer63:
I did not test the root method yet. I built in the same function from https://stackoverflow.com/questions/20932102/execute-shell-command-from-android/26654728 like you did, but I also made a normal shell function as I don't think I do need the rooted function. (I made a rootExec, like your sudo, and a shellExec).

As mentioned: I had an error in the ACC_ON/OFF events. When applying the same scripts/commands to one of the buttons (NAVI/BAND/MEDIA) it works fine (for any button of course).

But I need to test and it's freezing here, and it will continue freezing even harder here for the next week. I have already Vysor installed on my unit and in my laptop browser, but when freezing the battery gets drained very fast.

I have been thinking of hooking up my batttery loader on "slow load" via a long extension wire, but I still need to push buttons to test, and switch on/off the contact.

I uploaded my last untested changes to github, and you can find an untested apk here.

It contains:

an altered bt_phone button hook (your option)

reduced number of call methods (pkgname, intent and system call)

altered ACC_ON/ACC_OFF/RESume calls.

First (out-commented) changes for using an "installed apps" dropdown list to pick your app from.

Added a last Info/About screen in the Settings.

Wishes/ToDo:

I also want some kind of rotating function for the SRC/MODE button, but for the time being a script setup the same way as Gustdens script, for multi-tap, also works via a system call.

Write a HowTo page of the options and make it also accessible from the Info/About settings screen.

Add navi_app and player_app hooks be able to specify any application instead of the internal assets navi_app.txt and media_player.txt

If the ACC_ON/OFF events now work I will push a version 1. to the Xposed module repository, just like I did for the nokill and the sofiaservercustomkeymod.
[FYT Android Head Units] tOz666:
ACC_ON/OFF works now for me! using my scripts on /data I could turn off/on the button leds and pause/unpause music.
[FYT Android Head Units] surfer63:
Great to hear. I assume you now use an "ACC_OFF" script with something like

#!/system/bin/sh
input keyevent 127
echo -n "h" > /sys/fytver/colorled

Could you also try something like a system call without a script but with direct commands as the string, like:

input keyevent 127; echo -n "h" > /sys/fytver/colorled

I made it so that the ";" is the string separator (as it is the command separator anyway in a script). You can give multiple commands that will be executed that way (I hope :))
[FYT Android Head Units] tOz666:
Yes, that was my exact same script.

And, with direct commands it also worked :)
[FYT Android Head Units] surfer63:
:good:

Thanks again for testing

Just released to my repository which means it can be installed from my JET apk. (But I will now also create the entry in the Xposed global repository)

Changelog:

ACC_ON / ACC_OFF / RESume repaired.

Expanded the system call. It can be used with a single direct command, a number of commands or a script (see post 2) for a mini HowTo.

Changed some texts in the script to make the terms a little more understandable (I hope)

(And if you want you can still translate it in your own language: see here)
[FYT Android Head Units] tOz666:
Done, submitted a translation to Castilian Spanish (Spanish from Spain) :)
[FYT Android Head Units] surfer63:
Thanks a lot. I added it to the repository (same as my own Dutch translation :))

I just added a new option tonight resulting in 6 new strings.

A lot of people (including myself) hate it when the canbus overlay displays upon an airconditioning change. I created an option to disable that. Same for "open doors" although that one is quite useful (I think).

Anyway, six new strings. I do not know whether you want to translate them, but they are already in the strings.xml in the (new) values-es folder.

I wait a little before releasing the new apk (not to put pressure on you, but just in case).
[FYT Android Head Units] tOz666:
Done, my car doesn't have Canbus so I don't know much about what kind of overlay you mean, I assume it's a kind of like an annoying banner displayed so I translated it as that.

I'm uploading it right now.
[FYT Android Head Units] surfer63:
Thanks. Late already. Will release a new apk tomorrow.
[FYT Android Head Units] tOz666:
No problem, glad I could help!
[FYT Android Head Units] wanb1i:
Recents List Scroll

Surfer, I know your plate is full, but I wanted to ask you how difficult it would be to scroll thru the Recents list using a key on the SW. For example. In Android (like windows) I can use Alt Tab to pull up the list of open applications and by holding the Alt key, I can scroll through the list by hitting the Tab key until I pull the one I want to the foreground whereby releasing the Alt key switches to that app.

I would love to see that functionality with a SW key using, say, the Next/previous key to scroll forward or back while also holding, say, the Mode key.

Is this something that could be done, assuming your skill level?
[FYT Android Head Units] gtxaspec:
suggestion, in the information screen, could you add a date and or version number for the builds included in JET?

thx
[FYT Android Head Units] surfer63:
My skill level is pretty low :)

I really have no idea. It requires capturing the function behind the "rectangle" button in the top-right of the systemUI. If it is possible to do this, it should be possible to hook it to one of the "normal" hardware or steering wheel buttons.

BUT I think it will be impossible to hook it to the Next/Previous key in case you have a CANbus. These back/forward/fast-back/fast-forward keys are normally integrated into the Can bus control via the MCU. There is no way to modify this.

Anyway, I will have a look at it. Probably next weekend.

As you say: I have currently more things on my plate.. The SofiaServer has these navi_app.txt and player_app.txt internally that decide which app will get audio focus when "talking" (navi_app) and which apps are players and need to "volume decreased" as well when such a navi app is talking. The SofiaServer lacks this and the solution until now is that we modified these assets files (I added about 20 navi apps and about 10 player apps, but there are more exotic versions possible).

A user should be able to do that him/herself without anyone touching the SofiaServer apk.
[FYT Android Head Units] wanb1i:
Ok, thanks for having a look. My thoughts were more around emulating the Alt Tab keyboard functions, since those are known entities, rather than capturing the touch functions, but I don't know what I'm talking about when it comes to programming anything. ;)
[FYT Android Head Units] btrax:
Hey !

I wonder how can we know the number of the key pressed ? For Example on My VW I have the button for voice recognition but for the moment it's connected to the mute function. I want to link with the google voice search. How can I do that ? :)
[FYT Android Head Units] surfer63:
I do not have steering wheel buttons, but on my repository's Readme are the currently known keys. (Note that this was joint effort of Gustden with other users).
[FYT Android Head Units] btrax:
These keys are from the Head Unit, not the steering wheel buttons, isn't it ?

Is there a way to find the other ? Like a log cat for buttons ? ( I'm certainly not a programmer or a dev but I can do some trials to help ^^ )

Cheers :)
[FYT Android Head Units] surfer63:
Release 1.1 of XSofiaTweaker

Added Spanish translation (by tOz666) and Dutch translation.

Added options to disable CANbus overlay on heating/airconditioning change or door opened (untested; no canbus)

Modified BT/phone button hook (gtxaspec)

Can be downloaded and installed from the Xposed Installer.
[FYT Android Head Units] christian51:
Bluetooth pairing problem

Hello Surfer63,

Is there a way to pair a Bluetooth OBD device (OBD-MX)?

When pairing, the MX always offers a random 6 digit pairing code from the OBD device. When I try to confirm this code, the pairing aborts.

I am working on a Joying UMS03N with the GTX-ROM 5009_gtx_V7.
[FYT Android Head Units] surfer63:
I sure think there is a way to pair a Bluetooth OBD device, but I currently don't know how.

Months ago Treel made a modified BT app that allowed to pair "everything". Treel shared his code Yesterday evening with me.

I will examine his code.
[FYT Android Head Units] gtxaspec:
It really seems to vary by device, I have a generic adapter that pairs fine, and my Nexus 6p pairs using a generated pin as well.

---------- Post added at 08:05 PM ---------- Previous post was at 07:54 PM ----------

The SWI buttons via canbus are assigned buttons in Sofia server, they vary by vehicle, but they can all be hooked, just have to figure out what each one on your wheel specifically does. Example, Every button on my wheel does something, and I have remapped them using Sofia tweaker.
[FYT Android Head Units] surfer63:
Do you mean you "discovered" all the SWI keys and mapped these?

If you do mean that, can you share your code changes in a pull request?
[FYT Android Head Units] gtxaspec:
they work by default on the stock joying firmware. On some vehicles I have noticed the buttons on the wheel are assigned buttons that have no function on our units, so if you hook them, they will work, same thing as making the DVD and eject buttons. Those are functional keys, just "invisible" on our units due to vendor customization. If you look at the methods in bsp.key or something like that, you see a whole bunch of key names. Ideally, to cover ALL the weird units that have different buttons ( on their website, they had some units that had TONS of buttons on the front, numbers 0-9, brightness icon, etc.) each button method should be hooked. It's just nice to have someone who has all those buttons to test, and if we don't kind of hard to verify if it works.

I hope I am making sense

next, on the old sofiaserver mod, we were able to hook the TRACK REV and TRACK FWD buttons. Would be nice to add to the to do list if you have time, i think this would hook one of the knob's as well.

one last question, on the USB DAC mod, was anyone able to test? that hooks the volume knob correct?
[FYT Android Head Units] gtxaspec:
hi [MENTION=2550900]surfer63[/MENTION], just tested the latest build from the xposed store. When using the bt_phone key, it seems to launch whatever is set from the navi key entry:

02-28 13:38:55.099 2771 2871 I Xposed : XSofiaTweaker mcuKeyBtPhone pressed; bt_phone_call_option: pkgname bt_phone_call_entry : com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearchActivity

02-28 13:38:55.100 2771 2871 I Xposed : XSofiaTweaker WhichActionToPerform: Call method: pkgname actionString: com.waze

02-28 13:38:55.107 2771 2871 I Xposed : XSofiaTweaker startActivityByPackageName: com.waze

prefs:

<string name="navi_key_entry">com.waze</string>

<string name="bt_phone_key_entry">com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearchActivity</string>

haven't looked over the source yet as i am on mobile.

edit: on pc now, line 192 of XSofiaTweaker.java

bt_phone_call_option = sharedPreferences.getString(MySettings.BT_PHONE_CALL_OPTION, "");

bt_phone_call_entry = sharedPreferences.getString(MySettings.BT_PHONE_CALL_ENTRY, "");

XposedBridge.log(TAG + " mcuKeyBtPhone pressed; bt_phone_call_option: " + bt_phone_call_option + " bt_phone_call_entry : " + bt_phone_call_entry);

whichActionToPerform(context, navi_call_option, navi_call_entry);
[FYT Android Head Units] surfer63:
sorry. that is really stupid. One set of copy&paste not correctly covered.

I will upload a corrected version tomorrow morning.
[FYT Android Head Units] gtxaspec:
Quite alright I've made plenty of those also =D. Again, thanks for the contribution and work in the community! I updated my previous post with some more Q's if you haven't reloaded yet. Thx!
[FYT Android Head Units] PuntoGT16VT:
First thanks for the work in the community :good::good:

I have a question maybe its the wrong thread. :confused:

I have a 8" single-din Joying Unit and when i drive its some times very difficult to controll the volume.

Is it possible to control Volume Up, Volume Down with Tasker?

I like to map volume up/down to a hardware keyboard key. Im actually experiment with a OEM HU controller from BMW.

I dont have steering wheel buttons in my car :(

Again thank for your work guys :good::good:
[FYT Android Head Units] dyabolikarl:
Do the 1234 pairing trick (ignore the pairing pin) it worked for my odblink. Running custom V5 atm
[FYT Android Head Units] surfer63:
XSofiaTweaker, 01 March 2018, Version 1.11

- bigfix: bt_phone button function used wrong key to call action to be executed

- functionally identical to 1.1

====

Weird issue with Xposed Installer.

When I myself wanted to download the 1.11 from Xposed Installer, it was still stuck at Version 1.0, not even Version 1.1. I did a full reboot, and a few more checks but it stayed at Version 1.0.

Then I went into Android settings (not the Xposed installer settings), stopped Xposed Installer from the Android Settings, Removed data, and rebooted.

Now it shows 1.0, 1.1 and 1.11.

Other people also experiencing this issue? And have a better workaround then my blunt removal action?

I did already some googling and some older Xposed versions did not updated the "download" section as well.
[FYT Android Head Units] surfer63:
I don't know about tasker.

What do you mean with the BMW controller? Does it work via Bluetooth, or USB, or 433MHz units via receiver and resistance on the key1/key2/ground wires?
[FYT Android Head Units] gtxaspec:
I had the same issue, rebooting fixed it for me.
[FYT Android Head Units] btrax:
For probing the button, is it possible to use or develop something like the CarService app used on MTCB HU ? https://xdaforums.com/android-auto/...setting-steering-wheel-controls-want-t3343676

Maybe the dev of CarService can help you...
[FYT Android Head Units] gtxaspec:
No, software is totally different. What I will do is test using the input command line tools and use track back/next and see if it exhibits similar behavior, or not. then we will know if it's the sofiaserver redirecting the buttons incorrectly.
[FYT Android Head Units] surfer63:
Aaaargh! :mad:

Simply tap-hold-drag down updates the download list.
[FYT Android Head Units] surfer63:
Gustden built this SofiaServer that had a debug option. It did list all pressed keys. lbdroid made exactly the same which logs to /sdcard/mcu.log.

lbdroids version is here: it is the MCUDEBUG version.

It might behave very strange on your unit as quite some things have changed since that version, but at least it allows to capture the keys. Note that I don't have steering wheel buttons so I can't test myself.
[FYT Android Head Units] PuntoGT16VT:
BMW iDrive Controller

[IMG="BMW iDrive"]http://www.morningtonbmw.com.au/_common/shared/newvehicles/5series/gran_turismo/2013/showroom/driving_assistance/idrive-touch-slide-1.jpg[/IMG]

I have a BMW iDrive Controller its worked over CAN bus. Its connected to a interface, they converts the CAN bus messages from the controller into USB keyboard keys. With tasker i bind the keys for example to launch a application.

With Tasker i can send also intents or shell commands.

Is there a command with which I can change the volume?
[FYT Android Head Units] christian51:
Bluetooth Paring Problem resolved

Hello Surfer63,

Through your reference to the contribution of treel, I have now done the coupling with my OBDLink MX adapter. I replaced the JY-1-C9-BT-V1.0.apk and then successfully paired 3368 with the Joying BT setting. Pairing with Android Settings-BT does not work with this method.

In the GTX-ROM V7, only the original Android setting is possible, not the joying settings. In your Joying_Extra_Tools43.apk I can not restore the joying settings unfortunately, is grayed out.

The Android settings on the GTX-ROM contain unnecessary settings for a CAR HEADUNIT, but important custom settings, such as daytime and nighttime display settings, are missing.

How could I get the joying settings back?

Thanks for your efforts
[FYT Android Head Units] gtxaspec:
Day time and night time settings? You can set these without the joying settings. Set the brightness when the headlights are on and it remembers. [MENTION=2550900]surfer63[/MENTION] what's the difference in the jy bt APK that treel made?
[FYT Android Head Units] surfer63:
I'm still trying to understand, but did not look extensively at it. I simply didn't have the time.

To quote Treel:

I also asked for the original apks to be able to do a "diff" on the java and smali code.

I will dive into it this weekend. Hopefully "something" can be hooked onto the Page_PopPwd and Page_Pair, but as said: I hardly looked at it yet.

And if someone else can do this: please be my guest :)
[FYT Android Head Units] christian51:
Hello GTXASPEC,

Unfortunately, the different brightness settings for day and night are not saved. After the display settings are exited and the headlights are switched on or off again, the brightness setting is unchanged as before.

Is not it possible to re-enable the Joying settings instead of the AOSP settings?
[FYT Android Head Units] surfer63:
But the display settings are set from the CarSettings apk, not from the Settings apk. So I really don't understand this topic at all.

And w.r.t. the joying settings: Yes, of course it is. I disabled that option in the JET apk for the GTX ROM as I could not imagine someone wanting to have the on-purposely crippled and limited Joying Settings back on the GTX Rom. But I can enable that button again.
[FYT Android Head Units] Lowen SoDium:
I have a problem with the GPS fix. With it enabled, my reported location is off by 20 feet or more, even when not moving. This causes Google Maps to think I am exiting the interstate even though I am not, every time I pass an off ramp.

Disabling GPS fix corrects the location.
[FYT Android Head Units] gtxaspec:
[MENTION=2550900]surfer63[/MENTION], which specific version of apk2java are you using? I see there are many repos.
[FYT Android Head Units] surfer63:
This one.
[FYT Android Head Units] gtxaspec:
hi [MENTION=2550900]surfer63[/MENTION], can you add this to your xposed app? this prevents the BT app from being forced to the top...

findAndHookMethod("util.JumpPage", lpparam.classLoader, "activityByIntentName", String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
String actionName = (String) param.args[0];
if (actionName == "com.syu.bt") {
Log.d(TAG, "bt intent received");
XposedBridge.log(TAG + " skipped com.syu.bt force launch");
param.setResult(null);
}
}
});

scratch that off the list... next is preventing radio form starting at boot...

how do you think we should handle the minimized bt interface, that's usually shown on the navi app? we could figure out how to force it to stay in "pip" (minimized) mode throughout every app, or launchable some how...right now it's this:

public static void btShowPip() {
broadcastCmd("com.syu.ms.bt", "cmd", 1);
serviceByIntentName("com.syu.bt.pip");
}

I'm uncertain if you could use a command line argument to launch this, or directly from somewhere else. What do you think?

edit:

this is better, it does stop the radio on BOOT and the bluetooth app forced on top:

findAndHookMethod("util.JumpPage", lpparam.classLoader, "activityByIntentName", String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
String actionName = (String) param.args[0];
if (actionName == "com.syu.bt") {
Log.d(TAG, "bt intent received");
XposedBridge.log(TAG + " skipped com.syu.bt force launch");
param.setResult(null);
}
else
if (actionName == "com.syu.radio") {
Log.d(TAG, "RADIO intent received");
XposedBridge.log(TAG + " skipped com.syu.radio boot launch");
param.setResult(null);
}
}
});
[FYT Android Head Units] surfer63:
I will have a look at it, but I have the flu since Saturday and I don't have the energy or concentration to do anything useful currently.
[FYT Android Head Units] dyabolikarl:
Make sure you have the correct version of gps fix installed i think the correct is 1.1
[FYT Android Head Units] Lowen SoDium:
Thanks for this. For anyone else with this issue, you have to get the updated version from the Joying Extra Tools from here: https://xdaforums.com/android-auto/android-head-units/joying-extra-tools-apk-apk-to-help-t3628200

I updated the GPS fix using that (because the update doesn't show up in the Xposed Modules) and reenabled it then rebooted. I think it has fixed my issue but I will test it more before I am sure.
[FYT Android Head Units] surfer63:
I am only allowed to upload my own modules to the Xposed repository.

The GPSSpeedFix is by lbdroid. It would be an infringement of authorship if I would upload it.

For that reason you will find it only in my JET apk, while the others are in the xposed repo.
[FYT Android Head Units] gtxaspec:
so in sofia server,

in module.bt.HandlerBt, I'm trying to hook "topChanged" to stop it from running, but keep getting method not found errors in xposed.

public class HandlerBt {
public static final ITopListener TL_BTPHONE = new ITopListener() {
public void topChanged(boolean flag) {
if (!flag && DataBt.sPhoneWork != 0 && DataMain.sHostBackcar == 0 && DataBt.jumpBtPage && !DataBt.jumpBtPageEnable) {
JumpPage.activityByIntentName("com.syu.bt");
}
}
};

not working:

findAndHookMethod("module.bt.HandlerBt", lpparam.classLoader, "topChanged", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
XposedBridge.log("Loaded app: " + lpparam.packageName + "stopping top changed");
Log.d(TAG, "stopping top changed");
param.setResult(null);
}
});

[MENTION=2550900]surfer63[/MENTION], or anyone, ideas?
[FYT Android Head Units] surfer63:
I have more or like the same problem for the mediakey rewrite.

I just picked it up today (after a few days delay in between) and I found this one which even more describes your problem than mine

https://xdaforums.com/xposed/development/xposed-access-variables-methods-t3649565

However, you don't need the inner methods variable. You simply want to skip that inner method. Maybe you need to do something like

Class<?> ProfileInfoClass = XposedHelpers.findClass("module.bt.HandlerBt",lpparam.classLoader);
XposedBridge.hookAllMethods(ProfileInfoClass,"topChanged",new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("Loaded app: " + lpparam.packageName + "stopping top changed");
Log.d(TAG, "stopping top changed");
param.setResult(null);
}
});

But that's just the advice from 1 noob java programmer (who actually does not really understand what he's doing) to another :confused: