Page 10 of 26
MiBandWFTool
Posted: 08 Jul 2019, 12:57
by lvpokka
Author
lvpokka
Tool Description
1. The tool is based on a modified version of AmazfitBipTools, thanks to the original open source .
2. The tool supports unpacking, packing of the official watch face bin file.
3. Mi band 4 supports 16,581,375 colors.
4. Mi band 5 supports 15,499,008 colors.
How to
1. Unzip
MiBandWFTool_X.X.zip.
2. Download
.bin file from catalog or get standard watchface file.
3. Drag the
.bin file to
WatchFace.exe (in step 1. , get the decompressed file)
(if there is only one log file, the decompression failed).
4. There are two ways to modify the dial.
- is to modify the corresponding image file and replace it with what we want.
- is to modify the corresponding json file and modify the position of the image.
5. After all the modifications are completed, drag the modified json into
WatchFace.exe in step 1 to get the corresponding bin file
(the file name depends on the name of the bin. If the .bin file is not generated, the package is wrong)
6. Copy the newly generated bin file to the corresponding directory of the mobile phone, and the synchronization will be completed. (This step is not very clear, you can refer to the original tutorial) above, you're done!
What's new
- added animation support
- fixed pulse and weather
- removed color restrictions for images
- analog clock support
ver1.2
- Added compatibility for Pulse progress bar
ver1.3
- added full support for transparent images
- drawing 20 frames for preview GIF
ver1.3.2
- bug fixes
- added 2 versions, both with transparency but Palette version uses less memory if images are simple.
ver1.3.3
- Added circular/linear step progress on preview
Stable v1.3.6
- locked transparency for palette mode, support only (0 and 255) values
- palette mode fix
Stable v1.3.7
v1.3.7 (cosmetic changes, you can use 1.3.6 if everything suits)
- Fixed GIF preview (Pulse rendering, Step segments, Kilometer drawing, Calories)
- Added the ability to choose which Set of images to use for WeekDays. (Config file WatchFace.exe.config)
- STRONGLY fixed json examples in README.
(to avoid problems, pack 1.3.6 and unpack 1.3.7 for a smooth transition)
Stable v1.3.8
- Removed image order dependency for json (sorting images no longer required)
- Fixed display bugs
Important: the order of the images should be from 0000 to XXXX without gaps.
v1.3.9
- Removed dependence on images order 0000->XXXX
- Calories rendering fixed
- Added ability to change Preview Speed (available from 50ms - 1000ms)
- TimeElement DrawingOrder hardcoded to 1234 (not used by MiBand4)
v1.4.1
- Other bugfixes
- New WF support
- Added new elements (time delimiter / step icon / linear progress )
v2.1.4
- Added support Mi Band 5 wfaces
- Pandafix (new unknown element)
- BugFixes
v2.1.5
- Preview bugfixes
- [WFPreview] Added Copy/Paste/Save ability
- [WFPreview] Added ability to replace watchface header
Mi Band 4 WF Tool
v1.4.2
- Added miles image support
NOTE:
- if your using image for MilesSuffixImageIndex, then KmSuffixImageIndex is required! you can use the same image for it
Mi Band 5 WF Tool
v2.1.6
- Preview bugfixes
- Watchfaces generating with random header identifier
- Fixed problem with Windows scaling, DPI is tied to 96
- [WFPreview] Removed ability to clone watchface header
Mi Band 6 WF Tool
v4.1.0
- Added Lunar calendar
- Bug fixes
- New preview generator, should be pixel perfect (big thx to Johnson070)
MiBandWFTool_4.1.0.zip
MiBandWFTool_2.1.6.zip [
alt url] [
alt url 2]
MiBandWFTool_1.4.2.zip [
alt url] [
alt url 2]
Re: MiBandWFTool
Posted: 09 Sep 2019, 19:16
by mamen
Hi,
Can someone give me some explanation on how this MiBandWFTool works ?
The thing is, I think I am doing the procedure correctly i think, but my .bin file gets >400kb's of size and fails installing on the mi band!
I download any theme on the website, drag it to the .exe, and next (without doing any changes) drag the generated json to the .exe. Only on this procedure, the size goes from 20 / 30 kbs to 400kbs.. I just dont get it.
Can someone help please ? I tried several version i get always the same result..
Re: MiBandWFTool
Posted: 09 Sep 2019, 19:33
by lvpokka
Read README and use palette mode
Re: MiBandWFTool
Posted: 09 Sep 2019, 19:46
by hammad497
lumenvindex wrote: 09 Sep 2019, 17:47
hammad497 wrote: 09 Sep 2019, 12:33
Is there a way to create a watchface that displays time in words instead of numbers?
Yes, there is. But it will take a lot of space.
Words.gif
Can you provide a bin for this? I want to try it. Thanks
Re: MiBandWFTool
Posted: 09 Sep 2019, 20:37
by lumenvindex
hammad497 wrote: 09 Sep 2019, 19:46Can you provide a bin for this?
Sure.
Re: MiBandWFTool
Posted: 10 Sep 2019, 19:04
by hammad497
Is there a way to position an element in front of the other? Like z-index? I am trying to create a WF where the tens images come on top of ones images.
Re: MiBandWFTool
Posted: 10 Sep 2019, 19:34
by lumenvindex
hammad497 wrote: 10 Sep 2019, 19:04
Is there a way to position an element in front of the other?
In some other devices there were
DrawingOrder parameter in
Time section. But Mi Band 4 ignored it. And the latest firmware changed ignorance to intolerance - watchfaces with this parameter don't show time at all.
Re: MiBandWFTool
Posted: 10 Sep 2019, 20:29
by fprietog
lvpokka wrote: 08 Sep 2019, 09:05
v1.4.0
https://yadi.sk/d/hZnqJhUsUK6zow
- Added image quantization converter algorithm, it will compress image if it will have too much palette colors.
-- Will not affect RAW images. Added flag (ForceImageCompressor) to config
- If animation RepeatCount is 1, it will repeat only once
- Gif animation frames will be the same as animation image count
-- Added flag (PrettyAnimationPreview) to config
- Added new animation generator, now gif will look clean
- Fixed 8bit image usage, now it will work fine in palette mode
- bugfixes
v1.4.0 doesn't works well under linux using wine-mono 4.9.2: the .png preview files are not generated. There are the errors shown by process:
.bin to folder:
Code: Select all
Could not load signature of ImageMagick.MagickImage:ToBitmapSource due to: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
Could not load signature of ImageMagick.IMagickImage:ToBitmapSource due to: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
System.TypeLoadException: Could not resolve the signature of a virtual method
at WatchFace.Program.UnpackWatchFace (System.String inputFileName) [0x00152] in <e2b42eaa96114c83aaf5d13095e1566d>:0
.json to bin:
Code: Select all
Could not load signature of ImageMagick.MagickImage:ToBitmapSource due to: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
Could not load signature of ImageMagick.IMagickImage:ToBitmapSource due to: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
System.TypeLoadException: Could not resolve the signature of a virtual method
at WatchFace.Program.WriteWatchFace (System.String outputDirectory, System.String outputFileName, System.String imagesDirectory, WatchFace.Parser.WatchFace watchFace) [0x0015b] in <e2b42eaa96114c83aaf5d13095e1566d>:0
I know that using mono instead of .NET will not generate .gif preview but several .png preview files instead. It works perfectly well in v 1.3.9.
Thanks and best regards.
Re: MiBandWFTool
Posted: 10 Sep 2019, 23:59
by lvpokka
yeah, probably new library is not truly support mono. I will check it, thx
Re: MiBandWFTool
Posted: 14 Sep 2019, 10:13
by jmtomi
Hi guys,
In the latest version of Mi fit app beside the usual watchfaces a new feature added where you can set the background image from your gallery for 3 predefined watchfaces and apply to your watch. The bin file created this way cannot be extracted by the tool, displays an error like parameter not found. Tried with version 1.4.0. Could you check? Shall I send the exact error or the bin file?
Thanks,
jmtomi
Re: MiBandWFTool
Posted: 14 Sep 2019, 12:46
by lvpokka
Check what? Did you attached bin file?
upd. discovered 3 new images. Delimiter for Time, Icon for Steps, SolidStepProgressBar.
1.4.1 is coming soon
Re: MiBandWFTool
Posted: 14 Sep 2019, 19:09
by jmtomi
I was not sure if you can create such a bin file, that's why I asked if you can check this error or shall I attach the bin file. Now I can copypaste the error:
Code: Select all
c:\Temp\MiBandWFTool_1.4.0\PaletteImageMode>WatchFace.exe ..\..\fad3cc5b0dc07f24
e2b9c6c9d73e63e7.bin
Processing file '..\..\fad3cc5b0dc07f24e2b9c6c9d73e63e7.bin'
Opening watch face '..\..\fad3cc5b0dc07f24e2b9c6c9d73e63e7.bin'
Reading parameters...
Parsing parameters...
*************>>******[ERROR]Parameter does not exists
And I attached the bin file and the logfile too.
Thanks a lot,
jmtomi
Re: MiBandWFTool
Posted: 15 Sep 2019, 08:02
by Toan
Tofuman89 wrote: 07 Sep 2019, 17:21
On the new firmware, there is a weird behaviour if there is "seconds" variable in the .json file of the WF. The seconds of the watch will be animated for the new firmware but everything else such as the steps, date, weekdays, calories, distance, heart rate will be hidden. For example is in this WF:
https://amazfitwatchfaces.com/mi-band-4/view/1853 . My day to day custom WF is now somewhat broken because of this bug. Does anyone have a workaround? Thank you
No one answered you, but you're right. With MiFit app v4.0.8 seconds will now update and all the other data are not updated. As result after one second you can see only background image and time. For now I'm using MiFit app v4.0.7 and seconds are fixed like before but if someone can give us a solution, if there is one, will be very appreciated. Thank you.
Re: MiBandWFTool
Posted: 15 Sep 2019, 10:49
by lvpokka
solution, don`t use seconds)))
actually we don't know, please help up test
Re: MiBandWFTool
Posted: 16 Sep 2019, 12:23
by SinE_
Hello team!
I'm not able to upload new watchfaces to my mi4, also, the watchfaces that I made before, are not visible in the "Personlanaized" tab.
Do you know if the procedure is the same?
Normally I paste the new Bin file with the presentations in a folder, in: \Phone\Android\data\com.xiaomi.hm.health\files\watch_skin_local
And they were available. Now, nothing appears. (the files are in, but MiFit App doesn't show them).
I was out about this matter for a month (Holidays time), and now, I'm lost...
Any help will be apreciated.
Re: MiBandWFTool
Posted: 16 Sep 2019, 19:46
by lvpokka
use
https://play.google.com/store/apps/deta ... _watchface, and read manual carefully
own can be uploaded by Notify & Fitness.. please dont ask how(100% works), it's not a right place for that, just google it)
Re: MiBandWFTool
Posted: 18 Sep 2019, 03:02
by Faizan A
hey there, I used this tool to edit a bin file for a watch face but after completing my work, I tried to compress it into a bin file again and did not succeed, I then tried to decompress the original bin file again and then recompress it without making any changes to it and it still gave me the same error.... "header.json or version file must be present in the folder with the images" how can I fix it.
Re: MiBandWFTool
Posted: 18 Sep 2019, 03:09
by Faizan A
hey there, I used this tool to edit a bin file for a watch face but after completing my work, I tried to compress it into a bin file again and did not succeed, I then tried to decompress the original bin file again and then recompress it without making any changes to it and it still gave me the same error.... "header.json or version file must be present in the folder with the images" how can I fix it.
Re: MiBandWFTool
Posted: 18 Sep 2019, 08:18
by lvpokka
v1.4.1
https://yadi.sk/d/qcQN824qWeP2lw
- Linux will use old GIF builder
- Other bugfixes
- New WF support
- Added new elements (time delimiter / step icon / linear progress )
Re: MiBandWFTool
Posted: 18 Sep 2019, 10:50
by jmtomi
v1.4.1 is extracting new bin files correctly! Thanks a lot!
Re: MiBandWFTool
Posted: 18 Sep 2019, 21:45
by fprietog
v1.4.1 is still not generating .png preview files under linux...
- using wine-mono 4.9.2 the tool doesn't works at all:
Code: Select all
Unhandled Exception:
System.BadImageFormatException: Could not resolve field token 0x04000004, due to: Could not load type of field 'WatchFace.Program:Logger' (3) due to: Could not load file or assembly 'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies. assembly:H:\Descargas\RawImageMode\WatchFace.exe type:Program member:(null)
File name: 'WatchFace'
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Could not resolve field token 0x04000004, due to: Could not load type of field 'WatchFace.Program:Logger' (3) due to: Could not load file or assembly 'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies. assembly:H:\Descargas\RawImageMode\WatchFace.exe type:Program member:(null)
File name: 'WatchFace'
There is a workaround: if you move all files from new lib folder to the same folder of Watchface.exe it works.
- using mono 5.18.0.240 (not wine) the tool works with the files under lib folder.
In both cases the preview .png files are not generated... You stated that
"Linux will use old GIF builder" but I guess that GIF builder never worked for mono. In the source of
Watchface/Program.cs from
valeronm's amazfitbiptools when mono is detected it generated .png files instead of a .gif file. You probably changed that behavior after v1.3.9 (i.e. the message
"Generating previews..." isn't logged anymore from that version):
Code: Select all
private static void GeneratePreviews(List<Parameter> parameters, Bitmap[] images, string outputDirectory, string baseName)
{
Logger.Debug("Generating previews...");
var states = GetPreviewStates();
var staticPreview = PreviewGenerator.CreateImage(parameters, images, new WatchState());
staticPreview.Save(Path.Combine(outputDirectory, $"{baseName}_static.png"), ImageFormat.Png);
var previewImages = PreviewGenerator.CreateAnimation(parameters, images, states);
if (IsRunningOnMono)
{
var i = 0;
foreach (var previewImage in previewImages)
{
previewImage.Save(Path.Combine(outputDirectory, $"{baseName}_animated_{i}.png"), ImageFormat.Png);
i++;
}
}
else
{
using (var gifOutput = File.OpenWrite(Path.Combine(outputDirectory, $"{baseName}_animated.gif")))
using (var encoder = new GifEncoder(gifOutput))
{
foreach (var previewImage in previewImages)
encoder.AddFrame(previewImage, frameDelay: TimeSpan.FromSeconds(1));
}
}
}
Thanks and best regards.
Re: MiBandWFTool
Posted: 18 Sep 2019, 22:37
by lvpokka
Nope 1.3.9 works same as now, i just start using new lib in 1.4.0 for gif creation... but i will check, thanks.
If someone can confirm that "GIF builder never worked for mono" then i will revert code for preview generator
hmm just check legacy code, there is png generators for mono(linux) so you probably somehow trigger IsRunningOnMono to false and its using new lib...
new code is
Code: Select all
if (IsRunningOnMono)
{
generating png
}
else{
if (IsRunningOnMono){ <<-- mistype)) in 1.4.1
generating gif old lib
}else{
generating gif new lib
}
}
Re: MiBandWFTool
Posted: 18 Sep 2019, 23:08
by fprietog
lvpokka wrote: 18 Sep 2019, 22:37hmm just check legacy code, there is png generators for mono(linux) so you probably somehow trigger IsRunningOnMono to false and its using new lib...
If you didn't change it the way to check if it is using mono was like that:
Code: Select all
private static readonly bool IsRunningOnMono = Type.GetType("Mono.Runtime") != null;
You may log a debug message telling if it's using mono (or not) in order to know it for sure.
¿Did you still have this line in newer code? (routine GeneratePreviews):
Code: Select all
Logger.Debug("Generating previews...");
I ask because that message is not logged anymore in v.1.4.0 and v1.4.1 but is logged in v1.3.9. If you haven't changed it, it should means that new versions are not reaching that line so problem may occurs before generating previews.
Re: MiBandWFTool
Posted: 19 Sep 2019, 09:57
by mysiak
I'm sorry if this has been asked before or I missed something, but I noticed that when I extract a watch face, modify JSON file and pack it back, quality of pictures degrade significantly. Also the file size differs a lot from the original WF (original bin 120kb, repacked palette 60kb, raw 380kb). Is there some special parameter to have higher quality palette mode or smaller raw file?
Thanks in advance.
Re: MiBandWFTool
Posted: 19 Sep 2019, 10:21
by lvpokka
nope) limit of colors is 255, do what you want with it...
To use palette mode you can use paint.net and save it with 8 bit, or use JUST one background raw image by using raw.cfg
if you have 3 results of file size then there is 100% using mixed raw images with palette mode
Re: MiBandWFTool
Posted: 19 Sep 2019, 12:21
by SinE_
Thanks for the info.
I "googled" a lot, and may be a didn't ask the correct question to Google.
For this reason I ask to the comunity.
regards