yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] p33t-r:
Hi guys, I'm back again with the issue of the launcher script not working at all. I'm on latest Joying firmware, rooted, tried both 6.2 and 6.3 versions of the mod.

I've checked the permissions for the launcher.sh file, it's 755.

I did the "chmod a+x /data/launcher.sh" and tried the manual script to run any key press command through the terminal "/data/launcher.sh 9" or 37 (navi or source change). I'm using my edited script that was working fine with Android 5.1.1 and v.4.1 of the mod.

The output I get is only a ton of errors, as follows:

tmp-mksh: /data/launcher.sh[18]:
: not found
tmp-mksh: /data/launcher.sh[21]:
: not found
tmp-mksh: /data/launcher.sh[24]:
: not found
tmp-mksh: /data/launcher.sh[27]:
: not found
tmp-mksh: /data/launcher.sh[30]:
: not found
tmp-mksh: /data/launcher.sh[33]:
: not found
tmp-mksh: /data/launcher.sh[36]:
: not found
tmp-mksh: /data/launcher.sh[39]:
: not found
tmp-mksh: /data/launcher.sh[42]:
: not found
tmp-mksh: /data/launcher.sh[44]:
: not found
tmp-mksh: /data/launcher.sh[45]:
: not found
tmp-mksh: /data/launcher.sh[47]:
: not found
tmp-mksh: /data/launcher.sh[48]:
: not found
tmp-mksh: /data/launcher.sh[51]:
: not found
tmp-mksh: /data/launcher.sh[55]:
: not found
tmp-mksh: /data/launcher.sh[58]:
: not found
tmp-mksh: /data/launcher.sh[60]:
: not found
tmp-mksh: /data/launcher.sh[61]:
: not found
tmp-mksh: /data/launcher.sh[64]:
: not found
tmp-mksh: /data/launcher.sh[67]:
: not found
tmp-mksh: /data/launcher.sh[70]:
: not found
tmp-mksh: /data/launcher.sh[73]:
: not found
tmp-mksh: /data/launcher.sh[74]:
: not found
tmp-mksh: /data/launcher.sh[77]:
: not found
tmp-mksh: /data/launcher.sh[78]: syntax error: 'in
' unexpected

What does that mean? I am rooted, busybox updated, SU binaries updated, rebooted a few times, reassigned the steering wheel keys, tried with the "stock" launcher.sh script - nothing works. Any ideas?

Thanks a lot!

EDIT: I've installed the script via adb "install.bat 192.168.XX.XXX"
[Android Head-Units] edit:
I've also encountered BIG problems with launcher.sh

The story :

Wiped the unit, Flashed it with the 25 May update, wiped it again, rooted, installed the original settings.apk, installed viper4android, install custom mod keys - nokill server,logged into Google Play store and DL all the apps that I need (5 apps to be exact) and all went well for a very short while because I decided to modify the launcher.sh a little bit. The original one was also modified a little bit to accommodate the proper commands for Poweramp to play at unit resume from sleep.

The BIG problem is that once that I replaced the launcher.sh with my own giving it the proper permissions (renaming the original one in launcher.sh.old) the apps stopped auto-playing like they used to when i woke up the unit from sleep. It's true that my skills and limited when it comes to scripting and I thought that I broke it somehow so I replaced it with the old one that worked perfectly fine.... and surprise.

For some ODD and unexplained reason the old one ALSO did not work. I tried to restart, delete it completely, copied it again.... nothing that I could think of worked. The file is in the right place, has the right permission... so I don't see why is not working when it used to just fine.
[Android Head-Units] surfer63:
Error 1: You say that the unit is rooted, but do you also run the script as rooted?

Only root has access to the "/data" folder and the SofiaServer apk runs under root.

Secondly: apps have ONLY access to their own "/data/app/<package name>" and "/data/data/<package name>" folders. This is obviously for security reasons.

So if you run the launcher.sh from a terminal, you first need to do a "su" on the command line to switch to root mode.

If you run the script from tasker or some other tasking/scripting apk, make sure it has root access as well.

Otherwise the shell script is indeed not found by your tasker or whatever you use (although this is an secondary, indirect error message internally in your tasker apk. The actual error message should be "access denied").

