ZMake

(zmake - ZeppOS make)

Unofficial ZeppOS build tool. This application was developed for community-driven watchface and application development for Xiaomi Smart Band 7. But you also can use it for any other ZeppOS-device, if want.

It can:

Installation & Usage

Prebuild binaries can be downloaded here. Unpack downloaded ZIP somewhere. And that's all.

Windows and macOS users can run program via drag and drop. Just drag file to process to application icon.

Linux's users should call zmake from terminal. Open terminal in application folder and just run:

./zmake file_to_process

But in first of all, set encode_mode for your device. Different Amazfit devices has some differences in their graphic encoding formats. By default, ZMake is configured to work with Mi Band 7, but if you want to use them with other device, change encode_mode in zmake.json to match your device:

encode_mode Devices
dialog Mi Band 7, Amazfit Band 7, Amazfit GTS 4 Mini
nxp GTS 3/4, GTR 3/4, GTR 3 Pro, T-Rex 2/Ultra, Falcon
Not supported (MHS) GTR Mini

External tools (optional)

Some operations require external tools, like ESBuild, UglifyJS, ZeppPreview and/or adb. If you need this features, you sould install them.

For ESBuild, UglifyJS and/or ZeppPreview, you need NodeJS with npm. Install them, if you don't.

ESBuild, UglifyJS: Simply install them from npm:

npm i -g esbuild uglify-js

If installation fails, try to open terminal as administrator\root.

ZeppPreview: see here.

ADB: download Android SDK Platform Tools, unpack somewhere and add to PATH.

What they can do?

Action to be taken by application depends on what you give to the input.

You give... ZMake will...
App/watchface as bin-file unpack this file and convert all graphic assets into PNG. New folder appear near source bin-file
Empty directory generate new project template inside this folder. Type of project will be asked in prompt.
Unpacked app/watchface(directory with app.json inside) build your project, see action order bellow. Result file will appear in dist directory.
Any other files/directories try to convert them into PNG or ZeppOS TGA. Direction will be asked, if can't be detected automatically.

What actions will be performed when you attempt to build a project

  1. Convert all graphics to ZeppOS TGA
  2. If src dir exists, combine files into index.js
  3. If enabled, process all files in page/watchface dir via esbuild
  4. If enabled, process all files in page/watchface dir via uglifyjs
  5. If enabled, will create preview image via ZeppPlayer
  6. If enabled, will place smaller preview into assets dir
  7. If enabled, will upload result watchface to your phone via ADB |

Graphics processing

ZeppOS support images compressed in different ways. So, you can describe how zmake should process some images. When converting PNG to TGA, app selects compression method due to filename ending. There is a list of available compression options with some notices.

Name... Format Description
.p.png TGA-P Palette-encoded image. You can use any RGBA colors inside your image, but single image can't contain more than 256 different colors (one color with different transparency layer wasn't the same color). No specific compression will be applied. Final image filesize will be 64 + (count_of_colors * 4) + (width * height) bytes.
.rlp.png TGA-RLP Same as TGA-P, but also use per-line pixel compression. E.g. same pixels in one line will be written once. But images encoded in that way can't be rotated, so don't use this format for clock pointers.
.rgb.png TGA-16 16-bit RGB images, e.g. 5-6 bits per channel. Images in that format can't contain transparent parts. File size will be 64 + (2 * width * height) bytes.
.rgba.png TGA-32 Full 32-bit RGBA image, e.g. 8 bit for channel. No color limitations, but very big file size: 64 + (4 * width * height) bytes.

If you don't set compression format via filename, default will be used (TGA-P).

If some images have too much colors for TGA-RLP/TGA-P, they will be automatically quantized. Backup file will appear in backup directory near application.

Build from source code

Check here.

Links

Thanks to:

thumb_up 2 thumb_down 0 chat Comments (0) favorite Donate