yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] surfer63:
[MENTION=3076686]gustden[/MENTION]:

I feel a bit stupid right now. I mentioned that my JY-VL130N2 had different buttons compared to your model, but I was "in a hurry" and did not walk to my car but simply copied the image from my unit from the carjoying site.

That image is not the same as the buttons on my unit!

My buttons are:

left top-to-bottom: Home, Back and Mute

right top-to-botton: BAND, NAVI, MEDIA

I used the DEBUG apk to check on the MCUKEYs but I don't know how to recognize the keys.

I did a "sudo adb logcat -c", then I pushed the BAND keys at least 20 times, and did a "sudo adb logcat -d > BAND.logcat.txt". Next I did a "grep MCUKEY BAND.logcat.txt > BAND-grep.logcat.txt" . As it also activates the radio I now have a sequence of keys I'm not sure I recognize.

I did the same for the NAVI key (you never know) and for the MEDIA key.

I think I only identified the NAVI key sequence as the launcher also kicks in after it has been given but how do you come to "9" for a sequence of

D/MCUKEY ( 688): MCUKEYINPUT: B1=1 B2=0 B2=7 B2=1

Another guess for the MEDIA key, but that one is always followed with another set of keys.

B1=1 B2=0 B2=0 B2=49

Another guess for BAND, but that one is also always followed with another set of keys.

D/MCUKEY ( 688): MCUKEYINPUT: B1=1 B2=0 B2=0 B2=49

I attached the files to this post (unix line endings). Sorry for not being able to provide "ready" combinations.

I also tried http://www.javadecompilers.com, but the apk (your apk) is now already "waitingin a queue" for hours.

I decompiled it using apktool but could not find the mentioned code in "smali/module/main/HandlerMain.smali.keytrace2()".

I also tried jd-gui, which needs dex2jar, and finally found it int the HandlerMain.class, but not the "9" for the navi code.
[Android Head-Units] user-J:
"NO KILL" file causing HU not going into sleep/dormancy

Hi gustden,

My unit: JY-UL135N2 with Jan 4th update.

I have installed your NO KILL file "V1 - Built from the Jan 4, 2017 Joying ROM" from here:

https://xdaforums.com/showpost.php?p=71047452&postcount=62

I followed procedure with root etc.

After installation HU reboots every time I start the car. It does not go into dormancy/sleep properly.

It works only if I leave the car for short period of time, eg. 15-30 minutes.

Your help would be appreciated.

:)

regards,

J

========================================================================
[Android Head-Units] gustden:
My *guess* is you have a process running that really doesn't like full suspend, which happens a few minutes after you shut off the car. When the unit suspends, it will ignore any WAKE_LOCK and just suspend anyway. There are also timers in the Joying code that check if the resume takes too long, it forces a reboot. It could even be related to message queues overflowing during standby ( music player left playing?). I'm just guessing, but clearly something your running does not interact well with the mod.

You may want to try pausing all playing music before you shut the car off. If you are still having issues, it sounds like your better off not using the mod.

Since I have moved to the Feb update, I haven't had any reboots from standby. I am also using the steering wheel keys mods package, that also automatically pauses any music player when I shut the car off.
[Android Head-Units] user-J:
Thanks gustden,

Indeed I was leaving PowerAmp music player running. But that was my intention for installing the mod. I wonder if february update would fix it.

===========
[Android Head-Units] Hilari0:
With the ACC_OFF, is it also possible to have some sort of event for ACC_ON?
[Android Head-Units] dayanandgp:
I did it with "mactodroid" application... Use the trigger of "screen on"... It works...
[Android Head-Units] chammock:
First off thanks for this app. It is really useful however I am having issues I think with the launcher.sh. The issue isn't around the code its around the location of the file.

As part of the install process I copied launcher.sh to the /sdcard folder. I then copied the launcher.sh from /sdcard to /data and ran the command "su -c chmod 755 /data/launcher.sh". Obviously did all the apk stuff to as per the install.sh and rebooted. When I try and access the data directory to change the launcher.sh I get access denied, so I figure the idea is to change the launcher in sdcard directory and then copy into data and settings the attributes using the below commands

su -c cp /sdcard/launcher.sh /data

su -c chmod 755 /data/launcher.sh