Error 2 (syntax error: 'in' unexpected): This is a strange one.

I guess it comes from the line "case $key in".

If you do not specify a "key" (33, 34, 9, whatever), the script line upon execution will become "case in" due to the missing key. That is definitely an error.

I always recommend to copy your script into https://www.shellcheck.net/

It checks for syntax errors. It will most probably give you a number of warnings as it is very strict to POSIX syntax, but that's not a problem. Check for the errors.

I use it a lot. I consider myself an experienced scripter, but it is extremely easy to make a typo or forget an end bracket, semi-colon, etc.

---------- Post added at 11:45 AM ---------- Previous post was at 11:32 AM ----------
[Android Head-Units] edit:
Like I wrote in my Q&A thread, always Notepad++.

It makes absolutely no sense to me especially when I put back the old file (launcher.sh, with proper permissions) that used to work and it's not working anymore.

I hate the instantly... I don't have the expertise to figure out what is wrong here and what is going on but from a clean install is frustrating to experience such instability... I had to wipe my unit again... I found no other way of restoring the functionality of the launcher.sh and I really need it in order to kill Waze each time the unit sleeps and to have Auto play resume at unit start.
[Android Head-Units] fado5ster:
Hey guys, I may be a complete idiot here but I'll push on, please be gentle..

So I have just updated to the latest 6.0 ROM, had it working close to OK (startup issues) so decided to test rooting and getting rid of that pain of a task killer. So the root went OK (after a few teething problems) and I then downloaded v3 of the nokill apk (was reading an old post and thought that was recent) I then used es file explorer to just copy and replace the old original apk, but when I restarted I had no sound and no use of my hard buttons. So I copied and replaced the original file back into its folder and restarted but still had the same problems.

I have now reflashed the latest marshmallow ROM again and after 3 flashes and 2 factory resets I now have it running perfectly, apart from the task killer..

Am I correct in saying if I do the same thing (copy and replace) using 6.3GVC that I will loose the task killer, keep my volume and hard buttons and gain google voice commands using SRC? Because thats all I really want. I realise I need to do some more tinkering to get google voice to work with the launcher but 1 step at a time.

Again I'm sorry if I'm missing something/being stupid bit its been a really long week and my brain isn't doing well.. Thanks guys
[Android Head-Units] swanie2000:
Be sure you are rooted, I use root checker from play store. Then try again, this time use ROOT EXPLORER. Copy and paste. Remember android rules, you can only have one apk in the same folder at a time. After you paste the file, long press on the file to set permissions. Root explorer always works for me, I have not had any luck with ES file explorer. IIRC, Root explorer will not even open up(it will complain) unless your unit has been rooted.
[Android Head-Units] fado5ster:
Yeah I was rooted for sure, had checked with root checker and es file explorer asked for root privileges (via SuperSU) maybe I'll have more luck with root explorer. Just dont want to have to reflash again when it took so long to set up this time. What do you mean long press to set permissions?
[Android Head-Units] swanie2000:
When viewing the file with root explorer, a long press on the file (press and hold) will pop up a box of options, set permissions is one of the options.
[Android Head-Units] fado5ster:
OK cheers mate, I'll try with root explorer later. So I am right in saying I won't have to customize my keys using that version? That will just lose the task killer and add voice to SRC? Just wana be sure :D
[Android Head-Units] swanie2000:
History:

V6.3: Update using code base 5/25/2017 Joying Update ( Android 6.0 )

Files included:

- V6.3-Sofia-1-C9-Server_NOKILL_GVS.zip - Task killer removed, Google Voice Search on 'SRC' key

This should be the correct file name, Download from the bottom of the first post in this thread.
[Android Head-Units] fado5ster:
Yeah that's the file I've downloaded, just haven't got around to rooting yet. Will make a titanium backup before I change the apk anyway.. Hopefully get a chance to do it tomorrow. Thanks again mate
[Android Head-Units] Clandaries:
Sygic Car is missing or does it work with Sygic Car?

