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

项目依赖缺失 #107

Open
vincentzhang6230 opened this issue Dec 17, 2024 · 3 comments
Open

项目依赖缺失 #107

vincentzhang6230 opened this issue Dec 17, 2024 · 3 comments
Labels
bug 🐛程序异常 help wanted 🚸请求协助

Comments

@vincentzhang6230
Copy link

项目中使用的依赖:com.lapism:search:2.4.1@aar 在jcenter()仓库下,现已无法拉取.
搜索建议单独写一个界面吧

@fumiama fumiama added bug 🐛程序异常 help wanted 🚸请求协助 labels Dec 17, 2024
@fumiama
Copy link
Owner

fumiama commented Dec 17, 2024

自己开发太费事了,我更倾向于直接在本地导入那个库(

@vincentzhang6230
Copy link
Author

你写的代码太有个性了,没看懂你请求数据的方式.
我想用Okhttp重写数据获取方式,但一直返回的210错误码,是需要添加特定的请求头吗?

@fumiama
Copy link
Owner

fumiama commented Dec 21, 2024

石山是这样的,我主要并不是写kt所以没有系统学过。请求头你就看

connection.apply {
setRequestProperty("host", url.substringAfter("://").substringBefore("/"))
ua?.let { setRequestProperty("user-agent", it) }
refer?.let { setRequestProperty("referer", it) }
setRequestProperty("source", "copyApp")
setRequestProperty("webp", "1")
MainActivity.mainWeakReference?.get()?.let {
PreferenceManager.getDefaultSharedPreferences(it).apply {
setRequestProperty("region", if(!getBoolean("settings_cat_net_sw_use_foreign", false)) "1" else "0")
}
it.getPreferences(Context.MODE_PRIVATE).apply {
setRequestProperty("version", app_ver)
getString("token", "")?.let { tk ->
setRequestProperty("authorization", "Token $tk")
}
}
}
setRequestProperty("platform", "3")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛程序异常 help wanted 🚸请求协助
Projects
None yet
Development

No branches or pull requests

2 participants