I'm trying to build a custom ROM with secure access via adb. My goal is to secure the android image so that it can only be accessed with a certain adb RSA key pair.
When I build AOSP with 'user' variant, adb doesn't work, cannot connect to it in x86, always get 'connection refused by host', but when I build it with another variant (userdebug or eng), adb connect with no restrictions.
How can I secure adb in order to allow connections only from clients that uses certain RSA pairs?