yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] barnesk9:
I finally got around to rooting my unit and installing this. I have to say thank you very much gustden for creating this!! Do you have a donate link?

One of my biggest issues has been that I only have 5 swc buttons and I'd like to do more. With this I can turn that into 15!!!!!!! I did notice something in using it. With V2 my music never stops playing. So if I turn the car off and music is playing it doesn't stop. If I leave for 3 minutes my song advances 3 minutes. Is there some command that was removed to pause music? I'm using Gone Mad Music player if that helps.
[Android Head-Units] sonof:
Anyone know the key code to change volume up and down?

Also I'm looking for a code to turn off the screen.
[Android Head-Units] gustden:
There are two separate stages that happen after you shut the key is turned off. The first stage, disconnects bluetooth and shuts off the audio amp and screen, with most of the unit still active. Several minutes later it shuts off wifi and kills user processes before entering deep sleep. With V2 the only thing that was touched in the standby area was removing the line that kills all processes, just before the unit goes into deep sleep/standby.
[Android Head-Units] barnesk9:
Gotcha, so I'll probably just use tasker to do it for me since it won't die with V2
[Android Head-Units] naplesbill:
Thank you for making the apk to stop killing tasks. I am happy with the steering wheel controls as they are so this is perfect for me. We all owe you a debt of gratitude.
[Android Head-Units] wanb1i:
You know that weird foggy circle that's on the screen? Well it has a "Blank Screen" function in it.
[Android Head-Units] sonof:
The first thing I did was to remove the foggy circle from the screen when I received the unit :)
[Android Head-Units] wanb1i:
Ya, how'd you do that? I'd love to get rid of that POS! :eek::eek:
[Android Head-Units] gustden:
The codes being sent to the shell script are based on the keys assigned in the Joying keymapper. You can assign any action to any key. Hopefully this attached images helps clarify. Yes, with version 2 you do loose the stock functionality of the Call/Hang keys. I use google voice to make calls, and just reach over and tap the screen to answer/hang-up voice calls. I get so few voice calls, for me it is really a waste to dedicate buttons to do that specifically.
[Android Head-Units] gustden:
There are standard android codes for both of these, but the Joying unit does not "listen" to them. Both the volume and screen off are both controlled by the MCU.
[Android Head-Units] wanb1i:
Thanks for the quick response, I actually deleted this, cause i found the Notes in the zip file and I felt stupid...

So i tried just copying the files to their appropriate places because I didn't know how to run the terminal commands, but that didn't work. So I just copied back the original file to get back to where I was. Thanks for the work. I'll try to figure out how to do thus when I have some extra time.
[Android Head-Units] swanie2000:
Please help with (SOURCE) Button.

Hello All.

I am not a programmer, and trying to get my head around what is going on in this script.

I have not installed this script, nor the modified APK.

I wanted to understand what is happening, BEFORE I go out to the garage and break my radio.

My mission....

I would like the source button to rotate through 5 things.

Pandora

PowerAmp

Joying Radio

Joying Video player

Youtube

So first I assume I need to figure out the (am start) commands for PowerAmp, Joying Video Player, and Youtube.

EDIT: FOUND SOME ANSWERS:

*****************************************************************************************

POWERAMP = com.maxmpz.audioplayer/.PlayerUIActivity

JOYING VIDEO PLAYER = com.syu.video/com.syu.media.act.ActPlayer

com.syu.video/com.syu.media.act.ActGrid

YOUTUBE = com.google.android.youtube/com.google.android.apps.youtube.app.WatchWhileActivity

PANDORA = com.pandora.android/.tablet.TabletHome

com.pandora.android/.Main

JOYING RADIO = com.syu.radio/.RadioActivity

JOYING BLUETOOTH = com.syu.bt/.act.ActBt

GOOGLE MAPS = com.google.android.apps.maps/com.google.android.maps.MapsActivity

DASH COMMAND = com.palmerperformance.DashCommand/.MainActivity

TORQUE = org.prowl.torque/.landing.FrontPage

*************************************************************************************

END EDIT

After I solve that mystery, I need to add those commands to the script in this area.

# USEFUL LAUNCH COMMANDS defined as variables area

For example

...............................................................

# Youtube

