Are there any ways to install a third party keyboard as the system keyboard? I am wondering if it is possible to install a new keyboard as the system keyboard. I'd like to do this because I want to use an open-source keyboard (Like AnysoftKeyboard) for typing my encryption password at boot. From what I've read, only the system keyboard is available for use when entering the encryption password.

My phone is rooted, I have adb, and I have a terminal emulator on the phone that can su. If it's possible to do, what is the process? (If it's relevant, my phone is a Galaxy S7)
Way1: famous method now a days.


Unroot
Install Magisk (a systemless root solution) link
Install App Systemizer module for Magisk from magisk app
Make your app system app


This way you can make the user-installed app a system app without actually modifying the /system partition.

Way2: 

Change system partition evergreen method
Follow this guide link