My device doesn't pair correctly with GadgetBridge.
The pairing process goes as follows:
Linked below is a log file (can't upload here???), starting from a fresh install of GadegtBridge, with my device not currently paired to either the Fossil app or the device itself. I tried to pair the device, got to the point where the pairing process was complete but the device was not showing in the app, but the notification says ‘Connecting’. I waited in this state for a few minutes before closing the app and repairing to the Fossil app. As this screen was displayed, the hands on the device rotated like before. On the watches display, it says it is connecting to a device, but any options to interact with the phone (e.g. find my device) were unsuccessful.
LOG FILE: https://pastebin.com/xKTMVWnq
Fossil Q Hybrid Collider HR (Firmware No: DN220.127.116.11r.v4)
Android 9 on my Samsung Galaxy Note 8
Your device is not a Fossil Q Hybrid. It is a Fossil Hybrid HR. And that is not yet supported by Gadgetbridge.
There is a branch created by @dakhnod, in this repository, which has experimental support, but it requires you to get hold of a secret key, probably with a rooted phone from the fossil app database (this is purely my speculation, based on how it works with the Mi Band 4).
Please be patient while the branch evolves, I might be able to help once I get the watch.
Ahh, my bad. Model numbers get confusing!
@dakhnod Would I be able to test your experimental version? I'm rooted and can be very active, to help test and develop your branch. I'm not in a state to compile the APKs myself, but I could probably do so within the week.
@imdanperks could you please do me a favor and find where the device key is stored by the fossil app?
I think about getting a fossil Hybrid collider HR. As far as I understand this right, there will be support in the future, but I have to compile the app by myself.
Yes there is a branch with incomplete WIP support.
But in any case you would need to get hold of a secret key, that requires you to use the official app once plus you need the knowledge of getting the key. :/
Could you give a short description on were to find the key in the fossil apps directory? I would guess somewhere in databases?
What is the procedure to use gadgetbridge then? Delete the fossil app without unpairing and start the fossil-q-hr branch gadgetbridge?
Thanks for the work so far, I would love to get rid of the official app.
No I think the key is somewhere encrypted with another key securely stored in the KeyStore. If you can find a way of getting it from there - that would be cool.
But there are at least two other, more difficult ways of getting the key, the one I used requires a lot of knowledge.
Right now I don't think it would make sense to document these methods, since support is in so early stages.
I have the clock since yesterday and some hints to get the key would be good. Even if I search for the key, how long is the key and need I to add some letters before like by the amazfit gtr?
You cannot search for the key in the Fossil app, sorry. It is simply not there.
But anyway, if you insist to try, the key is 16 bytes log (128 bit), stored as hex the key would be 32 ASCII characters long.
In Gadgetbridge this key is prefixed with 0x
The way I got the key is really very complicated, and even if you manage to do it how I did it, you still will end up with very incomplete support in Gadgetbridge.
I think it would be best to wait till someone creates a modified app which spits out the key, like people did with Mi Fit. However personally won't be part of the effort, because that would be probably illegal.
The complicated way I used was without tampering with the original app.
If you are using the offical app, maybe you can answer if the watch is constantly vibration on incoming calls or if it will just disaplay a notification?
I have documented on how to get the key. Let's see how long it works, now that I have disclosed my method.
You might have to read tutorials on how to use mitmproxy with Android, that is probably not for the average user, you have been warned... :smirk:
thanks a lot. works fine.I have build the debug app and there are some errors about AssetFilePutRequest, do you need the debug output?
I am happy that my instructions were actually useful to at least you :)
We do not need debug output. This error happens when changing the widgets on the watchface.
Also I think it is not time for error reports yet - we are aware that thinks are not finished :)
as I was just too lazy to use mitmproxy I located the key in the configuration files of the original app.
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<string name="text_encryption_secret_key">SECRETKEY= </string>
The first 16 bytes of
echo "SECRETKEY=" | base64 -d | hexdump -C
prefixed by 0x were indeed the infamous key and worked in Gadgetbridge.
echo "SECRETKEY=" | base64 -d | hexdump -C
Wait, wait, wait...
I know that key.
That key is used for encrypting/decrypting the logs. It is different from the pairing key here.
That key also never changes (because it is for the “global” device independent logs) when you remove or add new devices which all have different keys, so how can that work?
The only thing I can think about is that (due to a bug?) it is the same as the key which the first paired device gets IF the first attempt works (multiple pairing tries generate different device keys, but same log encryption key).
Can anyone confirm?
Very interesting progress. This request made my choose that device instead of garmin :smile:
Have a question regarding the integration - will it support tasker activities integration like “alarm triggered”?
I built the version off master and IMO it works quite well. Being able to set a custom background is the only feature I was missing.
I did run into one bug; the time was off by one hour (I'm in EDT right now). Even after connecting to the official app and “fixing” the time, then reconnecting using GB with the ‘Sync Time’ setting to off, it would still change the time to be 1 hr less than the actual time. Any suggestions or workaround?
Also, I noticed there's a ‘time offset’ setting for Fossil hybrid watches, but that section isn't enable when connected to the Q HR.
EST is daylight saving time?
We still have standard time in Europe, so maybe we are just missing DST offset, should be an easy fix!
Can you try again?
That fixed it. Thanks for the quick fix!
For anyone else who'd like to test, here is what I've found so far:
For tasker (commute app) actions, you can handle intent: nodomain.freeyourgadget.gadgetbridge.Q_COMMUTE_MENU with param extra_action='destination’.
To send response for tasker (commute app) actions, send Intent: nodomain.freeyourgadget.gadgetbridge.Q_SET_MENU_MESSAGE with EXTRA_MESSAGE='your response’.
Button presses can be changed in service/devices/qhybrid/requests/fossil_hr/buttons/ButtonConfigurationPutRequest.java
I've found that the following apps work: commuteApp, weatherApp, musicApp, stopwatchApp.
@ashimokawa or @dakhnod is there an ‘app’ to get to the notification list?
Thanks for the information!
But I removed link to decompiled code (Accidentally actually removed your whole post, sorry)
The core team does not use decomiled code, it is tempting and easy but legally questionable. We use bluetooth logs, it takes more time but should be safe.
I know the buttons have to be made configurable, that is on my list (currently I put weather on the upper button and left the rest to commuteApp).
@ashimokawa thanks, didn't know about that.
@ashimokawa I had just finished adding in configurable button actions (don't worry, mine was a crazy mish mash of bad code; I haven't used Java in ages, so I'm happy to see your changes) and when I went to pull master I realized you had made the changes too.
Just tested out your changes and they work very well. Thanks! I also used the Fossil app to update to the latest firmware, and the new firmware continues to work well with GB.
@hackoder is the alarm clock works well?
@asafb26 last time I checked alarms worked
Sorry for duplicating the work, maybe the commit can serve a blueprint for further changes.
So the process is
Add a new option to an xml file, make it fine grained to make it reusable if it is not strictly device specific.
Add it to public int getSupportedDeviceSpecificSettings(GBDevice device) in the Coordinator class if 1 has been done in a new xml, if done in the device's main xml skip this step
add the handler to DeviceSpecificSettingsFragment.java (addPreferenceHandlerFor())
react in onSendConfiguration() in the device support class to make changes effective immediately when togging.
(This should go to the wiki with a concrete example)
@ashimokawa Does the music app work as expected for you? I can get the controls (next, prev, play, pause) to work correctly, however the currently playing info as well as current state (play/paused) doesn't seem to be sent to the watch yet. Is that correct or just an issue with my configuration?
@hackoder I just tested that, and after removing Spotify from the notification blacklist music info worked.
@ashimokawa maybe we should ignore notification blacklists when dealing with music info?
Yup, removing from notification blacklist fixes it. Nice!
No due date set.
This issue currently doesn't have any dependencies.
Deleting a branch is permanent. It CANNOT be undone. Continue?