youtube= "am start com.google.android.youtube/com.google.android.apps.youtube.app.WatchWhileActivity"

.............................................................

Next, I need to understand how to come up with the youtube_press line?

................................................................

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

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

................................................................

THIS IS A TOTAL GUESS. Can someone explain how the author found this set of numbers?

Swanie
[Android Head-Units] sonof:
I can't remember but I think it was under the CarMediaSettings somewhere, maybe. Or maybe inside the Chinese Settings.apk.

---------- Post added at 08:43 AM ---------- Previous post was at 08:38 AM ----------

I think you said in another thread that you were able to include the MCU's screen off code to launcher.sh. Could you please share the snippet of code and also the codes to control volume if you know them. I'd want to map those to some of my keys.
[Android Head-Units] dayanandgp:
Hi, did it work for you? I tried few hours back and poweramp did not resume after start. Can somebody let me know if the standalone apk is working?

What I did : replaced the original file with new file with ES Explorer. It did not prompt for any change of access rights.

---------- Post added at 11:59 AM ---------- Previous post was at 11:51 AM ----------

Hi, how did you do that? Where is the setting for that?

---------- Post added at 12:01 PM ---------- Previous post was at 11:59 AM ----------

Hi, I tried it today and it is not resuming poweramp. Can you tell me if it is working for you?
[Android Head-Units] naplesbill:
You have to replace the existing file then set the permissions to owner rwx, the other two should be rx. Then reboot the radio. Pull the drop down from the time at the top and choose reboot.

This worked perfectly for me.
[Android Head-Units] sonof:
I meant the Joying modified Android Settings
[Android Head-Units] dayanandgp:
Ok let me try with the access rights...i simply set everything using root explorer..maybe thats what was wrong :confused:

---------- Post added at 09:30 PM ---------- Previous post was at 08:46 PM ----------

Huh... Can you if possibly show where in settings is this? It's really irritating to have that halo everywhere
[Android Head-Units] gustden:
Looks like your understanding it pretty well. It is alot of trial and error, but worth it in the end.

A couple of ways the coordinates can be figured out:

I take a screenshot, and load it into a photo editor. I put my mouse pointer on where the button and just read the coordinates. I use gimp, but most photo editors should show you the coordinates. Irfanview for windows will show the coordinates in the title bar when you click a location.

Also in 'Settings -> Developer Options -> Pointer Location' should give an overlay showing the location every time you touch the screen. I haven't tried this on the Joying but it should be there.

In most cases a 'tap' works just fine. I think it was Pandora that would miss the tap occasionally and the short swipe was the only way to give a longer press.
[Android Head-Units] rhino6303:
There is an app called "touch assist" or something similar. If you scroll through the main list of apps you will find it. Open the app and you can disable it.
[Android Head-Units] gustden:
launcher.sh needs to be executable. From the install script:

> adb shell "su -c chmod 755 /data/launcher.sh"
[Android Head-Units] swanie2000:
Hi Gustden,

I apologise for the type. I ment the APK was 644, and the script was 755. I did have this right when trying, just mistyped it when asking the question.

HOWEVER:

I managed to get this working. It turns out you cannot edit an android (sh) script file with (notepad) or (wordpad). I needed a new program called (Notepad++). After downloading and installing this, the launcher.sh script began to work as expected. I was able to add another item to the rotation, save it, upload it, and it still worked.

Thanks!!!!!!!

Swanie
[Android Head-Units] gustden:
Good to see you got it working. You could have used the command "dos2unix launcher.sh" command to convert the file on the head unit. Android/linux vs. windows use different line break characters, this has always been a pain going between OSs. I rarely use windows, so I tend to forget this is an issue.
[Android Head-Units] wanb1i:
Gustden,

Any chance you could provide where to put the rest of the files in the zip folder and what the commands are to get the install.sh to run? For example, do I put install.sh & the sophia apk on the sdcard? then go to terminal and type /sdcard/install.sh? Sorry for sounding so dumb, but I really don't want to mess up my HU and I'm not really sure what goes where? I tried just copying the apk file to system/apps/sophia-1C9-Server/, changing permissions and Launcher.sh to /data/ and rebooting, but that didn't work so I ended up replacing it back to the previous apk I had named .bak.

