Chromium Code Reviews| Index: build/android/provision_devices.py |
| diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
| index 8c21f97ef200987db3d3432e4f26da2b67004d19..635d459460c4c1b7d099f50181b5c94a454e1ffe 100755 |
| --- a/build/android/provision_devices.py |
| +++ b/build/android/provision_devices.py |
| @@ -295,15 +295,26 @@ def SetProperties(device, options): |
| check_return=True) |
| if options.remove_system_webview: |
| - if device.HasRoot(): |
| - # This is required, e.g., to replace the system webview on a device. |
| - device.adb.Remount() |
| - device.RunShellCommand(['stop'], check_return=True) |
| - device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS, |
| - check_return=True) |
| - device.RunShellCommand(['start'], check_return=True) |
| + if any(device.PathExists(p) for p in _SYSTEM_WEBVIEW_PATHS): |
| + logging.info('Original WebView exists and needs to be removed') |
|
jbudorick
2016/05/10 22:58:08
nit: System instead of Original here too
Yoland Yan(Google)
2016/05/10 23:01:04
Done.
|
| + if device.HasRoot(): |
| + # Disabled Marshmallow's Verity security feature |
| + if device.build_version_sdk >= version_codes.MARSHMALLOW: |
| + device.adb.DisableVerity() |
| + device.Reboot() |
| + device.WaitUntilFullyBooted() |
| + device.EnableRoot() |
| + |
| + # This is required, e.g., to replace the system webview on a device. |
| + device.adb.Remount() |
| + device.RunShellCommand(['stop'], check_return=True) |
| + device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS, |
| + check_return=True) |
| + device.RunShellCommand(['start'], check_return=True) |
| + else: |
| + logging.warning('Cannot remove system webview from a non-rooted device') |
| else: |
| - logging.warning('Cannot remove system webview from a non-rooted device') |
| + logging.info('System WebView already removed') |
| # Some device types can momentarily disappear after setting properties. |
| device.adb.WaitForDevice() |