yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] yuvalmesika:
Thanks gustden,

Any chance to have a version which not sending the BT call/hang buttons?

Or is there a way to keep the original BT call / hang function with the current launcher.sh?
[Android Head-Units] x3rb3ru$:
You're my hero Gustden!
[Android Head-Units] gustden:
It was built from the Sept 1 Joying code, which does have quite a few changes. It may work with other releases of the joying software, but I have no way of testing it.

The old Launcher.sh should work without issue.
[Android Head-Units] dyabolikarl:
Thanks mate. I will have to wait until someone confirms the bluetooth pairing hack works then i'll have to update from there :)
[Android Head-Units] sweetnothings:
are the codes for bt/ptt(28) and hang up(27) for all of you working? on my Joying they seem not to work.

it works when i use the combined ones with bt/ptt + prev and hang + next (87 and 88)

did anybody have this too?

[MENTION=3076686]gustden[/MENTION] i am also looking to pass the mute key with your script, do you catch this key? i tried the code one have mentioned here but had no luck with it.
[Android Head-Units] surfer63:
On my unit key 33 is not working. I will check tomorrow with the debug version from gustden and/or ibdroid if FYT somehow changed the keys, or that is unfortunately gustdens apk not working entirely correct.
[Android Head-Units] gustden:
[MENTION=2550900]surfer63[/MENTION]

Can you see if this one works for key 33? I have no way to test, since I don't have that button. If it looks ok, I will replace the one on the first page.
[Android Head-Units] gustden:
I am using the bt/ptt(28) and hang(27) and not having any issues with them.

10-06 16:47:48.325 869 1226 D MCUKEY : /data/launcher.sh 28

10-06 16:48:00.816 869 1226 D MCUKEY : /data/launcher.sh 27

As far as the 'mute' key, It is hardcoded in the MCU to mute the amp. Not much I can do with it.
[Android Head-Units] surfer63:
It's almost midnight here. I try tomorrow.

One thing I did try (remembered somewhat later) was starting a rooted terminal and use a "./launcher.sh 33" which did kick off my media player. The laucher script works and the key 33 is still the key 33.

Again: tomorrow morning I will test your attached apk.
[Android Head-Units] warata:
I am doing your keymod according to the first page, but since I have not succeeded yet, please help me.

I renamed launcher_simple.sh to launcher.sh and executed install.bat on adb. Then launcher.sh was created on the SD card.

But you said "The launcher.sh script must be placed in the /data directory ( /data/launcher.sh) "

Do I need to put launcher.sh to data folder manually after script execution?Or is install.bat not working properly?Am I misunderstanding?

Please teach me.

Best regard
[Android Head-Units] ste2002:
Short note on "mute" key on HUs with HW buttons: there is an overkill - one can mute sound with 3 (three!) different buttons. 2 buttons are on HU (volume knob can be depressed to mute, and another separate button with dashed speaker on it) and the 3rd one - on the steering wheel.
[Android Head-Units] surfer63:
Thanks. :good: That one is working.

It means that every user with a unit with hardware buttons for media needs to redownload your version once you changedit in post 1.

I can confirm that the key-delay seems to be gone.

Users using my JET-apk application: if you downloaded the 01 September custom-key-mod sofiaserver via my apk before this post: simply download the key-mods Sofiaserver again.

I also expanded the navi_app.txt with a few more.

I also added the most common media players to the player_app.txt. I have the idea that the mixing of navigation instructions with "registered" media players works better.

Both txt files are added to the SofiaServer distributed via my apk.
[Android Head-Units] KamaL:
I haven't checked this thread lately.

I'm still using an old lollipop rom since it is the only one supporting an app for my aftermarket dashcam.

Is there any reason why I should update to the newer roms?

Is auto Bluetooth tethering working fine?

Thanks
[Android Head-Units] surfer63:
If you want to continue using your aftermarket dashcam: don't upgrade (I assume you are using the 5.1 ROM of 16 December or older?)

I'm an infrequent user of bluetooth. For me it works OK, but I'm not a representative user.
[Android Head-Units] KamaL:
Since the dashcam is of low quality, I might buy a new dedicated one anyway.

But are there any new features or better stability that are worth the update?

I'd appreciate to know if anyone is using Bluetooth tethering on a daily basis
[Android Head-Units] gustden:
The install script should put "launcher.sh" in the /data directory. You can check using adb.

> adb connect {IP Address}

> adb shell

> su