Also, when I change the key number from 27 to 37 for the PTT to be on the SW Talk button instead of the BT Phone button, that should be correct according to the key layout picture you provided in post 88, correct?

EDIT: Well I tried that, didn't work. I made the modification to the key number, but it didn't work. I tried doing the adb commands from my PC. It connected ok, and the commands appeared to work (I didn't see any feedback on the screen, but I thought it might be doing the commands. I checked the apk file for the correct permissins, they were correct. It created the .old backup file, but NONE of my buttons worked after I rebooted. I went and reset the SW buttons, they still didn't work, so I just reverted to the backup apk and now I'm back to the December mod you made.

All I really want is to keep the PTT button for Google Voice Command and have the HU remember where it was when I shut it off, cause it don't remember anything after a reboot. Poweramp even forgets my playlists and I have to go back and reset them after every reboot, PIA!

Any help would be appreciated. :D
[Android Head-Units] wanb1i:
Maybe this was my problem? I just copied the Launcher.sh to the /data/ directory.

I'll try this one more time to see if I can get it to work.

Nope, that didn't work either, almost bricked my HU. nothing worked, no volume, radio app didn't start up, none of the keys on the left of the screen worked. System kept rebooting.

Not sure what I'm doing wrong, but I quit for now.

Here's a picture of the left side SW Controls the circled buttons have been modified as indicated. I'm happy with the way they work. I just want the HU to remember where it was when it last shut down. If someone could help me with that, it would be AWESOME! Otherwise, I'll just have to live with redoing the settings and my playlists until I can figure this out.:eek:
[Android Head-Units] gustden:
I updated the apk that just has the "Google Voice Command" and task killer removed. I attached it to the original post: https://xdaforums.com/showpost.php?p=70480258&postcount=549
[Android Head-Units] barnesk9:
Loving this so far, the only question I have left is how do you go about finding the intent that you need to launch the app? For instance I'm using GoneMad Music player and I'd like to launch it from one of the buttons
[Android Head-Units] mkuzenko:
Its one of the factory apps "Touch Assistant" go into it and turn it off.
[Android Head-Units] sonof:
Use logcat with launcher filter and it should be easy to find.
[Android Head-Units] dayanandgp:
Hurray... found it and now very much happy... It was so irritating :eek:
[Android Head-Units] akuma148:
Thank you for the great work, gustden!

This is working great so far with a lot of trial and error.

The only issue I have is that I can't figure out the commands to Pick up a call or Hang up a current call and assign them to their respective soft steering wheel keys. I've tried using adb to get the functions returned, but they don't seem to show up in the activity list. I've tried "am start com.syu.bt/com.syu.bt.BtAct" and "am start com.syu.bt/.act.ActBt" but they only open the bluetooth calling app, they do not pick up or hang up a call.

Do you happen to know the commands to pick up or hang up a call?

Or if possible, can you provide an apk that doesn't pass those two keys, 27 - Call/BT Phone or 28 - Hang/Call End, that way I can retain the factory functions for those. I'm not too worried about the Hang/Call button, I don't use it that much, but the Call/BT Phone I do use quite often, so maybe an apk with just key 27 not passed, would also be great.

Thank you very much.
[Android Head-Units] hans.vinkers:
display

where can i find the app that gives you clearer view / better contrast in the movie ??

i don't have the same unit, but i guess that won't matter because it is android and the menu looks quite the same.

(mine says brand:eunavi in the advert but i didn't find that on the unit anywhere so i guess its a copy of a joying device)

h t t p s : / / www . aliexpress . com/item/8-inch-Quad-Core-Pure-Android-5-1-2-Din-Car-DVD-For-VW-JETTA-Tiguan/32669547569.html?spm=2114.13010608.0.0.fBHCcc

(remove the blanks)

now i find your re-progamming of buttons quite interresting. My problem so far: my steering wheel keys (seat leon 1p - 2008) are working, but not when you get to the original steering wheel programming.

When i go by the manual, i should press reset and every function disappears in the display. then i press save... that's where i think nothing should work anymore... then i press volume up... the device goes louder... ditto for the other keys, so i guess i cannot programme the keys ?? when i press a steering wheel button, no buttons appear on the display of the unit. weird enough, the main functions keep working.

the problem is, i want to un programme the MFD boardcomputer response.. now when i reset my boardcomputer, the radio shuts down... not a big issue, but something that i wouldn;t really want.

I have no KEY 1 or KEY 2 cables connected since i have the quad lock connection on both my car and my head unit...

can anyone help me out please ?? (seat is the spanish version of vw, working with VAG part, so the canbus part is starting with 1k0 partnumber, same as on vw golf around 2008)

the car has quad lock and this the pinout is this:

9 can/h

10 can/l

11 tel

12 earth

13 amp + (not connected)

14 removal key (not connected)

15 b+ up

16 alarm
[Android Head-Units] surfer63:
[MENTION=3076686]gustden[/MENTION]: Thanks for your work.

I assume the sofia-server apk inside this "Joying 2GB - Steering wheel key customization - V2 (NO KILL)" is the same but older/earlier compared to the one in "Joying 2GB - Source button mod - Google Voice Command" .

Or are they different? Based on the file dates and file sizes inside the zip they are different. So should I pick the "NoKill_google_voice_search.zip"?

And the "original" joying one from the 22 February Joying release is different from the original joying one from the 8 January release (based on a diff. I currently have no access to apktool). Did you check if it is indeed different and does the 22 Feb version require a patching for your "no-kill" patch?

(hint ;) )

Despite the hint I surely don't want to push. I'm just curious if your apks are the same or not.
[Android Head-Units] gustden:
The two packages are different, both built from the Jan release. The one in this thread provides the ability to customize the keys by launching a shell script , where other apk is hard coded to google voice commands for just one button. I have been using the package against the Feb 22 ROM and have not seen any issues.

I have done diffs and there are changes to Sofia-1-C9-Server-V1.0.apk in the Feb 22 package. Most of the changes are centered around additional "customers / car specific configurations" and additional hardware, such additional support for DVD devices.

I am in the process of carrying my changes forward into the Feb 22 code base, and will be posting an update in the near future.
[Android Head-Units] surfer63:
Thanks. Great.

Are your patches "open source"? Can I find them somewhere? I have no intention to create my own fork. Just curious (again) and wanting to learn from others.
[Android Head-Units] gustden:
I am making changes to code / apk at the smali level. Not sure if what I am doing is *legal*, but no one has asked me to stop yet.

In most cases, I put some comments in the smali code with a ##, so I can find them easily with a diff. For example, to remove the no-kill is a one character change. The comments should still be there if you decompile the apk.

I don't own the original code, so I don't think I really have any say in what people do with it.
[Android Head-Units] surfer63:
Using apktool I decompiled the orginal "Sofia-1-C9-Server-V1.0.apk" and your versions. With a diff I do find the differences, but there is no comment to be found. I assume all comment is removed on recompiling to make the code as compact as possible. There is no need to leave comments in binary code which is then zipped as well.

Another question: Do you sign the apks after recompilation or simply leave them as they are?

Edit: I tried to modify the 22 February version and (only) removed the "killAppWhenSleep" line and the next empty line (now in .line 1333), but on putting it back on my unit there was no sound and it became dead-slow. Luckily adb is our saviour so I reactivated the original and rebooted.
[Android Head-Units] gustden:
It sounds like the apk failed to compile. I have seen this many, many times in working on this :) If you tried to self sign it, it will not compile as the signature must match the the rest of the packages with the shared user id ( UID 1000, if I remember right ).

