This is my first time posting for a newbie, please give me some advice, I hope it can help those in need.
The QuickJS compiler qjsc.exe can convert JS files in watch faces/mini programs into bytecode bin files
The source code will be converted into a form that is similar to assembly. Currently, there is no tool that can completely restore the source code, which can effectively protect the source code from being stolen by others without a brain.
After the conversion is successful, normal operation will not be affected, the file size will be reduced, and the loading speed of watch faces/mini programs can be improved.
(Of course, you can also use it in conjunction with some JS obfuscation tools such as "JavaScript Obfuscator Tool", and the effect will be better. Correspondingly, JS running speed will decrease due to the increase in obfuscation level. You need to grasp the balance between code confidentiality and performance. )
But be careful to change the corresponding settings in app.json, otherwise the bracelet will have a black screen and cannot run.
浏览附件13805
Two tools are provided below (can be found in the attachment), you can choose according to your needs:
1. Command line tool qjsc.exe
This exe is extracted from the npm package "@zeppos/zpm" and is officially developed by zepp based on the 2020-07-07 version of the QuickJS compiler. Compared with the original version, the "-b" option is added to directly output the bin bytecode file.
Usage: qjsc.exe -b -o [bin file output path] [JS file path]
Example: qjsc.exe -b -o index.bin index.js
2. Personally developed one-click conversion tool (recommended)
This tool is green and non-toxic, please feel free to use it
Feedback is welcome if you have any questions
Instructions:
浏览附件13815
Just follow the order. See the box below for the conversion results.
The JS code must have no syntax errors, otherwise the conversion will fail.
浏览附件13814
After the conversion is completed, you can delete the JS file. Of course, you can also let the tool automatically complete it.
Known issues
The 2020-07-07 version of the QuickJS compiler has a problem with echoing Chinese characters. Garbled characters such as "锟斤拷" will appear in the error content. There is currently no way to solve it.
Example:
浏览附件13818