sticker-convert 2.13.3.0__py3-none-any.whl → 2.17.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 (93) hide show
  1. sticker_convert/__main__.py +24 -27
  2. sticker_convert/auth/__init__.py +0 -0
  3. sticker_convert/auth/auth_base.py +19 -0
  4. sticker_convert/{utils/auth/get_discord_auth.py → auth/auth_discord.py} +149 -118
  5. sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +331 -330
  6. sticker_convert/auth/auth_kakao_desktop_login.py +327 -0
  7. sticker_convert/{utils/auth/get_kakao_desktop_auth.py → auth/auth_kakao_desktop_memdump.py} +281 -263
  8. sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +98 -80
  9. sticker_convert/{utils/auth/get_signal_auth.py → auth/auth_signal.py} +139 -135
  10. sticker_convert/auth/auth_telethon.py +161 -0
  11. sticker_convert/{utils/auth/get_viber_auth.py → auth/auth_viber.py} +250 -235
  12. sticker_convert/{utils/auth → auth}/telegram_api.py +736 -675
  13. sticker_convert/cli.py +623 -608
  14. sticker_convert/converter.py +1093 -1084
  15. sticker_convert/definitions.py +4 -0
  16. sticker_convert/downloaders/download_band.py +111 -110
  17. sticker_convert/downloaders/download_base.py +171 -166
  18. sticker_convert/downloaders/download_discord.py +92 -91
  19. sticker_convert/downloaders/download_kakao.py +417 -404
  20. sticker_convert/downloaders/download_line.py +484 -475
  21. sticker_convert/downloaders/download_ogq.py +80 -79
  22. sticker_convert/downloaders/download_signal.py +108 -105
  23. sticker_convert/downloaders/download_telegram.py +56 -55
  24. sticker_convert/downloaders/download_viber.py +121 -120
  25. sticker_convert/gui.py +788 -873
  26. sticker_convert/gui_components/frames/comp_frame.py +180 -166
  27. sticker_convert/gui_components/frames/config_frame.py +156 -113
  28. sticker_convert/gui_components/frames/control_frame.py +32 -30
  29. sticker_convert/gui_components/frames/cred_frame.py +232 -233
  30. sticker_convert/gui_components/frames/input_frame.py +139 -137
  31. sticker_convert/gui_components/frames/output_frame.py +112 -110
  32. sticker_convert/gui_components/frames/right_clicker.py +25 -23
  33. sticker_convert/gui_components/windows/advanced_compression_window.py +757 -757
  34. sticker_convert/gui_components/windows/base_window.py +7 -2
  35. sticker_convert/gui_components/windows/discord_get_auth_window.py +79 -82
  36. sticker_convert/gui_components/windows/kakao_get_auth_window.py +511 -321
  37. sticker_convert/gui_components/windows/line_get_auth_window.py +94 -102
  38. sticker_convert/gui_components/windows/signal_get_auth_window.py +84 -89
  39. sticker_convert/gui_components/windows/viber_get_auth_window.py +168 -168
  40. sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +3 -3
  41. sticker_convert/ios-message-stickers-template/README.md +10 -10
  42. sticker_convert/ios-message-stickers-template/stickers/Info.plist +43 -43
  43. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +31 -31
  44. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +6 -6
  45. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +20 -20
  46. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +9 -9
  47. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +9 -9
  48. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +9 -9
  49. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +91 -91
  50. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +364 -364
  51. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
  52. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  53. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  54. sticker_convert/job.py +166 -130
  55. sticker_convert/job_option.py +1 -0
  56. sticker_convert/locales/en_US/LC_MESSAGES/base.mo +0 -0
  57. sticker_convert/locales/ja_JP/LC_MESSAGES/base.mo +0 -0
  58. sticker_convert/locales/zh_CN/LC_MESSAGES/base.mo +0 -0
  59. sticker_convert/locales/zh_TW/LC_MESSAGES/base.mo +0 -0
  60. sticker_convert/py.typed +0 -0
  61. sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  62. sticker_convert/resources/help.ja_JP.json +88 -0
  63. sticker_convert/resources/help.json +10 -7
  64. sticker_convert/resources/help.zh_CN.json +88 -0
  65. sticker_convert/resources/help.zh_TW.json +88 -0
  66. sticker_convert/resources/input.ja_JP.json +74 -0
  67. sticker_convert/resources/input.json +121 -121
  68. sticker_convert/resources/input.zh_CN.json +74 -0
  69. sticker_convert/resources/input.zh_TW.json +74 -0
  70. sticker_convert/resources/output.ja_JP.json +38 -0
  71. sticker_convert/resources/output.zh_CN.json +38 -0
  72. sticker_convert/resources/output.zh_TW.json +38 -0
  73. sticker_convert/uploaders/compress_wastickers.py +186 -177
  74. sticker_convert/uploaders/upload_base.py +44 -35
  75. sticker_convert/uploaders/upload_signal.py +218 -203
  76. sticker_convert/uploaders/upload_telegram.py +353 -338
  77. sticker_convert/uploaders/upload_viber.py +178 -169
  78. sticker_convert/uploaders/xcode_imessage.py +295 -286
  79. sticker_convert/utils/callback.py +238 -6
  80. sticker_convert/utils/emoji.py +16 -4
  81. sticker_convert/utils/files/json_resources_loader.py +24 -19
  82. sticker_convert/utils/files/metadata_handler.py +3 -3
  83. sticker_convert/utils/translate.py +108 -0
  84. sticker_convert/utils/url_detect.py +40 -37
  85. sticker_convert/version.py +1 -1
  86. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/METADATA +89 -74
  87. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/RECORD +91 -74
  88. sticker_convert/utils/auth/telethon_setup.py +0 -97
  89. sticker_convert/utils/singletons.py +0 -18
  90. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/WHEEL +0 -0
  91. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/entry_points.txt +0 -0
  92. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/licenses/LICENSE +0 -0
  93. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.17.0.0.dist-info}/top_level.txt +0 -0
