Skip to content

Commit 9d22069

Browse files
committed
Add .exe to tool ending
1 parent 0d556d5 commit 9d22069

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

openandroidinstaller/openandroidinstaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
from widgets import call_button, confirm_button, get_title, link_button
5757

5858
# Toggle to True for development purposes
59-
DEVELOPMENT = True
59+
DEVELOPMENT = False
6060
DEVELOPMENT_CONFIG = "yuga" # "a3y17lte" # "sargo"
6161

6262

openandroidinstaller/tool_utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# If not, see <https://www.gnu.org/licenses/>."""
1414
# Author: Tobias Sterbak
1515

16+
import sys
1617
from pathlib import Path
1718
from subprocess import STDOUT, CalledProcessError, call, check_output
1819
from typing import Optional
@@ -21,11 +22,19 @@
2122
from loguru import logger
2223

2324

25+
PLATFORM = sys.platform
26+
27+
2428
def call_tool_with_command(command: str, bin_path: Path) -> bool:
2529
"""Call an executable with a specific command."""
26-
command = re.sub(r"^adb", re.escape(str(bin_path.joinpath(Path("adb")))), command)
27-
command = re.sub(r"^fastboot", re.escape(str(bin_path.joinpath(Path("fastboot")))), command)
28-
command = re.sub(r"^heimdall", re.escape(str(bin_path.joinpath(Path("heimdall")))), command)
30+
if PLATFORM == "win32":
31+
command = re.sub(r"^adb", re.escape(str(bin_path.joinpath(Path("adb.exe")))), command)
32+
command = re.sub(r"^fastboot", re.escape(str(bin_path.joinpath(Path("fastboot.exe")))), command)
33+
command = re.sub(r"^heimdall", re.escape(str(bin_path.joinpath(Path("heimdall.exe")))), command)
34+
else:
35+
command = re.sub(r"^adb", re.escape(str(bin_path.joinpath(Path("adb")))), command)
36+
command = re.sub(r"^fastboot", re.escape(str(bin_path.joinpath(Path("fastboot")))), command)
37+
command = re.sub(r"^heimdall", re.escape(str(bin_path.joinpath(Path("heimdall")))), command)
2938

3039
logger.info(f"Run command: {command}")
3140
res = call(f"{command}", shell=True)

0 commit comments

Comments
 (0)