Hi there 👋

Welcome to my blog

codepush热更新

codepush是微软一套热更新系统,托管部署资源如 react-native , cordova 等 CodePush-CLI 是热更新客户端工具,目前微软已废弃,建议使用AppCenter-CLI Cordova 限制(只能更新静态资源,原生code不能更新) Any product changes which touch native code (e.g. upgrading Cordova versions, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s). MainActivity 触发 webview 加载 file:///android_asset/www/index.html code-push-cli 常用命令 #安装 最新为3.0 我们用2 yarn global add code-push-cli@2 code-push -h # 会打开浏览器 https://appcenter.ms/cli-login?hostname=CISZ03-0820 弹出token code-push login # admin 123456 code-push login https://code-push.xx.top/ code-push whoami # 创建app 默认创建两个deployment Production, Staging #code-push app add <appName> <os> <platform> code-push app add sankyu-test android cordova # 查看应用 code-push app ls code-push deployment ls sankyu-test -k # 查看deployment #code-push deployment history <appName> <deploymentName> [options] code-push deployment history sankyu-test Staging code-push deployment history sankyu-test Production # 发布 版本以config....

January 11, 2023

Antlr4初学

背景 项目需要实现前端任意字段匹配查询,故需要配合表达式来生产sql,其实就是定义一种DSL,让前后端相互了解这个语意,调研后决定使用Antlr,相关介绍就不过分多说,直接看效果。语法参考Odata filter ,后期不满足可以直接修改g4文件 Odata filter示例 Country_Region_Code eq 'ES' or Country_Region_Code eq 'US' Country_Region_Code eq 'ES' and Payment_Terms_Code eq '14 DAYS' Entry_No ge 610 Entry_No lt 610 VAT_Bus_Posting_Group ne 'EXPORT' Odata.g4 grammar OData; /* * Parser Rules */ program: expression; expression: LP expression RP # Parenthesis | K_STARTSWITH LP column=column_name ',' value=TEXT RP # StartsWith | K_ENDSWITH LP column=column_name ',' value=TEXT RP # EndsWith | K_CONTAINS LP column=column_name ',' value=TEXT RP # Contains | column=column_name K_IN LP value=decimal_array RP # InDecimal | column=column_name K_IN LP value=string_array RP # InText | column=column_name compare=( Equal | NotEqual | GreaterThan | GreaterThanOrEqual | LessThan | LessThanOrEqual) value=decimal # CompareDecimal | column=column_name compare=( Equal | NotEqual | GreaterThan | GreaterThanOrEqual | LessThan | LessThanOrEqual) value=TEXT # CompareText | expression logic = (K_AND | K_OR) expression # Logic ; column_name : COLUMN_NAME | '[' column_name ']' ; string_array : TEXT (',' TEXT)* ; decimal_array : NUMBER (',' NUMBER)* ; text: TEXT; decimal : NUMBER ; /* * Lexer Rules */ K_IN: I N; K_AND: A N D; K_OR: O R; K_STARTSWITH: S T A R T S W I T H; K_ENDSWITH: E N D S W I T H; K_CONTAINS: C O N T A I N S; LP : '('; RP : ')'; Equal: E Q; NotEqual: N E; GreaterThan: G T; GreaterThanOrEqual: G E; LessThan: L T; LessThanOrEqual: L E; COLUMN_NAME : VALID_ID_START VALID_ID_CHAR* ; TEXT :'"' ....

January 8, 2023

Docker多平台构建

问题 今天遇到个问题,Mac m1 上拉取之前java构建的程序发现跑不起来,第一反应arm平台不兼容之前在x86架构下构建的镜像。 现如今云厂商好多服务器都是arm架构的,加上window11都支持arm架构了(Windows on ARM),arm以后会越来越频繁使用了。 这时就得祭出docker出的利器 buildx,可以一次构建多个平台的镜像。废话不多,开搞。。 buildx其实是个容器工具 moby/buildkit:buildx-stable-1 # Create a new builder ➜ ~ docker buildx create --name mybuilder --bootstrap --use # 查看builder ➜ ~ docker buildx inspect mybuilder Name: mybuilder Driver: docker-container Nodes: Name: mybuilder0 Endpoint: unix:///var/run/docker.sock Status: running Buildkit: v0.11.2 Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6 构建 # 一条命令搞定,会pudh到registry 区别于常规build ➜ ~ docker buildx build --platform linux/arm64/v8,linux/amd64 -t registry....

January 4, 2023

网易2022年度盘点

致敬每一个扛住了生活的平凡人

December 30, 2022

红米Ax6000刷机

背景 家里路由器信号太差了想换一台,真好看到拼多多有活动(360RMB)就入手了一台,顺便手痒想刷下机,看看有什么好玩的软件和应用。 配置 红米 AX6000 搭载的是 MTK 2021 年发布的 Filogic 830 平台,具体型号是 mt7986a,四核 ARM A53 的架构, 512M 内存和 128M 闪存 刷机openwrt https://openwrt.org/toh/xiaomi/redmi_ax6000 官方固件还没有release 先不刷机了 https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/ 先贴一个官方刷机教材,等release再回头看看 https://github.com/openwrt/openwrt/pull/11115 Gain ssh access (see the link: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation) Check current stock system COMMAND: cat /proc/cmdline sample OUTPUT: console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1 if firmware=1, current system is ubi1 if firmware=0, current system is ubi0 Setup nvram If the current system is ubi1, please set it up so that the next time it will boot from ubi: nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=0 nvram set flag_last_success=0 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit If the current system is ubi, please set it up so that the next time it will boot from ubi1:...

December 20, 2022