Skip to content

Conversation

@huajiqaq
Copy link
Contributor

描述 / Description

  1. 新增脚本功能
    基于 Rhino JavaScript 引擎,首次引入脚本能力。用户可直接编写 .js 文件作为自定义 Hook,无需编译、无需重启,实现热加载、低门槛的框架扩展。
  2. 核心类设计优化
    • entry:从抽象方法改为非抽象,提供默认实现,子类可不被重写,减少模板代码
    • initOnce:标记为 final / 强制调用,确保不可被跳过、不可被重写,保障初始化逻辑100%执行

类型 / Type

  • Bug 修复 / Bug Fix
  • 新功能 / New Feature
  • 文档更新 / Documentation Update
  • 其他(请描述)/ Other (please describe):

修复或解决的问题 / Issues Fixed or Closed by This PR

  • 解决子类必须实现 entry 导致的冗余代码问题
  • 解决 initOnce 被子类覆盖或遗漏调用导致的初始化不可靠问题
  • 新增脚本能力,解决自定义 Hook 必须写 Java、编译、重启的低效问题

清单 / Checklist

  • 我已阅读并遵循贡献指南 / I have read and followed the contribution guidelines
  • 我已在本地测试这些更改 / I have tested these changes locally
  • 我已更新相关文档或注释(如适用) / I have updated relevant documentation or comments (if applicable)
  • 我确认此更改不会破坏任何原有功能 / I confirm this change does not break any existing features
  • 我已进行多版本适配(如适用) / I have used MMVersion for version compatibility (if applicable)
  • 我已在多个微信版本上测试此更改(如适用) / I have tested this change on multiple WeChat versions (if applicable)

其他信息 / Additional Information

Introduce native core initialization state (isNativeCoreInitialized / setNativeCoreInitialized) in NativeCoreBridge and use it when initializing MMKV to better track / log init status. Adjust initializeMmkvForPrimaryNativeLibrary to use the new API and set the flag via setter. Update LogUtils to consult the native init state before gating logs, preventing premature log suppression. Make WePkgDispatcher null-safe for getUri to avoid NPEs, and add a comment in MmkvConfigManagerImpl highlighting that MMKV must be initialized before use.
@huajiqaq huajiqaq closed this Feb 12, 2026
@huajiqaq huajiqaq deleted the patch1 branch February 12, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant