From 94bddf90371cdd014d0b51e69686b14a8c68fe11 Mon Sep 17 00:00:00 2001 From: Siqi Lin Date: Tue, 10 May 2016 17:31:27 -0700 Subject: [PATCH] marlin/sailfish: Fix adb doesn't remember computer authorization In init.common.diag.rc, make a backup of /data/misc/adb/adb_keys if it exists, copy the OEM adb_keys to /data/misc/adb/adb_keys, then copy the backup if it exists back to /data/misc/adb/adb_keys. This ensures that the OEM keys will always be present and new keys added by users will also be saved. Change-Id: I3e2a08936b9e961ac9eb25e2f06859a557ab0fd6 --- init.common.diag.rc.userdebug | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init.common.diag.rc.userdebug b/init.common.diag.rc.userdebug index cd715a0e4..a69fe3326 100644 --- a/init.common.diag.rc.userdebug +++ b/init.common.diag.rc.userdebug @@ -4,8 +4,13 @@ on post-fs-data # Modem logging collection mkdir /data/diag_logs 0777 system system - # Create symlink for OEM adb_keys - symlink /vendor/etc/adb_keys /data/misc/adb/adb_keys + # Copy OEM adb_keys if /data/misc/adb/adb_keys does not exist + copy /data/misc/adb/adb_keys /data/misc/adb/adb_keys_temp + copy /vendor/etc/adb_keys /data/misc/adb/adb_keys + copy /data/misc/adb/adb_keys_temp /data/misc/adb/adb_keys + chown system shell /data/misc/adb/adb_keys + chmod 640 /data/misc/adb/adb_keys + rm /data/misc/adb/adb_keys_temp on boot chmod 666 /dev/diag