Thank you
[Android Head-Units] surfer63:
You are right Cygic (com.sygic.aura) is in the navi_app.txt, but Cygic car (com.sygic.incar) is not.
[Android Head-Units] alexyie:
Can I request for a version that only have the Navi_App list and the SRC button mapped to Android App Switcher? I dont really get how to do modification and update using the launcher.sh mentioned here.

thanks before
[Android Head-Units] dyabolikarl:
Removed code to ask a different question
[Android Head-Units] fado5ster:
So I've rooted the HU, no problems, then I get root explorer, grant permissions, copy new V6.3-Sofia-1-C9-Server_NOKILL_GVS.zip into the correct system/app folder, grant permissions (read/write to all) then restart and now I have the same issue. No sound, hard buttons no longer work and unit won't reboot.. Am I missing something here or whats going on!?!?

*EDIT*

OK so after about 20min of trying to restart it finally did, sound came back and I thought it had worked, then I noticed my SRC button still scrolls through Joying apps so I'm guessing that means it didn't work.. Granted I'm still having issues getting google voice to work (installing google app crashes launcher) but I thought that in that case (with NOKILL working) the SRC button would just do nothing.. Not 100% yet but seems like background apps are still closing, when I open Waze after 5min of background it starts with the "524 wazers around you" startup prompt.

What the hell am I doing wrong?
[Android Head-Units] surfer63:
You mention "copy new V6.3-Sofia-1-C9-Server_NOKILL_GVS.zip" into the correct /system/app folder.

Of course you should not copy the zip into that folder. You should unzip the zip and use the script to install the apk.

If you want to do it manually make sure you have only one "file" in there ending with apk. Not something like "*_old.apk" and "*.apk"

You can not have two apk files in one folder. In that case none of them is loaded leading to the issues you mention.
[Android Head-Units] fado5ster:
Sorry, my bad.. Yes I have of course unzipped the file and copied it into the folder and deleted the old one (after making a copy in another folder)

I now have the new file @ 1.28mb and replaced the original file @ 1.31mb.. Does this sound right? I can't figure out what I'm doing wrong. I have noticed macrodroid seems to be running for a few hours but Waze still gets killed
[Android Head-Units] swanie2000:
Hey Surfer63,

This is clearly above my skill set, hoping you can set this straight, but I am just trying to help out....

I'm not sure if it matters, but doesn't fado5ster need to change the file permissions to 644, not 755?

755 is for the launcher script that fado5ster is not using, 644 is for the modified Sofia-1-C9-Server he is replacing.

Couldn't hurt to try?

Swanie
[Android Head-Units] surfer63:
It doesn't hurt either way: 644 or 755

The 755 sets the execute bit, which is necessary for a binary like su or busybox (in windows .exe) or a script.

An apk doesn't need that as it is actually a "zip" with executable stuff inside it, which is treated differerently as the stuff can be run by the java runtime engine, not by itself.

644 gives you -rw-r--r--

755 gives you -rwxr-xr-x

Technically (and from security point of view) the 644 is better, but it doesn't hurt and it certainly does not prevent the apk from working. That must be something else.

Giving 644 to a script (launcher.sh) or a binary, like su or busybox, makes it impossible to run it.

Unix and Linux use the execute bit to determine whether "something" is executable.

Windows uses the extension like .exe, .com, .bat, .cmd, or .vbs (and probably some others I forget).

[MENTION=5147153]fado5ster[/MENTION]: The best thing to try is to download the full steering wheel mod as well. Unzip it. Copy your GVS apk over the steering wheel mod (e.g. replace the steering wheel apk), and use the script to install your GVS verson. Before install do a reboot, immediately after install do a reboot again. If it fails again (no sound, terribly slow and sluggish), replace it again with the original apk.

It probably has to do with the dalvik cache. gustden metioned he had issues with the mods as well, until he started to delete the dalvik cache.

These 6.0.1 versions gives a lot of modders head aches.
[Android Head-Units] swanie2000:
[MENTION=2550900]surfer63[/MENTION]

Thanks for taking the time to explain, I always enjoy learning!
[Android Head-Units] dyabolikarl:
I'm not a shell expert by any means. But I did reference shell syntax on google. I know i am a pain in the butt.

I was wondering why my script was not cycling through and not launching the next app.

