Software Development [FYT units] FytHWOneKey: non-rooted app to assign other apps to the unit hardware buttons

Search This thread
ok here is something to play with,

1) Fixed AudioFocus when announcing app, it should now lower background app, announce, and then reset background volume.
2) You can now set up splitscreen pairs if your app and HU support splitscreen. Simple put a ";" between 2 apps you want in splitscreen("com.waze;com.android.chrome|My split screen,com.spotify|Spotify")

May still be some glitches with splitcreen, first app should be on the left, but seems I may need a reset in there somewhere as it sometimes swaps them. If the apps don't com up splitscreen try switching the app order. For some reason I haven't figured out some apps like to come up one side or the other in split screen. It may have to do with history of openning app in split screen, still trying to work this out.

FYI other than some clean up this is probably all the features I could come up with, but open to suggestions. Otherwise I'll probably start ripping apart the built in SWC app to see how much control we can get.
 

Attachments

  • fyttoggle.apk
    1.5 MB · Views: 41
Last edited:
that's very strange. Unfortunately without having it front of my I'm out of ideas. You could try installing an intent logger. Not sure they will work on the HU, but worth a shot
Yeah don't worry fellow, you provided me enough help, and waste your time to help me with this, I'll finally find it one day and then I'll post here the solution (if interested of course)

Many thanks for all
 

TorstenH

Senior Member
Feb 20, 2021
2,733
1,010
t.me
Realme GT 2 Pro
On Junsun devices the app doesn't work. E.g. activiy to start Bluetooth music app is com.ts.bt.BtMusicActivity.
Attached you can find the manifest file of the MainUI.apk
 

Attachments

  • AndroidManifest.zip
    51.5 KB · Views: 17
On Junsun devices the app doesn't work. E.g. activiy to start Bluetooth music app is com.ts.bt.BtMusicActivity.
Attached you can find the manifest file of the MainUI.apk
Yes unfortunately right now if the main SWC doesn't map to a know SYU activity you can't remap. I'll take a look later, I can maybe build you a version that will do the same for you activities
 

TorstenH

Senior Member
Feb 20, 2021
2,733
1,010
t.me
Realme GT 2 Pro
Yes unfortunately right now if the main SWC doesn't map to a know SYU activity you can't remap. I'll take a look later, I can maybe build you a version that will do the same for you activities
Looking forward to hear from you.
Yes unfortunately right now if the main SWC doesn't map to a know SYU activity you can't remap. I'll take a look later, I can maybe build you a version that will do the same for you activities
Maybe best chance with
com.ts.main.navi.NaviMainActivity
because navi and carousel can be started by SWC.
 
Looking forward to hear from you.

Maybe best chance with
com.ts.main.navi.NaviMainActivity
because navi and carousel can be started by SWC.
Give this a shot, if it works there are other activities I can try mapping for you. For now I mapped your com.ts.bt.BtMusicActivity to BTAV and
com.ts.main.navi.NaviMainActivity to OneKeyDVD

see if either of those give you control you want.
 
New version which will use Split Screen Launcher if installed and you tell it to. Rather than just pulling all this apps code into FYT, I decided(at least for now) to use that app if it's installed to gain improve split screen options.

The fallback code I had is still there if you tell it not to use Split Screen Launcher, but it is unreliable.

Split Screen Launcher: https://play.google.com/store/apps/details?id=com.fb.splitscreenlauncher&hl=en_US&gl=US

also including source code as I am approaching the end of my needs for this app.
 

Attachments

  • fyttoggle.apk
    2.6 MB · Views: 33
  • src.zip
    44.3 KB · Views: 19

TorstenH

Senior Member
Feb 20, 2021
2,733
1,010
t.me
Realme GT 2 Pro
odd it's removing my attachments today. I tried to PM you and it did the same

FInally, something was wrong now it isn't wwho knows.
Thank you very much for your help. I tried the app but it doesn't work. Maybe the apps are started by the steering wheel keys in another way. But that's not a huge problem because my solution with Automate is running without problems.
 
anyone ever figure out if the physical rotary buttons have interceptable events? I can't map them in either panel keys or SWC setup. Mine came mapped to volume, mute and tune/next play/pause.

