Skip to content

Conversation

@benzhe
Copy link

@benzhe benzhe commented Jun 24, 2025

Add a plugin for automatic reading OTP from SMS message.

90% of the code is generated by Gemini 2.5 Pro. I'm not an Android expert, so I couldn't identify any potential flaws in it. The code has only been tested on my own device. Therefore, I'd appreciate it if you guys could help review the code.

Copy link
Member

@rocka rocka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution! But to be honest, this implemetation is far from ideal.

The plugin has permission.IPC and interact with the input method with FcitxRemoteService, which is the intended design; but the input method itself uses Broadcast which makes the whole process slow and inscure, because other applications can also register an receiver with the same name and intercept the otp code. Moreover, it's actually not a trival task to extract otp code from SMS messages, a simple regex could lead to many false-positives.

I've read through the changes and made comments accordingly. In short, this PR cannot be merged in current state and needs to be rewritten from the ground up.


Or if you're tired, maybe it's better to just use https://github.com/RikkaW/SmsCodeHelper . It still works on Android 15 with fcitx5-android. It's more secure too, because on Android 10+, only the foreground process and the input method has access to the clipboard.

@benzhe
Copy link
Author

benzhe commented Jun 25, 2025

I've revised most of the code according to the guidelines. Please review it again.

And in my situation, I don't prefer the OTP codes messing up with clipboard content.

@benzhe benzhe requested a review from rocka July 15, 2025 06:47
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.

2 participants