My questions is about the sample script. This is NON edited from the sample.

I thought there needs to be a ; after a call to an executable in the code

In the sample script it has this code

# Press position on touchscreen for play/pause, small swipe was more reliable

pandora_press="input swipe 550 580 555 585 500";

No every other set variable in the script had no ; So this seems like that ; should not be there.

I removed all the apps I dont use from the script I am using so the above doesn't apply to my issue. I was just wondering why the random ; is there.

Then in the ACC section

97) # ACC_ON - execute on key on

$play

;;

98) # ACC_OFF - executes on key off

$pause;

;;

$play doesn't have ; and $pause does. So does it really matter if it has ; or not?

I run it through shellchecker and it passed.

As i understand it you can run one command after another with ; as separation IE: play; am force stop <package>;

If you require the commands to be successful before continuing you use a &&

The issue i am having it seems the system apps aren't being launched (music and radio) when the src button is used but the music player i put in there is.

I will try executing the keys manually in adb tomorrow to see if i can see why this is happening. I might need to swap music app maybe. I use rocket player now.

Even with the sample script (no mods) the radio and music player doesn't launch via the SRC but i can manually boot them from the home screen.

V6.3 keymod on 6.0.1 No kill apk
[Android Head-Units] surfer63:
From the (da)sh man page

Control operators:
& && ( ) ; ;; | || <newline>

Redirection operators:
< > >| << >> <& >& <<- <>

It means that at the end of a line a ";" is not necessary as the <newline> is a command separator as well. But it doesn't hurt and is not wrong. It is just a bit sloppy (but I make the mistake as well in my scripts)

Your statement/finding about the "oneliners" separated by ; versus && is correct as well.

As I understand you attached the "NON edited" form of the sample script. It would be handy if you attached your modified script.
[Android Head-Units] dyabolikarl:
It was attached in my previous post . I ended up debugging it. The $key variable was not updating. I thought i had a newer busybox on there but i updated it to a later version and it works now :) thanks for your patience.

One last question. Can i use the gplay version of busybox? I only used the one from the joying assistant.
[Android Head-Units] surfer63:
Sorry, my fault. I had misinterpreted your post. (And I do criticise people for not reading well enough :( )

I thought you wanted to use #33 (Media) for Music and #34 (Band) for Radio, because that is what I do. (Band simply activates the radio in my case).

All the gplay versions you can find on gplay are busybox "front ends": They come with a version of busybox packed internally and allow you to give commands via their apk.

The version I use via the joying rootassistant is the underlying one from JRummy without all the hassle around it (it is referred to on that busybox page of joying root assistant)

Probably you know this, but just to make sure: busybox is a swiss toolbox housing all kind of "applets" (in buxybox terms), replacing but also expanding installed commands. The busybox source comes with a huge amount of parameters to include or exclude certain commands during compilation. The version in joying assistant from jrummy (busybox itself is GPL-ed) is very complete.

The joying one is older, less complete and contains bugs.

Finally: The android version of busybox is called toolbox and is installed on every android. It is actually a very limited "swiss knife" incorporating a subset of commands only deemed necessary for android.

For everything you want to do do, the joying root assistant busybox version is enough. You can "play" with that one as well via the terminal, apps like scriptmanager, tasker or macrodroid.

And of course you could download one from gplay, but most probably that one would only be accessible from the app and will not replace the installed old, buggy version.

But that's all up to you. :)
[Android Head-Units] dyabolikarl:
Thanks for all the help :). I am debating putting tasker on to lock up my google play and settings with a pin. But also i might put on TBup to just freeze them.

Not sure if anyone uses tasker on the joying but i used it comprehensively on my phone and tablets. I saw a few people having issues with tasker keeping the joying awake or it's not working at all.

Not sure if that was an issue on their part though.
[Android Head-Units] f1x:
Hello,

