Storage location of "adb_keys" I have a Galaxy s3 (I9300) that has a broken touch screen (display is fine). I therefore can not click the authorization dialog that pops up when I try to access the device via adb on any ROMs above Android 4.2 as they require authorization to access the device via adb.

On 4.2 and 4.3 of the stock ROMs, I am able to copy my ~/.android/adbkey.pub  file from my machine to /data/misc/adb/adb_keys on the device via CWM recovery and gain access. I have tried this with LineageOS 14 which is on Android 7.1.1 and I still don't get access. I am wondering where the adb_keys file is located on android 7.1.1 so I can do the same.
Since Android 4.2 when public key authentication was added to ADB, up to latest release 10, there are only two possible locations for adb_keys on stock Android:


  On the device, vendors public keys are installed at build time in /adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.


So is the case with Android 7.1.1:

static const char *key_paths[] = {
    "/adb_keys",
    "/data/misc/adb/adb_keys",
    NULL
};


First one is only found on userdebug/eng ROMs. Also on debuggable builds, you can set ro.adb.secure to 0 to "allow adbd to connect without authentication". However "user builds filter out PRODUCT_ADB_KEYS, so no /adb_keys will be included". (Source)

So the RSA public keys added to /data/misc/adb/adb_keys should work. Make sure proper ownership (system:shell), mode (0640) and SELinux label (u:object_r:adb_keys_file:s0) are set on the file and restart adbd after adding key(s). Also check correct line endings (use dos2unix) after adding key(s) and make sure the right private key pair is available to adb server on PC. Path is ~/.android/ on Linux and %userprofile%\.android\ on Windows, or add the key filename/directory to ADB_VENDOR_KEYS environment variable.



RELATED:


Why “adb root” does nothing?