点击登录

讨论 个人关于米环7表盘的一些研究

XiaoMengXinX

Lv.6
社区会员
关于YMZJ大佬所说的“老过渡版表盘”和“新过渡版表盘”,即watchface目录中同时含有未加密js和加密bin的表盘,经部分测试是可以直接把表盘的js文件和资源文件移植到“老版表盘”(仅含js的表盘)中使用的,且功能上没有任何差异。
进一步研究后发现表盘是否读取js或读取bin是由json中的type参数决定的,目前经测试把type参数删掉后即可将表盘当作“老版表盘”修改且不影响功能,同时也可以删除表盘中所有的bin文件,同样不影响功能。
浏览附件12700

另外论坛中的环7图片格式转换工具似乎仍存在bug,大分辨率图片的转换会导致色彩出现问题,目前可以将图片导入小米运动健康的照片表盘作为替代方案,转换后的图片目录为 /storage/emulated/0/Android/data/com.mi.health/files/custom_dial/assets/images/bg.png
 
我把固件提出来看了看,手环上的系统用的是QuickJS的2020-07-05版本(用这个版本直接加载那些bin文件,就可以运行起来),但是这个把js变成bin字节码的过程经过了很多的优化,很多的信息都丢失了(近似于汇编),要魔改起来恐怕不容易。除非能开发出来工具把字节码变成可读的文件,还要能变换回去。

难点在于,这个字节码是没有文档的,只能看代码去推测行为。

1654959910548.png

不过,可以用对应版本的qjsc把js转换成字节码,就算以后停止了对js的支持,也不太会影响自定义的表盘。

C:
// quickjs.c 91行,取消注释
#define DUMP_BYTECODE  (0xFFFFFFFF)

// quickjs.c 28789行,去掉static
__maybe_unused void js_dump_function_bytecode(JSContext *ctx, JSFunctionBytecode *b)

C:
//qjsdump.c
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#if !defined(_WIN32)
#include <sys/wait.h>
#endif
#include "cutils.h"
#include "quickjs-libc.h"

// 这里把字节码放进来,记得改大小
const uint32_t bytecode_size = 1;
const uint8_t bytecode_data[] = {0x01};

void js_dump_function_bytecode(JSContext *ctx, void *b);

int main(int argc, char **argv)
{
    JSRuntime *rt;
    JSContext *ctx;
    rt = JS_NewRuntime();
    js_std_init_handlers(rt);
    ctx = JS_NewContext(rt);
    js_init_module_std(ctx, "std");
    js_std_add_helpers(ctx, argc, argv);

    JSValue obj = JS_ReadObject(ctx, bytecode_data, bytecode_size, JS_READ_OBJ_BYTECODE);
    if (JS_IsException(obj))
    {
        js_std_dump_error(ctx);
        return 1;
    }
    void *obj_ptr = obj.u.ptr;
    js_dump_function_bytecode(ctx, obj_ptr);
    // printf("%s\n", JS_ToCString(ctx, obj));
    // js_dump_obj(ctx, stderr, obj);

    // js_std_eval_binary(ctx, bytecode_data, bytecode_size, 0);
    // js_std_loop(ctx);
    // JS_FreeContext(ctx);
    // JS_FreeRuntime(rt);

    return 0;
}
Bash:
make libquickjs.a -j16
gcc qjsdump.c libquickjs.a -lm -o qjsdump && ./qjsdump

