Skip to content

Commit

Permalink
0.11.35,优化QQ平台使用体验
Browse files Browse the repository at this point in the history
Co-Authored-By: 赵怡然 <[email protected]>
  • Loading branch information
lunzhiPenxil and zhaodice committed Jun 8, 2024
1 parent cd159a6 commit c0edc16
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OlivOS/core/info/infoAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import OlivOS


OlivOS_Version = '0.11.34'
OlivOS_SVN = 154
OlivOS_Version = '0.11.35'
OlivOS_SVN = 155

# Compatible <= Plugin[compatible_svn] : Compatible
# OldCompatible <= Plugin[compatible_svn] < Compatible : OldCompatible Warn
Expand Down
1 change: 1 addition & 0 deletions OlivOS/libBooter/libAstralQsignEXEModelAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def run(self):
releaseDir("./conf")
releaseDir("./conf/astral-qsign")
unzip('./lib/astral-qsign.zip', "./conf/astral-qsign")
time.sleep(1)
tmp_env = dict(os.environ)
tmp_env['FORCE_TTY'] = ''
model_Proc = subprocess.Popen(
Expand Down
31 changes: 30 additions & 1 deletion OlivOS/nativeGUI/nativeWinUIAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ def root_Entry_init(self, obj_root, obj_name, str_name, x, y, width_t, width, he
# height = height
# )

def show_url_webbrowser(self, url):
def show_tx_url_webbrowser(self, url):
res = tkinter.messagebox.askquestion("请完成验证", "是否使用内置人机验证助手访问 \"" + url + "\" ?")
try:
if res == 'yes':
Expand All @@ -1295,6 +1295,23 @@ def show_url_webbrowser(self, url):
except webbrowser.Error as error_info:
tkinter.messagebox.showerror("webbrowser.Error", error_info)

def show_url_webbrowser(self, url):
res = tkinter.messagebox.askquestion("请完成验证", "是否通过浏览器访问 \"" + url + "\" ?")
try:
if res == 'yes':
res = tkinter.messagebox.askquestion("请完成验证", "是否使用内置浏览器?")
if res == 'yes':
OlivOS.webviewUIAPI.sendOpenWebviewPage(
control_queue=self.root.Proc_info.control_queue,
name='slider_verification_code=%s' % self.bot.hash,
title='请完成验证',
url=url
)
else:
webbrowser.open(url)
except webbrowser.Error as error_info:
tkinter.messagebox.showerror("webbrowser.Error", error_info)

def tree_init_line(self):
if self.bot.hash in self.root.UIObject['root_gocqhttp_terminal_data']:
for line in self.root.UIObject['root_gocqhttp_terminal_data'][self.bot.hash]:
Expand Down Expand Up @@ -1331,6 +1348,7 @@ def tree_add_line(self, data, flagInit = False):
self.tree_add_line('=================================================================')
self.tree_add_line(' 【推荐】 选择手动抓取ticket方式将会允许OlivOS接管验证流程 【推荐】')
self.tree_add_line('=================================================================')

matchRes = re.match(
r'^\[\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\]\s\[WARNING\]:\s请前往该地址验证\s+->\s+(http[s]{0,1}://ti\.qq\.com/safe/tools/captcha/sms-verify-login\?[^\s]+).*$',
res_data_raw
Expand All @@ -1339,6 +1357,17 @@ def tree_add_line(self, data, flagInit = False):
matchResList = list(matchRes.groups())
if len(matchResList) == 1:
matchResUrl = matchResList[0]
self.show_tx_url_webbrowser(matchResUrl)

matchRes = re.match(
r'^\[\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\]\s\[WARNING\]:\s账号已开启设备锁,请前往\s+->\s+(http[s]{0,1}://accounts\.qq\.com/safe/verify[^\s]+).*$',
res_data_raw
)
if matchRes != None:
matchResList = list(matchRes.groups())
if len(matchResList) == 1:
matchResUrl = matchResList[0]
matchResUrl = matchResUrl.replace('accounts.qq.com/safe/verify', 'accounts.qq.com/safe/qrcode')
self.show_url_webbrowser(matchResUrl)
except:
pass
Expand Down

0 comments on commit c0edc16

Please sign in to comment.