enable-swype-aosp-keyboard.md (2202B)
1 --- 2 title: "Enabling Swype on the AOSP keyboard" 3 date: 2021-01-31T14:42:00 4 lastmod: 2021-02-03T11:51:00 5 tags: ["Android", "Linux", "Snippets", "Software"] 6 --- 7 8 I've recently changed my phone to a Pixel 4, one of the reasons for this was to have as much of an open source device as possible. Naturally my operating system of choice was [LineageOS 17](https://lineageos.org/). 9 10 With this however, the included AOSP keyboard will not support gesture inputs without a proprietary Google library. To get this working, you'll first want to download the [Pico package of Open GApps](https://opengapps.org/) for your phone, I'm using ARM64 architecture for my Pixel 4 device however yours may be different. 11 12 Once downloaded, extract your archive: 13 ``` 14 unzip open_gapps-arm64-9.0-pico-20210127.zip 15 ``` 16 17 Now move to the directory containing the library and extract that: 18 ``` 19 cd Optional 20 tar --lzip -xf swypelibs-lib-arm64.tar.lz 21 cd swypelibs-lib-arm64/common/lib64 22 ls 23 ``` 24 25 Here, you should now have `libjni-latinimegoogle.so`. With this, you want to push this library to your phone. 26 Once connected via ADB (and with root access enabled in the debugging menu), do the following: 27 ``` 28 adb devices 29 adb root 30 adb remount 31 adb push libjni_latinimegoogle.so /system/lib64/ 32 adb unroot 33 adb reboot 34 ``` 35 36 Once rebooted, browse to: 37 ``` 38 Settings > System > Languages & input > Virtual Keyboard > Android Keyboard (AOSP) > Gesture Typing > Enable gesture typing 39 ``` 40 41 One annoyance is that whenever a OTA update is pushed out to your device, it will remove this library. A [helpful script](https://gist.github.com/rugk/a4c9fa11c5c031faf45602d6bf922a1c) ([and instructions](https://android.stackexchange.com/a/187686)) to workaround this have been provided by [rugk](https://github.com/rugk): 42 ``` 43 wget "https://gist.github.com/rugk/a4c9fa11c5c031faf45602d6bf922a1c/raw/eed64cea4d37f5c35cd4ced5ceb0281fef38afc9/95-latinimegoogle.sh" 44 sed -i 's/lib\//lib64\//g' 95-latinimegoogle.sh 45 adb root 46 adb remount 47 adb push 95-latinimegoogle.sh /system/addon.d/ 48 adb shell 49 cd /system/addon.d 50 chmod +x 95-latinimegoogle.sh 51 exit 52 adb unroot 53 adb reboot 54 ``` 55 56 And you should be done. 57 58 * **Edit 2021-02-03:** Add OTA update library preservation section.