no matter what I do to the launcher.sh it doesn't effect anything. I can even empty the entire launcher and everything works fine. Am I missing something. I am just trying to get spotify to autoplay when it resumes but I have traced the problem all the way back to this and am now stuck.
[Android Head-Units] gustden:
Are you doing any modifications to the launcher.sh before you are copying it to the unit? I know some people have had issue editing the file with a tool such as "notepad", then copying to the headunit. This post might help it this is the case: https://xdaforums.com/showpost.php?p=71098203&postcount=103

You might also see if you can check the permissions and run the file directly on the head unit from adb. For example:

> adb connect {IP ADDRESS}

> adb shell

> su

> chmod 755 /data # give less restrictive permissions on /data

> ls -l /data/launcher.sh # check the permissions of the file

> /data/launcher.sh # see if it gives you any errors just trying to run the script
[Android Head-Units] gustden:
This is helpful. If I get some spare time, I can use these codes to trace through the java code and see what is being done currently with this set of bytes when received from the MCU. The DVD and eject buttons that I added were pretty obvious .

The problem is some keys perform actions directly in the MCU and tell the "android side" about it. These I really can't do much with. Others are just sent from the MCU directly to the "android side" of things.

The "9" for the NAVI button is an arbitrary number I gave it, based on the case statements that were handling it in the code. If there was a corresponding 'keycode' in android for an action, I used that ( things like home, back, play/pause, etc ).

--------------------- Edit ----------------------

I was able to trace some of the codes that were in your logcat files.

For the MEDIA Key, I think it is these codes: B1=1 B2=0 B2=16 B2=11 - Which takes you to

dev/ReceiverMcu.java-OnHandleMain() -> module/main/HanderMain.java-mcuKeyPlayer()

public static void mcuKeyPlayer()
{
switch (DataMain.sAppId)
{
default:
JumpPage.audioPlayer();
return;
case 9:
JumpPage.videoPlayer();
return;
}
JumpPage.thirdPlayer();
}

For BAND - I think it is these codes: B1=1 B2=0 B2=16 B2=16 - Which takes you to

dev/ReceiverMcu.java-OnHandleMain() -> module/main/HanderMain.java-mcuKeyBand()

public static void mcuKeyBand()
{
if (JumpPage.isRadioTop())
{
DataRadio.sCmd.band(-1);
return;
}
JumpPage.radio();
}

Then the question becomes, would we want to replace the existing functionality or just modify it in some conditions?
[Android Head-Units] chammock:
Thanks gustden, I believe the launcher was working all along its just maybe my resume code wasn't working maybe it was just getting late. Anyway I realised that rather than trying to play on resume it would work just as well if I remove the pause on ACC off. Did that and seem to work fine so now I know the launcher.sh is working its just a case of modifying it to my tastes. Good suggestion to run the launcher manually to make sure its valid and permissions are set correctly.
[Android Head-Units] gustden:
I actually do most of the changes/testing of the launcher.sh using adb. I also have a program called "vysor" to remotely display the unit on my desktop computer. You can just run launcher.sh with adb and the argument the button you want to test.

> /data/launcher.sh 9 # test navi case

You see all the standard output in the adb window, also see if it does what you expected in the screen displayed in vysor. Works real nice.
[Android Head-Units] surfer63:
[MENTION=3076686]gustden[/MENTION]:

I made some more modifications to the Sofia Server apk.

One of the issues I had is that when using the Radio and the correctly assigned NAVI app, I did not get instructions (also mentioned here). With Google Maps and iGO it works, but not with other nav apps.

If you decompile the apk you will find in "assets/property" a set of (dos-line endings) text files, one of them is the navi_app.txt

It contains the following lines:

(Note: Joying did a bad thing when converting this text from, I think, Big-5 characterset to ISO-8859. Hence the unrecognizable characters. And why not UTF-8?)

#�Ծ��ſ�ʼΪע��:����Ӧ��
cn.com.tiros.android.navidog #����Ȯ
cn.com.tiros.android.navidog4x #����Ȯ2013
com.autonavi.xmgd.navigator #�ߵµ���
com.mapbar.android.mapnavi #����С��
com.pdager #��������
com.raxtone.flynavi #��¬�쵼��
com.uu.uunavi #���Ƶ���
com.baidu.navi #�ٶȵ���
cld.navi.mobile.mainframe #������
com.mapbar.android.mapbarmap #ͼ�ɵ���
#com.mapbar.android.carnavi #ͼ������
title.navi #����ͨ
cld.navi.c2802.mainframe #������
cld.navi.c3525.mainframe #������
cld.navi.c2198.mainframe #������ 2015/12/24�ø�����
com.navngo.igo.javaclient #IGO
com.basarsoft.igo.javaclient #IGO
com.mxnavi.mxnavi #�����ﶨ�Ƶ����е�ͼ
#com.txznet.txz #��֮��
com.autonavi.amapauto #�ߵ³�����
ru.yandex.yandexnavi
com.navitel
com.google.android.apps.maps #�ȸ赼��

