-
Notifications
You must be signed in to change notification settings - Fork 272
Add SmsOtp plugin #743
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
base: master
Are you sure you want to change the base?
Add SmsOtp plugin #743
Conversation
rocka
left a comment
There was a problem hiding this 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.
app/src/main/java/org/fcitx/fcitx5/android/input/FcitxInputMethodService.kt
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/FcitxInputMethodService.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/bar/KawaiiBarComponent.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/bar/ui/idle/OtpUi.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/broadcast/InputBroadcastReceiver.kt
Outdated
Show resolved
Hide resolved
lib/common/src/main/aidl/org/fcitx/fcitx5/android/common/ipc/IFcitxRemoteService.aidl
Outdated
Show resolved
Hide resolved
plugin/sms-otp/src/main/java/org/fcitx/fcitx5/android/plugin/smsotp/MainService.kt
Outdated
Show resolved
Hide resolved
plugin/sms-otp/src/main/java/org/fcitx/fcitx5/android/plugin/smsotp/MainService.kt
Outdated
Show resolved
Hide resolved
plugin/sms-otp/src/main/play/listings/en-US/graphics/icon/icon.png
Outdated
Show resolved
Hide resolved
|
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. |
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.