mirror of
https://github.com/fumiama/copymanga.git
synced 2026-06-05 07:20:23 +08:00
v2.3.1
新增 1. 增强型数据访问选项 2. 漫画下载数量并发限制 修复 1. 同时下载过多漫画时失败 (fix #67) 2. 主页滑动横幅后刷新闪退 (fix #65) 3. v2.3.0 增强型数据访问下登录失败 4. jna R8 闪退 优化 1. 网络不佳时自动打开增强型数据访问 2. 不再反复读取代理状态
This commit is contained in:
1
.idea/dictionaries/fumiama.xml
generated
1
.idea/dictionaries/fumiama.xml
generated
@@ -2,6 +2,7 @@
|
||||
<dictionary name="fumiama">
|
||||
<words>
|
||||
<w>alphae</w>
|
||||
<w>azurewebsites</w>
|
||||
<w>comandy</w>
|
||||
<w>downloaders</w>
|
||||
<w>grps</w>
|
||||
|
||||
7
app/proguard-rules.pro
vendored
7
app/proguard-rules.pro
vendored
@@ -76,3 +76,10 @@
|
||||
}
|
||||
|
||||
##---------------End: proguard configuration for Gson ----------
|
||||
|
||||
-keep class com.sun.jna.** { *; }
|
||||
-keep class * implements com.sun.jna.** { *; }
|
||||
-dontwarn java.awt.Component
|
||||
-dontwarn java.awt.GraphicsEnvironment
|
||||
-dontwarn java.awt.HeadlessException
|
||||
-dontwarn java.awt.Window
|
||||
|
||||
@@ -44,9 +44,6 @@ class ComandyGlideModule: AppGlideModule() {
|
||||
}
|
||||
try {
|
||||
val para = Gson().toJson(capsule)
|
||||
MainActivity.mainWeakReference?.get()?.runOnUiThread {
|
||||
Log.d("MyCGM", "request: $para")
|
||||
}
|
||||
Comandy.instance!!.request(para).let { result ->
|
||||
Gson().fromJson(result, ComandyCapsule::class.java)!!.let {
|
||||
if (it.code != 200) {
|
||||
@@ -88,7 +85,9 @@ class ComandyGlideModule: AppGlideModule() {
|
||||
}
|
||||
|
||||
override fun handles(model: GlideUrl): Boolean {
|
||||
return Comandy.useComandy && Comandy.instance != null && model.toURL().let { it.protocol == "https" }
|
||||
return Comandy.useComandy && Comandy.instance != null && model.toURL().let {
|
||||
it.protocol == "https" && it.host != "copymanga.azurewebsites.net"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ object DownloadTools {
|
||||
|
||||
suspend fun getHttpContent(u: String, refer: String? = null, ua: String? = pc_ua): ByteArray =
|
||||
withContext(Dispatchers.IO) {
|
||||
if (Comandy.useComandy) {
|
||||
if (!u.startsWith("https://copymanga.azurewebsites.net") && Comandy.useComandy) {
|
||||
getComandyApiConnection(u, "GET", refer, ua).let { capsule ->
|
||||
val para = Gson().toJson(capsule)
|
||||
//Log.d("MyDT", "comandy request: $para")
|
||||
@@ -147,7 +147,7 @@ object DownloadTools {
|
||||
|
||||
fun prepare(u: String, readSize: Int = -1) = run {
|
||||
Log.d("MyDT", "prepareHttp: $u")
|
||||
FutureTask(if (Comandy.useComandy) Callable{
|
||||
FutureTask(if (!u.startsWith("https://copymanga.azurewebsites.net") && Comandy.useComandy) Callable{
|
||||
try {
|
||||
Comandy.instance?.request(Gson().toJson(
|
||||
getComandyNormalConnection(u, "GET", pc_ua))
|
||||
@@ -189,7 +189,7 @@ object DownloadTools {
|
||||
fun requestWithBody(url: String, method: String, body: ByteArray, refer: String? = referer, ua: String? = pc_ua, contentType: String? = "application/x-www-form-urlencoded;charset=utf-8"): ByteArray? {
|
||||
Log.d("MyDT", "$method Http: $url")
|
||||
var ret: ByteArray? = null
|
||||
val task = FutureTask(if(Comandy.useComandy) Callable{
|
||||
val task = FutureTask(if(!url.startsWith("https://copymanga.azurewebsites.net") && Comandy.useComandy) Callable{
|
||||
try {
|
||||
val capsule = getComandyApiConnection(url, method, refer, ua)
|
||||
contentType?.let { capsule.headers["content-type"] = it }
|
||||
|
||||
@@ -13,6 +13,7 @@ import top.fumiama.copymanga.tools.http.Comandy
|
||||
import top.fumiama.copymanga.tools.http.DownloadTools
|
||||
import top.fumiama.copymanga.tools.http.DownloadTools.app_ver
|
||||
import top.fumiama.copymanga.tools.http.DownloadTools.pc_ua
|
||||
import top.fumiama.copymanga.tools.http.Proxy
|
||||
import top.fumiama.dmzj.copymanga.R
|
||||
import java.net.URLEncoder
|
||||
import java.nio.charset.Charset
|
||||
@@ -21,7 +22,7 @@ class Member(private val pref: SharedPreferences, private val getString: (Int) -
|
||||
val hasLogin: Boolean get() = pref.getString("token", "")?.isNotEmpty()?:false
|
||||
suspend fun login(username: String, pwd: String, salt: Int): LoginInfoStructure = withContext(Dispatchers.IO) {
|
||||
var err = ""
|
||||
if (Comandy.useComandy) getComandyLoginConnection(username, pwd, salt).let { capsule ->
|
||||
if (!Proxy.useApiProxy && Comandy.useComandy) getComandyLoginConnection(username, pwd, salt).let { capsule ->
|
||||
try {
|
||||
val para = Gson().toJson(capsule)
|
||||
Comandy.instance?.request(para)?.let { result ->
|
||||
|
||||
Reference in New Issue
Block a user