I added:

com.mapfactor.navigator	#Mapfactor Navigator Free
com.generalmagic.magicearth	#Magic Earth
net.osmand	#OsmAnd Free
net.osmand.plus	#OsmAnd Plus
com.here.app.maps	#HERE WeGo
com.mapswithme.maps.pro	#MAPS.ME
com.waze	#Waze
com.navfree.android.OSM.ALL	#Navmii
com.navigon.navigator_one	#Navigon
com.tomtom.gplay.navapp	#TomTom Mobile Go
com.sygic.aura	#Sygic GPS
com.alk.copilot.mapviewer	#CoPilot GPS
cz.aponia.bor3.offlinemaps	#Offline Maps & Navigation
com.google.android.tts	#Google TTS
com.turboled.enhancedtts	#Enhanced TTs improves TTS

I am using Magic Earth and Mapfactor Navigator. In both I now get instructions using the Google TTS voice while playing the radio.

In the same folder you will also find a player_app.txt containing (some obscure) player apps.

I added:

com.maxmpz.audioplayer
com.maxmpz.audioplayer.unlock
com.vipercn.viper4android_v2_fx
com.jrtstudio.music
com.jrtstudio.AnotherMusicPlayer
com.jrtstudio.AnotherMusicPlayer.Unlocker
com.spotify.music
com.pandora.android

I don't experience any improvement yet (like the music app correctly pausing on sleep), but I don't use pandora, poweramp or viper4android. jrtstudio are the RocketPlayer aps.

I don't experience anything disturbing either.

The folder also contains the "unkill_app.txt" which, I think, contains the apps (package names) that are not killed upon sleep, which you already deactivated with the NoKill patch.

The attached zip contains your own V3 version apk, with modified text files, and the launcher.sh. I put in the launcher the "onekey navigation" option as I prefer to use the dedicated app. As I was not exactly sure whether you already discovered that one I added the navi="am start ......." line.

I will mail my "navi_app.txt" "patch" to Joying. See what they do.
[Android Head-Units] gustden:
Nice find! Do you know if defining an app in this file always allows it to "speak" when the radio is playing, or just when it is assigned as a navi app? Hopefully the former... I have several apps that I would like to have speak when the radio is playing, not just the Navi app.

My guess is all the "sofia" code is direct from an upstream platform supplier, so I suspect they won't do anything with it :(
[Android Head-Units] surfer63:
I did not test that but immediately tried. Yes, it also works when the app is not the dedicated navi app.

I am afraid of that as well. I have already been in contact with them about the issue and based on their questions to me they don't know what happens inside "their" apps or what is causing what. It can also be that "first line" helpdesk did not yet forward it to "second line" support. (but I don't think so :))

In which case I hope they forward it to their suppliers.

---------- Post added at 06:16 PM ---------- Previous post was at 05:49 PM ----------

As you can see I also added the Google TTS package name.

I will test tomorrow whether that might be sufficient in case you use Google TTS as voice in your navigation app as in that case the instructions actually do not come from your nav app, but from Google TTS.
[Android Head-Units] surfer63:
I think users can modify that in the launcher, can't they? For me personal the "BAND" button is absolutely useless. I only use my radio on 4 FM frequencies and I certainly don't want to switch to MW or LW.

Or am I misunderstanding you?

With respect to your install script: I slightly modified it and added a windows bat file. See attached.

Do with it what you like (or nothing at all).
[Android Head-Units] Polluti0n:
Does adding the Google TTS to the navi text file enable Google TTS from any screen? For instance, spoken responses from Google now?

If the TTS engine works with spoken responses that would be another huge break thru in this thread.

-Polluti0n
[Android Head-Units] gustden:
Thanks for the bat file, I will make sure I include this in future updates. For the shell script, just wondering about the check for root? I have no issues using adb running a standard user.

For the BAND button, it would be very easy to replace the function call to not call mcuKeyBand() and just call the shell script. Not sure how well this work very well, since many things related to the radio is handled "in MCU". It might make more sense to change it in a different place, so the BAND would perform its original function, and launch to the shell script of outside the radio. Hacking these things is alot of trial and error to see what works best.

