Chromium Code Reviews| Index: build/android/provision_devices.py |
| diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
| index 984c026c21023a05255da07a8ecee1c1923c86ae..fed237b9a770ab0be7fdc2f7c719cbb187deb0d1 100755 |
| --- a/build/android/provision_devices.py |
| +++ b/build/android/provision_devices.py |
| @@ -119,18 +119,18 @@ def WipeDeviceData(device): |
| """ |
| device_authorized = device.FileExists(constants.ADB_KEYS_FILE) |
| if device_authorized: |
| - adb_keys = device.RunShellCommand('cat %s' % constants.ADB_KEYS_FILE, |
| - as_root=True) |
| + adb_keys = '\n'.join(set( |
| + device.ReadFile(constants.ADB_KEYS_FILE, as_root=True))) |
| device.RunShellCommand('wipe data', as_root=True) |
| if device_authorized: |
| path_list = constants.ADB_KEYS_FILE.split('/') |
| dir_path = '/'.join(path_list[:len(path_list)-1]) |
| device.RunShellCommand('mkdir -p %s' % dir_path, as_root=True) |
| - device.RunShellCommand('echo %s > %s' % |
| - (adb_keys[0], constants.ADB_KEYS_FILE)) |
| - for adb_key in adb_keys[1:]: |
| - device.RunShellCommand( |
| - 'echo %s >> %s' % (adb_key, constants.ADB_KEYS_FILE)) |
| + device.RunShellCommand('restorecon %s' % dir_path, as_root=True) |
| + device.RunShellCommand('echo %s > %s' % (adb_keys, constants.ADB_KEYS_FILE), |
|
Sami
2014/07/10 11:26:37
Does this work if there are multiple keys in adb_k
|
| + as_root=True) |
| + device.RunShellCommand('restorecon %s' % constants.ADB_KEYS_FILE, |
| + as_root=True) |
| def ProvisionDevices(options): |