@@ -177,18 +177,11 @@ def adb_twrp_copy_partitions(bin_path: Path, config_path: Path) -> TerminalRespo
177177
178178@add_logging ("Perform a factory reset with adb and twrp." , return_if_fail = True )
179179def adb_twrp_format_data (bin_path : Path ) -> TerminalResponse :
180- """Perform a factory reset with twrp and adb."""
181- for line in run_command ("adb shell twrp format data" , bin_path ):
182- yield line
183-
184-
185- @add_logging ("Wipe the selected partition with adb and twrp." , return_if_fail = True )
186- def adb_twrp_wipe_partition (bin_path : Path , partition : str ) -> TerminalResponse :
187180 """Perform a factory reset with twrp and adb.
188181
189182 If `format data` fails (for example because of old TWRP versions) we fall back to `wipe data`.
190183 """
191- for line in run_command (f "adb shell twrp wipe { partition } " , bin_path ):
184+ for line in run_command ("adb shell twrp format data " , bin_path ):
192185 yield line
193186 if (type (line ) == bool ) and not line :
194187 logger .info (
@@ -199,6 +192,13 @@ def adb_twrp_wipe_partition(bin_path: Path, partition: str) -> TerminalResponse:
199192 yield line
200193
201194
195+ @add_logging ("Wipe the selected partition with adb and twrp." , return_if_fail = True )
196+ def adb_twrp_wipe_partition (bin_path : Path , partition : str ) -> TerminalResponse :
197+ """Perform a factory reset with twrp and adb."""
198+ for line in run_command (f"adb shell twrp wipe { partition } " , bin_path ):
199+ yield line
200+
201+
202202def adb_twrp_wipe_and_install (
203203 bin_path : Path ,
204204 target : str ,
0 commit comments