I'll start digging but figured I'd ask here first. If they are coded into system level actions, there's not much without root. honestly the only thing I'd change is I want the PUSH of the volume to do next song
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    logo.png

    Hi,

    I created an app (first release March 2019) that works on standard FYT ROMs (Joying, T'eyes, KingBeats, NaviFly, Funrover, some Witsons, some Sinosmarts, iDoing, etc) and allows to modify the standard actions (started apps) of a number of the hardware buttons on the units.

    See on my github repository.
    It does not (always) work in combination with the Steering Wheel keys if they are controlled by the CANbus..

    It is simple but has the great benefit that you do not need a rooted unit (YOU DON'T NEED ROOT, but it functions just as well on a rooted unit).
    The app is < 50 Kb and starts therefore extremely fast.
    Again: See on my github repository.

    New release 1.6.0 18 December 2022:
    Changelog:

    Download this 1.6.0 version.

    For a "Changelog" about this and previous versions, you can visit the general Releases page.


    Currently there are 4 options to "start something" with the "Call method"
    • by package name
    • by intent (package name / intent)
    • by system call (terminal command(s) or script)
    • by LlamaLab Automate Flow URI (Automate various tasks; Added by giladgd (Gilad S.)

    configurescreen.jpg


    configurescreen-2.jpg

    configurescreen-3.jpg

    by package name: This is NOT the name of the apk but the internal package name. How do you get this "package name"?
    • Use the "List all Installed apps" option in the main screen of the settings. It shows the app icon, the app name and the package name. This package name is what you need. You can select it and copy & paste it into the field.
    • Search in play.google.com for the app you want to start. Say you want to start the navigation app "Magic Earth" and you have selected that one in the play store (in a browser, not the android app). In the address bar you will then see "https://play.google.com/store/apps/details?id=com.generalmagic.magicearth". The bold part behind the "id=" is your package name.

    by intent: Every app has a "launch" intent to start the app. Some apps can also be started with other intents to immediately start a specific function. Google Search can be started with the launch intent, but you can also start it with the Google Voice search option intent. The Google (Search) package name is "com.google.android.googlequicksearchbox", the specific intent for google voice search is "com.google.android.googlequicksearchbox.VoiceSearchActivity". The combined "String to be used" is therefore "com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearchActivity".
    Another example is the Joying Bluetooth apk having intents for the dialer (default launch), the call receiver, the bluetooth streaming, the pairing and a few more.

    by system call: A system call can be a direct (linux) command or a shell script or a binary (to do something).
    = Commands can be a single command as in:
    1. "ls -l > /sdcard/some_file.txt" to capture a directory listing to a file
    2. "input keyevent 3" => Go to the Home screen (of the default launcher)
    3. "am start -a android.intent.action.MAIN -c android.intent.category.HOME" => Go to the Home screen (of the default launcher)
    4. "input keyevent 127" => pause active media player (any media player)
    5. "input key event 126" => (re)start last used media player.
    6. "am start com.syu.radio/com.syu.radio.Launch" => Start the radio app with the default launch intent (or better use "by package name": com.syu.radio; Or use "by intent": com.syu.radio/com.syu.radio.Launch)
    As you can see from the 2nd and 3rd example, there are multiple ways to do something.
    From the 6th example you can see that you can start an app (the radio) from the command line with "am start <full intent>", or by package name, or by intent directly.

    by Automate Flow URI: Every Flow in LlamaLab Automate has a URI you can find in its Flow Beginning block.
    For example: content://com.llamalab.automate.provider/flows/7/statements/1.

    If you want to start one Flow on a short button press and a different Flow on a long button press, you can set the value to be the short press Flow URI, followed by a new line with the maximum time to wait for a second button press in milliseconds, followed by a new line with the long press Flow URI.
    For examples on how to use a created flow from FytHWOneKey, see the Readme on the github repository site. On how to use LlamaLab Automate itself you have to visit the LlamaLab website.
    5
    Yes, I also strongly disagree on these kind of actions. You request assistance in the forum, solve it yourself, which is good, and don't want to share the solution with everyone?
    Then what do you do here on a forum where a lot of people share their knowledge?
    2
    New version which will use Split Screen Launcher if installed and you tell it to. Rather than just pulling all this apps code into FYT, I decided(at least for now) to use that app if it's installed to gain improve split screen options.

    The fallback code I had is still there if you tell it not to use Split Screen Launcher, but it is unreliable.

    Split Screen Launcher: https://play.google.com/store/apps/details?id=com.fb.splitscreenlauncher&hl=en_US&gl=US

    also including source code as I am approaching the end of my needs for this app.
    2
    Yep, here are the steps for disabling the stock radio and get navradio+ assigned to the hardware button "BAND" .
    All done on Joying JY-VQ131N4GN , firmware 2021-11-11.
    a) remove the original stock app, after installing navradio+
    >> look at this post: https://xdaforums.com/t/dev-new-nav...and-sc9853i-fyt-devices.4387965/post-86251885
    b) use this link, to do the settings on assigning the hardware button "BAND. We only talk about the "BAND" button here, nothing else
    >> https://xdaforums.com/t/fyt-units-f...er-apps-to-the-unit-hardware-buttons.3912075/
    download the apk to your car device and install it.
    then you have to close it again, i guess.
    open FYT HW OneKey Config app again, select "List all installed apps" , scroll to the AppName: NavRadio+ .
    copy the Package Name: com.navimods.radio to the clipboard, you will need it.
    One step back, select "Configure the BAND button".
    > BAND Key:Call Method >> by package name ( i got no ok button, can not be changed , so click on cancel )
    > BAND Key: Action string to be used >> copy the string "com.navimods.radio", or whatever you copied from the app listing into. OK.
    Close the app.
    A reboot for safety, afterwards pressing the hardware button "BAND" brings the fabulous NAvradio+ app, with great FM music :D :D

    All, really all credits go to @surfer63 , Surfer63 , you are really a genius !!! Chapeau !!!
    2
    Version 1.4.0 Beta
    Beta due to insufficient testing possibilities as I myself have a unit with only HOME/BACK/Vol+/Vol- buttons

    In previous versions you could only start an app by package name like: com.syu.radio if you wanted to start the FYT radio (BAND) app.
    Currently there are 3 options to "start something" with the "Call method"

    • by package name
    • by intent (package name / intent)
    • by system call (terminal command(s) or script)
    by package name: This is NOT the name of the apk but the internal package name. How do you get this "package name"?
    • Use the "List all Installed apps" option in the main screen of the settings. It shows the app icon, the app name and the package name. This package name is what you need. You can select it and copy & paste it into the field.
    • Search in play.google.com for the app you want to start. Say you want to start the navigation app "Magic Earth" and you have selected that one in the play store (in a browser, not the android app). In the address bar you will then see "https://play.google.com/store/apps/details?id=com.generalmagic.magicearth". The bold part behind the "id=" is your package name.

    by intent: Every app has a "launch" intent to start the app. Some apps can also be started with other intents to immediately start a specific function. Google Search can be started with the launch intent, but you can also start it with the Google Voice search option intent. The Google (Search) package name is "com.google.android.googlequicksearchbox", the specific intent for google voice search is com.google.android.googlequicksearchbox.VoiceSearchActivity. The combined "String to be used" is therefore com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearchActivity.
    Another example is the Joying Bluetooth apk having intents for the dialer (default launch), the call receiver, the bluetooth streaming, the pairing and a few more.

    by system call: A system call can be a direct (linux) command or a shell script or a binary (to do something).
    = Commands can be a single command as in:
    1. ls -l > /sdcard/some_file.txt to capture a directory listing to a file
    2. input keyevent 3 => Go to the Home screen (of the default launcher)
    3. am start -a android.intent.action.MAIN -c android.intent.category.HOME => Go to the Home screen (of the default launcher)
    4. input keyevent 127 => pause active media player (any media player)
    5. input key event 126 => (re)start last used media player.
    6. am start com.syu.radio/com.syu.radio.Launch => Start the radio app with the default launch intent (or better use "by package name": com.syu.radio; Or use "by intent": com.syu.radio/com.syu.radio.Launch)
    As you can see from the 2nd and 3rd example, there are multiple ways to do something.
    From the 6th example you can see that you can start an app (the radio) from the command line with "am start <full intent>", or by package name, or by intent directly.


    (See post #1 for screenshots)