> ls -l /data/launcher.sh
[Android Head-Units] gustden:
I use Bluetooth tethering constantly and there is one minor issues with 6. My phone will connect fine with tethering first, then my ODBII connects afterwards. Once the ODBII connects, the unit is still tethered to my phone, but the data connection is dead until I toggle tethering off and back on ( on the head unit ). This does not always happen, but is a bit annoying. If I wait until the ODBII connects then turn on my phone bluetooth, I don't have an issue.

It seemed to start about the time I upgraded my phone earlier this year, so I have no idea if this is a 6.0 issue or phone issue. I really don't see any advantages of 6 over the last stable 5.11 release.
[Android Head-Units] gustden:
Thanks for confirming the fix. It was a careless mistake on my part, bad copy paste :(

I updated on the first post with the fixed version, and also included the latest navi_app.txt and player_app.txt that you posted.
[Android Head-Units] sweetnothings:
Ok let me explain this a bit more.

- with original sofia server bt(28) and hang(27) work as expected: bt/ptt starts joying BT phone app, and in the app initiates a dialed call and hang does end the call

- with no kill only mod it works exactly the same as with original

- but if i use the mod with launcher script (even with key 27 and 28 simply passed through as keyevent) Joying BT app does not start and in app there is no dial or hang up function. but i can assign other functions to these buttons in script that works.

- if i assign my steering wheel buttons to combined function buttons bt/prev(88) and hang/next(87) - still using mod with launcher script - they get catched by the joying bt app as expected (hardcoded in app) and in other apps i can assign functions in launcher script too.

- sending keyevent 27 and 28 or 87 and 88 from script does nothing, what i didnt expect any other, because of hardcoded keys in joying apps.

so is there any difference in your mod which you are aware off between key27/28 and key87/88?

it does look for me that in case of 27/28 the keyevent is somehow catched and forwarded to the script but consumed/canceled in sofia server so they dont reach joying apps while 87/88 are consumed by joying apps and if not, they are forwarded to the script.

in case of mute function, i dont kneed to catch mute key, but does anybody know a keyevent or other shell command that does trigger the mute function?
[Android Head-Units] akuma148:
Can you add PlayerPro to the player_app list, the id is "com.tbig.playerpro"

Thank you for the great work!
[Android Head-Units] gustden:
The BT / Hang buttons send 27/28 respectively at all times. The buttons that perform the bt/-> and hang/<- should now behave the same as stock, and not send anything to launcher.sh. With the latest version, none of the media keys are sent to the launcher.sh script.

In previous versions, the bt/-> and hang/<- did send 87/88, when not in a joying app. Personally, I do not use these keys, as when in the radio they do not move the tuner to the next or back programmed station, but move the frequency up and down.

I don't know of any way to send a keyevent or shell command to perform a mute of the system. The mute on these is controlled withing the MCU and does not use the standard mute functions within android.
[Android Head-Units] sweetnothings:
Thanks for the explanation.

seems that i first need to update to the newest rom and check if keys 27 and 28 are still not working for me.

Is it possible that you list all keyevent codes that are sent to the script? not sure if i got all of them.
[Android Head-Units] gustden:
Here is the list of the codes sent to launcher.sh . The attached image shows the soft key codes:

KEY CODE - BUTTON - Type

9 - NAVI ( Steering wheel softkey / On unit hard key )

27 - CALL/BT PHONE ( Steering wheel softkey )

28 - HANG/CALL END ( Steering wheel softkey)

31 - DVD ( On unit hard key )

32 - EJECT ( On unit hard key )

33 - MEDIA ( On unit hard key )

34 - BAND ( On unit hard key )

37 - MODE/SRC ( Steering wheel softkey / On unit hard key )

97 - ACC_ON ( good place to add "Play" )

98 - ACC_OFF ( good place to add "Pause" )

99 - RESUME/RESTORE from suspend
[Android Head-Units] Logicsystem360:
Upgraded to 1sept version and tested the V6.4, the delay on input keyevent 85 has fall to 1 sec

That better than 3 sec !

But something is bothering me, for the physical button on the HU for play/plause I don't have delay but on my steering wheel I have 1 sec latency, why ?
[Android Head-Units] gustden:
Version 6.4 is not sending any of the media keys to launcher.sh. The pause/play on my steering wheel has almost no latency for me.

Are you using a CAN box? Does it have the delay when not using the custom key mod?
[Android Head-Units] Logicsystem360:
Yes CAN box.

Just to make sure I am fully understood

My steering wheel button : (bmw e46)

Vol button and prev/next are not modded and have not delay

In my case :

CALL/BT PHONE(27) = Speaker

MODE/SRC(37) = R/T

here my launcher.sh

#!/system/bin/sh

key=$1
case $key in
27)
service call statusbar 1
;;
9)
am start com.google.android.apps.maps/com.google.android.maps.MapsActivity
;;
37)
input keyevent 85
;;
32)
am start com.camsam.plus/de.blitzer.activity.SplashScreen
;;
34)
am start com.google.android.music/com.android.music.activitymanagement.TopLevelActivity
;;
*)
input keyevent $key
;;
esac
exit 0

