sticker-convert 2.8.12__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 (124) hide show
  1. sticker_convert/__main__.py +24 -24
  2. sticker_convert/auth/__init__.py +0 -0
  3. sticker_convert/auth/auth_base.py +19 -0
  4. sticker_convert/auth/auth_discord.py +149 -0
  5. sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +331 -300
  6. sticker_convert/auth/auth_kakao_desktop_login.py +327 -0
  7. sticker_convert/auth/auth_kakao_desktop_memdump.py +281 -0
  8. sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +98 -80
  9. sticker_convert/auth/auth_signal.py +139 -0
  10. sticker_convert/auth/auth_telethon.py +161 -0
  11. sticker_convert/auth/auth_viber.py +250 -0
  12. sticker_convert/auth/telegram_api.py +736 -0
  13. sticker_convert/cli.py +623 -509
  14. sticker_convert/converter.py +1093 -962
  15. sticker_convert/definitions.py +11 -0
  16. sticker_convert/downloaders/download_band.py +111 -0
  17. sticker_convert/downloaders/download_base.py +171 -130
  18. sticker_convert/downloaders/download_discord.py +92 -0
  19. sticker_convert/downloaders/download_kakao.py +417 -255
  20. sticker_convert/downloaders/download_line.py +484 -472
  21. sticker_convert/downloaders/download_ogq.py +80 -0
  22. sticker_convert/downloaders/download_signal.py +108 -92
  23. sticker_convert/downloaders/download_telegram.py +56 -130
  24. sticker_convert/downloaders/download_viber.py +121 -95
  25. sticker_convert/gui.py +788 -795
  26. sticker_convert/gui_components/frames/comp_frame.py +180 -165
  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 -162
  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 -715
  34. sticker_convert/gui_components/windows/base_window.py +7 -2
  35. sticker_convert/gui_components/windows/discord_get_auth_window.py +79 -0
  36. sticker_convert/gui_components/windows/kakao_get_auth_window.py +511 -186
  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 -135
  39. sticker_convert/gui_components/windows/viber_get_auth_window.py +168 -0
  40. sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +3 -3
  41. sticker_convert/ios-message-stickers-template/.gitignore +0 -0
  42. sticker_convert/ios-message-stickers-template/README.md +10 -10
  43. sticker_convert/ios-message-stickers-template/stickers/Info.plist +43 -43
  44. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +31 -31
  45. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +6 -6
  46. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +20 -20
  47. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +9 -9
  48. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Sticker 1.png +0 -0
  49. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +9 -9
  50. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Sticker 2.png +0 -0
  51. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +9 -9
  52. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Sticker 3.png +0 -0
  53. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/App-Store-1024x1024pt.png +0 -0
  54. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +91 -91
  55. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-App-Store-1024x768pt.png +0 -0
  56. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-67x50pt@2x.png +0 -0
  57. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-Pro-74x55pt@2x.png +0 -0
  58. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@2x.png +0 -0
  59. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@3x.png +0 -0
  60. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@2x.png +0 -0
  61. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@3x.png +0 -0
  62. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@2x.png +0 -0
  63. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@3x.png +0 -0
  64. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPad-Settings-29pt@2x.png +0 -0
  65. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-Settings-29pt@3x.png +0 -0
  66. sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-settings-29pt@2x.png +0 -0
  67. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +364 -364
  68. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
  69. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  70. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcuserdata/niklaspeterson.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  71. sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  72. sticker_convert/job.py +279 -179
  73. sticker_convert/job_option.py +15 -2
  74. sticker_convert/locales/en_US/LC_MESSAGES/base.mo +0 -0
  75. sticker_convert/locales/ja_JP/LC_MESSAGES/base.mo +0 -0
  76. sticker_convert/locales/zh_CN/LC_MESSAGES/base.mo +0 -0
  77. sticker_convert/locales/zh_TW/LC_MESSAGES/base.mo +0 -0
  78. sticker_convert/py.typed +0 -0
  79. sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  80. sticker_convert/resources/compression.json +220 -16
  81. sticker_convert/resources/emoji.json +527 -77
  82. sticker_convert/resources/help.ja_JP.json +88 -0
  83. sticker_convert/resources/help.json +24 -10
  84. sticker_convert/resources/help.zh_CN.json +88 -0
  85. sticker_convert/resources/help.zh_TW.json +88 -0
  86. sticker_convert/resources/input.ja_JP.json +74 -0
  87. sticker_convert/resources/input.json +121 -71
  88. sticker_convert/resources/input.zh_CN.json +74 -0
  89. sticker_convert/resources/input.zh_TW.json +74 -0
  90. sticker_convert/resources/memdump_linux.sh +25 -0
  91. sticker_convert/resources/memdump_windows.ps1 +8 -0
  92. sticker_convert/resources/output.ja_JP.json +38 -0
  93. sticker_convert/resources/output.json +24 -0
  94. sticker_convert/resources/output.zh_CN.json +38 -0
  95. sticker_convert/resources/output.zh_TW.json +38 -0
  96. sticker_convert/uploaders/compress_wastickers.py +186 -156
  97. sticker_convert/uploaders/upload_base.py +44 -35
  98. sticker_convert/uploaders/upload_signal.py +218 -173
  99. sticker_convert/uploaders/upload_telegram.py +353 -388
  100. sticker_convert/uploaders/upload_viber.py +178 -0
  101. sticker_convert/uploaders/xcode_imessage.py +295 -285
  102. sticker_convert/utils/callback.py +238 -6
  103. sticker_convert/utils/chrome_remotedebug.py +219 -0
  104. sticker_convert/utils/chromiums/linux.py +52 -0
  105. sticker_convert/utils/chromiums/osx.py +68 -0
  106. sticker_convert/utils/chromiums/windows.py +45 -0
  107. sticker_convert/utils/emoji.py +28 -0
  108. sticker_convert/utils/files/json_resources_loader.py +24 -19
  109. sticker_convert/utils/files/metadata_handler.py +8 -7
  110. sticker_convert/utils/files/run_bin.py +1 -1
  111. sticker_convert/utils/media/codec_info.py +99 -67
  112. sticker_convert/utils/media/format_verify.py +33 -20
  113. sticker_convert/utils/process.py +231 -0
  114. sticker_convert/utils/translate.py +108 -0
  115. sticker_convert/utils/url_detect.py +40 -33
  116. sticker_convert/version.py +1 -1
  117. {sticker_convert-2.8.12.dist-info → sticker_convert-2.17.0.0.dist-info}/METADATA +189 -96
  118. sticker_convert-2.17.0.0.dist-info/RECORD +138 -0
  119. {sticker_convert-2.8.12.dist-info → sticker_convert-2.17.0.0.dist-info}/WHEEL +1 -1
  120. sticker_convert/utils/auth/get_signal_auth.py +0 -129
  121. sticker_convert-2.8.12.dist-info/RECORD +0 -101
  122. {sticker_convert-2.8.12.dist-info → sticker_convert-2.17.0.0.dist-info}/entry_points.txt +0 -0
  123. {sticker_convert-2.8.12.dist-info → sticker_convert-2.17.0.0.dist-info/licenses}/LICENSE +0 -0
  124. {sticker_convert-2.8.12.dist-info → sticker_convert-2.17.0.0.dist-info}/top_level.txt +0 -0
