Skip to content

Commit

Permalink
Fix unable to get signal uuid and password (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Feb 21, 2024
1 parent 4764906 commit 85779d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/sticker_convert/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ def get_opt_cred(self, args: Namespace) -> CredOption:

if args.signal_get_auth:
m = GetSignalAuth(cb_msg=self.cb.msg, cb_ask_str=self.cb.ask_str)
m.launch_signal_desktop()

uuid, password = None, None
while True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def cb_login(self):

def cb_login_thread(self, *args: Any):
m = GetSignalAuth(cb_msg=self.gui.cb_msg, cb_ask_str=self.cb_ask_str_signal)
m.launch_signal_desktop()

uuid, password = None, None
while Toplevel.winfo_exists(self):
Expand Down
11 changes: 4 additions & 7 deletions src/sticker_convert/utils/auth/get_signal_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def get_local_chromedriver(
chromedriver_which = shutil.which("chromedriver")
if chromedriver_which:
chromedriver_path = Path(chromedriver_which)
else:
chromedriver_path = None

if chromedriver_path:
status, output_str = RunBin.run_cmd(
Expand Down Expand Up @@ -205,11 +207,6 @@ def launch_signal(
self.driver = webdriver.Chrome(options=options, service=service)

def get_cred(self) -> tuple[Optional[str], Optional[str]]:
success = self.launch_signal_desktop()

if not success:
return None, None

# https://stackoverflow.com/a/73456344
uuid: Optional[str] = None
password: Optional[str] = None
Expand All @@ -231,8 +228,8 @@ def get_cred(self) -> tuple[Optional[str], Optional[str]]:
except JavascriptException:
pass

assert isinstance(uuid, str)
assert isinstance(password, str)
assert uuid is None or isinstance(uuid, str)
assert password is None or isinstance(password, str)
return uuid, password

def close(self):
Expand Down

0 comments on commit 85779d6

Please sign in to comment.