Only those modded buttons have delay (except 27 because this command didn't have latency before)

and with stock sofiaserver, i don't have delay at all :)

Thanks for your time
[Android Head-Units] gustden:
The issue is the "input keyevent" takes ~2 seconds to execute ( twice as long as it did on 5.1.1 ) . "am start" is not any better.

When you use the CAN box, do you still map anything through the "steering wheel setup" screen?

If so, instead of mapping it to the 'SRC'/37 you could map it to the 'Pause/Play' which is not handled by the shell script, so it should execute much quicker.
[Android Head-Units] Logicsystem360:
Non it's mapped by default, the steering wheel setup is only for cars haven't CAN box i guess

have you put the apk source code on github ? I will try to hard code my mod into the app :good:
[Android Head-Units] gustden:
I don't have the source. The changes are all done directly in the smali code. If you use "apktool d {apkfile}" it will extract the smali code. The change should be easy then just repackage using "apktool -c b {directory}".

smali/dev/ReceiverMcu.smali:

From sending 37 to the launcher script:

.line 1218

:sswitch_39

const/16 v12, 0x25

invoke-static {v12}, Lmodule/main/HandlerMain;->onItemSelectedp(I)V

To invoking media key 85:

.line 1218

:sswitch_39

const/16 v12, 0x55

invoke-static {v12}, Lapp/ToolkitApp;->mediaKey(I)V
[Android Head-Units] newell63:
Hello.

For understand correctly....with this mod i can add or modify my steering wheel button (on audi a4) ?

Because i have 2 button don't work....

With the new version the delay is gone or still 2/3 sec ?

Thanks.
[Android Head-Units] gustden:
This mod allows you to change the functional of the steering wheel buttons. If 2 keys are not functioning, I am not sure if this would help, without more details.

There should be no delay when using the media key. For the codes sent to launcher.sh the delay is entirely dependent on what you have the keys set up to do.
[Android Head-Units] newell63:
Ok.

I have an audi a4, the scroll for (previous/left) work also like button if i push but nothing happen.

Without push scroll up is next, scroll down is previous.

Now if in the same time i keep the scroll button push and i scroll up or down i have 2 more action.

(It was like this with my pionneer)

Example with my old Pioneer on radio mod :

Scroll up = search new station frequency up

Scroll down = search new station frequency down

Push scroll = change band (fm1,fm2)

Scroll push and scroll up = next preset station

Scroll push and scrool down= previous preset station.

That's it i want to have back.

Now i just have the scroll up and down.

Actualy i'm on android 5.1.1 december 08 and i would update to july 6.0.1, but i've read that in android 6 with have a delay of 2/3 sec when press steering wheel button that is not present on android 5.1.1

Hope it's understandable....

Thanks
[Android Head-Units] Logicsystem360:
Thanks, so after few tests/research I have succeeded to have no latency with play/pause with this :

.line 1218

:sswitch_39

sget v3, Lmodule/main/DataMain;->sAppId:I

invoke-static {v3}, Lapp/ToolkitApp;->mediaPlayPause(I)V

There are one thing I don't understand, that the number switch

If I want to recode my other button switch 27, I have to recode the switch 29 in smali code ?

What are the connection betwen switch number in smali code and launcher.sh ?

Thanks.

I quickly took a look, maybe I will be able to recode the color of RGBs LED :confused:
[Android Head-Units] gustden:
The switch number in the smali code and the codes in launcher.sh are unrelated. The switch numbers seem to change quite a bit from release to release of the joying code.

If you are looking to modify the place where "27" is sent to launcher.sh, was done in a different file where I replaced a function.

smali/module/main/HandlerMain.smali:

.method public static mcuKeyBtPhone()V

.locals 2

.prologue

const/16 v1, 0x1B

invoke-static {v1}, Lmodule/main/HandlerMain;->onItemSelectedp(I)V

return-void

.end method
[Android Head-Units] surfer63:
The delay is now gone in the sofiaserver steering wheel mod for the 1 September firmware.

I have no idea about the keys themselves.
[Android Head-Units] xxBrun0xx:
If all I want to do is have launcher.sh kill waze when I turn key off and resume music (using Shuttle app) when I turn key on, would I have no 2-3 second delay when I press nav button (due to it not being passed to through launcher.sh)?

If so, how would one do this? The scripting being used here is a little intimidating. Can I just delete everything from lines 31-188? Going to do some experimenting and see if I can't get this to work.

Edit: can't seem to get a modified version of launcher.sh to work. Are there any good tutorials anywhere that explain how to modify this? Ideally I'd like Waze on nav button press and Shuttle on Band button.
[Android Head-Units] dyabolikarl:
Put the 6.4 on my july 6.0 install. The delay is gone but the navi key has stopped working. I'll have to run some debugging.
[Android Head-Units] surfer63:
The first thing for you to do is share your launcher.sh (and not only the relevant section, it might be something way up in the script).

My first question is: Which editor did you use to modify the launcher.sh? (hint: If you are on Windows do NOT use notepad. Use something like notepad++)

---------- Post added at 10:25 AM ---------- Previous post was at 10:24 AM ----------

Share your launcher.sh, otherwise we can't help.

Edit: Is your Navi pointing to the Joying "One key Navi" app, and if so: did you assign a navi app?
[Android Head-Units] dyabolikarl:
I am just using the launcher.sh i been using since 6.3 I didn't do any change or upload a new one.

Just copied the new server over the old one and reboots. The next key, mute key and volume keys work.

Just not the Navi key. I will make sure it's just not because of the reboot it's doing it. Sometimes it takes a while for the launcher to start working.
[Android Head-Units] surfer63:
How did you install the new 6.4? manually, using gustdens script or using my apk?

And if you used gustdens script, did you copy in your modified launcher.sh?

And if you used my apk, which version?

And did you already try to reinstall this launcher.sh you attached to this post?
[Android Head-Units] xxBrun0xx:
I'd ideally like Band button to activate Shuttle music and Nav button to activate Waze. Nothing fancy. I added a few lines at the bottom that play music when I start the car and kill Waze when I turn the car OFF.

Would be even better if I could get this app to pan my phone to start bluetooth tethering when my car is started (I usually have to open the app and manually do that every time I start the car): https://xdaforums.com/android-auto/...elopment/bluetooth-settings-launcher-t3504526

Thanks for your help, really appreciate it!
[Android Head-Units] dyabolikarl:
Ok. So I did manually copied the file using a file manager to the system app server directory.

I didn't use gustden's script. (I guess there must be issues with permissions now)

I used your extra tools latest to reinstall the V6.3. The launcher worked again

You script didn't have the v6.4 using the 16 October 2017: V2.6 tool.

So i guess the issue now is permissions.

I'll try to reinstall it today sometime using the script and report back.
[Android Head-Units] surfer63:
My latest 2.6 and the 2.5 before that one, do have the 6.4. That is also how I installed it, be it for testing. However, due to the many changes in the sofiaserver apk, it only allows you to install it on the September firmware. Using the Gustden 6.4 on the 07 July or older firmwares might lead to issues. In that case you really have to install it manually or using Gustdens script. I don't want to support all kind of issues arising from people installing the wrong sofiaServer version onto their firmware. You mentioning that the 6.4 didn't work on your firmware already clearly states that you are not on the 01 September firmware.

My apk also allows you to install a new launcher.sh immediately giving it the right permissions. Simply copy the launcher.sh in the root of your internal memory (/sdcard), and use my apk.
[Android Head-Units] dyabolikarl:
Thanks for the help.

I got it all back to what it was (the apk i had before i decided to test the new server) but now my music player either seems to be getting killed or something weird going on.

When i start the car i get a toast saying file not supported. Music starts and only plays the one song over until I quit and restart then it will go back to changing songs.

Weird thing is nothing else was changed apart from the APK. No sure if i need to kill the music app now with the launcher or not.

Will test that today.
[Android Head-Units] surfer63:
Which music player? The Joying one in modded form or another?
[Android Head-Units] dyabolikarl:
Playerpro. Nothing was changed in my setup apart from the server apk. Playerpro was working flawless before i changed the server.

When i changed it back to the original working server apk i had it started doing it.

I am going to try a force stop on the app to see if that does anything.
[Android Head-Units] biggy238:
I installed the V6.4 no-kill only, and renamed the stock apk to .bak. I thought it worked initially, but now it isn't. The only app I'm concerned with is Viper, and I know it's still being killed because I can hear the EQ change when the app starts.

Did I miss a step?
[Android Head-Units] surfer63:
You don't mention whether you use the free or paid version of Shuttle.

34) # BAND KEY - Not used by me
# free
#am start another.music.player/com.simplecity.amp_library.ui.activities.MainActivity
#paid
#am start com.simplecity.amp_pro/com.simplecity.amp_library.ui.activities.MainActivity
;;

