Skip to content

Commit

Permalink
marlin/sailfish: Fix adb doesn't remember computer authorization
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Siqi Lin committed May 11, 2016
1 parent 35800f7 commit 94bddf9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions init.common.diag.rc.userdebug
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 94bddf9

Please sign in to comment.