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

Side by Side Diff: build/android/provision_devices.py

Issue 1960363002: Change provision_devices.py to disable verity for remove webview on M (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Provisions Android devices with settings required for bots. 7 """Provisions Android devices with settings required for bots.
8 8
9 Usage: 9 Usage:
10 ./provision_devices.py [-d <device serial number>] 10 ./provision_devices.py [-d <device serial number>]
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if options.disable_network: 288 if options.disable_network:
289 device_settings.ConfigureContentSettings( 289 device_settings.ConfigureContentSettings(
290 device, device_settings.NETWORK_DISABLED_SETTINGS) 290 device, device_settings.NETWORK_DISABLED_SETTINGS)
291 291
292 if options.disable_system_chrome: 292 if options.disable_system_chrome:
293 # The system chrome version on the device interferes with some tests. 293 # The system chrome version on the device interferes with some tests.
294 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'], 294 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'],
295 check_return=True) 295 check_return=True)
296 296
297 if options.remove_system_webview: 297 if options.remove_system_webview:
298 if device.HasRoot(): 298 if any(device.PathExists(p) for p in _SYSTEM_WEBVIEW_PATHS):
299 # This is required, e.g., to replace the system webview on a device. 299 logging.info('System WebView exists and needs to be removed')
300 device.adb.Remount() 300 if device.HasRoot():
301 device.RunShellCommand(['stop'], check_return=True) 301 # Disabled Marshmallow's Verity security feature
302 device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS, 302 if device.build_version_sdk >= version_codes.MARSHMALLOW:
303 check_return=True) 303 device.adb.DisableVerity()
304 device.RunShellCommand(['start'], check_return=True) 304 device.Reboot()
305 device.WaitUntilFullyBooted()
306 device.EnableRoot()
307
308 # This is required, e.g., to replace the system webview on a device.
309 device.adb.Remount()
310 device.RunShellCommand(['stop'], check_return=True)
311 device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS,
312 check_return=True)
313 device.RunShellCommand(['start'], check_return=True)
314 else:
315 logging.warning('Cannot remove system webview from a non-rooted device')
305 else: 316 else:
306 logging.warning('Cannot remove system webview from a non-rooted device') 317 logging.info('System WebView already removed')
307 318
308 # Some device types can momentarily disappear after setting properties. 319 # Some device types can momentarily disappear after setting properties.
309 device.adb.WaitForDevice() 320 device.adb.WaitForDevice()
310 321
311 322
312 def _ConfigureLocalProperties(device, java_debug=True): 323 def _ConfigureLocalProperties(device, java_debug=True):
313 """Set standard readonly testing device properties prior to reboot.""" 324 """Set standard readonly testing device properties prior to reboot."""
314 local_props = [ 325 local_props = [
315 'persist.sys.usb.config=adb', 326 'persist.sys.usb.config=adb',
316 'ro.monkey=1', 327 'ro.monkey=1',
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 }, 547 },
537 } 548 }
538 549
539 devil_chromium.Initialize(custom_deps=devil_custom_deps) 550 devil_chromium.Initialize(custom_deps=devil_custom_deps)
540 551
541 return ProvisionDevices(args) 552 return ProvisionDevices(args)
542 553
543 554
544 if __name__ == '__main__': 555 if __name__ == '__main__':
545 sys.exit(main()) 556 sys.exit(main())
OLDNEW
« 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