@@ -1,321 +1,511 @@
1
- #!/usr/bin/env python3
2
- import platform
3
- from functools import partial
4
- from threading import Thread
5
- from typing import Any, Optional
6
-
7
- from ttkbootstrap import Button, Entry, Frame, Label, LabelFrame # type: ignore
8
-
9
- from sticker_convert.gui_components.frames.right_clicker import RightClicker
10
- from sticker_convert.gui_components.gui_utils import GUIUtils
11
- 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
-
15
-
16
- class KakaoGetAuthWindow(BaseWindow):
17
- def __init__(self, *args: Any, **kwargs: Any) -> None:
18
- super().__init__(*args, **kwargs)
19
-
20
- self.title("Get Kakao auth_token")
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"
27
- )
28
- self.frame_simulate_login = LabelFrame(
29
- self.scrollable_frame, text="Method 2: Simulate login"
30
- )
31
- self.frame_login_btn = Frame(self.scrollable_frame)
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)
35
-
36
- # Method 1 frame
37
- self.explanation1_1_lbl = Label(
38
- self.frame_from_desktop,
39
- text="This will get Kakao auth_token from Kakao Desktop",
40
- justify="left",
41
- anchor="w",
42
- )
43
- self.explanation1_2_lbl = Label(
44
- self.frame_from_desktop,
45
- text="Download Kakao Desktop, login and press 'Get auth_token'",
46
- justify="left",
47
- anchor="w",
48
- )
49
- self.explanation1_3_lbl = Label(
50
- self.frame_from_desktop,
51
- text="This can take about a minute.",
52
- justify="left",
53
- anchor="w",
54
- )
55
- if platform.system() != "Darwin":
56
- self.explanation1_4_lbl = Label(
57
- self.frame_from_desktop,
58
- text="Note: This will download ProcDump and read memory of KakaoTalk Desktop",
59
- justify="left",
60
- anchor="w",
61
- )
62
- else:
63
- self.explanation1_4_lbl = Label(
64
- self.frame_from_desktop,
65
- text="Note: This will read memory of KakaoTalk Desktop",
66
- justify="left",
67
- anchor="w",
68
- )
69
- self.kakao_bin_path_lbl = Label(
70
- self.frame_from_desktop,
71
- text="Kakao app path (Optional):",
72
- justify="left",
73
- anchor="w",
74
- )
75
- self.kakao_bin_path_entry = Entry(
76
- self.frame_from_desktop,
77
- textvariable=self.gui.kakao_bin_path_var,
78
- width=30,
79
- )
80
- self.launch_desktop_btn = Button(
81
- self.frame_from_desktop,
82
- text="Launch Desktop app",
83
- command=self.cb_launch_desktop,
84
- width=24,
85
- bootstyle="secondary", # type: ignore
86
- )
87
- self.get_auth_desktop_btn = Button(
88
- self.frame_from_desktop,
89
- text="Get auth_token",
90
- command=self.cb_from_desktop,
91
- width=24,
92
- )
93
-
94
- self.explanation1_1_lbl.grid(
95
- column=0, row=0, columnspan=2, sticky="w", padx=3, pady=3
96
- )
97
- self.explanation1_2_lbl.grid(
98
- column=0, row=1, columnspan=2, sticky="w", padx=3, pady=3
99
- )
100
- self.explanation1_3_lbl.grid(
101
- column=0, row=2, columnspan=2, sticky="w", padx=3, pady=3
102
- )
103
- self.explanation1_4_lbl.grid(
104
- column=0, row=3, columnspan=2, sticky="w", padx=3, pady=3
105
- )
106
- self.kakao_bin_path_lbl.grid(column=0, row=4, sticky="w", padx=3, pady=3)
107
- self.kakao_bin_path_entry.grid(column=1, row=4, sticky="w", padx=3, pady=3)
108
- self.launch_desktop_btn.grid(column=0, row=5, columnspan=2, padx=3, pady=3)
109
- self.get_auth_desktop_btn.grid(column=0, row=6, columnspan=2, padx=3, pady=3)
110
-
111
- # Method 2 frame
112
- self.explanation2_1_lbl = Label(
113
- self.frame_simulate_login,
114
- text="This will simulate login to Android Kakao app",
115
- justify="left",
116
- anchor="w",
117
- )
118
- self.explanation2_2_lbl = Label(
119
- self.frame_simulate_login,
120
- text="You will send / receive verification code via SMS",
121
- justify="left",
122
- anchor="w",
123
- )
124
- self.explanation2_3_lbl = Label(
125
- self.frame_simulate_login,
126
- text="You will be logged out of existing device",
127
- justify="left",
128
- anchor="w",
129
- )
130
-
131
- self.kakao_username_help_btn = Button(
132
- self.frame_simulate_login,
133
- text="?",
134
- width=1,
135
- command=lambda: self.cb_msg_block_kakao(
136
- self.gui.help["cred"]["kakao_username"]
137
- ),
138
- bootstyle="secondary", # type: ignore
139
- )
140
- self.kakao_username_lbl = Label(
141
- self.frame_simulate_login,
142
- text="Username",
143
- width=18,
144
- justify="left",
145
- anchor="w",
146
- )
147
- self.kakao_username_entry = Entry(
148
- self.frame_simulate_login,
149
- textvariable=self.gui.kakao_username_var,
150
- width=30,
151
- )
152
- self.kakao_username_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
153
-
154
- self.kakao_password_help_btn = Button(
155
- self.frame_simulate_login,
156
- text="?",
157
- width=1,
158
- command=lambda: self.cb_msg_block_kakao(
159
- self.gui.help["cred"]["kakao_password"]
160
- ),
161
- bootstyle="secondary", # type: ignore
162
- )
163
- self.kakao_password_lbl = Label(
164
- self.frame_simulate_login, text="Password", justify="left", anchor="w"
165
- )
166
- self.kakao_password_entry = Entry(
167
- self.frame_simulate_login,
168
- textvariable=self.gui.kakao_password_var,
169
- width=30,
170
- )
171
- self.kakao_password_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
172
-
173
- self.kakao_country_code_help_btn = Button(
174
- self.frame_simulate_login,
175
- text="?",
176
- width=1,
177
- command=lambda: self.cb_msg_block_kakao(
178
- self.gui.help["cred"]["kakao_country_code"]
179
- ),
180
- bootstyle="secondary", # type: ignore
181
- )
182
- self.kakao_country_code_lbl = Label(
183
- self.frame_simulate_login, text="Country code", justify="left", anchor="w"
184
- )
185
- self.kakao_country_code_entry = Entry(
186
- self.frame_simulate_login,
187
- textvariable=self.gui.kakao_country_code_var,
188
- width=30,
189
- )
190
- self.kakao_country_code_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
191
-
192
- self.kakao_phone_number_help_btn = Button(
193
- self.frame_simulate_login,
194
- text="?",
195
- width=1,
196
- command=lambda: self.cb_msg_block_kakao(
197
- self.gui.help["cred"]["kakao_phone_number"]
198
- ),
199
- bootstyle="secondary", # type: ignore
200
- )
201
- self.kakao_phone_number_lbl = Label(
202
- self.frame_simulate_login, text="Phone number", justify="left", anchor="w"
203
- )
204
- self.kakao_phone_number_entry = Entry(
205
- self.frame_simulate_login,
206
- textvariable=self.gui.kakao_phone_number_var,
207
- width=30,
208
- )
209
- self.kakao_phone_number_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
210
-
211
- self.login_btn = Button(
212
- self.frame_simulate_login,
213
- text="Login and get auth_token",
214
- command=self.cb_simulate_login,
215
- width=24,
216
- )
217
-
218
- self.explanation2_1_lbl.grid(
219
- column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
220
- )
221
- self.explanation2_2_lbl.grid(
222
- column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
223
- )
224
- self.explanation2_3_lbl.grid(
225
- column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
226
- )
227
-
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)
231
-
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)
235
-
236
- self.kakao_country_code_help_btn.grid(
237
- column=0, row=5, sticky="w", padx=3, pady=3
238
- )
239
- self.kakao_country_code_lbl.grid(column=1, row=5, sticky="w", padx=3, pady=3)
240
- self.kakao_country_code_entry.grid(column=2, row=5, sticky="w", padx=3, pady=3)
241
-
242
- self.kakao_phone_number_help_btn.grid(
243
- column=0, row=6, sticky="w", padx=3, pady=3
244
- )
245
- self.kakao_phone_number_lbl.grid(column=1, row=6, sticky="w", padx=3, pady=3)
246
- 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)
248
-
249
- GUIUtils.finalize_window(self)
250
-
251
- def cb_simulate_login(self) -> None:
252
- Thread(target=self.cb_simulate_login_thread, daemon=True).start()
253
-
254
- def cb_simulate_login_thread(self, *_: Any) -> None:
255
- 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
- )
262
-
263
- auth_token = m.get_cred()
264
-
265
- if auth_token:
266
- if not self.gui.creds.get("kakao"):
267
- self.gui.creds["kakao"] = {}
268
- self.gui.creds["kakao"]["auth_token"] = auth_token
269
- self.gui.kakao_auth_token_var.set(auth_token)
270
-
271
- self.cb_msg_block_kakao(f"Got auth_token successfully: {auth_token}")
272
- self.gui.save_creds()
273
- self.gui.highlight_fields()
274
- else:
275
- self.cb_msg_block_kakao("Failed to get auth_token")
276
-
277
- def cb_launch_desktop(self) -> None:
278
- m = GetKakaoDesktopAuth(
279
- cb_ask_str=self.cb_ask_str_kakao,
280
- )
281
- if self.gui.kakao_bin_path_var.get() != "":
282
- bin_path = self.gui.kakao_bin_path_var.get()
283
- else:
284
- bin_path = m.get_kakao_desktop()
285
-
286
- if bin_path is not None:
287
- m.launch_kakao(bin_path)
288
- else:
289
- self.cb_msg_block_kakao(
290
- "Error: Cannot launch Kakao Desktop. Is it installed?"
291
- )
292
-
293
- def cb_from_desktop(self) -> None:
294
- Thread(target=self.cb_from_desktop_thread, daemon=True).start()
295
-
296
- def cb_from_desktop_thread(self, *_: Any) -> None:
297
- 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
- )
303
-
304
- bin_path: Optional[str]
305
- if self.gui.kakao_bin_path_var.get() != "":
306
- bin_path = self.gui.kakao_bin_path_var.get()
307
- else:
308
- bin_path = None
309
- auth_token, msg = m.get_cred(bin_path)
310
-
311
- if auth_token:
312
- if not self.gui.creds.get("kakao"):
313
- self.gui.creds["kakao"] = {}
314
- self.gui.creds["kakao"]["auth_token"] = auth_token
315
- self.gui.kakao_auth_token_var.set(auth_token)
316
-
317
- self.gui.save_creds()
318
- self.gui.highlight_fields()
319
-
320
- self.cb_msg_block_kakao(msg)
321
- self.gui.cb_bar("clear")
1
+ #!/usr/bin/env python3
2
+ import platform
3
+ from threading import Thread
4
+ from typing import Any, Optional
5
+
6
+ from ttkbootstrap import Button, Entry, Frame, Label, LabelFrame # type: ignore
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
11
+ from sticker_convert.gui_components.frames.right_clicker import RightClicker
12
+ from sticker_convert.gui_components.gui_utils import GUIUtils
13
+ from sticker_convert.gui_components.windows.base_window import BaseWindow
14
+ from sticker_convert.utils.translate import I
15
+
16
+
17
+ class KakaoGetAuthWindow(BaseWindow):
18
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
19
+ super().__init__(*args, **kwargs)
20
+
21
+ self.title(I("Get Kakao auth_token"))
22
+
23
+ self.frame_desktop_memdump = LabelFrame(
24
+ self.scrollable_frame, text=I("Method 1: KakaoTalk Desktop memdump")
25
+ )
26
+ self.frame_desktop_login = LabelFrame(
27
+ self.scrollable_frame, text=I("Method 2: Simulate Desktop login")
28
+ )
29
+ self.frame_android_login = LabelFrame(
30
+ self.scrollable_frame, text=I("Method 3: Simulate Android login")
31
+ )
32
+ self.frame_login_btn = Frame(self.scrollable_frame)
33
+
34
+ self.frame_desktop_memdump.grid(column=0, row=0, sticky="news", padx=3, pady=3)
35
+ self.frame_desktop_login.grid(column=0, row=1, sticky="news", padx=3, pady=3)
36
+ self.frame_android_login.grid(column=0, row=2, sticky="news", padx=3, pady=3)
37
+
38
+ # Method 1 frame
39
+ self.explanation1_1_lbl = Label(
40
+ self.frame_desktop_memdump,
41
+ text=I("This will get Kakao auth_token from Kakao Desktop"),
42
+ justify="left",
43
+ anchor="w",
44
+ )
45
+ self.explanation1_2_lbl = Label(
46
+ self.frame_desktop_memdump,
47
+ text=I("Download Kakao Desktop, login and press 'Get auth_token'"),
48
+ justify="left",
49
+ anchor="w",
50
+ )
51
+ self.explanation1_3_lbl = Label(
52
+ self.frame_desktop_memdump,
53
+ text=I("This can take about a minute."),
54
+ justify="left",
55
+ anchor="w",
56
+ )
57
+ if platform.system() != "Darwin":
58
+ self.explanation1_4_lbl = Label(
59
+ self.frame_desktop_memdump,
60
+ text=I(
61
+ "Note: This will download ProcDump and read memory of KakaoTalk Desktop"
62
+ ),
63
+ justify="left",
64
+ anchor="w",
65
+ )
66
+ else:
67
+ self.explanation1_4_lbl = Label(
68
+ self.frame_desktop_memdump,
69
+ text=I("Note: This will read memory of KakaoTalk Desktop"),
70
+ justify="left",
71
+ anchor="w",
72
+ )
73
+ self.kakao_bin_path_lbl = Label(
74
+ self.frame_desktop_memdump,
75
+ text=I("Kakao app path (Optional):"),
76
+ justify="left",
77
+ anchor="w",
78
+ )
79
+ self.kakao_bin_path_entry = Entry(
80
+ self.frame_desktop_memdump,
81
+ textvariable=self.gui.kakao_bin_path_var,
82
+ width=30,
83
+ )
84
+ self.launch_desktop_btn = Button(
85
+ self.frame_desktop_memdump,
86
+ text=I("Launch Desktop app"),
87
+ command=self.cb_launch_desktop,
88
+ width=24,
89
+ bootstyle="secondary", # type: ignore
90
+ )
91
+ self.get_auth_desktop_btn = Button(
92
+ self.frame_desktop_memdump,
93
+ text=I("Get auth_token"),
94
+ command=self.cb_get_auth_desktop_memdump,
95
+ width=24,
96
+ )
97
+
98
+ self.explanation1_1_lbl.grid(
99
+ column=0, row=0, columnspan=2, sticky="w", padx=3, pady=3
100
+ )
101
+ self.explanation1_2_lbl.grid(
102
+ column=0, row=1, columnspan=2, sticky="w", padx=3, pady=3
103
+ )
104
+ self.explanation1_3_lbl.grid(
105
+ column=0, row=2, columnspan=2, sticky="w", padx=3, pady=3
106
+ )
107
+ self.explanation1_4_lbl.grid(
108
+ column=0, row=3, columnspan=2, sticky="w", padx=3, pady=3
109
+ )
110
+ self.kakao_bin_path_lbl.grid(column=0, row=4, sticky="w", padx=3, pady=3)
111
+ self.kakao_bin_path_entry.grid(column=1, row=4, sticky="w", padx=3, pady=3)
112
+ self.launch_desktop_btn.grid(column=0, row=5, columnspan=2, padx=3, pady=3)
113
+ self.get_auth_desktop_btn.grid(column=0, row=6, columnspan=2, padx=3, pady=3)
114
+
115
+ # Method 2 frame
116
+ self.explanation2_1_lbl = Label(
117
+ self.frame_desktop_login,
118
+ text=I("This will simulate login to Desktop Kakao app"),
119
+ justify="left",
120
+ anchor="w",
121
+ )
122
+ self.explanation2_2_lbl = Label(
123
+ self.frame_desktop_login,
124
+ text=I("You may receive verification code from Kakao app on phone"),
125
+ justify="left",
126
+ anchor="w",
127
+ )
128
+ self.explanation2_3_lbl = Label(
129
+ self.frame_desktop_login,
130
+ text=I("It is not necessary to download Desktop Kakao app"),
131
+ justify="left",
132
+ anchor="w",
133
+ )
134
+
135
+ self.kakao_username_help_btn2 = Button(
136
+ self.frame_desktop_login,
137
+ text="?",
138
+ width=1,
139
+ command=lambda: self.gui.cb.put(
140
+ (
141
+ "msg_block",
142
+ None,
143
+ {
144
+ "message": self.gui.help["cred"]["kakao_username"],
145
+ "parent": self,
146
+ },
147
+ )
148
+ ),
149
+ bootstyle="secondary", # type: ignore
150
+ )
151
+ self.kakao_username_lbl2 = Label(
152
+ self.frame_desktop_login,
153
+ text=I("Username"),
154
+ width=18,
155
+ justify="left",
156
+ anchor="w",
157
+ )
158
+ self.kakao_username_entry2 = Entry(
159
+ self.frame_desktop_login,
160
+ textvariable=self.gui.kakao_username_var,
161
+ width=30,
162
+ )
163
+ self.kakao_username_entry2.bind("<Button-3><ButtonRelease-3>", RightClicker)
164
+
165
+ self.kakao_password_help_btn2 = Button(
166
+ self.frame_desktop_login,
167
+ text="?",
168
+ width=1,
169
+ command=lambda: self.gui.cb.put(
170
+ (
171
+ "msg_block",
172
+ None,
173
+ {
174
+ "message": self.gui.help["cred"]["kakao_password"],
175
+ "parent": self,
176
+ },
177
+ )
178
+ ),
179
+ bootstyle="secondary", # type: ignore
180
+ )
181
+ self.kakao_password_lbl2 = Label(
182
+ self.frame_desktop_login,
183
+ text=I("Password"),
184
+ justify="left",
185
+ anchor="w",
186
+ )
187
+ self.kakao_password_entry2 = Entry(
188
+ self.frame_desktop_login,
189
+ textvariable=self.gui.kakao_password_var,
190
+ width=30,
191
+ )
192
+ self.kakao_password_entry2.bind("<Button-3><ButtonRelease-3>", RightClicker)
193
+
194
+ self.kakao_device_uuid_help_btn = Button(
195
+ self.frame_desktop_login,
196
+ text="?",
197
+ width=1,
198
+ command=lambda: self.gui.cb.put(
199
+ (
200
+ "msg_block",
201
+ None,
202
+ {
203
+ "message": self.gui.help["cred"]["kakao_device_uuid"],
204
+ "parent": self,
205
+ },
206
+ )
207
+ ),
208
+ bootstyle="secondary", # type: ignore
209
+ )
210
+ self.kakao_device_uuid_lbl = Label(
211
+ self.frame_desktop_login,
212
+ text=I("Device UUID (Optional)"),
213
+ justify="left",
214
+ anchor="w",
215
+ )
216
+ self.kakao_device_uuid_entry = Entry(
217
+ self.frame_desktop_login,
218
+ textvariable=self.gui.kakao_device_uuid_var,
219
+ width=30,
220
+ )
221
+ self.kakao_device_uuid_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
222
+
223
+ self.login_btn2 = Button(
224
+ self.frame_desktop_login,
225
+ text=I("Login and get auth_token"),
226
+ command=self.cb_get_auth_desktop_login,
227
+ width=24,
228
+ )
229
+
230
+ self.explanation2_1_lbl.grid(
231
+ column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
232
+ )
233
+ self.explanation2_2_lbl.grid(
234
+ column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
235
+ )
236
+ self.explanation2_3_lbl.grid(
237
+ column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
238
+ )
239
+
240
+ self.kakao_username_help_btn2.grid(column=0, row=3, sticky="w", padx=3, pady=3)
241
+ self.kakao_username_lbl2.grid(column=1, row=3, sticky="w", padx=3, pady=3)
242
+ self.kakao_username_entry2.grid(column=2, row=3, sticky="w", padx=3, pady=3)
243
+
244
+ self.kakao_password_help_btn2.grid(column=0, row=4, sticky="w", padx=3, pady=3)
245
+ self.kakao_password_lbl2.grid(column=1, row=4, sticky="w", padx=3, pady=3)
246
+ self.kakao_password_entry2.grid(column=2, row=4, sticky="w", padx=3, pady=3)
247
+
248
+ self.kakao_device_uuid_help_btn.grid(
249
+ column=0, row=5, sticky="w", padx=3, pady=3
250
+ )
251
+ self.kakao_device_uuid_lbl.grid(column=1, row=5, sticky="w", padx=3, pady=3)
252
+ self.kakao_device_uuid_entry.grid(column=2, row=5, sticky="w", padx=3, pady=3)
253
+
254
+ self.login_btn2.grid(column=0, row=6, columnspan=3, padx=3, pady=3)
255
+
256
+ # Method 3 frame
257
+ self.explanation3_1_lbl = Label(
258
+ self.frame_android_login,
259
+ text=I("This will simulate login to Android Kakao app"),
260
+ justify="left",
261
+ anchor="w",
262
+ )
263
+ self.explanation3_2_lbl = Label(
264
+ self.frame_android_login,
265
+ text=I("You will send / receive verification code via SMS"),
266
+ justify="left",
267
+ anchor="w",
268
+ )
269
+ self.explanation3_3_lbl = Label(
270
+ self.frame_android_login,
271
+ text=I("You will be logged out of existing device"),
272
+ justify="left",
273
+ anchor="w",
274
+ )
275
+
276
+ self.kakao_username_help_btn3 = Button(
277
+ self.frame_android_login,
278
+ text="?",
279
+ width=1,
280
+ command=lambda: self.gui.cb.put(
281
+ (
282
+ "msg_block",
283
+ None,
284
+ {
285
+ "message": self.gui.help["cred"]["kakao_username"],
286
+ "parent": self,
287
+ },
288
+ )
289
+ ),
290
+ bootstyle="secondary", # type: ignore
291
+ )
292
+ self.kakao_username_lbl3 = Label(
293
+ self.frame_android_login,
294
+ text=I("Username"),
295
+ width=18,
296
+ justify="left",
297
+ anchor="w",
298
+ )
299
+ self.kakao_username_entry3 = Entry(
300
+ self.frame_android_login,
301
+ textvariable=self.gui.kakao_username_var,
302
+ width=30,
303
+ )
304
+ self.kakao_username_entry3.bind("<Button-3><ButtonRelease-3>", RightClicker)
305
+
306
+ self.kakao_password_help_btn3 = Button(
307
+ self.frame_android_login,
308
+ text="?",
309
+ width=1,
310
+ command=lambda: self.gui.cb.put(
311
+ (
312
+ "msg_block",
313
+ None,
314
+ {
315
+ "message": self.gui.help["cred"]["kakao_password"],
316
+ "parent": self,
317
+ },
318
+ )
319
+ ),
320
+ bootstyle="secondary", # type: ignore
321
+ )
322
+ self.kakao_password_lbl3 = Label(
323
+ self.frame_android_login,
324
+ text=I("Password"),
325
+ justify="left",
326
+ anchor="w",
327
+ )
328
+ self.kakao_password_entry3 = Entry(
329
+ self.frame_android_login,
330
+ textvariable=self.gui.kakao_password_var,
331
+ width=30,
332
+ )
333
+ self.kakao_password_entry3.bind("<Button-3><ButtonRelease-3>", RightClicker)
334
+
335
+ self.kakao_country_code_help_btn = Button(
336
+ self.frame_android_login,
337
+ text="?",
338
+ width=1,
339
+ command=lambda: self.gui.cb.put(
340
+ (
341
+ "msg_block",
342
+ None,
343
+ {
344
+ "message": self.gui.help["cred"]["kakao_country_code"],
345
+ "parent": self,
346
+ },
347
+ )
348
+ ),
349
+ bootstyle="secondary", # type: ignore
350
+ )
351
+ self.kakao_country_code_lbl = Label(
352
+ self.frame_android_login,
353
+ text=I("Country code"),
354
+ justify="left",
355
+ anchor="w",
356
+ )
357
+ self.kakao_country_code_entry = Entry(
358
+ self.frame_android_login,
359
+ textvariable=self.gui.kakao_country_code_var,
360
+ width=30,
361
+ )
362
+ self.kakao_country_code_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
363
+
364
+ self.kakao_phone_number_help_btn = Button(
365
+ self.frame_android_login,
366
+ text="?",
367
+ width=1,
368
+ command=lambda: self.gui.cb.put(
369
+ (
370
+ "msg_block",
371
+ None,
372
+ {
373
+ "message": self.gui.help["cred"]["kakao_phone_number"],
374
+ "parent": self,
375
+ },
376
+ )
377
+ ),
378
+ bootstyle="secondary", # type: ignore
379
+ )
380
+ self.kakao_phone_number_lbl = Label(
381
+ self.frame_android_login,
382
+ text=I("Phone number"),
383
+ justify="left",
384
+ anchor="w",
385
+ )
386
+ self.kakao_phone_number_entry = Entry(
387
+ self.frame_android_login,
388
+ textvariable=self.gui.kakao_phone_number_var,
389
+ width=30,
390
+ )
391
+ self.kakao_phone_number_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
392
+
393
+ self.login_btn3 = Button(
394
+ self.frame_android_login,
395
+ text=I("Login and get auth_token"),
396
+ command=self.cb_get_auth_android_login,
397
+ width=24,
398
+ )
399
+
400
+ self.explanation3_1_lbl.grid(
401
+ column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
402
+ )
403
+ self.explanation3_2_lbl.grid(
404
+ column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
405
+ )
406
+ self.explanation3_3_lbl.grid(
407
+ column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
408
+ )
409
+
410
+ self.kakao_username_help_btn3.grid(column=0, row=3, sticky="w", padx=3, pady=3)
411
+ self.kakao_username_lbl3.grid(column=1, row=3, sticky="w", padx=3, pady=3)
412
+ self.kakao_username_entry3.grid(column=2, row=3, sticky="w", padx=3, pady=3)
413
+
414
+ self.kakao_password_help_btn3.grid(column=0, row=4, sticky="w", padx=3, pady=3)
415
+ self.kakao_password_lbl3.grid(column=1, row=4, sticky="w", padx=3, pady=3)
416
+ self.kakao_password_entry3.grid(column=2, row=4, sticky="w", padx=3, pady=3)
417
+
418
+ self.kakao_country_code_help_btn.grid(
419
+ column=0, row=5, sticky="w", padx=3, pady=3
420
+ )
421
+ self.kakao_country_code_lbl.grid(column=1, row=5, sticky="w", padx=3, pady=3)
422
+ self.kakao_country_code_entry.grid(column=2, row=5, sticky="w", padx=3, pady=3)
423
+
424
+ self.kakao_phone_number_help_btn.grid(
425
+ column=0, row=6, sticky="w", padx=3, pady=3
426
+ )
427
+ self.kakao_phone_number_lbl.grid(column=1, row=6, sticky="w", padx=3, pady=3)
428
+ self.kakao_phone_number_entry.grid(column=2, row=6, sticky="w", padx=3, pady=3)
429
+ self.login_btn3.grid(column=0, row=7, columnspan=3, padx=3, pady=3)
430
+
431
+ GUIUtils.finalize_window(self)
432
+
433
+ def cb_get_auth_android_login(self) -> None:
434
+ Thread(target=self.cb_get_auth_android_login_thread, daemon=True).start()
435
+
436
+ def cb_get_auth_desktop_login_thread(self, *_: Any) -> None:
437
+ self.gui.save_creds()
438
+ m = AuthKakaoDesktopLogin(self.gui.get_opt_cred(), self.gui.cb)
439
+
440
+ auth_token, msg = m.get_cred()
441
+
442
+ if auth_token:
443
+ if not self.gui.creds.get("kakao"):
444
+ self.gui.creds["kakao"] = {}
445
+ self.gui.creds["kakao"]["auth_token"] = auth_token
446
+ self.gui.kakao_auth_token_var.set(auth_token)
447
+
448
+ self.gui.save_creds()
449
+ self.gui.highlight_fields()
450
+
451
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
452
+
453
+ def cb_get_auth_desktop_login(self) -> None:
454
+ Thread(target=self.cb_get_auth_desktop_login_thread, daemon=True).start()
455
+
456
+ def cb_get_auth_android_login_thread(self, *_: Any) -> None:
457
+ self.gui.save_creds()
458
+ m = AuthKakaoAndroidLogin(self.gui.get_opt_cred(), self.gui.cb)
459
+
460
+ auth_token, msg = m.get_cred()
461
+
462
+ if auth_token:
463
+ if not self.gui.creds.get("kakao"):
464
+ self.gui.creds["kakao"] = {}
465
+ self.gui.creds["kakao"]["auth_token"] = auth_token
466
+ self.gui.kakao_auth_token_var.set(auth_token)
467
+
468
+ self.gui.save_creds()
469
+ self.gui.highlight_fields()
470
+
471
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
472
+
473
+ def cb_launch_desktop(self) -> None:
474
+ m = AuthKakaoDesktopMemdump(self.gui.get_opt_cred(), self.gui.cb)
475
+ if self.gui.kakao_bin_path_var.get() != "":
476
+ bin_path = self.gui.kakao_bin_path_var.get()
477
+ else:
478
+ bin_path = m.get_kakao_desktop()
479
+
480
+ if bin_path is not None:
481
+ m.launch_kakao(bin_path)
482
+ else:
483
+ msg = I("Error: Cannot launch Kakao Desktop. Is it installed?")
484
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
485
+
486
+ def cb_get_auth_desktop_memdump(self) -> None:
487
+ Thread(target=self.cb_get_auth_desktop_memdump_thread, daemon=True).start()
488
+
489
+ def cb_get_auth_desktop_memdump_thread(self, *_: Any) -> None:
490
+ self.gui.save_creds()
491
+ self.gui.cb.bar("indeterminate")
492
+ m = AuthKakaoDesktopMemdump(self.gui.get_opt_cred(), self.gui.cb)
493
+
494
+ bin_path: Optional[str]
495
+ if self.gui.kakao_bin_path_var.get() != "":
496
+ bin_path = self.gui.kakao_bin_path_var.get()
497
+ else:
498
+ bin_path = None
499
+ auth_token, msg = m.get_cred(bin_path)
500
+
501
+ if auth_token:
502
+ if not self.gui.creds.get("kakao"):
503
+ self.gui.creds["kakao"] = {}
504
+ self.gui.creds["kakao"]["auth_token"] = auth_token
505
+ self.gui.kakao_auth_token_var.set(auth_token)
506
+
507
+ self.gui.save_creds()
508
+ self.gui.highlight_fields()
509
+
510
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))
511
+ self.gui.cb.bar("clear")