sticker-convert 2.13.3.0__py3-none-any.whl → 2.15.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. sticker_convert/auth/__init__.py +0 -0
  2. sticker_convert/auth/auth_base.py +19 -0
  3. sticker_convert/{utils/auth/get_discord_auth.py → auth/auth_discord.py} +40 -13
  4. sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +80 -84
  5. sticker_convert/auth/auth_kakao_desktop_login.py +323 -0
  6. sticker_convert/{utils/auth/get_kakao_desktop_auth.py → auth/auth_kakao_desktop_memdump.py} +21 -12
  7. sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +21 -6
  8. sticker_convert/{utils/auth/get_signal_auth.py → auth/auth_signal.py} +18 -20
  9. sticker_convert/auth/auth_telethon.py +151 -0
  10. sticker_convert/{utils/auth/get_viber_auth.py → auth/auth_viber.py} +19 -11
  11. sticker_convert/{utils/auth → auth}/telegram_api.py +10 -18
  12. sticker_convert/cli.py +57 -67
  13. sticker_convert/converter.py +4 -4
  14. sticker_convert/downloaders/download_line.py +2 -2
  15. sticker_convert/downloaders/download_telegram.py +1 -1
  16. sticker_convert/gui.py +20 -100
  17. sticker_convert/gui_components/frames/comp_frame.py +12 -4
  18. sticker_convert/gui_components/frames/config_frame.py +14 -6
  19. sticker_convert/gui_components/frames/control_frame.py +1 -1
  20. sticker_convert/gui_components/frames/cred_frame.py +6 -8
  21. sticker_convert/gui_components/windows/advanced_compression_window.py +3 -4
  22. sticker_convert/gui_components/windows/base_window.py +7 -2
  23. sticker_convert/gui_components/windows/discord_get_auth_window.py +3 -7
  24. sticker_convert/gui_components/windows/kakao_get_auth_window.py +272 -97
  25. sticker_convert/gui_components/windows/line_get_auth_window.py +5 -14
  26. sticker_convert/gui_components/windows/signal_get_auth_window.py +4 -12
  27. sticker_convert/gui_components/windows/viber_get_auth_window.py +8 -11
  28. sticker_convert/job.py +16 -32
  29. sticker_convert/job_option.py +1 -0
  30. sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  31. sticker_convert/resources/help.json +8 -6
  32. sticker_convert/uploaders/upload_telegram.py +1 -1
  33. sticker_convert/utils/callback.py +238 -6
  34. sticker_convert/version.py +1 -1
  35. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/METADATA +41 -42
  36. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/RECORD +40 -37
  37. sticker_convert/utils/auth/telethon_setup.py +0 -97
  38. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/WHEEL +0 -0
  39. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/entry_points.txt +0 -0
  40. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/licenses/LICENSE +0 -0
  41. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/top_level.txt +0 -0
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env python3
2
2
  import platform
3
- from functools import partial
4
3
  from threading import Thread
5
4
  from typing import Any, Optional
6
5
 
7
6
  from ttkbootstrap import Button, Entry, Frame, Label, LabelFrame # type: ignore
8
7
 
8
+ from sticker_convert.auth.auth_kakao_android_login import AuthKakaoAndroidLogin
9
+ from sticker_convert.auth.auth_kakao_desktop_login import AuthKakaoDesktopLogin
10
+ from sticker_convert.auth.auth_kakao_desktop_memdump import AuthKakaoDesktopMemdump
9
11
  from sticker_convert.gui_components.frames.right_clicker import RightClicker
10
12
  from sticker_convert.gui_components.gui_utils import GUIUtils
11
13
  from sticker_convert.gui_components.windows.base_window import BaseWindow
12
- from sticker_convert.utils.auth.get_kakao_auth import GetKakaoAuth
13
- from sticker_convert.utils.auth.get_kakao_desktop_auth import GetKakaoDesktopAuth
14
14
 
15
15
 
16
16
  class KakaoGetAuthWindow(BaseWindow):
@@ -19,75 +19,76 @@ class KakaoGetAuthWindow(BaseWindow):
19
19
 
20
20
  self.title("Get Kakao auth_token")
