Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DisableUtfControlCharacterInNickname #1151

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Conversation

Allenyou1126
Copy link
Contributor

标题 / Title Here

修复将 RTLO、LTRO 等 UTF 控制字符替换为空格功能会导致无法正常发送消息的问题

描述 / Description

对功能实现进行重构,改为 Hook TextView.onDraw() 方法,并修正了一个会导致无限循环的错误。

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

对功能实现进行重构,改为 Hook TextView.onDraw() 方法,并修正了一个会导致无限循环的错误。

检查列表 / Check List

  • 我已经在预期的 QQ 或 TIM 版本上测试了这些更改,并确认它们能够正常工作,不会破坏任何东西(尽我所能)。
    I have tested these changes on the expected version and confirmed that they work and don't break anything (as well as I can manage).
  • 我的改动不会导致本模块丢失对旧版 QQ 或 TIM 的支持。
    My changes will not cause this module to lose support for older versions of QQ or TIM。
  • 我已经合并了对后续工作无意义的提交,并确认它们不会对后续维护造成破坏。(必须)
    I have merged commits that are meaningless for follow-up work and confirmed that they will not cause damage to follow-up maintenance. (Required)

@cinit
Copy link
Owner

cinit commented Aug 24, 2024

@Allenyou1126 请考虑不要 hook 此类系统方法,TextView.onDraw 可能会被高频调用,hook 此类方法可能会带来性能问题(如在 ListView 滚动时)

@Cryolitia
Copy link
Collaborator

@cinit 其实不IPC的话性能问题不太严重,参见简洁模式圆头像的高速缓存

@cinit
Copy link
Owner

cinit commented Aug 24, 2024

@cinit 你考虑一下是就这样还是再改一下?

@cinit cinit merged commit 3bd609c into cinit:main Aug 24, 2024
2 checks passed
@Allenyou1126
Copy link
Contributor Author

@Allenyou1126 请考虑不要 hook 此类系统方法,TextView.onDraw 可能会被高频调用,hook 此类方法可能会带来性能问题(如在 ListView 滚动时)

实际上我个人选择这个方法是作为一个临时解决方法,QQ里面的组件库比较复杂,要一一分析并 Hook 花费的精力超过了我能承担的范围。
实际上在 K60 上测试的效果来看,这样实现对性能的影响并不是特别严重。如果有更好的实现思路欢迎大佬指出。

(看看抛砖引玉能不能成功x

@EatHatsuneShallots
Copy link

个人认为使用 TransformationMethodTextView.setTransformationMethod 是一个更好的解决方案

@Allenyou1126
Copy link
Contributor Author

个人认为使用 TransformationMethodTextView.setTransformationMethod 是一个更好的解决方案

了解了,改天有时间了我再重构一下

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.

4 participants