Skip to main content

Command Palette

Search for a command to run...

Reviving Keymonk Android Keyboard - Detailed

Updated
4 min read
P

I like tech, and sometimes I'm even good at it. This blog is a scratch space for good solutions to problems I've encountered.

This article builds on the excellent overview from Gil Portnoy over on Medium about what needs to be done to the Keymonk Android app to get it working on Android 13. There's a minor but annoying bug where text predictions won't show on your screen.

https://miro.medium.com/v2/resize:fit:640/format:webp/1*rVkEU6wO3QoTm_9Tl-nYvQ.jpeg

Gil has done the lion's share of the work in identifying the problem and its cause, and figuring out how to fix it. His article gives a high-level guide to what needs to be done but as some commenters have observed, it doesn't provide detail or artifacts that can be used by others. I managed to figure out the details based on Gil's guide, and will document here the exact steps I followed so that others might be able to do the same.

All the usual warnings apply, but mainly: don't download and install software from untrusted sources unless you feel comfortable with the level of risk you're taking!

Part 1: Source the APK

Keymonk really does look like abandonware, and thanks to this Reddit comment I was able to source a copy of it on Dropbox. You probably hopefully can, too!

https://www.reddit.com/r/ApksApps/comments/i56wrr/comment/i1oqhm5/

Part 2: Modify the APK

Gil's guide says he used APKTool and APKLab to unpack the Keymonk APK, but APKLab is a VSCode extension and personally I'm not really a fan of using VSCode. I tried using just APKTool on its own, but I found I couldn't edit the AndroidManifest.xml without the APK becoming unusable as I recompiled it. I'm sure APKTool is capable of recompiling it properly, but I just couldn't figure it out.

Instead, I used the APK Editor Studio to open up the APK and make my edits. The Studio was easy to download and run - I used the AppImage edition as I run Linux, but I'd imagine the Windows/Mac editions to be just as straightforward.

  1. Configure the Studio

    Start the APK Editor Studio and click SettingsOptions. In the Options widget, select the Apktool tab and check the box for Decompile source code (smali). Click OK.

  2. Open the APK
    Click FileOpen APK..., then browse to the APK you downloaded in Part 1. It should load up nicely in the Studio.

  3. Switch the Resources view to File System:

  4. Set the Minimum SDK to Android 13.

  5. Edit the AndroidManifest.xml, and add android:exported="true" to the <service> and <activity> tags that include <intent-filter> sub-tags.

    1. Change L6 from:

       <service android:name=".LatinIME" android:permission="android.permission.BIND_INPUT_METHOD">
      

      to:

       <service android:name=".LatinIME" android:permission="android.permission.BIND_INPUT_METHOD" android:exported="true">
      
    2. Change L12 from:

       <activity android:label="@string/ime_setup" android:name=".SetupHelper" android:theme="@android:style/Theme.Black.NoTitleBar">
      

      to:

       <activity android:label="@string/ime_setup" android:name=".SetupHelper" android:theme="@android:style/Theme.Black.NoTitleBar" android:exported="true">
      
    3. Your updated file should look like this:

    4. Save the AndroidManifest.xml file (either by using Ctrl+S, or from the menu by clicking TabSave Resource.

  6. Edit the file LatinIME.smali to add the function code.

    1. In the File System tree, expand smalicomkeymonkfull, then double-click the file LatinIME.smali to edit it.

    2. Either search for the text .line 595, or manually scroll down to line 13586 to find it. After L13587, i.e., between the .line 595 block and the .line 597 block, add the below code:

       .line 596
       virtual {p0, v6}, Lcom/keymonk/full/LatinIME;->setCandidatesViewShown(Z)V
      

      Now your file should read like this:

       [...]
      
           .line 595
           invoke-super {p0, p1, p2}, Landroid/inputmethodservice/InputMethodService;->onStartInput(Landroid/view/inputmethod/EditorInfo;Z)V
      
           .line 596
           invoke-virtual {p0, v6}, Lcom/keymonk/full/LatinIME;->setCandidatesViewShown(Z)V
      
           .line 597
           iget-object v5, p0, Lcom/keymonk/full/LatinIME;->mThemeConfig:Lcom/keymonk/full/ThemeConfig;
      
       [...]
      
    3. Save the LatinIME.smali file (either by using Ctrl+S, or from the menu by clicking TabSave Resource.

  7. Save the APK, probably as a new file.

    1. Click FileSave APK..., or use Ctrl+Alt+S. Pick a name for the new APK and click Save.

      You'll be prompted with a note to tell you that the Studio is going to use its own keystore to sign the APK, which is fine for our purposes. You don't intend on sharing this around, right?

Part 3: Install the modified APK

That's it! You need to get that APK onto your Android device and install it - if you don't already have it configured, you'll need to set the OS to allow installations from untrusted sources. But if you've made it this far down in this article on your own, you can probably figure this part out yourself. :)

Big thanks to Gil for his original article, there was no way on Earth I'd figure this out on my own otherwise.

B

Anyone else having an issue with the dictionary part of the keyboard showing up on the bottom of the screen at times even when the keyboard isn't in use? I am on an up-to-date OnePlus Open.

O
Ojay S2y ago

I have kept checking for years to see whether one day this amazing app was somehow restored. I checked again a few days ago and found Gil's post. I really appreciate you, not only making this more thorough guide, but also posting the comment on Gil's post. It would have taken me significantly more hours to understand what Gil did, thank you!

I started two-thumb typing once I got it installed and it's amazing how intuitive it instantly felt. Can't believe other apps haven't matched it yet.

O
Ojay S2y ago

Oh, that's probably why others haven't: Patent#: US8713464B2

B

Ojay S Looks like Keymonk came out a year or two before the patent was filed. I'd hope it would have been considered prior art and invalidated the patent but, unfortunately, that is easier said than done.

O
Ojay S1y ago

Brian Snipes So for some reason I might have made the leap in judgement that the patent was filed by the Keymonk creator (I assume that's how I found the patent in the first place). However, when trying to retrace my steps I guess I might have made a poor assumption.

However, the better news is that the patent is expired as of this year.

1
P
Philipp2y ago

Awesome! I've been looking for a working version of keymonk keyboard every year. Could you share the APK?