Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请求头执行ajax会导致堆栈溢出 #4368

Closed
4 tasks done
yolo52 opened this issue Nov 20, 2024 · 1 comment
Closed
4 tasks done

请求头执行ajax会导致堆栈溢出 #4368

yolo52 opened this issue Nov 20, 2024 · 1 comment
Labels
BUG B.软件未按预期的功能运行

Comments

@yolo52
Copy link

yolo52 commented Nov 20, 2024

确认 / Assignments

  • 搜索现有issues,不存在相似或相关的issue / No similar or related issues
  • 最新测试版依然存在此问题 / Latest beta app does not work
  • 此问题和Xposed、Lsposed、Magisk、手机主题、浏览器插件、无障碍服务等无关 / Make sure your machine is not touched by hook frameworks, plugins, accessibility etc

问题描述 / Describe Bugs

不知道是不是bug,还是写法问题,但在我上个版本3.24.1113以及3.24.1109都没有问题,其他暂未测试但更新后会堆栈溢出,根据打印日志排查是在header中执行一个ajax会一直执行,直至堆栈溢出报错

复现步骤 / How to reproduce

function md5ToUuid(md5String) { const uuid = md5String.substr(0, 8) + '-' + md5String.substr(8, 4) + '-' + md5String.substr(12, 4) + '-' + md5String.substr(16, 4) + '-' + md5String.substr(20); return uuid; } // java.log(baseUrl) var cookie = source.getLoginHeader() || "" var uuid = java.randomUUID().toString().toUpperCase() var deviceUUID = md5ToUuid(java.md5Encode(java.androidId())).toString().toString().toUpperCase() java.log(deviceUUID) var time = Date.now() var security = JSON.parse(java.ajax(`https://ikun.laoguantx.top:45554/sfapi/sign?uuid=${uuid}&time=${time}&deviceuuid=${deviceUUID}`)).data var header = { cookie: cookie, "user-agent": `boluobao/5.0.60(android;29)/H5/${deviceUUID.toLowerCase()}/H5`, sfsecurity: `nonce=${uuid}×tamp=${time}&devicetoken=${deviceUUID}&sign=${security}`, authorization: "Basic YW5kcm9pZHVzZXI6MWEjJDUxLXl0Njk7KkFjdkBxeHE=", accept: "application/vnd.sfacg.api+json;version=1" } JSON.stringify(header) 代码如上,任意新建一个书源,将其放在书源header中,搜索随意填个链接,然后调试,会报java.lang.StackOverflowError: stack size 1039KB

确认 / Assignment

  • 已经提交复现所需要的附加资料 / Submit additions related with bugs

其他信息 / Additions

No response

日志提交 / Relevant log output

No response

阅读版本 / Legado version

3.24.112016

Android版本 / Android version

14

机型 / Model

VIVO

@yolo52 yolo52 added the BUG B.软件未按预期的功能运行 label Nov 20, 2024
@821938089
Copy link
Collaborator

请求头不能写ajax,不然会递归,之前有修复,但是发现可能有问题现在又删掉了
你能解决的话可以PR

@yolo52 yolo52 closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG B.软件未按预期的功能运行
Projects
None yet
Development

No branches or pull requests

2 participants