FORUMS
Remove All Ads from XDA

[FYT units] non-rooted app to modify the unit hardware buttons: FYT HW OneKey

2,716 posts
Thanks Meter: 1,054
 
Post Reply Email Thread
Hi,

I created an app that works on standard FYT ROMs (Joying, Funrover, some Witsons, some Sinosmarts, 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 is currently configured for the BAND(=radio), MEDIA, DVD and EQ button. The NAVI button already has its own FYT application onekeynavi.apk.
It does not work in combination with the Steering Wheel keys.

It is simple but has the great benefit that you do not need a rooted unit.
The app is < 30 Kb and starts therefore extremely fast.
Again: See on my github repository.
Attached Thumbnails
Click image for larger version

Name:	logo.png
Views:	464
Size:	9.5 KB
ID:	4725668   Click image for larger version

Name:	configurescreen.jpg
Views:	526
Size:	28.9 KB
ID:	4725669   Click image for larger version

Name:	specifyappbypackagename.jpg
Views:	516
Size:	18.0 KB
ID:	4725670   Click image for larger version

Name:	selectoncealways.jpg
Views:	522
Size:	10.3 KB
ID:	4725671   Click image for larger version

Name:	listinstalledapps.jpg
Views:	500
Size:	47.8 KB
ID:	4725674  
The Following 2 Users Say Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
 
 
17th March 2019, 03:05 PM |#2  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
** Reserved **
(You never know)
19th March 2019, 01:36 PM |#3  
IG_Vasilich's Avatar
Senior Member
Flag Mayence, Germany
Thanks Meter: 46
 
More
Hi Surfer.
I will check this app tonight.
My unit has 5 HW buttons: FF, REW, DVD, MUTE, MODE.
I want to change function for DVD (as the HU has no DVD drive), mute (as it repeats function of volume knob press) and Mode(to change it to app of my choice).
Will mute button work separately of volume knob press?
Is it possible to call specific activity on some app (if that app has several ones)?
Can you share the methods you have used in this app for rerouting button presses (short, in technical terms)?
Thanks in advance.
19th March 2019, 02:07 PM |#4  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
Quote:
Originally Posted by IG_Vasilich

Hi Surfer.
I will check this app tonight.
My unit has 5 HW buttons: FF, REW, DVD, MUTE, MODE.
I want to change function for DVD (as the HU has no DVD drive), mute (as it repeats function of volume knob press) and Mode(to change it to app of my choice).
Will mute button work separately of volume knob press?
Is it possible to call specific activity on some app (if that app has several ones)?
Can you share the methods you have used in this app for rerouting button presses (short, in technical terms)?
Thanks in advance.

The "application" buttons simply call the app connected to it. I could easily capture that.
Mode will not work as it is an internally arranged "carroussel" function in the server apk. I can't capture that.
I don't know whether the mute button acts differently from the volume knob press. Also in that case I can't capture it as it is a direct android keyevent call. You would really need Xposed to capture the entire function.

Currently my app only allows for calling an app by package name, which will always start the default launching activity. I have already the layout ready for a "call by intent" which allows you to call any activity which is defined in the AndroidManifest of that app: This is what you are asking for. I will also add a system call.
The point is that I wanted to wait how many people would use my app before putting more time in it. It has only been downloaded 4 times: 2x by me, 1x by you (I assume), and someone else (I guess Paul Borges).
Of course the "audience" is rather limited as it only deals with those units having hardware buttons.

This apk is really a non-rooted "poor mans" Xposed spin off. The options are really limited in comparison with Xposed, but then of course you need root and Xposed.

The working:
- I checked in the AndroidManifest.xml of the radio, music, dvd and eq apk what their launch intents/activities were.
- Then I created aliases for them in the AndroidManifest.xml of my OneKey app "targeting" those original intents/activities to activities in my app, which then call the configured apps.
- In that case Android finds two intents doing the same and therefore asking which app to start. It is actually exactly the same as clicking an html file where the Android Browser and Google Chrome (and/or firefox/opera/etc) have an intent defined which takes care of an html file. Or in case of a gpx file in case of several navigation apps.

Please have a look on my github at my AndroidManifest.xml. I think i put it quite understandably in there

Edit: If you investigate the launch intents for for example TomTom or PowerAmp or whatever app, you could also capture them via aliases in "your" app if you would want that. That is also what the Google package installer does when you compare it to the default AOSP android package installer.
The Following User Says Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
19th March 2019, 04:11 PM |#5  
IG_Vasilich's Avatar
Senior Member
Flag Mayence, Germany
Thanks Meter: 46
 
More
Thank you for explanation, got the trick with package names, and all the restrictions related to it. Nice idea!
Will report whether it will work for my DVD hw key.

Will also test it with media key - maybe it will help to replace some apps, hardcoded in the caroussel, with calls to my apps (though in that case your app has to be extended to the package names used in the caroussel).
20th March 2019, 08:09 AM |#6  
IG_Vasilich's Avatar
Senior Member
Flag Mayence, Germany
Thanks Meter: 46
 
More
Tested it. As it appeared, my HU has EJECT button, not DVD, so this button stays dead.
But i tested MODE button, and it calls following packages:
com.syu.radio
com.syu.bt - BT phone
com.syu.bt - BT AV
com.syu.video
com.syu.av
com.syu.music
????? - smth like ipod (i don't have ipod)

SO for that case i have already changed music player to the app i use for music. Maybe you can implement other package names as well, to be able to change some apps in caroussel mode to other ones (e.g. i don't use video on this unit, so i would like to change call to video player to call to DAB software).
And another question: in the list of installed apps with package names is it possible to copy package name, to later paste it in configuration dialog for replacing?
Thanks in advance
20th March 2019, 10:10 AM |#7  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
Quote:
Originally Posted by IG_Vasilich

Tested it. As it appeared, my HU has EJECT button, not DVD, so this button stays dead.
But i tested MODE button, and it calls following packages:
com.syu.radio
com.syu.bt - BT phone
com.syu.bt - BT AV
com.syu.video
com.syu.av
com.syu.music
????? - smth like ipod (i don't have ipod)

SO for that case i have already changed music player to the app i use for music. Maybe you can implement other package names as well, to be able to change some apps in caroussel mode to other ones (e.g. i don't use video on this unit, so i would like to change call to video player to call to DAB software).
And another question: in the list of installed apps with package names is it possible to copy package name, to later paste it in configuration dialog for replacing?
Thanks in advance

W.r.t. to the MODE carrousel: Yes, I can capture the activities/intents for the BT phone/AV options (one app, 2 launch intents) and the video and av apk. Music is already captured.
Eject does not call an app, but performs a "physical" action in the device (if a DVDplayer is installed). I captured that in Xposed where I capture the entire function. I'm afraid that won't be possible in this app.

Copying of package names: I already experienced that myself but it was not high on my priority list. I do not know why that doesn't work. It is a standard text field, which should allow copy&paste. I will google for it.
The Following User Says Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
20th March 2019, 10:34 AM |#8  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
Quote:
Originally Posted by surfer63

Copying of package names: I already experienced that myself but it was not high on my priority list. I do not know why that doesn't work. It is a standard text field, which should allow copy&paste. I will google for it.

Stupid. It requires 2 enties in the layout per textview. I did some copy&paste from one of my other apps and I did not copy that.
Code:
android:longClickable="true"
android:textIsSelectable="true"
So copy&paste now works in my local version. Not uploaded yet.
20th March 2019, 12:29 PM |#9  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
Not on release page, only in attached version:
- Added copy&paste
- Added BT phone and BT AV options for the MODE "carrousel" button.

@IG_Vasilich: As I do not have a MODE button on either of my 2 units, I can't test myself. Can you please test if the BT phone and BT AV options work? If so, I will also add video and av.

EDIT: Sorry. I made an error. File temporarily removed.

EDIT2: New version attached. With BT AV, BT Phone, Video and AV


Attachment removed. Version not correct.
22nd March 2019, 08:57 AM |#10  
IG_Vasilich's Avatar
Senior Member
Flag Mayence, Germany
Thanks Meter: 46
 
More
Sorry for late reply.
My HW button seems to be broken - nothing happens when i press it. And it worked the day before yesterday. Even with uninstalled HWOneKey app. So i tested it with Mode button from steering wheel (or actually any SW key mapped to Mode function - this way you can also test it ).
And there are the differences to previous version:
1. package name copy works!
2. Rado app starts instantly - no request for OneKey or Radio. in previous version i got a selection menu what to use. Have you changed anything related to radio?
And now the rest of report:
* Media button override works - i got selection dialog once, and then it just started the player i have selected in OneKey. Good.
* No other selection dialogs - neither for BT Phone, nor for BT AV. Just as before.
So with your last version only media(music) override works.
22nd March 2019, 10:39 AM |#11  
surfer63's Avatar
OP Senior Member
Flag Zwolle
Thanks Meter: 1,054
 
Donate to Me
More
Quote:
Originally Posted by IG_Vasilich

Sorry for late reply.
My HW button seems to be broken - nothing happens when i press it. And it worked the day before yesterday. Even with uninstalled HWOneKey app. So i tested it with Mode button from steering wheel (or actually any SW key mapped to Mode function - this way you can also test it ).
And there are the differences to previous version:
1. package name copy works!
2. Rado app starts instantly - no request for OneKey or Radio. in previous version i got a selection menu what to use. Have you changed anything related to radio?
And now the rest of report:
* Media button override works - i got selection dialog once, and then it just started the player i have selected in OneKey. Good.
* No other selection dialogs - neither for BT Phone, nor for BT AV. Just as before.
So with your last version only media(music) override works.

2. This can happen if you selected "Always" for the action to start the radio. Then you will have to undo the "default" activity/app/action. I assume somewhere from the settings, but I can't find it right now. I will do some googling. Normally you should be able to do this from Settings -> Apps -> "specific app" -> Clear Defaults.
I will check again on my unit, but as far as I can remember it did work for me.

The BT AV and BT phone and others: I will check this weekend. I can't test it myself, so it is a theoretical approach (and of course I could have made some other ordinary mistake).
The Following User Says Thank You to surfer63 For This Useful Post: [ View ] Gift surfer63 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes