ghtalpo / py_amazfit_tools Goto Github PK
View Code? Open in Web Editor NEWpack/unpack .bin for amazfit verge lite/gtr/gts
pack/unpack .bin for amazfit verge lite/gtr/gts
The Bluetooth icon in the json ends up being the lock screen icon on the converted watch face.
The lock screen icon seems to always show up in off state.
I see in the code there is worked on child parent base, i also see that the function dayprogress hasnt got its own element yet. I have a problem that i try to get this function dayprogress behind other elements, ideal would be behind the background.
Also in the background there we have a option to set the X and Y for this element but it doesnt work. When image is smaller then 454 x 454 on the gtr its shown in the left upper corner, if we could fix this i can fix my date problem. (rotating date behind clock).
Please help!
Hi, I've seen that on GTS the coordinates sometime can be an Array/List.
I've tried to implement something to make unpack/pack to work correctly, but I can't figure out the best way to do that
I think the json should become something like this:
"Battery": {
"Icons": {
"FirtsImageIndex": 12,
"Coordinates": [
{
"X": 10,
"Y": 20
},
{
"X": 20,
"Y": 10
},
]
}
}
},
Any hint?
Regards,
Eddi
For example Battery on some original GTR watchface looks like
4A 05
- 4A _id(9), flags(2)
- 05
08 90 02 10 2C
08 -> _id(1), flag(0)
90 -> offset 272
02 -> ---'
10 -> _id(2), flag(0)
2C -> lenght 44
{1A2A 085B 1206 08E10210AB02 1206 08D00210C102 1206 08BB0210D502 1206 08A20210E702 1206 08870210F402
what is expected:
{
"Battery": {
"Icons": {
"FirtsImageIndex": 91,
"Coordinates":
[ {
"X": 353,
"Y": 299
},
{
"X": 336,
"Y": 321
},
{
"X": 315,
"Y": 341
},
{
"X": 290,
"Y": 359
},
{
"X": 263,
"Y": 372
}
]
}
}
}
what we have now:
{
"Battery": {
"Icons": {
"FirtsImageIndex": 91,
"Coordinates": {
"X": 263,
"Y": 372
}
}
}
}
Packing a bin for gtr47mm from demo.json (example_watchface) adding bluetooth section (and pngs as well) results in a always BT OFF icon displayed.
Hi @ghtalpo thank you so much for your contributions.
I was trying to extend this existing fork for GTS2 (https://github.com/Tnxec2/py_amazfit_tools/tree/GTS2) to GTS2-mini. But so far, I can't understand how to deals with bin and the HEX editors in order to know the internal structure of the binaries.
For the time being I'm using the provided Huami web tool to create some watchfaces but I really would like to contribute here.
Any suggestion will be appreciated!
Thanks
PS: I was looking at this file: https://github.com/ghtalpo/py_amazfit_tools/blob/master/analysis.md but not sure how to start with the gts2-min bin files.
Hi Ghtalpo,
Here is GTS but i expect the same on gtr and other watches in the near future...
I need some help in decoding an unexpected byte:
Sports Circle:
https://store-cdn.huami.com/market_app/20191029/dca475518b08e48c90d592fbc8bfe817.bin
Fluorescence:
https://store-cdn.huami.com/market_app/20191130/0e7b2617d07122eb6b2b2538621a841a.bin
these are just an example... however on Fluorescence I have more evidence...
On Activity Parameter as you can see I get two time the Id 3.
Parmeter4:
2 (12): 18 bytes
1 ( 8): 266 10A
2 (10): 38 26
3 (18): 318 13E
4 (20): 53 35
5 (28): 24 18
6 (30): 0 0
7 (38): 2 2
8 (40): 10 A
3 (1A): 16 bytes
1 ( 8): 34 22
2 (10): 38 26
3 (18): 74 4A
4 (20): 53 35
5 (28): 72 48
6 (30): 0 0
7 (38): 2 2
8 (40): 10 A
11 (5A): 37 bytes
1 ( 8): 54 36
2 (10): 46 2E
3 (18): 37 25
4 (20): 37 25
5 (28): 18446744073709551485 FFFFFFFFFFFFFF7D
6 (30): 131 83
7 (38): 8 8
8 (40): 18446744073706601289 FFFFFFFFFFD2FB49
9 (48): 0 0
13 (68): 12 C
17 (8A): 1 bytes
7 (3A): 2 2
1 ( A): 38 bytes
1 ( 8): 292 124
2 (10): 46 2E
3 (18): 37 25
4 (20): 37 25
5 (28): 18446744073709551485 FFFFFFFFFFFFFF7D
6 (30): 131 83
7 (38): 8 8
8 (40): 18446744073706601289 FFFFFFFFFFD2FB49
9 (48): 0 0
3 (1A): 16 bytes
1 ( 8): 0 0
2 (10): 0 0
3 (1A): 4 bytes
1 ( 8): 0 0
2 (10): 0 0
4 (22): 4 bytes
1 ( 8): 0 0
2 (10): 0 0
18 (92): 1 bytes
2 (12): 2 2
2 (12): 16 bytes
1 ( 8): 0 0
2 (10): 0 0
3 (1A): 4 bytes
1 ( 8): 0 0
2 (10): 0 0
4 (22): 4 bytes
1 ( 8): 0 0
2 (10): 0 0
If in parameters.py - def readFrom() I add
+ if value == 1 and flags.hasFlag(ParameterFlags.hasChildren):
+ value = Parameter.readValue(fileStream, traceOffset)
if flags.hasFlag(ParameterFlags.hasChildren):
All get more sense and the repeated rowid get nested under the previous element.
But why i have that unexpected 1 byte? how i can store in the json this information?
Regards E.
Seems Huami added full date format (yyyy-mm-dd) and personalized steps bar and pulse rate.
Here a sample watchface
sample bin
Hi, i created several watchfaces for GTR-47mm.
Although they seem to be ok, when installed at the watch they fail.
I'm not sure what it's the problem with them. i created others some time ago and there is no problem with them
Can anybody give me some light ? Do not understand where the problem is with this one:
https://amazfitwatchfaces.com/gtr/view/2714
Thank you very much in advance!
There is a way to use it with amazfit gts?
cant unpack virge lite wf https://amazfitwatchfaces.com/verge-lite/view/139
end of log:
2019-08-28 20:29:54,532 - root - ERROR -
Traceback (most recent call last):
File "D:\py_amazfit_tools-master\py_amazfit_tools-master\program.py", line 86, in readWatchFace
reader.read()
File "D:\py_amazfit_tools-master\py_amazfit_tools-master\watchFaceParser\reader.py", line 42, in read
self._resources = Reader(self._stream).read(imagesCount)
File "D:\py_amazfit_tools-master\py_amazfit_tools-master\resources\reader.py", line 38, in read
bitmap = Reader(self._stream).read()
File "D:\py_amazfit_tools-master\py_amazfit_tools-master\resources\image\reader.py", line 25, in read
assert(False) # not implemented
AssertionError
The delimiter image defined on json is not visible on preview and design canvas
for example
"Delimiter": {
"X": 192,
"Y": 152,
"ImageIndex": 12
}
despite this the image is present in the final file bin, the problem is only on editor
Work with Amazfit gtr2 watchfaces?
Hi Ghtalpo,
this new face introduces new structure..
"https://store-cdn.huami.com/market_app/20200109/382057225cafa13aad367d7eaa869dd8.bin"
this introduce supports for animations in fw 1.3.5.37
my current array implementation in buggy with this new structure :-(
i have no idea yet about how to implements the preview animations :-(
feel free to do your considerations
watchface.py:
from watchFaceParser.elements.unknownType11 import UnknownType11
[...]
11: { 'Name': 'Unknown11', 'Type': UnknownType11},
elements/unknownType11.py :
from watchFaceParser.elements.timeElements.twoDigits import TwoDigits
from watchFaceParser.elements.unknown11Elements.unknownType11d1 import UnknownType11d1
from watchFaceParser.elements.unknown11Elements.unknownType11d2 import UnknownType11d2
class UnknownType11:
definitions = {
1: { 'Name': 'Unknown11_1', 'Type': [UnknownType11d1]}, #x/y coordinate moving??
2: { 'Name': 'Unknown11_2', 'Type': UnknownType11d2}, # animation??
}
elements/unknown11Elements/unknownType11d1.py:
from watchFaceParser.elements.basicElements.coordinates import Coordinates
class UnknownType11d1:
definitions = {
1: { 'Name': 'Unknown11d1p1', 'Type': 'long'},
2: { 'Name': 'Unknown11d1p2', 'Type': Coordinates}, #start position
3: { 'Name': 'Unknown11d1p3', 'Type': Coordinates}, #end position
4: { 'Name': 'ImageIndex', 'Type': 'long'},
5: { 'Name': 'Unknown11d1p5', 'Type': 'long'}, #maybe period
6: { 'Name': 'Unknown11d1p6', 'Type': 'long'},
7: { 'Name': 'Unknown11d1p7', 'Type': 'long'},
8: { 'Name': 'Unknown11d1p8', 'Type': 'long'}, #maybe y increment
9: { 'Name': 'Unknown11d1p9', 'Type': 'long'},
10: { 'Name': 'Unknown11d1p10', 'Type': 'long'},
}
elements/unknown11Elements/unknownType11d2.py:
from watchFaceParser.elements.basicElements.imageSet import ImageSet
from watchFaceParser.elements.basicElements.coordinates import Coordinates
class UnknownType11d2:
definitions = {
1: { 'Name': 'Unknown11d2p1', 'Type': ImageSet},
2: { 'Name': 'Unknown11d2p2', 'Type': 'long'}, #sleep between images
3: { 'Name': 'Unknown11d2p3', 'Type': 'long'}, #???
4: { 'Name': 'Unknown11d2p4', 'Type': 'long'}, #????
5: { 'Name': 'Unknown11d2p5', 'Type': 'long'}, #pause between loop??
}
$ python3 convert.py gtr47
GTR source
Traceback (most recent call last):
File "convert.py", line 112, in
Converter().resizePng(inputFileName)
File "convert.py", line 89, in resizePng
self.resizeJson(full_path)
File "convert.py", line 53, in resizeJson
self.patchTree(tree)
File "convert.py", line 43, in patchTree
value = tree[k]
TypeError: list indices must be integers or slices, not dict
main.py wont open
Seems like weather and temperature are available on the GTR.
Here is an official watchface that has both of them:
33264f0313c9043d70c0a5bbc21e2367.zip
If you could add support for it I'd appreciate it.
Thanks.
Hi, I want to use this program to create watchfaces to mi band 4c. I program in python but I don't know where to start to make it work with my band 4c.
Hi ghtalpo,
I tried two of Your branches (master, gtr) but I am not able to decompile correctly the Amazfit Rainbow Watchface i got this log (log is generated with master version)
Amazfit_RainbowCircle.log
I am using Python 3.8 x64 and latest Pillow 7.0.0 thanx for help
Best regards Horatius80
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.