@@ -57,7 +57,7 @@ def adb_reboot(bin_path: Path) -> bool:
5757 for line in run_command ("adb" , ["reboot" ], bin_path ):
5858 yield line
5959 if (type (line ) == bool ) and line :
60- logger .info ("Reboot failed." )
60+ logger .debug ("Reboot failed." )
6161 yield False
6262 else :
6363 yield True
@@ -69,15 +69,15 @@ def adb_reboot_bootloader(bin_path: Path) -> bool:
6969 for line in run_command ("adb" , ["reboot" , "bootloader" ], bin_path ):
7070 yield line
7171 if (type (line ) == bool ) and not line :
72- logger .info ("Reboot into bootloader failed." )
72+ logger .error ("Reboot into bootloader failed." )
7373 yield False
7474 return
7575 sleep (1 )
7676 # check if in fastboot mode
7777 for line in run_command ("fastboot" , ["devices" ], bin_path ):
7878 yield line
7979 if (type (line ) == bool ) and not line :
80- logger .info ("No fastboot mode detected. Reboot into bootloader failed." )
80+ logger .error ("No fastboot mode detected. Reboot into bootloader failed." )
8181 yield False
8282 else :
8383 yield True
@@ -89,7 +89,7 @@ def adb_reboot_download(bin_path: Path) -> bool:
8989 for line in run_command ("adb" , ["reboot" , "download" ], bin_path ):
9090 yield line
9191 if (type (line ) == bool ) and not line :
92- logger .info ("Reboot into download mode failed." )
92+ logger .error ("Reboot into download mode failed." )
9393 yield False
9494 else :
9595 # check if in download mode with heimdall?
@@ -118,7 +118,7 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str) -> bool:
118118 for line in run_command ("adb" , ["shell" , "twrp" , "format" , "data" ], bin_path ):
119119 yield line
120120 if (type (line ) == bool ) and not line :
121- logger .info ("Formatting data failed." )
121+ logger .error ("Formatting data failed." )
122122 yield False
123123 return
124124 sleep (1 )
@@ -128,15 +128,15 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str) -> bool:
128128 yield not line
129129 sleep (1 )
130130 if (type (line ) == bool ) and not line :
131- logger .info (f"Wiping { partition } failed." )
131+ logger .error (f"Wiping { partition } failed." )
132132 yield False
133133 return
134134 # activate sideload
135135 logger .info ("Wiping is done, now activate sideload." )
136136 for line in run_command ("adb" , ["shell" , "twrp" , "sideload" ], bin_path ):
137137 yield line
138138 if (type (line ) == bool ) and not line :
139- logger .info ("Activating sideload failed." )
139+ logger .error ("Activating sideload failed." )
140140 yield False
141141 return
142142 # now flash os image
@@ -145,7 +145,7 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str) -> bool:
145145 for line in run_command ("adb" , ["sideload" , f"{ target } " ], bin_path ):
146146 yield line
147147 if (type (line ) == bool ) and not line :
148- logger .info (f"Sideloading { target } failed." )
148+ logger .error (f"Sideloading { target } failed." )
149149 yield False
150150 return
151151 # wipe some cache partitions
@@ -155,7 +155,7 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str) -> bool:
155155 yield line
156156 sleep (1 )
157157 if (type (line ) == bool ) and not line :
158- logger .info (f"Wiping { partition } failed." )
158+ logger .error (f"Wiping { partition } failed." )
159159 yield False
160160 return
161161 # finally reboot into os
@@ -164,7 +164,7 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str) -> bool:
164164 for line in run_command ("adb" , ["shell" , "twrp" , "reboot" ], bin_path ):
165165 yield line
166166 if (type (line ) == bool ) and not line :
167- logger .info ("Rebooting with twrp failed." )
167+ logger .error ("Rebooting with twrp failed." )
168168 yield False
169169 return
170170 else :
@@ -177,7 +177,7 @@ def fastboot_unlock_with_code(bin_path: Path, unlock_code: str) -> bool:
177177 for line in run_command ("adb" , ["oem" , "unlock" , f"{ unlock_code } " ], bin_path ):
178178 yield line
179179 if (type (line ) == bool ) and not line :
180- logger .info (f"Unlocking with code { unlock_code } failed." )
180+ logger .error (f"Unlocking with code { unlock_code } failed." )
181181 yield False
182182 else :
183183 yield True
@@ -189,7 +189,7 @@ def fastboot_unlock(bin_path: Path) -> bool:
189189 for line in run_command ("adb" , ["flashing" , "unlock" ], bin_path ):
190190 yield line
191191 if (type (line ) == bool ) and not line :
192- logger .info (f"Unlocking failed." )
192+ logger .error (f"Unlocking failed." )
193193 yield False
194194 else :
195195 yield True
@@ -201,7 +201,7 @@ def fastboot_oem_unlock(bin_path: Path) -> bool:
201201 for line in run_command ("adb" , ["oem" , "unlock" ], bin_path ):
202202 yield line
203203 if (type (line ) == bool ) and not line :
204- logger .info (f"OEM unlocking failed." )
204+ logger .error (f"OEM unlocking failed." )
205205 yield False
206206 else :
207207 yield True
@@ -213,7 +213,7 @@ def fastboot_reboot(bin_path: Path) -> bool:
213213 for line in run_command ("fastboot" , ["reboot" ], bin_path ):
214214 yield line
215215 if (type (line ) == bool ) and not line :
216- logger .info (f"Rebooting with fastboot failed." )
216+ logger .error (f"Rebooting with fastboot failed." )
217217 yield False
218218 else :
219219 yield True
@@ -225,7 +225,7 @@ def fastboot_flash_recovery(bin_path: Path, recovery: str) -> bool:
225225 for line in run_command ("fastboot" , ["boot" , f"{ recovery } " ], bin_path ):
226226 yield line
227227 if (type (line ) == bool ) and not line :
228- logger .info (f"Flashing recovery failed." )
228+ logger .error (f"Flashing recovery failed." )
229229 yield False
230230 else :
231231 yield True
@@ -237,7 +237,7 @@ def heimdall_flash_recovery(bin_path: Path, recovery: str) -> bool:
237237 for line in run_command ("heimdall" , ["flash" , "--no-reboot" , "--RECOVERY" , f"{ recovery } " ], bin_path ):
238238 yield line
239239 if (type (line ) == bool ) and not line :
240- logger .info (f"Flashing recovery with heimdall failed." )
240+ logger .error (f"Flashing recovery with heimdall failed." )
241241 yield False
242242 else :
243243 yield True
@@ -279,5 +279,5 @@ def search_device(platform: str, bin_path: Path) -> Optional[str]:
279279 logger .info (device_code )
280280 return device_code
281281 except CalledProcessError :
282- logger .info (f"Failed to detect a device." )
282+ logger .error (f"Failed to detect a device." )
283283 return None
0 commit comments