Skip to content

Commit d9cbcd1

Browse files
committed
Fix packaged paths
1 parent 4920a52 commit d9cbcd1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ app:
66
poetry run python openandroidinstaller/openandroidinstaller.py
77

88
build-app:
9-
poetry run pyinstaller openandroidinstaller/openandroidinstaller.py --noconsole --noconfirm --onefile --icon "/assets/favicon.ico" --add-data "openandroidinstaller/assets:assets" --add-binary "openandroidinstaller/bin/adb:bin/adb" --add-binary "openandroidinstaller/bin/fastboot:bin/fastboot" --add-binary "openandroidinstaller/bin/heimdall:bin/heimdall"
9+
poetry run pyinstaller openandroidinstaller/openandroidinstaller.py --noconsole --noconfirm --onefile --icon "/assets/favicon.ico" --add-data "openandroidinstaller/assets:assets" --add-binary "openandroidinstaller/bin/adb:bin" --add-binary "openandroidinstaller/bin/fastboot:bin" --add-binary "openandroidinstaller/bin/heimdall:bin"
1010

1111

1212
clean-build:

openandroidinstaller/openandroidinstaller.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
from widgets import call_button, confirm_button, get_title
5353

5454
# Toggle to True for development purposes
55-
DEVELOPMENT = False
55+
DEVELOPMENT = False
5656
DEVELOPMENT_CONFIG = "Samsung Galaxy A3 2017" # "Pixel 3a"
5757

5858

@@ -184,7 +184,7 @@ def search_devices(self, e):
184184
if PLATFORM in ("linux", "MacOS"):
185185
output = check_output(
186186
[
187-
BIN_PATH.joinpath(Path("adb")).name,
187+
str(BIN_PATH.joinpath(Path("adb"))),
188188
"shell",
189189
"dumpsys",
190190
"bluetooth_manager",
@@ -200,7 +200,7 @@ def search_devices(self, e):
200200
elif PLATFORM == "windows":
201201
output = check_output(
202202
[
203-
BIN_PATH.joinpath(Path("adb")).name,
203+
str(BIN_PATH.joinpath(Path("adb"))),
204204
"shell",
205205
"dumpsys",
206206
"bluetooth_manager",
@@ -218,7 +218,6 @@ def search_devices(self, e):
218218

219219
self.device_name.value = output.strip()
220220
# load config from file
221-
# path = f"{CONFIG_PATH}/{output.strip()}.yaml"
222221
path = CONFIG_PATH.joinpath(Path(f"{output.strip()}.yaml"))
223222
load_config_success = self.load_config(path)
224223
if load_config_success:
@@ -231,7 +230,6 @@ def search_devices(self, e):
231230
except CalledProcessError:
232231
if DEVELOPMENT:
233232
path = CONFIG_PATH.joinpath(Path(f"{DEVELOPMENT_CONFIG}.yaml"))
234-
# path = f"{CONFIG_PATH}/{DEVELOPMENT_CONFIG}.yaml"
235233
load_config_success = self.load_config(path)
236234
if load_config_success:
237235
self.config_found_box.value = True
@@ -503,9 +501,9 @@ def build(self):
503501

504502
def call_to_phone(self, e, command: str):
505503
# TODO: use proper windows paths
506-
command = command.replace("adb", BIN_PATH.joinpath(Path("adb")).name)
507-
command = command.replace("fastboot", BIN_PATH.joinpath(Path("fastboot")).name)
508-
command = command.replace("heimdall", BIN_PATH.joinpath(Path("heimdall")).name)
504+
command = command.replace("adb", str(BIN_PATH.joinpath(Path("adb"))))
505+
command = command.replace("fastboot", str(BIN_PATH.joinpath(Path("fastboot"))))
506+
command = command.replace("heimdall", str(BIN_PATH.joinpath(Path("heimdall"))))
509507

510508
command = command.replace("<recovery>", self.recovery_path)
511509
command = command.replace("<image>", self.image_path)

0 commit comments

Comments
 (0)