代码:
0000:  01 64                    100 atom indexes {
1"e"
1"console"
1"log"
1"/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
1"o"
1"n"
1"__$$hmAppManager$$__"
1"currentApp"
1"current"
1"px"
1"DeviceRuntimeCore"
1"WidgetFactory"
1"HmDomApi"
1"app"
1"__globals__"
1"t"
1"_"
1"a"
1"r"
1"i"
1"s"
1"h"
1"g"
1"m"
1"drink"
1"----->>>current"
1"pid"
1"push"
1"images/weeken/"
1".png"
1"images/weeksc/"
1"images/weektc/"
1"images/28pt/"
1"images/144pt/line/"
1"x"
1"y"
1"week_en"
1"week_tc"
1"week_sc"
1"hmUI"
1"show_level"
1"ONLY_AOD"
1"month_startX"
1"month_startY"
1"images/28pt/fenhao.png"
1"month_unit_sc"
1"month_unit_tc"
1"month_unit_en"
1"month_space"
1"month_zero"
1"month_en_array"
1"month_sc_array"
1"month_tc_array"
1"day_follow"
1"day_space"
1"day_zero"
1"day_en_array"
1"day_sc_array"
1"day_tc_array"
1"hour_zero"
1"hour_startX"
1"hour_startY"
1"hour_array"
1"minute_zero"
1"minute_startX"
1"minute_startY"
1"minute_array"
1"w"
1"data_type"
1"STEP"
1"type"
1"font_array"
1"align"
1"CENTER_H"
1"align_h"
1"images/steps.png"
1"src"
1"HmLogger"
1"getLogger"
1"sanjiao"
1"Page"
1"init_view"
1"onInit"
1"onReady"
1"onShow"
1"onHide"
1"onDestory"
1"module"
1"createWidget"
1"widget"
1"IMG_WEEK"
1"IMG_DATE"
1"IMG_TIME"
1"TEXT_IMG"
1"IMG"
1"index page.js on init invoke"
1"index page.js on ready invoke"
1"index page.js on show invoke"
1"index page.js on hide invoke"
1"index page.js on destory invoke"
0002:  02 65 0e 63 6f 6e 73 6f
       6c 65 06 6c 6f 67 b4 01
       2f 68 6f 6d 65 2f 68 74
       6f 6f 2f 44 65 73 6b 74
       6f 70 2f 6c 36 36 2f 30
       39 45 36 41 33 33 31 2f
       64 69 73 74 2f 31 39 32
       78 34 39 30 5f 73 5f 6c
       36 36 2f 64 65 76 69 63
       65 2f 77 61 74 63 68 66
       61 63 65 2f 31 39 32 78
       34 39 30 5f 73 5f 6c 36
       36 2f 69 6e 64 65 78 2e
       6a 73 02 6f 02 6e 28 5f
       5f 24 24 68 6d 41 70 70
       4d 61 6e 61 67 65 72 24
       24 5f 5f 14 63 75 72 72
       65 6e 74 41 70 70 0e 63
       75 72 72 65 6e 74 04 70
       78 22 44 65 76 69 63 65
       52 75 6e 74 69 6d 65 43
       6f 72 65 1a 57 69 64 67
       65 74 46 61 63 74 6f 72
       79 10 48 6d 44 6f 6d 41
       70 69 06 61 70 70 16 5f
       5f 67 6c 6f 62 61 6c 73
       5f 5f 02 74 02 5f 02 61
       02 72 02 69 02 73 02 68
       02 67 02 6d 0a 64 72 69
       6e 6b 1e 2d 2d 2d 2d 2d
       3e 3e 3e 63 75 72 72 65
       6e 74 06 70 69 64 08 70
       75 73 68 1c 69 6d 61 67
       65 73 2f 77 65 65 6b 65
       6e 2f 08 2e 70 6e 67 1c
       69 6d 61 67 65 73 2f 77
       65 65 6b 73 63 2f 1c 69
       6d 61 67 65 73 2f 77 65
       65 6b 74 63 2f 18 69 6d
       61 67 65 73 2f 32 38 70
       74 2f 24 69 6d 61 67 65
       73 2f 31 34 34 70 74 2f
       6c 69 6e 65 2f 02 78 02
       79 0e 77 65 65 6b 5f 65
       6e 0e 77 65 65 6b 5f 74
       63 0e 77 65 65 6b 5f 73
       63 08 68 6d 55 49 14 73
       68 6f 77 5f 6c 65 76 65
       6c 10 4f 4e 4c 59 5f 41
       4f 44 18 6d 6f 6e 74 68
       5f 73 74 61 72 74 58 18
       6d 6f 6e 74 68 5f 73 74
       61 72 74 59 2c 69 6d 61
       67 65 73 2f 32 38 70 74
       2f 66 65 6e 68 61 6f 2e
       70 6e 67 1a 6d 6f 6e 74
       68 5f 75 6e 69 74 5f 73
       63 1a 6d 6f 6e 74 68 5f
       75 6e 69 74 5f 74 63 1a
       6d 6f 6e 74 68 5f 75 6e
       69 74 5f 65 6e 16 6d 6f
       6e 74 68 5f 73 70 61 63
       65 14 6d 6f 6e 74 68 5f
       7a 65 72 6f 1c 6d 6f 6e
       74 68 5f 65 6e 5f 61 72
       72 61 79 1c 6d 6f 6e 74
       68 5f 73 63 5f 61 72 72
       61 79 1c 6d 6f 6e 74 68
       5f 74 63 5f 61 72 72 61
       79 14 64 61 79 5f 66 6f
       6c 6c 6f 77 12 64 61 79
       5f 73 70 61 63 65 10 64
       61 79 5f 7a 65 72 6f 18
       64 61 79 5f 65 6e 5f 61
       72 72 61 79 18 64 61 79
       5f 73 63 5f 61 72 72 61
       79 18 64 61 79 5f 74 63
       5f 61 72 72 61 79 12 68
       6f 75 72 5f 7a 65 72 6f
       16 68 6f 75 72 5f 73 74
       61 72 74 58 16 68 6f 75
       72 5f 73 74 61 72 74 59
       14 68 6f 75 72 5f 61 72
       72 61 79 16 6d 69 6e 75
       74 65 5f 7a 65 72 6f 1a
       6d 69 6e 75 74 65 5f 73
       74 61 72 74 58 1a 6d 69
       6e 75 74 65 5f 73 74 61
       72 74 59 18 6d 69 6e 75
       74 65 5f 61 72 72 61 79
       02 77 12 64 61 74 61 5f
       74 79 70 65 08 53 54 45
       50 08 74 79 70 65 14 66
       6f 6e 74 5f 61 72 72 61
       79 0a 61 6c 69 67 6e 10
       43 45 4e 54 45 52 5f 48
       0e 61 6c 69 67 6e 5f 68
       20 69 6d 61 67 65 73 2f
       73 74 65 70 73 2e 70 6e
       67 06 73 72 63 10 48 6d
       4c 6f 67 67 65 72 12 67
       65 74 4c 6f 67 67 65 72
       0e 73 61 6e 6a 69 61 6f
       08 50 61 67 65 12 69 6e
       69 74 5f 76 69 65 77 0c
       6f 6e 49 6e 69 74 0e 6f
       6e 52 65 61 64 79 0c 6f
       6e 53 68 6f 77 0c 6f 6e
       48 69 64 65 12 6f 6e 44
       65 73 74 6f 72 79 0c 6d
       6f 64 75 6c 65 18 63 72
       65 61 74 65 57 69 64 67
       65 74 0c 77 69 64 67 65
       74 10 49 4d 47 5f 57 45
       45 4b 10 49 4d 47 5f 44
       41 54 45 10 49 4d 47 5f
       54 49 4d 45 10 54 45 58
       54 5f 49 4d 47 06 49 4d
       47 38 69 6e 64 65 78 20
       70 61 67 65 2e 6a 73 20
       6f 6e 20 69 6e 69 74 20
       69 6e 76 6f 6b 65 3a 69
       6e 64 65 78 20 70 61 67
       65 2e 6a 73 20 6f 6e 20
       72 65 61 64 79 20 69 6e
       76 6f 6b 65 38 69 6e 64
       65 78 20 70 61 67 65 2e
       6a 73 20 6f 6e 20 73 68
       6f 77 20 69 6e 76 6f 6b
       65 38 69 6e 64 65 78 20
       70 61 67 65 2e 6a 73 20
       6f 6e 20 68 69 64 65 20
       69 6e 76 6f 6b 65 3e 69
       6e 64 65 78 20 70 61 67
       65 2e 6a 73 20 6f 6e 20
       64 65 73 74 6f 72 79 20
       69 6e 76 6f 6b 65        }