I tried adding a couple of apps to the file, but neither would speak while on radio. I'll try adding google tts to see if that works.

------------- Edit -----------

I added the "com.google.android.tts" line to the navi_app.txt, now both automate and read-it-to-me can speak messages while the radio is playing :)
[Android Head-Units] surfer63:
my mistake.

Either you made the user part of the group that can start the adb server part, or you are not on a Debian based (Ubuntu,Mint, etc) linux, but something like Fedora, Slackware, Archlinux, (Open)Suse or the like.

In that case I should test on something like /etc/*release. I have no idea how complex that will be.

if [ "$(grep -Ei 'debian|buntu|mint|lsb' /etc/*release)" ];
then
#check for root
fi

hmm.

Just tell a user "if you are using a debian like linux ..." might be simpler :)

---------- Post added at 09:42 PM ---------- Previous post was at 09:33 PM ----------

I guess then that it works. Never thought of that.
[Android Head-Units] Polluti0n:
This thread has been great. Seems to me like the next logical step would be to write an app that manipulates the launcher script so users that don't feel comfortable editing the script can have a GUI. I am not volunteering as I have no free time, and the patch works perfect for me. I was just thinking out loud.

-Polluti0n
[Android Head-Units] gustden:
I am using Ubuntu and don't remember doing anything special to make it run without root. It is entirely possible I have though.

I added a couple of calls for the media and band keys in dev/ReceiverMcu.smali to call launcher.sh . The 2 cases you would need to add are 33 & 34.

33) MEDIA

34) BAND

The media key should work, just not sure about the BAND key as some of the functionality is done in the MCU. I also included the updated file navi_app.txt that you provided. It compiled and runs fine on my unit, but no way to test the media or band keys.
[Android Head-Units] surfer63:
Both work. I pushed the apk to the unit and added 33 & 34 with related "am start .." commands to the launcher and both work fine.

Thank you.
[Android Head-Units] chammock:
What are peoples experience with the resume function (Key 99)? I would assume that its the opposite as ACC_OFF but maybe this is not the case. I am having issues getting my music to resume when the units resumes (The ACC Power is switched on). I think my code is ok so I think its the resume function maybe not being when I think it should be. For example if switch of the ACC power and switch it back on 1 minute later should this tragger the resume function? Below is my code snippet using the standard launcher.sh as a base.

98) # ACC_OFF

$pause;

;;

99) # RESUME - executes on resume of system. Commands to be executed on resume

sleep 5; input keyevent 126;

;;
[Android Head-Units] gustden:
Does the play work when it has been sitting for a longer time and it goes into full standby?

This was originally intended to restart processes that were killed when the unit went into standby. It should be pretty easy to add ACC_ON.
[Android Head-Units] chammock:
Gustden, since my last post I have done some testing and it seems that the resume does indeed seem to execute if I leave the unit for say 30 minutes. So an ACC_ON code would produce a more consistent behaviour. Is there anything I can do to help identify the ACC_ON Code?
[Android Head-Units] wanb1i:
It worked great for my wife's 7" RAV4 unit, but not for my 8" Prius unit. The 8" now reboots every time I shut the car off, even if it's for just a few minutes. It doesn't remember ANYTHING, no steering wheel settings, no music playing, no tasker, nothing! Very frustrating! So, I'm going to remove it and replace it with the 12/5 version that was mod'd for the PTT to Google Search, which worked fine except for the forgetting thing.

Hopefully, another one will come out in the future I can try.
[Android Head-Units] gustden:
Which version of the steering wheel mod did you try? What ROM is the 8" Prius unit using?
[Android Head-Units] wanb1i:
The one with PTT & Resume (NoKill_google_voice_search)

ROM version is 12/8. I don't use the Joying UI, so I didn't see a reason to update in January and not enough info on the latest to make me go through the work.

BTW, my wife's 7" works great!

I also want you to know that I'm not not complaining and I hope it didn't come across that way. :cool:
[Android Head-Units] gustden:
Your the second person to have an issue like this. I was able to reproduce this by leaving VLC playing a video at the time it goes into standby, it will reboot afterwards. There are probably other apps that do the same if left actively playing.

The latest version of the key mods, I have added a "pause" to be sent at key off to stop any audio/video players. This seems to have eliminated the issue, at least for me.
[Android Head-Units] wanb1i:
The only thing that might be playing is PowerAmp & it was fine in the other version.

So, is there a newer version that has the PTT for Google Search and Resume that I can try?
[Android Head-Units] bogdi1988:
I guess we need a V4 now with this new update :P
[Android Head-Units] vassandrei:
I wonder if that main apk even got an update in the latest update
[Android Head-Units] chammock:
[MENTION=3076686]gustden[/MENTION], any update on the likleyhood of an ACC_ON option?

[MENTION=1007992]everyone[/MENTION] else, any users seeing odd behaviour from waze when resuming? I have found that on resuming, waze always resumes in focus over the top of every other app even if it didn't have focus on ACC_OFF. I am sure their might be a better solution to resolve this but I have essentially modified the launcher.sh to save the currently running app when ACC_OFF is triggered and then after leaving time for waze to load restore the previous app. As part of this I have also added a specific section to run different commands based on what the focus_app is for example when spotify restores it goes straight into the album cover screen. You could add other app cases if you wish.

I have attached my launcher with this code in if anyone wants to give it go. If you just want the changes then you will need to copy the line 71 - 78 and 190 - 202.

Also if anyone has any ideas how I can leave the screen blank for about 10 seconds while all the automated app changing is going on and I would appreciate your input. I have tried keyevent 26 and KEYCODE_POWER and KEYCODE_WAKEUP but these switch off the audio and this is not what I wan't.
[Android Head-Units] KamaL:
I'm planning (finally) to update my unit, I haven't updated the January and February ones yet, so I'll update straight to the latest one.

Is the apk for having resume function working properly on the March update? I'm not interested in key changes.

Has anyone tried it yet?

Also, do I need to root the unit to be able to replace the apk using es file Explorer?
[Android Head-Units] surfer63:
There are minor differences between the March version and the February version but it's not clear to me yet what that means. The part where the NoKill patch is placed has not changed.

The unit is "semi-rooted". If you use adb you have full root access and can simply replace the apk.

If you want to use es file Explorer you first have to install a Superuser apk like SuperSU which also modifies the policies (this is what a lot of users call rooting, but that is not correct).

---------- Post added at 10:33 AM ---------- Previous post was at 10:22 AM ----------

So I did sent the mail with a modified and original navi_app.txt, explaining that it now works correctly also for other applications using Google Voice. I even send them the working apk (without the NoKill and without the keymapping). [MENTION=3076686]gustden[/MENTION] also made his own copy/version which worked as well.

And the reaction this morning by Joying:

Hi Harry,

Nice day

Our engineer have checked, and we think that our head unit may can not support that

Hope you can use other map, like iGO, google map, waze,

Hope you can understand

Mandy

No, I don't understand!!!! :mad:

I already mailed that I hope their engineer will contact me so I can explain to him/her.
[Android Head-Units] KamaL:
Thanks for the reply.

I see what you mean with the Superuser apk.

Is it difficult to make the changes with adb without the need to install Superuser?
[Android Head-Units] surfer63:
If you download the CUSTOMV3 zip from gustden from the fist post you see that it contains a linux script to do the install.

I attached also a windows bat script to this post.

If you only want to use the NoKill version you simply copy the scripts to the folder on your pc containing the nokill version.

Remove the 3 launcher.sh lines in the script
[Android Head-Units] gustden:
I haven't had the chance to load the new ROM yet. I'm hesitant to upgrade, since my unit is working perfectly, and Marshmallow is supposed to a couple weeks away.

If someone can upload the latest apk (Sofia-1-C9-Server-V1.0.apk) from the March ROM, I can decompile and see if anything has changed.
[Android Head-Units] surfer63:
See attached the version from the 20170305 ROM.
[Android Head-Units] bogdi1988:
Where'd you hear about Marshmallow being a couple weeks away?
[Android Head-Units] gustden:
https://www.facebook.com/joyingradio/posts/623400534510592
[Android Head-Units] bogdi1988:
Hot damn! :)
[Android Head-Units] SebbiSt:
Hello Friends,

I read the whole thread, but i still don't get how to adjust the buttons for my JY-VL130N2

i want to adjust the NAV and Mute Button(which is on my VW steering wheel)

Is the NAV Button #9 for my unit too?

Which Number is the Mute Button on my steering wheel?

Thank you so much :)
[Android Head-Units] KamaL:
Had anyone tried the patch for no kill on the March update already?
[Android Head-Units] bogdi1988:
I think [MENTION=3076686]gustden[/MENTION] was looking into writing up the patch for March 05 update.
[Android Head-Units] KamaL:
Ok I'll wait then for hours update. Thanks