Could any owner of Intel unit test the newest version of MtcdTools (1.9)? I added support of PX5 few days ago and there is a chance that Intel units have similar mechanisms to communicate with SWC,HU buttons and to wakeup/sleep manage. Thanks in advance.
[Android Head-Units] gtxaspec:
I will test for you today!
[Android Head-Units] edit:
How is it? :) (just curious)
[Android Head-Units] dayanandgp:
[MENTION=3076686]gustden[/MENTION], do we need new version of steering wheel key script for July update? I can't live without this script so if you are not going to update the scripts I will not do the update.. Let me know and thanks..
[Android Head-Units] gtxaspec:
Used the last released version and it works fine with the new firmware.
[Android Head-Units] edit:
I haven't seen [MENTION=3076686]gustden[/MENTION] in months so he might not show up.... at all.

I am sorry that he gave up on this, he was one of the few skilled guys that could help us make this unit better.
[Android Head-Units] avnb39:
That's odd, on the newest update I can't get mine to work at all. I've checked in Logcat, and the only mcukey entries I get are with an id of 127, which isn't any of the listed keys. I went as far as to add a logging line in my launcher.sh, and it's not called.
[Android Head-Units] surfer63:
Did you check whether the apk really got installed? Something like an "ls -l" in the SofiaServer folder?

or an md5sum of both apks?
[Android Head-Units] avnb39:
I did, yes. I also cleared the cache, and made sure that the permissions were correct.

I was also under the impression that the "MCUKEY" prints in Logcat were generated by this mod.
[Android Head-Units] kampfschachtel:
That will be a huge loss...hope he comes back.
[Android Head-Units] colonchristian:
Steering wheel control not working with Poweramp

I just updated my head unit from Android 4.2.1 to Android 7.1 and steering wheel control no longer works with the new unit I bought.

Can anyone please tell me how to get the forward and backward buttons to work on my steering wheel so that it controls PowerAmp? The controls work with the native Music android app BUT not with Poweramp.

I tried the following with NO success: CarService_2.1.3, MtcdTools, and jy-steering-wheel-control-1-0-0.

This is my current unit:

seicane.DOTCOM/android-radio-dvd-player-car-gps-navigation-for-1998-2006-mercedes-benz-g-class-w463-g550-g500-g400-with-bluetooth-music-mirror-link-usb-wifi-1080p-video-aux-dvr-s6907
[Android Head-Units] kampfschachtel:
nobody here uses 7.1.....

we are struggling with messy updates on 6.0.1....I am afraid but nobody here will have a glue why they are not working. Didn't even know there are units out with 7.1 .....
[Android Head-Units] k4ever:
What are the exact permissions for the file? I copied over the old file without checking the permissions first :(

I got the read by all part, but what about write and execute permissions?
[Android Head-Units] Lowen SoDium:
644 or 755 will work.

I have a problem... I am using the v6.3 with the google now function and the disable tone option (make the head unit beep when you touch the screen). is missing from the car settings menu. I can swap the APK back with the original and it is back. I can change the setting and save it, then change the APK back to the hacked one and the option is gone. Thankfully it remembers what I set it to even if I can't change it again.

Anyone else missing this option?
[Android Head-Units] surfer63:
As the files are written as root and you have to be root to overwrite them again , you don't even have to care about the attributes.

If you copy as the same user the same file over an older version, all attributes remain the same.

But as Lowen Sodium already said: it should preferably be 644, but 755 will also work (the 644 for apks and their odex files, the 755 for folders)

---------- Post added at 02:34 PM ---------- Previous post was at 02:25 PM ----------

The V6.3 is based on the 25 May version. That (original) 25 May SofiaServer apk is different from the original 7 July version. I already decompiled them and compared them.

(I try to rework [MENTION=3076686]gustden[/MENTION]s work by simply "diff-ing" the decompiled versions of both originals and the mods, and then patching the new version again with the several mods.

However, I'm not a java/smali programmer, so syntactically it might be correct, but that doesn't mean it will work.)
[Android Head-Units] k4ever:
When I overwrote the file the permissions were set to 777 on the new file. I knew this wasn't right, but I didn't want to cause any problems by changing the permissions in the blind. I have since set it to 644.
[Android Head-Units] surfer63:
His last post was on June 9th.

For him lets hope he indeed simply gave up on this, and that it isn't something with his health or worse.

Some people disappear from forums or mailing lists for other reasons than simply not being interested anymore.