21
21
 
22
- self.cb_msg_block_kakao = partial(self.gui.cb_msg_block, parent=self)
23
- self.cb_ask_str_kakao = partial(self.gui.cb_ask_str, parent=self)
24
-
25
- self.frame_from_desktop = LabelFrame(
26
- self.scrollable_frame, text="Method 1: From KakaoTalk Desktop"
22
+ self.frame_desktop_memdump = LabelFrame(
23
+ self.scrollable_frame, text="Method 1: KakaoTalk Desktop memdump"
24
+ )
25
+ self.frame_desktop_login = LabelFrame(
26
+ self.scrollable_frame, text="Method 2: Simulate Desktop login"
27
27
  )
28
- self.frame_simulate_login = LabelFrame(
29
- self.scrollable_frame, text="Method 2: Simulate login"
28
+ self.frame_android_login = LabelFrame(
29
+ self.scrollable_frame, text="Method 3: Simulate Android login"
30
30
  )
31
31
  self.frame_login_btn = Frame(self.scrollable_frame)
32
32
 
33
- self.frame_from_desktop.grid(column=0, row=0, sticky="news", padx=3, pady=3)
34
- self.frame_simulate_login.grid(column=0, row=1, sticky="news", padx=3, pady=3)
33
+ self.frame_desktop_memdump.grid(column=0, row=0, sticky="news", padx=3, pady=3)
34
+ self.frame_desktop_login.grid(column=0, row=1, sticky="news", padx=3, pady=3)
35
+ self.frame_android_login.grid(column=0, row=2, sticky="news", padx=3, pady=3)
35
36
 
36
37
  # Method 1 frame
37
38
  self.explanation1_1_lbl = Label(
38
- self.frame_from_desktop,
39
+ self.frame_desktop_memdump,
39
40
  text="This will get Kakao auth_token from Kakao Desktop",
40
41
  justify="left",
41
42
  anchor="w",
42
43
  )
43
44
  self.explanation1_2_lbl = Label(
44
- self.frame_from_desktop,
45
+ self.frame_desktop_memdump,
45
46
  text="Download Kakao Desktop, login and press 'Get auth_token'",
46
47
  justify="left",
47
48
  anchor="w",
48
49
  )
49
50
  self.explanation1_3_lbl = Label(
50
- self.frame_from_desktop,
51
+ self.frame_desktop_memdump,
51
52
  text="This can take about a minute.",
52
53
  justify="left",
53
54
  anchor="w",
54
55
  )
55
56
  if platform.system() != "Darwin":
56
57
  self.explanation1_4_lbl = Label(
57
- self.frame_from_desktop,
58
+ self.frame_desktop_memdump,
58
59
  text="Note: This will download ProcDump and read memory of KakaoTalk Desktop",
59
60
  justify="left",
60
61
  anchor="w",
61
62
  )
62
63
  else:
63
64
  self.explanation1_4_lbl = Label(
64
- self.frame_from_desktop,
65
+ self.frame_desktop_memdump,
65
66
  text="Note: This will read memory of KakaoTalk Desktop",
66
67
  justify="left",
67
68
  anchor="w",
68
69
  )
69
70
  self.kakao_bin_path_lbl = Label(
70
- self.frame_from_desktop,
71
+ self.frame_desktop_memdump,
71
72
  text="Kakao app path (Optional):",
72
73
  justify="left",
73
74
  anchor="w",
74
75
  )
75
76
  self.kakao_bin_path_entry = Entry(
76
- self.frame_from_desktop,
77
+ self.frame_desktop_memdump,
77
78
  textvariable=self.gui.kakao_bin_path_var,
78
79
  width=30,
79
80
  )
80
81
  self.launch_desktop_btn = Button(
81
- self.frame_from_desktop,
82
+ self.frame_desktop_memdump,
82
83
  text="Launch Desktop app",
83
84
  command=self.cb_launch_desktop,
84
85
  width=24,
85
86
  bootstyle="secondary", # type: ignore
86
87
  )
87
88
  self.get_auth_desktop_btn = Button(
88
- self.frame_from_desktop,
89
+ self.frame_desktop_memdump,
89
90
  text="Get auth_token",
90
- command=self.cb_from_desktop,
91
+ command=self.cb_get_auth_desktop_memdump,
91
92
  width=24,
92
93
  )
93
94
 
@@ -110,128 +111,294 @@ class KakaoGetAuthWindow(BaseWindow):
110
111
 
111
112
  # Method 2 frame
112
113
  self.explanation2_1_lbl = Label(
113
- self.frame_simulate_login,
114
- text="This will simulate login to Android Kakao app",
114
+ self.frame_desktop_login,
115
+ text="This will simulate login to Desktop Kakao app",
115
116
  justify="left",
116
117
  anchor="w",
117
118
  )
118
119
  self.explanation2_2_lbl = Label(
119
- self.frame_simulate_login,
120
- text="You will send / receive verification code via SMS",
120
+ self.frame_desktop_login,
121
+ text="You may receive verification code from Kakao app on phone",
121
122
  justify="left",
122
123
  anchor="w",
123
124
  )
124
125
  self.explanation2_3_lbl = Label(
125
- self.frame_simulate_login,
126
+ self.frame_desktop_login,
127
+ text="It is not necessary to download Desktop Kakao app",
128
+ justify="left",
129
+ anchor="w",
130
+ )
131
+
132
+ self.kakao_username_help_btn2 = Button(
133
+ self.frame_desktop_login,
134
+ text="?",
135
+ width=1,
136
+ command=lambda: self.gui.cb.put(
137
+ (
138
+ "msg_block",
139
+ None,
140
+ {
141
+ "message": self.gui.help["cred"]["kakao_username"],
142
+ "parent": self,
143
+ },
144
+ )
145
+ ),
146
+ bootstyle="secondary", # type: ignore
147
+ )
148
+ self.kakao_username_lbl2 = Label(
149
+ self.frame_desktop_login,
150
+ text="Username",
151
+ width=18,
152
+ justify="left",
153
+ anchor="w",
154
+ )
155
+ self.kakao_username_entry2 = Entry(
156
+ self.frame_desktop_login,
157
+ textvariable=self.gui.kakao_username_var,
158
+ width=30,
159
+ )
160
+ self.kakao_username_entry2.bind("<Button-3><ButtonRelease-3>", RightClicker)
161
+
162
+ self.kakao_password_help_btn2 = Button(
163
+ self.frame_desktop_login,
164
+ text="?",
165
+ width=1,
166
+ command=lambda: self.gui.cb.put(
167
+ (
168
+ "msg_block",
169
+ None,
170
+ {
171
+ "message": self.gui.help["cred"]["kakao_password"],
172
+ "parent": self,
173
+ },
174
+ )
175
+ ),
176
+ bootstyle="secondary", # type: ignore
177
+ )
178
+ self.kakao_password_lbl2 = Label(
179
+ self.frame_desktop_login, text="Password", justify="left", anchor="w"
180
+ )
181
+ self.kakao_password_entry2 = Entry(
182
+ self.frame_desktop_login,
183
+ textvariable=self.gui.kakao_password_var,
184
+ width=30,
185
+ )
186
+ self.kakao_password_entry2.bind("<Button-3><ButtonRelease-3>", RightClicker)
187
+
188
+ self.kakao_device_uuid_help_btn = Button(
189
+ self.frame_desktop_login,
190
+ text="?",
191
+ width=1,
192
+ command=lambda: self.gui.cb.put(
193
+ (
194
+ "msg_block",
195
+ None,
196
+ {
197
+ "message": self.gui.help["cred"]["kakao_device_uuid"],
198
+ "parent": self,
199
+ },
200
+ )
201
+ ),
202
+ bootstyle="secondary", # type: ignore
203
+ )
204
+ self.kakao_device_uuid_lbl = Label(
205
+ self.frame_desktop_login,
206
+ text="Device UUID (Optional)",
207
+ justify="left",
208
+ anchor="w",
209
+ )
210
+ self.kakao_device_uuid_entry = Entry(
211
+ self.frame_desktop_login,
212
+ textvariable=self.gui.kakao_device_uuid_var,
213
+ width=30,
214
+ )
215
+ self.kakao_device_uuid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
216
+
217
+ self.login_btn2 = Button(
218
+ self.frame_desktop_login,
219
+ text="Login and get auth_token",
220
+ command=self.cb_get_auth_desktop_login,
221
+ width=24,
222
+ )
223
+
224
+ self.explanation2_1_lbl.grid(
225
+ column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
226
+ )
227
+ self.explanation2_2_lbl.grid(
228
+ column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
229
+ )
230
+ self.explanation2_3_lbl.grid(
231
+ column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
232
+ )
233
+
234
+ self.kakao_username_help_btn2.grid(column=0, row=3, sticky="w", padx=3, pady=3)
235
+ self.kakao_username_lbl2.grid(column=1, row=3, sticky="w", padx=3, pady=3)
236
+ self.kakao_username_entry2.grid(column=2, row=3, sticky="w", padx=3, pady=3)
237
+
238
+ self.kakao_password_help_btn2.grid(column=0, row=4, sticky="w", padx=3, pady=3)
239
+ self.kakao_password_lbl2.grid(column=1, row=4, sticky="w", padx=3, pady=3)
240
+ self.kakao_password_entry2.grid(column=2, row=4, sticky="w", padx=3, pady=3)
241
+
242
+ self.kakao_device_uuid_help_btn.grid(
243
+ column=0, row=5, sticky="w", padx=3, pady=3
244
+ )
245
+ self.kakao_device_uuid_lbl.grid(column=1, row=5, sticky="w", padx=3, pady=3)
246
+ self.kakao_device_uuid_entry.grid(column=2, row=5, sticky="w", padx=3, pady=3)
247
+
248
+ self.login_btn2.grid(column=0, row=6, columnspan=3, padx=3, pady=3)
249
+
250
+ # Method 3 frame
251
+ self.explanation3_1_lbl = Label(
252
+ self.frame_android_login,
253
+ text="This will simulate login to Android Kakao app",
254
+ justify="left",
255
+ anchor="w",
256
+ )
257
+ self.explanation3_2_lbl = Label(
258
+ self.frame_android_login,
259
+ text="You will send / receive verification code via SMS",
260
+ justify="left",
261
+ anchor="w",
262
+ )
263
+ self.explanation3_3_lbl = Label(
264
+ self.frame_android_login,
126
265
  text="You will be logged out of existing device",
127
266
  justify="left",
128
267
  anchor="w",
129
268
  )
130
269
 
131
- self.kakao_username_help_btn = Button(
132
- self.frame_simulate_login,
270
+ self.kakao_username_help_btn3 = Button(
271
+ self.frame_android_login,
133
272
  text="?",
134
273
  width=1,
135
- command=lambda: self.cb_msg_block_kakao(
136
- self.gui.help["cred"]["kakao_username"]
274
+ command=lambda: self.gui.cb.put(
275
+ (
276
+ "msg_block",
277
+ None,
278
+ {
279
+ "message": self.gui.help["cred"]["kakao_username"],
280
+ "parent": self,
281
+ },
282
+ )
137
283
  ),
138
284
  bootstyle="secondary", # type: ignore
139
285
  )
140
- self.kakao_username_lbl = Label(
141
- self.frame_simulate_login,
286
+ self.kakao_username_lbl3 = Label(
287
+ self.frame_android_login,
142
288
  text="Username",
143
289
  width=18,
144
290
  justify="left",
145
291
  anchor="w",
146
292
  )
147
- self.kakao_username_entry = Entry(
148
- self.frame_simulate_login,
293
+ self.kakao_username_entry3 = Entry(
294
+ self.frame_android_login,
149
295
  textvariable=self.gui.kakao_username_var,
150
296
  width=30,
151
297
  )
152
- self.kakao_username_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
298
+ self.kakao_username_entry3.bind("<Button-3><ButtonRelease-3>", RightClicker)
153
299
 
154
- self.kakao_password_help_btn = Button(
155
- self.frame_simulate_login,
300
+ self.kakao_password_help_btn3 = Button(
301
+ self.frame_android_login,
156
302
  text="?",
157
303
  width=1,
158
- command=lambda: self.cb_msg_block_kakao(
159
- self.gui.help["cred"]["kakao_password"]
304
+ command=lambda: self.gui.cb.put(
305
+ (
306
+ "msg_block",
307
+ None,
308
+ {
309
+ "message": self.gui.help["cred"]["kakao_password"],
310
+ "parent": self,
311
+ },
312
+ )
160
313
  ),
161
314
  bootstyle="secondary", # type: ignore
162
315
  )
163
- self.kakao_password_lbl = Label(
164
- self.frame_simulate_login, text="Password", justify="left", anchor="w"
316
+ self.kakao_password_lbl3 = Label(
317
+ self.frame_android_login, text="Password", justify="left", anchor="w"
165
318
  )
166
- self.kakao_password_entry = Entry(
167
- self.frame_simulate_login,
319
+ self.kakao_password_entry3 = Entry(
320
+ self.frame_android_login,
168
321
  textvariable=self.gui.kakao_password_var,
169
322
  width=30,
170
323
  )
171
- self.kakao_password_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
324
+ self.kakao_password_entry3.bind("<Button-3><ButtonRelease-3>", RightClicker)
172
325
 
173
326
  self.kakao_country_code_help_btn = Button(
174
- self.frame_simulate_login,
327
+ self.frame_android_login,
175
328
  text="?",
176
329
  width=1,
177
- command=lambda: self.cb_msg_block_kakao(
178
- self.gui.help["cred"]["kakao_country_code"]
330
+ command=lambda: self.gui.cb.put(
331
+ (
332
+ "msg_block",
333
+ None,
334
+ {
335
+ "message": self.gui.help["cred"]["kakao_country_code"],
336
+ "parent": self,
337
+ },
338
+ )
179
339
  ),
180
340
  bootstyle="secondary", # type: ignore
181
341
  )
182
342
  self.kakao_country_code_lbl = Label(
183
- self.frame_simulate_login, text="Country code", justify="left", anchor="w"
343
+ self.frame_android_login, text="Country code", justify="left", anchor="w"
184
344
  )
185
345
  self.kakao_country_code_entry = Entry(
186
- self.frame_simulate_login,
346
+ self.frame_android_login,
187
347
  textvariable=self.gui.kakao_country_code_var,
188
348
  width=30,
189
349
  )
190
350
  self.kakao_country_code_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
191
351
 
192
352
  self.kakao_phone_number_help_btn = Button(
193
- self.frame_simulate_login,
353
+ self.frame_android_login,
194
354
  text="?",
195
355
  width=1,
196
- command=lambda: self.cb_msg_block_kakao(
197
- self.gui.help["cred"]["kakao_phone_number"]
356
+ command=lambda: self.gui.cb.put(
357
+ (
358
+ "msg_block",
359
+ None,
360
+ {
361
+ "message": self.gui.help["cred"]["kakao_phone_number"],
362
+ "parent": self,
363
+ },
364
+ )
198
365
  ),
199
366
  bootstyle="secondary", # type: ignore
200
367
  )
201
368
  self.kakao_phone_number_lbl = Label(
202
- self.frame_simulate_login, text="Phone number", justify="left", anchor="w"
369
+ self.frame_android_login, text="Phone number", justify="left", anchor="w"
203
370
  )
204
371
  self.kakao_phone_number_entry = Entry(
205
- self.frame_simulate_login,
372
+ self.frame_android_login,
206
373
  textvariable=self.gui.kakao_phone_number_var,
207
374
  width=30,
208
375
  )
209
376
  self.kakao_phone_number_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
210
377
 
211
- self.login_btn = Button(
212
- self.frame_simulate_login,
378
+ self.login_btn3 = Button(
379
+ self.frame_android_login,
213
380
  text="Login and get auth_token",
214
- command=self.cb_simulate_login,
381
+ command=self.cb_get_auth_android_login,
215
382
  width=24,
216
383
  )
217
384
 
218
- self.explanation2_1_lbl.grid(
385
+ self.explanation3_1_lbl.grid(
219
386
  column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
220
387
  )
221
- self.explanation2_2_lbl.grid(
388
+ self.explanation3_2_lbl.grid(
222
389
  column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
223
390
  )
224
- self.explanation2_3_lbl.grid(
391
+ self.explanation3_3_lbl.grid(
225
392
  column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
226
393
  )
227
394
 
228
- self.kakao_username_help_btn.grid(column=0, row=3, sticky="w", padx=3, pady=3)
229
- self.kakao_username_lbl.grid(column=1, row=3, sticky="w", padx=3, pady=3)
230
- self.kakao_username_entry.grid(column=2, row=3, sticky="w", padx=3, pady=3)
395
+ self.kakao_username_help_btn3.grid(column=0, row=3, sticky="w", padx=3, pady=3)
396
+ self.kakao_username_lbl3.grid(column=1, row=3, sticky="w", padx=3, pady=3)
397
+ self.kakao_username_entry3.grid(column=2, row=3, sticky="w", padx=3, pady=3)
231
398
 
232
- self.kakao_password_help_btn.grid(column=0, row=4, sticky="w", padx=3, pady=3)
233
- self.kakao_password_lbl.grid(column=1, row=4, sticky="w", padx=3, pady=3)
234
- self.kakao_password_entry.grid(column=2, row=4, sticky="w", padx=3, pady=3)
399
+ self.kakao_password_help_btn3.grid(column=0, row=4, sticky="w", padx=3, pady=3)
400
+ self.kakao_password_lbl3.grid(column=1, row=4, sticky="w", padx=3, pady=3)
401
+ self.kakao_password_entry3.grid(column=2, row=4, sticky="w", padx=3, pady=3)
235
402
 
236
403
  self.kakao_country_code_help_btn.grid(
237
404
  column=0, row=5, sticky="w", padx=3, pady=3
@@ -244,23 +411,18 @@ class KakaoGetAuthWindow(BaseWindow):
244
411
  )
245
412
  self.kakao_phone_number_lbl.grid(column=1, row=6, sticky="w", padx=3, pady=3)
246
413
  self.kakao_phone_number_entry.grid(column=2, row=6, sticky="w", padx=3, pady=3)
247
- self.login_btn.grid(column=0, row=7, columnspan=3, padx=3, pady=3)
414
+ self.login_btn3.grid(column=0, row=7, columnspan=3, padx=3, pady=3)
248
415
 
249
416
  GUIUtils.finalize_window(self)
250
417
 
251
- def cb_simulate_login(self) -> None:
252
- Thread(target=self.cb_simulate_login_thread, daemon=True).start()
418
+ def cb_get_auth_android_login(self) -> None:
419
+ Thread(target=self.cb_get_auth_android_login_thread, daemon=True).start()
253
420
 
254
- def cb_simulate_login_thread(self, *_: Any) -> None:
421
+ def cb_get_auth_desktop_login_thread(self, *_: Any) -> None:
255
422
  self.gui.save_creds()
256
- m = GetKakaoAuth(
257
- opt_cred=self.gui.get_opt_cred(),
258
- cb_msg=self.gui.cb_msg,
259
- cb_msg_block=self.cb_msg_block_kakao,
260
- cb_ask_str=self.cb_ask_str_kakao,
261
- )
423
+ m = AuthKakaoDesktopLogin(self.gui.get_opt_cred(), self.gui.cb)
262
424
 
263
- auth_token = m.get_cred()
425
+ auth_token, msg = m.get_cred()
264
426
 
265
427
  if auth_token:
266
428
  if not self.gui.creds.get("kakao"):
@@ -268,16 +430,33 @@ class KakaoGetAuthWindow(BaseWindow):
268
430
  self.gui.creds["kakao"]["auth_token"] = auth_token
269
431
  self.gui.kakao_auth_token_var.set(auth_token)
270
432
 
271
- self.cb_msg_block_kakao(f"Got auth_token successfully: {auth_token}")
272
433
  self.gui.save_creds()
273
434
  self.gui.highlight_fields()
274
- else:
275
- self.cb_msg_block_kakao("Failed to get auth_token")
435
+
436
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
437
+
438
+ def cb_get_auth_desktop_login(self) -> None:
439
+ Thread(target=self.cb_get_auth_desktop_login_thread, daemon=True).start()
440
+
441
+ def cb_get_auth_android_login_thread(self, *_: Any) -> None:
442
+ self.gui.save_creds()
443
+ m = AuthKakaoAndroidLogin(self.gui.get_opt_cred(), self.gui.cb)
444
+
445
+ auth_token, msg = m.get_cred()
446
+
447
+ if auth_token:
448
+ if not self.gui.creds.get("kakao"):
449
+ self.gui.creds["kakao"] = {}
450
+ self.gui.creds["kakao"]["auth_token"] = auth_token
451
+ self.gui.kakao_auth_token_var.set(auth_token)
452
+
453
+ self.gui.save_creds()
454
+ self.gui.highlight_fields()
455
+
456
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
276
457
 
277
458
  def cb_launch_desktop(self) -> None:
278
- m = GetKakaoDesktopAuth(
279
- cb_ask_str=self.cb_ask_str_kakao,
280
- )
459
+ m = AuthKakaoDesktopMemdump(self.gui.get_opt_cred(), self.gui.cb)
281
460
  if self.gui.kakao_bin_path_var.get() != "":
282
461
  bin_path = self.gui.kakao_bin_path_var.get()
283
462
  else:
@@ -286,20 +465,16 @@ class KakaoGetAuthWindow(BaseWindow):
286
465
  if bin_path is not None:
287
466
  m.launch_kakao(bin_path)
288
467
  else:
289
- self.cb_msg_block_kakao(
290
- "Error: Cannot launch Kakao Desktop. Is it installed?"
291
- )
468
+ msg = "Error: Cannot launch Kakao Desktop. Is it installed?"
469
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
292
470
 
293
- def cb_from_desktop(self) -> None:
294
- Thread(target=self.cb_from_desktop_thread, daemon=True).start()
471
+ def cb_get_auth_desktop_memdump(self) -> None:
472
+ Thread(target=self.cb_get_auth_desktop_memdump_thread, daemon=True).start()
295
473
 
296
- def cb_from_desktop_thread(self, *_: Any) -> None:
474
+ def cb_get_auth_desktop_memdump_thread(self, *_: Any) -> None:
297
475
  self.gui.save_creds()
298
- self.gui.cb_msg("Getting auth_token, this may take a minute...")
299
- self.gui.cb_bar("indeterminate")
300
- m = GetKakaoDesktopAuth(
301
- cb_ask_str=self.cb_ask_str_kakao,
302
- )
476
+ self.gui.cb.bar("indeterminate")
477
+ m = AuthKakaoDesktopMemdump(self.gui.get_opt_cred(), self.gui.cb)
303
478
 
304
479
  bin_path: Optional[str]
305
480
  if self.gui.kakao_bin_path_var.get() != "":
@@ -317,5 +492,5 @@ class KakaoGetAuthWindow(BaseWindow):
317
492
  self.gui.save_creds()
318
493
  self.gui.highlight_fields()
319
494
 
320
- self.cb_msg_block_kakao(msg)
321
- self.gui.cb_bar("clear")
495
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
496
+ self.gui.cb.bar("clear")
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env python3
2
2
  import webbrowser
3
- from functools import partial
4
3
  from threading import Thread
5
4
  from typing import Any
6
5
 
7
6
  from ttkbootstrap import Button, Frame, Label # type: ignore
8
7
 
8
+ from sticker_convert.auth.auth_line import AuthLine
9
9
  from sticker_convert.gui_components.gui_utils import GUIUtils
10
10
  from sticker_convert.gui_components.windows.base_window import BaseWindow
11
- from sticker_convert.utils.auth.get_line_auth import GetLineAuth
12
11
 
13
12
 
14
13
  class LineGetAuthWindow(BaseWindow):
@@ -17,8 +16,6 @@ class LineGetAuthWindow(BaseWindow):
17
16
 
18
17
  self.title("Get Line cookie")
19
18
 
20
- self.cb_msg_block_line = partial(self.gui.cb_msg_block, parent=self)
21
-
22
19
  self.frame_info = Frame(self.scrollable_frame)
23
20
  self.frame_btn = Frame(self.scrollable_frame)
24
21
 
@@ -72,7 +69,7 @@ class LineGetAuthWindow(BaseWindow):
72
69
  line_login_site = "https://store.line.me/login"
73
70
  success = webbrowser.open(line_login_site)
74
71
  if not success:
75
- self.gui.cb_ask_str(
72
+ self.gui.cb.ask_str(
76
73
  "Cannot open web browser for you. Install web browser and open:",
77
74
  initialvalue=line_login_site,
78
75
  )
@@ -81,22 +78,16 @@ class LineGetAuthWindow(BaseWindow):
81
78
  Thread(target=self.cb_get_cookies_thread, daemon=True).start()
82
79
 
83
80
  def cb_get_cookies_thread(self, *_: Any) -> None:
84
- m = GetLineAuth()
81
+ m = AuthLine(self.gui.get_opt_cred(), self.gui.cb)
85
82
 
86
83
  line_cookies = None
87
- line_cookies = m.get_cred()
88
-
84
+ line_cookies, msg = m.get_cred()
85
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
89
86
  if line_cookies:
90
87
  if not self.gui.creds.get("line"):
91
88
  self.gui.creds["line"] = {}
92
89
  self.gui.creds["line"]["cookies"] = line_cookies
93
90
  self.gui.line_cookies_var.set(line_cookies)
94
-
95
- self.cb_msg_block_line("Got Line cookies successfully")
96
91
  self.gui.save_creds()
97
92
  self.gui.highlight_fields()
98
93
  return
99
-
100
- self.cb_msg_block_line(
101
- "Failed to get Line cookies. Have you logged in the web browser?"
102
- )
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env python3
2
- from functools import partial
3
2
  from threading import Thread
4
3
  from typing import Any
5
4
 
6
5
  from ttkbootstrap import Button, Frame, Label # type: ignore
7
6
 
7
+ from sticker_convert.auth.auth_signal import AuthSignal
8
8
  from sticker_convert.gui_components.gui_utils import GUIUtils
9
9
  from sticker_convert.gui_components.windows.base_window import BaseWindow
10
- from sticker_convert.utils.auth.get_signal_auth import GetSignalAuth
11
10
 
12
11
 
13
12
  class SignalGetAuthWindow(BaseWindow):
@@ -16,9 +15,6 @@ class SignalGetAuthWindow(BaseWindow):
16
15
 
17
16
  self.title("Get Signal uuid and password")
18
17
 
19
- self.cb_msg_block_signal = partial(self.gui.cb_msg_block, parent=self)
20
- self.cb_ask_str_signal = partial(self.gui.cb_ask_str, parent=self)
21
-
22
18
  self.frame_info = Frame(self.scrollable_frame)
23
19
  self.frame_start_btn = Frame(self.scrollable_frame)
24
20
 
@@ -68,9 +64,10 @@ class SignalGetAuthWindow(BaseWindow):
68
64
  Thread(target=self.cb_login_thread, daemon=True).start()
69
65
 
70
66
  def cb_login_thread(self, *args: Any) -> None:
71
- m = GetSignalAuth(cb_msg=self.gui.cb_msg, cb_ask_str=self.cb_ask_str_signal)
67
+ m = AuthSignal(self.gui.get_opt_cred(), self.gui.cb)
72
68
 
73
- uuid, password = m.get_cred()
69
+ uuid, password, msg = m.get_cred()
70
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
74
71
  if uuid and password:
75
72
  if not self.gui.creds.get("signal"):
76
73
  self.gui.creds["signal"] = {}
@@ -79,11 +76,6 @@ class SignalGetAuthWindow(BaseWindow):
79
76
  self.gui.signal_uuid_var.set(uuid)
80
77
  self.gui.signal_password_var.set(password)
81
78
 
82
- self.cb_msg_block_signal(
83
- f"Got uuid and password successfully:\nuuid={uuid}\npassword={password}"
84
- )
85
79
  self.gui.save_creds()
86
80
  self.gui.highlight_fields()
87
81
  return
88
-
89
- self.cb_msg_block_signal("Failed to get uuid and password")