@@ -1,186 +1,511 @@
1
- #!/usr/bin/env python3
2
- from functools import partial
3
- from threading import Thread
4
- from typing import Any
5
-
6
- from ttkbootstrap import Button, Entry, Frame, Label, LabelFrame # type: ignore
7
-
8
- from sticker_convert.gui_components.frames.right_clicker import RightClicker
9
- from sticker_convert.gui_components.gui_utils import GUIUtils
10
- from sticker_convert.gui_components.windows.base_window import BaseWindow
11
- from sticker_convert.utils.auth.get_kakao_auth import GetKakaoAuth
12
-
13
-
14
- class KakaoGetAuthWindow(BaseWindow):
15
- def __init__(self, *args: Any, **kwargs: Any) -> None:
16
- super().__init__(*args, **kwargs)
17
-
18
- self.title("Get Kakao auth_token")
19
-
20
- self.cb_msg_block_kakao = partial(self.gui.cb_msg_block, parent=self)
21
- self.cb_ask_str_kakao = partial(self.gui.cb_ask_str, parent=self)
22
-
23
- self.frame_login_info = LabelFrame(
24
- self.scrollable_frame, text="Kakao login info"
25
- )
26
- self.frame_login_btn = Frame(self.scrollable_frame)
27
-
28
- self.frame_login_info.grid(column=0, row=0, sticky="news", padx=3, pady=3)
29
- self.frame_login_btn.grid(column=0, row=1, sticky="news", padx=3, pady=3)
30
-
31
- # Login info frame
32
- self.explanation1_lbl = Label(
33
- self.frame_login_info,
34
- text="This will simulate login to Android Kakao app",
35
- justify="left",
36
- anchor="w",
37
- )
38
- self.explanation2_lbl = Label(
39
- self.frame_login_info,
40
- text="You will send / receive verification code via SMS",
41
- justify="left",
42
- anchor="w",
43
- )
44
- self.explanation3_lbl = Label(
45
- self.frame_login_info,
46
- text="You maybe logged out of existing device",
47
- justify="left",
48
- anchor="w",
49
- )
50
-
51
- self.kakao_username_help_btn = Button(
52
- self.frame_login_info,
53
- text="?",
54
- width=1,
55
- command=lambda: self.cb_msg_block_kakao(
56
- self.gui.help["cred"]["kakao_username"]
57
- ),
58
- bootstyle="secondary", # type: ignore
59
- )
60
- self.kakao_username_lbl = Label(
61
- self.frame_login_info, text="Username", width=18, justify="left", anchor="w"
62
- )
63
- self.kakao_username_entry = Entry(
64
- self.frame_login_info, textvariable=self.gui.kakao_username_var, width=30
65
- )
66
- self.kakao_username_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
67
-
68
- self.kakao_password_help_btn = Button(
69
- self.frame_login_info,
70
- text="?",
71
- width=1,
72
- command=lambda: self.cb_msg_block_kakao(
73
- self.gui.help["cred"]["kakao_password"]
74
- ),
75
- bootstyle="secondary", # type: ignore
76
- )
77
- self.kakao_password_lbl = Label(
78
- self.frame_login_info, text="Password", justify="left", anchor="w"
79
- )
80
- self.kakao_password_entry = Entry(
81
- self.frame_login_info, textvariable=self.gui.kakao_password_var, width=30
82
- )
83
- self.kakao_password_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
84
-
85
- self.kakao_country_code_help_btn = Button(
86
- self.frame_login_info,
87
- text="?",
88
- width=1,
89
- command=lambda: self.cb_msg_block_kakao(
90
- self.gui.help["cred"]["kakao_country_code"]
91
- ),
92
- bootstyle="secondary", # type: ignore
93
- )
94
- self.kakao_country_code_lbl = Label(
95
- self.frame_login_info, text="Country code", justify="left", anchor="w"
96
- )
97
- self.kakao_country_code_entry = Entry(
98
- self.frame_login_info,
99
- textvariable=self.gui.kakao_country_code_var,
100
- width=30,
101
- )
102
- self.kakao_country_code_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
103
-
104
- self.kakao_phone_number_help_btn = Button(
105
- self.frame_login_info,
106
- text="?",
107
- width=1,
108
- command=lambda: self.cb_msg_block_kakao(
109
- self.gui.help["cred"]["kakao_phone_number"]
110
- ),
111
- bootstyle="secondary", # type: ignore
112
- )
113
- self.kakao_phone_number_lbl = Label(
114
- self.frame_login_info, text="Phone number", justify="left", anchor="w"
115
- )
116
- self.kakao_phone_number_entry = Entry(
117
- self.frame_login_info,
118
- textvariable=self.gui.kakao_phone_number_var,
119
- width=30,
120
- )
121
- self.kakao_phone_number_entry.bind("<Button-3><ButtonRelease-3>", RightClicker)
122
-
123
- self.explanation1_lbl.grid(
124
- column=0, row=0, columnspan=3, sticky="w", padx=3, pady=3
125
- )
126
- self.explanation2_lbl.grid(
127
- column=0, row=1, columnspan=3, sticky="w", padx=3, pady=3
128
- )
129
- self.explanation3_lbl.grid(
130
- column=0, row=2, columnspan=3, sticky="w", padx=3, pady=3
131
- )
132
-
133
- self.kakao_username_help_btn.grid(column=0, row=3, sticky="w", padx=3, pady=3)
134
- self.kakao_username_lbl.grid(column=1, row=3, sticky="w", padx=3, pady=3)
135
- self.kakao_username_entry.grid(column=2, row=3, sticky="w", padx=3, pady=3)
136
-
137
- self.kakao_password_help_btn.grid(column=0, row=4, sticky="w", padx=3, pady=3)
138
- self.kakao_password_lbl.grid(column=1, row=4, sticky="w", padx=3, pady=3)
139
- self.kakao_password_entry.grid(column=2, row=4, sticky="w", padx=3, pady=3)
140
-
141
- self.kakao_country_code_help_btn.grid(
142
- column=0, row=5, sticky="w", padx=3, pady=3
143
- )
144
- self.kakao_country_code_lbl.grid(column=1, row=5, sticky="w", padx=3, pady=3)
145
- self.kakao_country_code_entry.grid(column=2, row=5, sticky="w", padx=3, pady=3)
146
-
147
- self.kakao_phone_number_help_btn.grid(
148
- column=0, row=6, sticky="w", padx=3, pady=3
149
- )
150
- self.kakao_phone_number_lbl.grid(column=1, row=6, sticky="w", padx=3, pady=3)
151
- self.kakao_phone_number_entry.grid(column=2, row=6, sticky="w", padx=3, pady=3)
152
-
153
- # Login button frame
154
- self.login_btn = Button(
155
- self.frame_login_btn, text="Login and get auth_token", command=self.cb_login
156
- )
157
-
158
- self.login_btn.pack()
159
-
160
- GUIUtils.finalize_window(self)
161
-
162
- def cb_login(self) -> None:
163
- Thread(target=self.cb_login_thread, daemon=True).start()
164
-
165
- def cb_login_thread(self, *_: Any) -> None:
166
- self.gui.save_creds()
167
- m = GetKakaoAuth(
168
- opt_cred=self.gui.get_opt_cred(),
169
- cb_msg=self.gui.cb_msg,
170
- cb_msg_block=self.cb_msg_block_kakao,
171
- cb_ask_str=self.cb_ask_str_kakao,
172
- )
173
-
174
- auth_token = m.get_cred()
175
-
176
- if auth_token:
177
- if not self.gui.creds.get("kakao"):
178
- self.gui.creds["kakao"] = {}
179
- self.gui.creds["kakao"]["auth_token"] = auth_token
180
- self.gui.kakao_auth_token_var.set(auth_token)
181
-
182
- self.cb_msg_block_kakao(f"Got auth_token successfully: {auth_token}")
183
- self.gui.save_creds()
184
- self.gui.highlight_fields()
185
- else:
186
- self.cb_msg_block_kakao("Failed to get auth_token")
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")