Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: build/android/provision_devices.py

Issue 801283004: Provision devices: use ReadFile/WriteFile to load/restore adb keys (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index c719754bffa49b697dc88f9bda29ab26ea3c52ce..a3b24f54047295fb628c7a39233caf056d15558e 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -119,19 +119,14 @@ 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 = device.ReadFile(constants.ADB_KEYS_FILE, as_root=True)
jbudorick 2014/12/15 23:13:42 These will both now check a return value where the
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('restorecon %s' % dir_path, as_root=True)
- device.RunShellCommand('echo %s > %s' %
- (adb_keys[0], constants.ADB_KEYS_FILE), as_root=True)
- for adb_key in adb_keys[1:]:
- device.RunShellCommand(
- 'echo %s >> %s' % (adb_key, constants.ADB_KEYS_FILE), as_root=True)
+ device.WriteFile(constants.ADB_KEYS_FILE, adb_keys, as_root=True)
device.RunShellCommand('restorecon %s' % constants.ADB_KEYS_FILE,
as_root=True)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698