The first am start is for the free player. Remove the # if you want to use that one.

The second is for the paid player. The package name is simple as Google Play mentions that in the address bar of the browser. I guessed the MAIN activity (/com.simplecity.amp_library.ui.activities.MainActivity) and hope it is the same as for the free player. I can't download the paid version.

See attached zip with a launcher.sh
[Android Head-Units] surfer63:
You don't mention your firmware version and you don't mention how you installed V4A. Please be complete.

Maybe it isn't the nokill at all. There could be several things playing a role here.

If you are on a 6.0.1 Rom after 25 May, you can forget it. Viper no longer works correctly. Joying/FYT changed "something" that cripples Viper and enables their internal DSP, whether you have that or not.

The november ROM is currently unknown. If you are on the November ROM some people really like to know whether V4A functions or not, regardless the fact it's getting killed.
[Android Head-Units] xxBrun0xx:
Shuttle seems to be working (albeit still with a huge delay), but no dice getting waze to launch when I press Nav button. Any way to keep the stock behavior of this button? I really only want this script to start music when I turn the key and kill waze when car is turned off.

Edit: Figured it out. Need to use "am start com.waze/com.waze.FreeMapAppActivity" for Waze, not "com.waze". Shoot me your paypal and I'll send you some money. Thanks for the help!
[Android Head-Units] surfer63:
The NAV key is #9.

