Repository navigation
Conversation
…ng is extracted Plugins run inside the keyboard and see everything that is typed, but any APK a user picks was loaded. Now the AI, translation, OCR, handwriting and CJK plugins are checked before extraction: signed with a known LeanBitLab key (or the keyboard's own key), or one of the known unsigned handwriting releases 1.0.0-1.0.6. The voice plugin app is only bound when it has a known key. File names from the plugin archive are used without their path, so an entry like "../x.so" can't leave the plugin folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…9, key rotation, message once - Translation import and the handwriting class loader (every load and import) are checked as well - Signatures are read with GET_SIGNATURES and GET_SIGNING_CERTIFICATES (Android 9 fills signingInfo only with the first in some versions) - One signer: a trusted key anywhere in its history is enough (key rotation); several signers: all - A refused file or app is not checked again in this process and its message is shown once - Messages as string resources Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The AI, translation, OCR, handwriting and CJK plugins are APK files the user picks; their code is loaded with
DexClassLoaderinto the keyboard process, where it sees everything that is typed. Today any APK is loaded. A fake "plugin" from some download site would run as part of the keyboard.What changes
PluginTrust.requireTrusted()before any plugin file is extracted or loaded, on every load and import path (AI, translation, OCR, handwriting, CJK). Accepted:apksigner: CJK, GIF and translation01cfc721…, OCR, AI and handwriting from 1.0.7963156a0…, voicec537f494…;lib/arm64-v8a/../../x.socan't leave the plugin folder.Please check
PluginTrust; otherwise that plugin is refused with the message above. Signing every plugin keeps this simple.How we tested
Compiles. The same check runs in my fork (LeanType+) since 27.10.; there I use the AI and voice plugins with it, the other plugins I only checked against the signatures of their releases. An independent review (Claude) found two import paths I had missed in this port (translation and handwriting import) and a likely Android 9 issue with the signature flags; both are fixed in this PR. Not tested on Android 6 or 9 devices.
🤖 Generated with Claude Code