The trick is to copy the original signature file back to the apk. This can only be done if you do not change the AndroidManifest.xml (which you shouldn't need to). The apktool will copy the original signature if you give it a "-c" option. so the command would look like this:

> apktool -c b Sofia-1-C9-Server-V1.0

It also really helps to look at the java code along side of the smali code. I use: http://www.javadecompilers.com/apk and the tool "jd-gui". There are parts of the code neither one does a good job with.
[Android Head-Units] surfer63:
I'm learning something every day. Live is great.

Anyway, I will try that tomorrow. I'm living in a different time zone :) It's pitch dark here. I have no garage.

I did quickly install your new NoKill V2 version and that one works fine.
[Android Head-Units] surfer63:
I don't have steering wheel controls, but I downloaded your V3_Custom_keys and modified the simple launcher.

I have a JY-VL130N2 which has different buttons compared to your Joying unit.

[IMG="Buttons on the JY-VL130N2"]http://img5.fotos-hochladen.net/uploads/jyvl130n2butt3r1yunbms6.jpg[/IMG]

Edit: button layout incorrect. Take from joying website not from unit it self. See here.

As you can see they are different (screen "removed in between). The two bottom "buttons" are the covers for the SD-cards.

These units do not even have a DVD-station but still have the DVD button :eek:

So I remapped Google Voice to my DVD button.

Do you know by any chance what the key-codes for the Band and Media buttons are? Or to spare you time and learn it myself: Where can I find them?

Edit:

I did find the NAVI (I think): module/main/FinalMain.smali:.field public static final C_NAVI_PACKAGE:I = 0x9

But is the BAND: module/main/FinalVa.smali:.field public static final VA_CMD_RADIO_BAND:I = 0x12 ?

Or am I completely wrong?

(and MEDIA I can't find at all)
[Android Head-Units] sonof:
Please see this post for instructions.
[Android Head-Units] gustden:
If you start reading the thread here, this may help you:

https://xdaforums.com/showpost.php?p=70754168&postcount=8

https://xdaforums.com/showpost.php?p=70836076&postcount=17

If you can identify the codes that get sent from the MCU for the specific button, the condition can be added to the function that I added: smali/module/main/HandlerMain.smali.keytrace2()

public static void keytrace2(int input, int input2, int input3, int input4)
{

if (input == 1 && input2 == 0 && input3 == 16 && input4 == 80 ) {
onItemSelectedp(31);
}

if (input == 1 && input2 == 161 && input3 == 2 && input4 == 91 ) {
onItemSelectedp(32);
}

}
[Android Head-Units] surfer63:
Thanks for this reference. In the mean time I "edit"ed my message, but I'm now not sure anymore whether my findings are the key definitions by Joying or by gustden.

---------- Post added at 01:49 PM ---------- Previous post was at 01:44 PM ----------

Thanks. I will have a look.
[Android Head-Units] dayanandgp:
Hi [MENTION=3076686]gustden[/MENTION] did you already find a possibility to send intent to pause the music ? my configuration of " screen off " detection in macrodroid is not working somehow. Dont know why

becuase it works for ScreenOn... if you have figured out a way to do in the apk directly would be very nice :)
[Android Head-Units] gustden:
Posted V3 yesterday - which includes an action at key off - ACC_OFF(98). ( see first post of this thread )

I also added case 98) to the shell scripts that sends 'input keyevent 127' / $pause. This pauses the current music player. Been using it for a few days, and it leaves the music player exactly where it was when the key was shut off.
[Android Head-Units] dayanandgp:
Thanks and apologies, didn't check the first post ?

Will copy it tomorrow!

---------- Post added at 08:17 PM ---------- Previous post was at 07:59 PM ----------

[MENTION=3076686]gustden[/MENTION], quick question... V3 is only "kill" command removed and pause before sleep right? Or does it contain button remapping?
[Android Head-Units] gustden:
V3 contains all of the button remapping of V2. I updated the first message to make this more clear.
[Android Head-Units] dayanandgp:
Scheise .. :p if you have some spare time, would it be possible to create one without mapping ? Would appreciate it very much... I tried decompiling but not good at these things :laugh:
[Android Head-Units] VWCC_GERMANY:
You are looking for no kill for Feb Update?

gustden already did it

https://xdaforums.com/showthread.php?p=71047452
[Android Head-Units] dayanandgp:
I know... He did an update based on Feb 22nd update with "pause media" during sleep... There is no " without remapping" version of it yet... That's what I was requesting for...
[Android Head-Units] surfer63:
Deleted. Wrong answer.
[Android Head-Units] sonof:
I'm sure with the new ACC_OFF there is a way to make the head unit say something like "Remember the parking disc." when you turn off the car. I seem to forget the disc frequently so that would be nice. Then again I wouldn't want to hear it each time I arrive home. Unfortunately Tasker's GPS conditions are not effective at all for this kind of thing. Would be nice if it could be used to prevent it from saying it at home but say it when car is turned off elsewhere.

Or maybe it would just be a pain to hear it all the time :)

Edit: Actually there is a radius setting in Tasker's GPS location. So it should be possible to exclude home and work for example and let it say something when turning off the car elsewhere.