@@ -177,18 +177,11 @@ def adb_twrp_copy_partitions(bin_path: Path, config_path: Path) -> TerminalRespo
177
177
178
178
@add_logging ("Perform a factory reset with adb and twrp." , return_if_fail = True )
179
179
def 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 :
187
180
"""Perform a factory reset with twrp and adb.
188
181
189
182
If `format data` fails (for example because of old TWRP versions) we fall back to `wipe data`.
190
183
"""
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 ):
192
185
yield line
193
186
if (type (line ) == bool ) and not line :
194
187
logger .info (
@@ -199,6 +192,13 @@ def adb_twrp_wipe_partition(bin_path: Path, partition: str) -> TerminalResponse:
199
192
yield line
200
193
201
194
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
+
202
202
def adb_twrp_wipe_and_install (
203
203
bin_path : Path ,
204
204
target : str ,
0 commit comments