Skip to content

Commit b778487

Browse files
committed
Fix bootloader unlock issue with fastboot
1 parent 1a23301 commit b778487

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

openandroidinstaller/tool_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def adb_twrp_wipe_and_install(bin_path: Path, target: str, config_path: Path) ->
182182
def fastboot_unlock_with_code(bin_path: Path, unlock_code: str) -> bool:
183183
"""Unlock the device with fastboot and code given."""
184184
logger.info(f"Unlock the device with fastboot and code: {unlock_code}.")
185-
for line in run_command("adb", ["oem", "unlock", f"{unlock_code}"], bin_path):
185+
for line in run_command("fastboot", ["oem", "unlock", f"{unlock_code}"], bin_path):
186186
yield line
187187
if (type(line) == bool) and not line:
188188
logger.error(f"Unlocking with code {unlock_code} failed.")
@@ -194,7 +194,7 @@ def fastboot_unlock_with_code(bin_path: Path, unlock_code: str) -> bool:
194194
def fastboot_unlock(bin_path: Path) -> bool:
195195
"""Unlock the device with fastboot and without code."""
196196
logger.info("Unlock the device with fastboot.")
197-
for line in run_command("adb", ["flashing", "unlock"], bin_path):
197+
for line in run_command("fastboot", ["flashing", "unlock"], bin_path):
198198
yield line
199199
if (type(line) == bool) and not line:
200200
logger.error("Unlocking failed.")
@@ -206,7 +206,7 @@ def fastboot_unlock(bin_path: Path) -> bool:
206206
def fastboot_oem_unlock(bin_path: Path) -> bool:
207207
"""OEM unlock the device with fastboot and without code."""
208208
logger.info("OEM unlocking the device with fastboot.")
209-
for line in run_command("adb", ["oem", "unlock"], bin_path):
209+
for line in run_command("fastboot", ["oem", "unlock"], bin_path):
210210
yield line
211211
if (type(line) == bool) and not line:
212212
logger.error("OEM unlocking failed.")

0 commit comments

Comments
 (0)