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

Unified 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: Use DeviceUtils.PathExists 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 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 8c21f97ef200987db3d3432e4f26da2b67004d19..2d97a9c1d5527dd0e243e84440ed64ac3c04b01a 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -295,15 +295,28 @@ 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)
+ original_webview_exist = False
jbudorick 2016/05/10 22:28:44 These four lines can just be: if any(device.Pat
Yoland Yan(Google) 2016/05/10 22:36:48 Nicee, done!
+ for p in _SYSTEM_WEBVIEW_PATHS:
+ original_webview_exist = original_webview_exist or device.PathExists(p)
+ if original_webview_exist:
+ logging.info('Original WebView exists and needs to be removed')
+ 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.
jbudorick 2016/05/10 22:28:44 nit: line break before this line
Yoland Yan(Google) 2016/05/10 22:36:48 Done.
+ 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('Original WebView already removed')
jbudorick 2016/05/10 22:28:44 nit: "system webview" instead of "original webview
Yoland Yan(Google) 2016/05/10 22:36:48 Done.
# Some device types can momentarily disappear after setting properties.
device.adb.WaitForDevice()
« 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