Search the script where it says 9)

It now mentions

am start com.waze

Either disable it, or set it for example to

am start com.syu.onekeynavi/com.syu.onekeynavi.MainActivity

.

That will start the OneKeyNavi app. If you have setup Waze to be your navigation app in the car settings, it should start waze.

I used that setting for some time when I did not exactly know whether to use Mapfactor Navigator or Magic Earth.
[Android Head-Units] biggy238:
May 08 Rom

V4A installed in Priv-app.

Stericson's busybox

V4A works, and has since it was installed in July.

I made a mistake. I downloaded the 6.2 NOKILL

I'm sorry for not being complete.
[Android Head-Units] biggy238:
[MENTION=2550900]surfer63[/MENTION] so what DO you think is happening?

Does launcher.sh have to be modified for every version of the apk?
[Android Head-Units] surfer63:
No, not at all.

The laucher.sh is "universal".

And w.r.t. V4A: How did you install it? You can't simply install it from google Play or simply clicking a downloaded version to get it installed. Then it gets killed.

You need to install it into /system/priv-app. And for (improved) functionality you need to make some modifications to both audio_effects.conf and audio_policy.conf. Did you do that?
[Android Head-Units] biggy238:
That's exactly how it was done. I answered you in post #654 the first time you asked.

I'm curious now if I only extracted and replaced the apk. I never told it to install.
[Android Head-Units] biggy238:
[MENTION=2550900]surfer63[/MENTION] each time I tell ES file explorer to install the apk, it fails. I can go to any of the other system apk's and they install successfully.
[Android Head-Units] biggy238:
I got it to work.

I left the original apk in the folder as .bak and rebooted. I caught the error and moved the file but never rebooted after that. I rebooted before I left for work and the server is working as expected.

Thank you for the great mod
[Android Head-Units] surfer63:
For me that reboot is so obvious I did not even ask :)

You almost always need to reboot. Apks are optimized and have odex files in the Dalvik-cache (unless they are odexed on beforehand which is the case with the apks in the 5009_60.zip).

If the apk has changed it needs to be optimized (odexed) again. If you simply replace the app without "notifying" Android, like with a copy, Android will not recognize that and use the "old" odex file. Sometimes that is not a problem but in this case it is an absolute problem as some of the coding has changed.

Android detects upon boot that a new app or modified app is "in the file system" and will do the optimizing.

So when replacing an app by simply copying: Always reboot !

And please google on "android what is odex and deodex" (or likewise) to get some background information.