0448:  0e                       function {
0449:  00 06 00 a0 01 00 02 00
       04 00 01 29 02             name: "<eval>"
                                  args=0 vars=2 defargs=0 closures=0 cpool=1
                                  stack=4 bclen=41 locals=2
                                  vars {
0456:  a2 01 00 00 00               name: "<ret>"
045b:  a2 03 03 00 03               name: e
                                  }
                                  bytecode {
0460:  06 c8 6c 0b 00 00 00 bf
       00 ed c8 0e eb 1a c9 6c
       16 00 00 00 38 d2 00 00
       00 42 d3 00 00 00 c5 24
       01 00 c8 0e eb 02 2f c4
       28                           at 21, fixup atom: console
                                    at 26, fixup atom: log
                                  }
                                  debug {
0489:  a8 03 01 00                  filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                  }
                                  cpool {
048d:  0e                           function {
048e:  02 06 00 00 00 04 00 06
       00 01 71 04                    name: "<null>"
                                      args=0 vars=4 defargs=0 closures=0 cpool=1
                                      stack=6 bclen=113 locals=4
                                      vars {
049a:  a2 03 00 00 00                   name: e
049f:  aa 03 00 01 00                   name: o
04a4:  ac 03 00 02 00                   name: n
04a9:  a2 03 03 00 03                   name: e
                                      }
                                      bytecode {
04ae:  38 d7 00 00 00 41 d8 00
       00 00 cc 41 d9 00 00 00
       c9 06 11 f1 ea 0c 6f 11
       41 da 00 00 00 ca 0e eb
       2e 0e 38 db 00 00 00 41
       dc 00 00 00 11 38 db 00
       00 00 41 dd 00 00 00 11
       c4 c5 21 02 00 21 01 00
       0e c4 41 de 00 00 00 41
       df 00 00 00 eb c9 6c 0a
       00 00 00 bf 00 ed 0e 0e
       29 cb 6c 15 00 00 00 38
       d2 00 00 00 42 d3 00 00
       00 c7 24 01 00 0e 0e 29
       2f                               at 1, fixup atom: __$$hmAppManager$$__
                                        at 6, fixup atom: currentApp
                                        at 12, fixup atom: current
                                        at 25, fixup atom: px
                                        at 35, fixup atom: DeviceRuntimeCore
                                        at 40, fixup atom: WidgetFactory
                                        at 46, fixup atom: DeviceRuntimeCore
                                        at 51, fixup atom: HmDomApi
                                        at 67, fixup atom: app
                                        at 72, fixup atom: __globals__
                                        at 96, fixup atom: console
                                        at 101, fixup atom: log
                                      }
                                      debug {
051f:  a8 03 01 00                      filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                      }
                                      cpool {
0523:  0e                               function {
0524:  02 06 00 00 00 0e 00 06
       00 06 95 07 0e                     name: "<null>"
                                          args=0 vars=14 defargs=0 closures=0 cpool=6
                                          stack=6 bclen=917 locals=14
                                          vars {
0531:  a2 03 00 00 00                       name: e
0536:  aa 03 00 01 00                       name: o
053b:  ac 03 01 00 40                       name: n
0540:  c0 03 01 03 40                       name: t
0545:  c2 03 01 04 40                       name: _
054a:  c4 03 01 05 40                       name: a
054f:  c6 03 01 06 40                       name: r
0554:  a2 03 02 0e 40                       name: e
0559:  a2 03 03 0e 40                       name: e
055e:  c8 03 01 07 c0                       name: i
0563:  ca 03 01 0a c0                       name: s
0568:  cc 03 01 0b c0                       name: h
056d:  ce 03 01 0c c0                       name: g
0572:  d0 03 01 0d c0                       name: m
                                          }
                                          bytecode {
0577:  61 0d 00 61 0c 00 61 0b
       00 61 0a 00 61 09 00 61
       06 00 61 05 00 61 04 00
       61 03 00 61 02 00 38 d7
       00 00 00 41 d8 00 00 00
       cc 41 d9 00 00 00 c9 38
       db 00 00 00 41 dc 00 00
       00 11 38 db 00 00 00 41
       dd 00 00 00 11 c4 c5 21
       02 00 04 e9 00 00 00 21
       02 00 0e 38 d2 00 00 00
       42 d3 00 00 00 04 ea 00
       00 00 24 01 00 0e 38 d2
       00 00 00 42 d3 00 00 00
       38 d7 00 00 00 41 d8 00
       00 00 41 eb 00 00 00 24
       01 00 0e 38 d2 00 00 00
       42 d3 00 00 00 38 d7 00
       00 00 41 d8 00 00 00 41
       d9 00 00 00 24 01 00 0e
       26 00 00 ca 26 00 00 cb
       26 00 00 c2 04 26 00 00
       c2 05 26 00 00 c2 06 61
       07 00 b4 c2 07 62 07 00
       bb a4 e9 6e 62 02 00 42
       ec 00 00 00 04 ed 00 00
       00 42 5b 00 00 00 62 07
       00 04 ee 00 00 00 24 02
       00 24 01 00 0e 62 04 00
       42 ec 00 00 00 04 ef 00
       00 00 42 5b 00 00 00 62
       07 00 04 ee 00 00 00 24
       02 00 24 01 00 0e 62 03
       00 42 ec 00 00 00 04 f0
       00 00 00 42 5b 00 00 00
       62 07 00 04 ee 00 00 00
       24 02 00 24 01 00 0e 62
       07 00 92 63 07 00 0e eb
       8d 61 08 00 b4 c2 08 62
       08 00 bc 0a a4 e9 4d 62
       05 00 42 ec 00 00 00 04
       f1 00 00 00 42 5b 00 00
       00 62 08 00 04 ee 00 00
       00 24 02 00 24 01 00 0e
       62 06 00 42 ec 00 00 00
       04 f2 00 00 00 42 5b 00
       00 00 62 08 00 04 ee 00
       00 00 24 02 00 24 01 00
       0e 62 08 00 92 63 08 00
       0e eb ad 0b bc 3c 4c f3
       00 00 00 bc 28 4c f4 00
       00 00 62 02 00 4c f5 00
       00 00 62 03 00 4c f6 00
       00 00 62 04 00 4c f7 00
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 09
       0b bc 38 4c fb 00 00 00
       bc 48 4c fc 00 00 00 04
       fd 00 00 00 4c fe 00 00
       00 04 fd 00 00 00 4c ff
       00 00 00 04 fd 00 00 00
       4c 00 01 00 00 b5 4c 01
       01 00 00 b5 4c 02 01 00
       00 62 05 00 4c 03 01 00
       00 62 05 00 4c 04 01 00
       00 62 05 00 4c 05 01 00
       00 b5 4c 06 01 00 00 b5
       4c 07 01 00 00 b5 4c 08
       01 00 00 62 05 00 4c 09
       01 00 00 62 05 00 4c 0a
       01 00 00 62 05 00 4c 0b
       01 00 00 38 f8 00 00 00
       41 f9 00 00 00 41 fa 00
       00 00 4c f9 00 00 00 c2
       0a 0b b4 97 4c 0c 01 00
       00 bc 08 4c 0d 01 00 00
       bc 75 4c 0e 01 00 00 62
       06 00 4c 0f 01 00 00 b4
       97 4c 10 01 00 00 bc 08
       4c 11 01 00 00 bd f5 00
       4c 12 01 00 00 62 06 00
       4c 13 01 00 00 38 f8 00
       00 00 41 f9 00 00 00 41
       fa 00 00 00 4c f9 00 00
       00 c2 0b 0b bc 28 4c f3
       00 00 00 bd 8a 01 4c f4
       00 00 00 bc 78 4c 14 01
       00 00 38 f8 00 00 00 41
       15 01 00 00 41 16 01 00
       00 4c 17 01 00 00 62 05
       00 4c 18 01 00 00 38 f8
       00 00 00 41 19 01 00 00
       41 1a 01 00 00 4c 1b 01
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 0c
       0b bc 54 4c f3 00 00 00
       bd ae 01 4c f4 00 00 00
       04 1c 01 00 00 4c 1d 01
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 0d
       38 db 00 00 00 41 1e 01
       00 00 42 1f 01 00 00 04
       20 01 00 00 24 01 00 0e
       c5 38 db 00 00 00 42 21
       01 00 00 0b bf 00 54 22
       01 00 00 04 bf 01 54 23
       01 00 00 04 bf 02 54 24
       01 00 00 04 bf 03 54 25
       01 00 00 04 bf 04 54 26
       01 00 00 04 bf 05 54 27
       01 00 00 04 24 01 00 43
       28 01 00 00 29                       at 31, fixup atom: __$$hmAppManager$$__
                                            at 36, fixup atom: currentApp
                                            at 42, fixup atom: current
                                            at 48, fixup atom: DeviceRuntimeCore
                                            at 53, fixup atom: WidgetFactory
                                            at 59, fixup atom: DeviceRuntimeCore
                                            at 64, fixup atom: HmDomApi
                                            at 75, fixup atom: drink
                                            at 84, fixup atom: console
                                            at 89, fixup atom: log
                                            at 94, fixup atom: "----->>>current"
                                            at 103, fixup atom: console
                                            at 108, fixup atom: log
                                            at 113, fixup atom: __$$hmAppManager$$__
                                            at 118, fixup atom: currentApp
                                            at 123, fixup atom: pid
                                            at 132, fixup atom: console
                                            at 137, fixup atom: log
                                            at 142, fixup atom: __$$hmAppManager$$__
                                            at 147, fixup atom: currentApp
                                            at 152, fixup atom: current
                                            at 200, fixup atom: push
                                            at 205, fixup atom: "images/weeken/"
                                            at 210, fixup atom: concat
                                            at 218, fixup atom: ".png"
                                            at 233, fixup atom: push
                                            at 238, fixup atom: "images/weeksc/"
                                            at 243, fixup atom: concat
                                            at 251, fixup atom: ".png"
                                            at 266, fixup atom: push
                                            at 271, fixup atom: "images/weektc/"
                                            at 276, fixup atom: concat
                                            at 284, fixup atom: ".png"
                                            at 323, fixup atom: push
                                            at 328, fixup atom: "images/28pt/"
                                            at 333, fixup atom: concat
                                            at 341, fixup atom: ".png"
                                            at 356, fixup atom: push
                                            at 361, fixup atom: "images/144pt/line/"
                                            at 366, fixup atom: concat
                                            at 374, fixup atom: ".png"
                                            at 399, fixup atom: x
                                            at 406, fixup atom: y
                                            at 414, fixup atom: week_en
                                            at 422, fixup atom: week_tc
                                            at 430, fixup atom: week_sc
                                            at 435, fixup atom: hmUI
                                            at 440, fixup atom: show_level
                                            at 445, fixup atom: ONLY_AOD
                                            at 450, fixup atom: show_level
                                            at 460, fixup atom: month_startX
                                            at 467, fixup atom: month_startY
                                            at 472, fixup atom: "images/28pt/fenhao.png"
                                            at 477, fixup atom: month_unit_sc
                                            at 482, fixup atom: "images/28pt/fenhao.png"
                                            at 487, fixup atom: month_unit_tc
                                            at 492, fixup atom: "images/28pt/fenhao.png"
                                            at 497, fixup atom: month_unit_en
                                            at 503, fixup atom: month_space
                                            at 509, fixup atom: month_zero
                                            at 517, fixup atom: month_en_array
                                            at 525, fixup atom: month_sc_array
                                            at 533, fixup atom: month_tc_array
                                            at 539, fixup atom: day_follow
                                            at 545, fixup atom: day_space
                                            at 551, fixup atom: day_zero
                                            at 559, fixup atom: day_en_array
                                            at 567, fixup atom: day_sc_array
                                            at 575, fixup atom: day_tc_array
                                            at 580, fixup atom: hmUI
                                            at 585, fixup atom: show_level
                                            at 590, fixup atom: ONLY_AOD
                                            at 595, fixup atom: show_level
                                            at 605, fixup atom: hour_zero
                                            at 612, fixup atom: hour_startX
                                            at 619, fixup atom: hour_startY
                                            at 627, fixup atom: hour_array
                                            at 634, fixup atom: minute_zero
                                            at 641, fixup atom: minute_startX
                                            at 649, fixup atom: minute_startY
                                            at 657, fixup atom: minute_array
                                            at 662, fixup atom: hmUI
                                            at 667, fixup atom: show_level
                                            at 672, fixup atom: ONLY_AOD
                                            at 677, fixup atom: show_level
                                            at 687, fixup atom: x
                                            at 695, fixup atom: y
                                            at 702, fixup atom: w
                                            at 707, fixup atom: hmUI
                                            at 712, fixup atom: data_type
                                            at 717, fixup atom: STEP
                                            at 722, fixup atom: type
                                            at 730, fixup atom: font_array
                                            at 735, fixup atom: hmUI
                                            at 740, fixup atom: align
                                            at 745, fixup atom: CENTER_H
                                            at 750, fixup atom: align_h
                                            at 755, fixup atom: hmUI
                                            at 760, fixup atom: show_level
                                            at 765, fixup atom: ONLY_AOD
                                            at 770, fixup atom: show_level
                                            at 780, fixup atom: x
                                            at 788, fixup atom: y
                                            at 793, fixup atom: "images/steps.png"
                                            at 798, fixup atom: src
                                            at 803, fixup atom: hmUI
                                            at 808, fixup atom: show_level
                                            at 813, fixup atom: ONLY_AOD
                                            at 818, fixup atom: show_level
                                            at 825, fixup atom: DeviceRuntimeCore
                                            at 830, fixup atom: HmLogger
                                            at 835, fixup atom: getLogger
                                            at 840, fixup atom: sanjiao
                                            at 850, fixup atom: DeviceRuntimeCore
                                            at 855, fixup atom: Page
                                            at 863, fixup atom: init_view
                                            at 871, fixup atom: onInit
                                            at 879, fixup atom: onReady
                                            at 887, fixup atom: onShow
                                            at 895, fixup atom: onHide
                                            at 903, fixup atom: onDestory
                                            at 912, fixup atom: module
                                          }
                                          debug {
090c:  a8 03 01 00                          filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                          }
                                          cpool {
0910:  0e                                   function {
0911:  42 07 00 00 00 00 00 04
       05 00 a0 01 00                         name: "<null>"
                                              args=0 vars=0 defargs=0 closures=5 cpool=0
                                              stack=4 bclen=160 locals=0
                                              closure vars {
091e:  c8 03 09 09                              name: i
0922:  ca 03 0a 09                              name: s
0926:  cc 03 0b 09                              name: h
092a:  ce 03 0c 09                              name: g
092e:  d0 03 0d 09                              name: m
                                              }
                                              bytecode {
0932:  38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2b 01 00
       00 65 00 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2c 01 00
       00 65 01 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2d 01 00
       00 65 02 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2e 01 00
       00 65 03 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2f 01 00
       00 65 04 00 24 02 00 29                  at 1, fixup atom: hmUI
                                                at 6, fixup atom: createWidget
                                                at 11, fixup atom: hmUI
                                                at 16, fixup atom: widget
                                                at 21, fixup atom: IMG_WEEK
                                                at 33, fixup atom: hmUI
                                                at 38, fixup atom: createWidget
                                                at 43, fixup atom: hmUI
                                                at 48, fixup atom: widget
                                                at 53, fixup atom: IMG_DATE
                                                at 65, fixup atom: hmUI
                                                at 70, fixup atom: createWidget
                                                at 75, fixup atom: hmUI
                                                at 80, fixup atom: widget
                                                at 85, fixup atom: IMG_TIME
                                                at 97, fixup atom: hmUI
                                                at 102, fixup atom: createWidget
                                                at 107, fixup atom: hmUI
                                                at 112, fixup atom: widget
                                                at 117, fixup atom: TEXT_IMG
                                                at 129, fixup atom: hmUI
                                                at 134, fixup atom: createWidget
                                                at 139, fixup atom: hmUI
                                                at 144, fixup atom: widget
                                                at 149, fixup atom: IMG
                                              }
                                              debug {
09d2:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
09d6:  0e                                   function {
09d7:  42 07 00 00 00 01 00 03
       00 00 1f 01                            name: "<null>"
                                              args=0 vars=1 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=31 locals=1
                                              vars {
09e3:  10 00 01 00                              name: this
                                              }
                                              bytecode {
09e7:  08 c8 38 d2 00 00 00 42
       d3 00 00 00 04 30 01 00
       00 24 01 00 0e c4 42 22
       01 00 00 24 00 00 29                     at 3, fixup atom: console
                                                at 8, fixup atom: log
                                                at 13, fixup atom: "index page.js on init invoke"
                                                at 23, fixup atom: init_view
                                              }
                                              debug {
0a06:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a0a:  0e                                   function {
0a0b:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a17:  38 d2 00 00 00 42 d3 00
       00 00 04 31 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on ready invoke"
                                              }
                                              debug {
0a2a:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a2e:  0e                                   function {
0a2f:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a3b:  38 d2 00 00 00 42 d3 00
       00 00 04 32 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on show invoke"
                                              }
                                              debug {
0a4e:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a52:  0e                                   function {
0a53:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a5f:  38 d2 00 00 00 42 d3 00
       00 00 04 33 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on hide invoke"
                                              }
                                              debug {
0a72:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a76:  0e                                   function {
0a77:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a83:  38 d2 00 00 00 42 d3 00
       00 00 04 34 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on destory invoke"
                                              }
                                              debug {
0a96:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
 
最后编辑:
我把固件提出来看了看,手环上的系统用的是QuickJS的2020-07-05版本(用这个版本直接加载那些bin文件,就可以运行起来),但是这个把js变成bin字节码的过程经过了很多的优化,很多的信息都丢失了(近似于汇编),要魔改起来恐怕不容易。除非能开发出来工具把字节码变成可读的文件,还要能变换回去。

难点在于,这个字节码是没有文档的,只能看代码去推测行为。

浏览附件12840

不过,可以用对应版本的qjsc把js转换成字节码,就算以后停止了对js的支持,也不太会影响自定义的表盘。

C:
// quickjs.c 91行,取消注释
#define DUMP_BYTECODE  (0xFFFFFFFF)

// quickjs.c 28789行,去掉static
__maybe_unused void js_dump_function_bytecode(JSContext *ctx, JSFunctionBytecode *b)

C:
//qjsdump.c
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#if !defined(_WIN32)
#include <sys/wait.h>
#endif
#include "cutils.h"
#include "quickjs-libc.h"

// 这里把字节码放进来,记得改大小
const uint32_t bytecode_size = 1;
const uint8_t bytecode_data[] = {0x01};

void js_dump_function_bytecode(JSContext *ctx, void *b);

int main(int argc, char **argv)
{
    JSRuntime *rt;
    JSContext *ctx;
    rt = JS_NewRuntime();
    js_std_init_handlers(rt);
    ctx = JS_NewContext(rt);
    js_init_module_std(ctx, "std");
    js_std_add_helpers(ctx, argc, argv);

    JSValue obj = JS_ReadObject(ctx, bytecode_data, bytecode_size, JS_READ_OBJ_BYTECODE);
    if (JS_IsException(obj))
    {
        js_std_dump_error(ctx);
        return 1;
    }
    void *obj_ptr = obj.u.ptr;
    js_dump_function_bytecode(ctx, obj_ptr);
    // printf("%s\n", JS_ToCString(ctx, obj));
    // js_dump_obj(ctx, stderr, obj);

    // js_std_eval_binary(ctx, bytecode_data, bytecode_size, 0);
    // js_std_loop(ctx);
    // JS_FreeContext(ctx);
    // JS_FreeRuntime(rt);

    return 0;
}
Bash:
make libquickjs.a -j16
gcc qjsdump.c libquickjs.a -lm -o qjsdump && ./qjsdump

代码:
0000:  01 64                    100 atom indexes {
1"e"
1"console"
1"log"
1"/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
1"o"
1"n"
1"__$$hmAppManager$$__"
1"currentApp"
1"current"
1"px"
1"DeviceRuntimeCore"
1"WidgetFactory"
1"HmDomApi"
1"app"
1"__globals__"
1"t"
1"_"
1"a"
1"r"
1"i"
1"s"
1"h"
1"g"
1"m"
1"drink"
1"----->>>current"
1"pid"
1"push"
1"images/weeken/"
1".png"
1"images/weeksc/"
1"images/weektc/"
1"images/28pt/"
1"images/144pt/line/"
1"x"
1"y"
1"week_en"
1"week_tc"
1"week_sc"
1"hmUI"
1"show_level"
1"ONLY_AOD"
1"month_startX"
1"month_startY"
1"images/28pt/fenhao.png"
1"month_unit_sc"
1"month_unit_tc"
1"month_unit_en"
1"month_space"
1"month_zero"
1"month_en_array"
1"month_sc_array"
1"month_tc_array"
1"day_follow"
1"day_space"
1"day_zero"
1"day_en_array"
1"day_sc_array"
1"day_tc_array"
1"hour_zero"
1"hour_startX"
1"hour_startY"
1"hour_array"
1"minute_zero"
1"minute_startX"
1"minute_startY"
1"minute_array"
1"w"
1"data_type"
1"STEP"
1"type"
1"font_array"
1"align"
1"CENTER_H"
1"align_h"
1"images/steps.png"
1"src"
1"HmLogger"
1"getLogger"
1"sanjiao"
1"Page"
1"init_view"
1"onInit"
1"onReady"
1"onShow"
1"onHide"
1"onDestory"
1"module"
1"createWidget"
1"widget"
1"IMG_WEEK"
1"IMG_DATE"
1"IMG_TIME"
1"TEXT_IMG"
1"IMG"
1"index page.js on init invoke"
1"index page.js on ready invoke"
1"index page.js on show invoke"
1"index page.js on hide invoke"
1"index page.js on destory invoke"
0002:  02 65 0e 63 6f 6e 73 6f
       6c 65 06 6c 6f 67 b4 01
       2f 68 6f 6d 65 2f 68 74
       6f 6f 2f 44 65 73 6b 74
       6f 70 2f 6c 36 36 2f 30
       39 45 36 41 33 33 31 2f
       64 69 73 74 2f 31 39 32
       78 34 39 30 5f 73 5f 6c
       36 36 2f 64 65 76 69 63
       65 2f 77 61 74 63 68 66
       61 63 65 2f 31 39 32 78
       34 39 30 5f 73 5f 6c 36
       36 2f 69 6e 64 65 78 2e
       6a 73 02 6f 02 6e 28 5f
       5f 24 24 68 6d 41 70 70
       4d 61 6e 61 67 65 72 24
       24 5f 5f 14 63 75 72 72
       65 6e 74 41 70 70 0e 63
       75 72 72 65 6e 74 04 70
       78 22 44 65 76 69 63 65
       52 75 6e 74 69 6d 65 43
       6f 72 65 1a 57 69 64 67
       65 74 46 61 63 74 6f 72
       79 10 48 6d 44 6f 6d 41
       70 69 06 61 70 70 16 5f
       5f 67 6c 6f 62 61 6c 73
       5f 5f 02 74 02 5f 02 61
       02 72 02 69 02 73 02 68
       02 67 02 6d 0a 64 72 69
       6e 6b 1e 2d 2d 2d 2d 2d
       3e 3e 3e 63 75 72 72 65
       6e 74 06 70 69 64 08 70
       75 73 68 1c 69 6d 61 67
       65 73 2f 77 65 65 6b 65
       6e 2f 08 2e 70 6e 67 1c
       69 6d 61 67 65 73 2f 77
       65 65 6b 73 63 2f 1c 69
       6d 61 67 65 73 2f 77 65
       65 6b 74 63 2f 18 69 6d
       61 67 65 73 2f 32 38 70
       74 2f 24 69 6d 61 67 65
       73 2f 31 34 34 70 74 2f
       6c 69 6e 65 2f 02 78 02
       79 0e 77 65 65 6b 5f 65
       6e 0e 77 65 65 6b 5f 74
       63 0e 77 65 65 6b 5f 73
       63 08 68 6d 55 49 14 73
       68 6f 77 5f 6c 65 76 65
       6c 10 4f 4e 4c 59 5f 41
       4f 44 18 6d 6f 6e 74 68
       5f 73 74 61 72 74 58 18
       6d 6f 6e 74 68 5f 73 74
       61 72 74 59 2c 69 6d 61
       67 65 73 2f 32 38 70 74
       2f 66 65 6e 68 61 6f 2e
       70 6e 67 1a 6d 6f 6e 74
       68 5f 75 6e 69 74 5f 73
       63 1a 6d 6f 6e 74 68 5f
       75 6e 69 74 5f 74 63 1a
       6d 6f 6e 74 68 5f 75 6e
       69 74 5f 65 6e 16 6d 6f
       6e 74 68 5f 73 70 61 63
       65 14 6d 6f 6e 74 68 5f
       7a 65 72 6f 1c 6d 6f 6e
       74 68 5f 65 6e 5f 61 72
       72 61 79 1c 6d 6f 6e 74
       68 5f 73 63 5f 61 72 72
       61 79 1c 6d 6f 6e 74 68
       5f 74 63 5f 61 72 72 61
       79 14 64 61 79 5f 66 6f
       6c 6c 6f 77 12 64 61 79
       5f 73 70 61 63 65 10 64
       61 79 5f 7a 65 72 6f 18
       64 61 79 5f 65 6e 5f 61
       72 72 61 79 18 64 61 79
       5f 73 63 5f 61 72 72 61
       79 18 64 61 79 5f 74 63
       5f 61 72 72 61 79 12 68
       6f 75 72 5f 7a 65 72 6f
       16 68 6f 75 72 5f 73 74
       61 72 74 58 16 68 6f 75
       72 5f 73 74 61 72 74 59
       14 68 6f 75 72 5f 61 72
       72 61 79 16 6d 69 6e 75
       74 65 5f 7a 65 72 6f 1a
       6d 69 6e 75 74 65 5f 73
       74 61 72 74 58 1a 6d 69
       6e 75 74 65 5f 73 74 61
       72 74 59 18 6d 69 6e 75
       74 65 5f 61 72 72 61 79
       02 77 12 64 61 74 61 5f
       74 79 70 65 08 53 54 45
       50 08 74 79 70 65 14 66
       6f 6e 74 5f 61 72 72 61
       79 0a 61 6c 69 67 6e 10
       43 45 4e 54 45 52 5f 48
       0e 61 6c 69 67 6e 5f 68
       20 69 6d 61 67 65 73 2f
       73 74 65 70 73 2e 70 6e
       67 06 73 72 63 10 48 6d
       4c 6f 67 67 65 72 12 67
       65 74 4c 6f 67 67 65 72
       0e 73 61 6e 6a 69 61 6f
       08 50 61 67 65 12 69 6e
       69 74 5f 76 69 65 77 0c
       6f 6e 49 6e 69 74 0e 6f
       6e 52 65 61 64 79 0c 6f
       6e 53 68 6f 77 0c 6f 6e
       48 69 64 65 12 6f 6e 44
       65 73 74 6f 72 79 0c 6d
       6f 64 75 6c 65 18 63 72
       65 61 74 65 57 69 64 67
       65 74 0c 77 69 64 67 65
       74 10 49 4d 47 5f 57 45
       45 4b 10 49 4d 47 5f 44
       41 54 45 10 49 4d 47 5f
       54 49 4d 45 10 54 45 58
       54 5f 49 4d 47 06 49 4d
       47 38 69 6e 64 65 78 20
       70 61 67 65 2e 6a 73 20
       6f 6e 20 69 6e 69 74 20
       69 6e 76 6f 6b 65 3a 69
       6e 64 65 78 20 70 61 67
       65 2e 6a 73 20 6f 6e 20
       72 65 61 64 79 20 69 6e
       76 6f 6b 65 38 69 6e 64
       65 78 20 70 61 67 65 2e
       6a 73 20 6f 6e 20 73 68
       6f 77 20 69 6e 76 6f 6b
       65 38 69 6e 64 65 78 20
       70 61 67 65 2e 6a 73 20
       6f 6e 20 68 69 64 65 20
       69 6e 76 6f 6b 65 3e 69
       6e 64 65 78 20 70 61 67
       65 2e 6a 73 20 6f 6e 20
       64 65 73 74 6f 72 79 20
       69 6e 76 6f 6b 65        }
0448:  0e                       function {
0449:  00 06 00 a0 01 00 02 00
       04 00 01 29 02             name: "<eval>"
                                  args=0 vars=2 defargs=0 closures=0 cpool=1
                                  stack=4 bclen=41 locals=2
                                  vars {
0456:  a2 01 00 00 00               name: "<ret>"
045b:  a2 03 03 00 03               name: e
                                  }
                                  bytecode {
0460:  06 c8 6c 0b 00 00 00 bf
       00 ed c8 0e eb 1a c9 6c
       16 00 00 00 38 d2 00 00
       00 42 d3 00 00 00 c5 24
       01 00 c8 0e eb 02 2f c4
       28                           at 21, fixup atom: console
                                    at 26, fixup atom: log
                                  }
                                  debug {
0489:  a8 03 01 00                  filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                  }
                                  cpool {
048d:  0e                           function {
048e:  02 06 00 00 00 04 00 06
       00 01 71 04                    name: "<null>"
                                      args=0 vars=4 defargs=0 closures=0 cpool=1
                                      stack=6 bclen=113 locals=4
                                      vars {
049a:  a2 03 00 00 00                   name: e
049f:  aa 03 00 01 00                   name: o
04a4:  ac 03 00 02 00                   name: n
04a9:  a2 03 03 00 03                   name: e
                                      }
                                      bytecode {
04ae:  38 d7 00 00 00 41 d8 00
       00 00 cc 41 d9 00 00 00
       c9 06 11 f1 ea 0c 6f 11
       41 da 00 00 00 ca 0e eb
       2e 0e 38 db 00 00 00 41
       dc 00 00 00 11 38 db 00
       00 00 41 dd 00 00 00 11
       c4 c5 21 02 00 21 01 00
       0e c4 41 de 00 00 00 41
       df 00 00 00 eb c9 6c 0a
       00 00 00 bf 00 ed 0e 0e
       29 cb 6c 15 00 00 00 38
       d2 00 00 00 42 d3 00 00
       00 c7 24 01 00 0e 0e 29
       2f                               at 1, fixup atom: __$$hmAppManager$$__
                                        at 6, fixup atom: currentApp
                                        at 12, fixup atom: current
                                        at 25, fixup atom: px
                                        at 35, fixup atom: DeviceRuntimeCore
                                        at 40, fixup atom: WidgetFactory
                                        at 46, fixup atom: DeviceRuntimeCore
                                        at 51, fixup atom: HmDomApi
                                        at 67, fixup atom: app
                                        at 72, fixup atom: __globals__
                                        at 96, fixup atom: console
                                        at 101, fixup atom: log
                                      }
                                      debug {
051f:  a8 03 01 00                      filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                      }
                                      cpool {
0523:  0e                               function {
0524:  02 06 00 00 00 0e 00 06
       00 06 95 07 0e                     name: "<null>"
                                          args=0 vars=14 defargs=0 closures=0 cpool=6
                                          stack=6 bclen=917 locals=14
                                          vars {
0531:  a2 03 00 00 00                       name: e
0536:  aa 03 00 01 00                       name: o
053b:  ac 03 01 00 40                       name: n
0540:  c0 03 01 03 40                       name: t
0545:  c2 03 01 04 40                       name: _
054a:  c4 03 01 05 40                       name: a
054f:  c6 03 01 06 40                       name: r
0554:  a2 03 02 0e 40                       name: e
0559:  a2 03 03 0e 40                       name: e
055e:  c8 03 01 07 c0                       name: i
0563:  ca 03 01 0a c0                       name: s
0568:  cc 03 01 0b c0                       name: h
056d:  ce 03 01 0c c0                       name: g
0572:  d0 03 01 0d c0                       name: m
                                          }
                                          bytecode {
0577:  61 0d 00 61 0c 00 61 0b
       00 61 0a 00 61 09 00 61
       06 00 61 05 00 61 04 00
       61 03 00 61 02 00 38 d7
       00 00 00 41 d8 00 00 00
       cc 41 d9 00 00 00 c9 38
       db 00 00 00 41 dc 00 00
       00 11 38 db 00 00 00 41
       dd 00 00 00 11 c4 c5 21
       02 00 04 e9 00 00 00 21
       02 00 0e 38 d2 00 00 00
       42 d3 00 00 00 04 ea 00
       00 00 24 01 00 0e 38 d2
       00 00 00 42 d3 00 00 00
       38 d7 00 00 00 41 d8 00
       00 00 41 eb 00 00 00 24
       01 00 0e 38 d2 00 00 00
       42 d3 00 00 00 38 d7 00
       00 00 41 d8 00 00 00 41
       d9 00 00 00 24 01 00 0e
       26 00 00 ca 26 00 00 cb
       26 00 00 c2 04 26 00 00
       c2 05 26 00 00 c2 06 61
       07 00 b4 c2 07 62 07 00
       bb a4 e9 6e 62 02 00 42
       ec 00 00 00 04 ed 00 00
       00 42 5b 00 00 00 62 07
       00 04 ee 00 00 00 24 02
       00 24 01 00 0e 62 04 00
       42 ec 00 00 00 04 ef 00
       00 00 42 5b 00 00 00 62
       07 00 04 ee 00 00 00 24
       02 00 24 01 00 0e 62 03
       00 42 ec 00 00 00 04 f0
       00 00 00 42 5b 00 00 00
       62 07 00 04 ee 00 00 00
       24 02 00 24 01 00 0e 62
       07 00 92 63 07 00 0e eb
       8d 61 08 00 b4 c2 08 62
       08 00 bc 0a a4 e9 4d 62
       05 00 42 ec 00 00 00 04
       f1 00 00 00 42 5b 00 00
       00 62 08 00 04 ee 00 00
       00 24 02 00 24 01 00 0e
       62 06 00 42 ec 00 00 00
       04 f2 00 00 00 42 5b 00
       00 00 62 08 00 04 ee 00
       00 00 24 02 00 24 01 00
       0e 62 08 00 92 63 08 00
       0e eb ad 0b bc 3c 4c f3
       00 00 00 bc 28 4c f4 00
       00 00 62 02 00 4c f5 00
       00 00 62 03 00 4c f6 00
       00 00 62 04 00 4c f7 00
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 09
       0b bc 38 4c fb 00 00 00
       bc 48 4c fc 00 00 00 04
       fd 00 00 00 4c fe 00 00
       00 04 fd 00 00 00 4c ff
       00 00 00 04 fd 00 00 00
       4c 00 01 00 00 b5 4c 01
       01 00 00 b5 4c 02 01 00
       00 62 05 00 4c 03 01 00
       00 62 05 00 4c 04 01 00
       00 62 05 00 4c 05 01 00
       00 b5 4c 06 01 00 00 b5
       4c 07 01 00 00 b5 4c 08
       01 00 00 62 05 00 4c 09
       01 00 00 62 05 00 4c 0a
       01 00 00 62 05 00 4c 0b
       01 00 00 38 f8 00 00 00
       41 f9 00 00 00 41 fa 00
       00 00 4c f9 00 00 00 c2
       0a 0b b4 97 4c 0c 01 00
       00 bc 08 4c 0d 01 00 00
       bc 75 4c 0e 01 00 00 62
       06 00 4c 0f 01 00 00 b4
       97 4c 10 01 00 00 bc 08
       4c 11 01 00 00 bd f5 00
       4c 12 01 00 00 62 06 00
       4c 13 01 00 00 38 f8 00
       00 00 41 f9 00 00 00 41
       fa 00 00 00 4c f9 00 00
       00 c2 0b 0b bc 28 4c f3
       00 00 00 bd 8a 01 4c f4
       00 00 00 bc 78 4c 14 01
       00 00 38 f8 00 00 00 41
       15 01 00 00 41 16 01 00
       00 4c 17 01 00 00 62 05
       00 4c 18 01 00 00 38 f8
       00 00 00 41 19 01 00 00
       41 1a 01 00 00 4c 1b 01
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 0c
       0b bc 54 4c f3 00 00 00
       bd ae 01 4c f4 00 00 00
       04 1c 01 00 00 4c 1d 01
       00 00 38 f8 00 00 00 41
       f9 00 00 00 41 fa 00 00
       00 4c f9 00 00 00 c2 0d
       38 db 00 00 00 41 1e 01
       00 00 42 1f 01 00 00 04
       20 01 00 00 24 01 00 0e
       c5 38 db 00 00 00 42 21
       01 00 00 0b bf 00 54 22
       01 00 00 04 bf 01 54 23
       01 00 00 04 bf 02 54 24
       01 00 00 04 bf 03 54 25
       01 00 00 04 bf 04 54 26
       01 00 00 04 bf 05 54 27
       01 00 00 04 24 01 00 43
       28 01 00 00 29                       at 31, fixup atom: __$$hmAppManager$$__
                                            at 36, fixup atom: currentApp
                                            at 42, fixup atom: current
                                            at 48, fixup atom: DeviceRuntimeCore
                                            at 53, fixup atom: WidgetFactory
                                            at 59, fixup atom: DeviceRuntimeCore
                                            at 64, fixup atom: HmDomApi
                                            at 75, fixup atom: drink
                                            at 84, fixup atom: console
                                            at 89, fixup atom: log
                                            at 94, fixup atom: "----->>>current"
                                            at 103, fixup atom: console
                                            at 108, fixup atom: log
                                            at 113, fixup atom: __$$hmAppManager$$__
                                            at 118, fixup atom: currentApp
                                            at 123, fixup atom: pid
                                            at 132, fixup atom: console
                                            at 137, fixup atom: log
                                            at 142, fixup atom: __$$hmAppManager$$__
                                            at 147, fixup atom: currentApp
                                            at 152, fixup atom: current
                                            at 200, fixup atom: push
                                            at 205, fixup atom: "images/weeken/"
                                            at 210, fixup atom: concat
                                            at 218, fixup atom: ".png"
                                            at 233, fixup atom: push
                                            at 238, fixup atom: "images/weeksc/"
                                            at 243, fixup atom: concat
                                            at 251, fixup atom: ".png"
                                            at 266, fixup atom: push
                                            at 271, fixup atom: "images/weektc/"
                                            at 276, fixup atom: concat
                                            at 284, fixup atom: ".png"
                                            at 323, fixup atom: push
                                            at 328, fixup atom: "images/28pt/"
                                            at 333, fixup atom: concat
                                            at 341, fixup atom: ".png"
                                            at 356, fixup atom: push
                                            at 361, fixup atom: "images/144pt/line/"
                                            at 366, fixup atom: concat
                                            at 374, fixup atom: ".png"
                                            at 399, fixup atom: x
                                            at 406, fixup atom: y
                                            at 414, fixup atom: week_en
                                            at 422, fixup atom: week_tc
                                            at 430, fixup atom: week_sc
                                            at 435, fixup atom: hmUI
                                            at 440, fixup atom: show_level
                                            at 445, fixup atom: ONLY_AOD
                                            at 450, fixup atom: show_level
                                            at 460, fixup atom: month_startX
                                            at 467, fixup atom: month_startY
                                            at 472, fixup atom: "images/28pt/fenhao.png"
                                            at 477, fixup atom: month_unit_sc
                                            at 482, fixup atom: "images/28pt/fenhao.png"
                                            at 487, fixup atom: month_unit_tc
                                            at 492, fixup atom: "images/28pt/fenhao.png"
                                            at 497, fixup atom: month_unit_en
                                            at 503, fixup atom: month_space
                                            at 509, fixup atom: month_zero
                                            at 517, fixup atom: month_en_array
                                            at 525, fixup atom: month_sc_array
                                            at 533, fixup atom: month_tc_array
                                            at 539, fixup atom: day_follow
                                            at 545, fixup atom: day_space
                                            at 551, fixup atom: day_zero
                                            at 559, fixup atom: day_en_array
                                            at 567, fixup atom: day_sc_array
                                            at 575, fixup atom: day_tc_array
                                            at 580, fixup atom: hmUI
                                            at 585, fixup atom: show_level
                                            at 590, fixup atom: ONLY_AOD
                                            at 595, fixup atom: show_level
                                            at 605, fixup atom: hour_zero
                                            at 612, fixup atom: hour_startX
                                            at 619, fixup atom: hour_startY
                                            at 627, fixup atom: hour_array
                                            at 634, fixup atom: minute_zero
                                            at 641, fixup atom: minute_startX
                                            at 649, fixup atom: minute_startY
                                            at 657, fixup atom: minute_array
                                            at 662, fixup atom: hmUI
                                            at 667, fixup atom: show_level
                                            at 672, fixup atom: ONLY_AOD
                                            at 677, fixup atom: show_level
                                            at 687, fixup atom: x
                                            at 695, fixup atom: y
                                            at 702, fixup atom: w
                                            at 707, fixup atom: hmUI
                                            at 712, fixup atom: data_type
                                            at 717, fixup atom: STEP
                                            at 722, fixup atom: type
                                            at 730, fixup atom: font_array
                                            at 735, fixup atom: hmUI
                                            at 740, fixup atom: align
                                            at 745, fixup atom: CENTER_H
                                            at 750, fixup atom: align_h
                                            at 755, fixup atom: hmUI
                                            at 760, fixup atom: show_level
                                            at 765, fixup atom: ONLY_AOD
                                            at 770, fixup atom: show_level
                                            at 780, fixup atom: x
                                            at 788, fixup atom: y
                                            at 793, fixup atom: "images/steps.png"
                                            at 798, fixup atom: src
                                            at 803, fixup atom: hmUI
                                            at 808, fixup atom: show_level
                                            at 813, fixup atom: ONLY_AOD
                                            at 818, fixup atom: show_level
                                            at 825, fixup atom: DeviceRuntimeCore
                                            at 830, fixup atom: HmLogger
                                            at 835, fixup atom: getLogger
                                            at 840, fixup atom: sanjiao
                                            at 850, fixup atom: DeviceRuntimeCore
                                            at 855, fixup atom: Page
                                            at 863, fixup atom: init_view
                                            at 871, fixup atom: onInit
                                            at 879, fixup atom: onReady
                                            at 887, fixup atom: onShow
                                            at 895, fixup atom: onHide
                                            at 903, fixup atom: onDestory
                                            at 912, fixup atom: module
                                          }
                                          debug {
090c:  a8 03 01 00                          filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                          }
                                          cpool {
0910:  0e                                   function {
0911:  42 07 00 00 00 00 00 04
       05 00 a0 01 00                         name: "<null>"
                                              args=0 vars=0 defargs=0 closures=5 cpool=0
                                              stack=4 bclen=160 locals=0
                                              closure vars {
091e:  c8 03 09 09                              name: i
0922:  ca 03 0a 09                              name: s
0926:  cc 03 0b 09                              name: h
092a:  ce 03 0c 09                              name: g
092e:  d0 03 0d 09                              name: m
                                              }
                                              bytecode {
0932:  38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2b 01 00
       00 65 00 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2c 01 00
       00 65 01 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2d 01 00
       00 65 02 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2e 01 00
       00 65 03 00 24 02 00 0e
       38 f8 00 00 00 42 29 01
       00 00 38 f8 00 00 00 41
       2a 01 00 00 41 2f 01 00
       00 65 04 00 24 02 00 29                  at 1, fixup atom: hmUI
                                                at 6, fixup atom: createWidget
                                                at 11, fixup atom: hmUI
                                                at 16, fixup atom: widget
                                                at 21, fixup atom: IMG_WEEK
                                                at 33, fixup atom: hmUI
                                                at 38, fixup atom: createWidget
                                                at 43, fixup atom: hmUI
                                                at 48, fixup atom: widget
                                                at 53, fixup atom: IMG_DATE
                                                at 65, fixup atom: hmUI
                                                at 70, fixup atom: createWidget
                                                at 75, fixup atom: hmUI
                                                at 80, fixup atom: widget
                                                at 85, fixup atom: IMG_TIME
                                                at 97, fixup atom: hmUI
                                                at 102, fixup atom: createWidget
                                                at 107, fixup atom: hmUI
                                                at 112, fixup atom: widget
                                                at 117, fixup atom: TEXT_IMG
                                                at 129, fixup atom: hmUI
                                                at 134, fixup atom: createWidget
                                                at 139, fixup atom: hmUI
                                                at 144, fixup atom: widget
                                                at 149, fixup atom: IMG
                                              }
                                              debug {
09d2:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
09d6:  0e                                   function {
09d7:  42 07 00 00 00 01 00 03
       00 00 1f 01                            name: "<null>"
                                              args=0 vars=1 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=31 locals=1
                                              vars {
09e3:  10 00 01 00                              name: this
                                              }
                                              bytecode {
09e7:  08 c8 38 d2 00 00 00 42
       d3 00 00 00 04 30 01 00
       00 24 01 00 0e c4 42 22
       01 00 00 24 00 00 29                     at 3, fixup atom: console
                                                at 8, fixup atom: log
                                                at 13, fixup atom: "index page.js on init invoke"
                                                at 23, fixup atom: init_view
                                              }
                                              debug {
0a06:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a0a:  0e                                   function {
0a0b:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a17:  38 d2 00 00 00 42 d3 00
       00 00 04 31 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on ready invoke"
                                              }
                                              debug {
0a2a:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a2e:  0e                                   function {
0a2f:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a3b:  38 d2 00 00 00 42 d3 00
       00 00 04 32 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on show invoke"
                                              }
                                              debug {
0a4e:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a52:  0e                                   function {
0a53:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a5f:  38 d2 00 00 00 42 d3 00
       00 00 04 33 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on hide invoke"
                                              }
                                              debug {
0a72:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
0a76:  0e                                   function {
0a77:  42 07 00 00 00 00 00 03
       00 00 13 00                            name: "<null>"
                                              args=0 vars=0 defargs=0 closures=0 cpool=0
                                              stack=3 bclen=19 locals=0
                                              bytecode {
0a83:  38 d2 00 00 00 42 d3 00
       00 00 04 34 01 00 00 24
       01 00 29                                 at 1, fixup atom: console
                                                at 6, fixup atom: log
                                                at 11, fixup atom: "index page.js on destory invoke"
                                              }
                                              debug {
0a96:  a8 03 01 00                              filename: "/home/htoo/Desktop/l66/09E6A331/dist/192x490_s_l66/device/watchface/192x490_s_l66/index.js"
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
问下qjsc还需要魔改嘛?我用2020-7-5的qjsc转换后的字节码在手环上跑不起来诶(
 
问下qjsc还需要魔改嘛?我用2020-7-5的qjsc转换后的字节码在手环上跑不起来诶(
我把手环的固件里面的字符串提了一下,确实是这个版本,用对应的qjs加载官方的bin也能跑起来(虽然会因为电脑上没有对应的全局对象报错,但是不会崩溃)

但是自己生成之后放到手环上确实会出问题,具体怎么回事还在查
 

*这是一则由 Google AdSense 自动推荐的广告,与本站无关,不对其真实性与可靠性负责

相似主题

米环7表盘
29K
352

Home 首页
Home 资源
News 发现
Account 我的
顶部