This repository was archived by the owner on Jan 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ def Root(self):
218218 """Restart adbd as root on the device."""
219219 return self .protocol_handler .Command (self .handle , service = b'root' )
220220
221+ def EnableVerity (self ):
222+ """Re-enable dm-verity checking on userdebug builds"""
223+ return self .protocol_handler .Command (self .handle , service = b'enable-verity' )
224+
225+ def DisableVerity (self ):
226+ """Disable dm-verity checking on userdebug builds"""
227+ return self .protocol_handler .Command (self .handle , service = b'disable-verity' )
228+
221229 def Shell (self , command , timeout_ms = None ):
222230 """Run command on the device, returning the output."""
223231 return self .protocol_handler .Command (
Original file line number Diff line number Diff line change @@ -141,6 +141,8 @@ def main():
141141 common_cli .MakeSubparser (
142142 subparsers , parents , adb_commands .AdbCommands .Remount )
143143 common_cli .MakeSubparser (subparsers , parents , adb_commands .AdbCommands .Root )
144+ common_cli .MakeSubparser (subparsers , parents , adb_commands .AdbCommands .EnableVerity )
145+ common_cli .MakeSubparser (subparsers , parents , adb_commands .AdbCommands .DisableVerity )
144146 common_cli .MakeSubparser (subparsers , parents , Shell )
145147
146148 if len (sys .argv ) == 1 :
Original file line number Diff line number Diff line change @@ -151,6 +151,15 @@ def testRoot(self):
151151 adb_commands = self ._Connect (usb )
152152 adb_commands .Root ()
153153
154+ def testEnableVerity (self ):
155+ usb = self ._ExpectCommand (b'enable-verity' , b'' , b'' )
156+ adb_commands = self ._Connect (usb )
157+ adb_commands .EnableVerity ()
158+
159+ def testDisableVerity (self ):
160+ usb = self ._ExpectCommand (b'disable-verity' , b'' , b'' )
161+ adb_commands = self ._Connect (usb )
162+ adb_commands .DisableVerity ()
154163
155164class FilesyncAdbTest (BaseAdbTest ):
156165
You can’t perform that action at this time.
0 commit comments