Rm dynamic change

master^2
fengyuecanzhu 2 years ago
parent 2c9a5f1bb3
commit 72cb6bf89c
No known key found for this signature in database
GPG Key ID: 04B78AD06A9D6E6C
  1. 1
      dynamic/src/main/java/xyz/fycz/dynamic/AppLoadImpl.kt
  2. 54
      dynamic/src/main/java/xyz/fycz/dynamic/fix/App250Fix.kt

@ -57,7 +57,6 @@ class AppLoadImpl : IAppLoader {
App246Fix3::class.java,
App246Fix4::class.java,
App246Fix5::class.java,
App250Fix::class.java,
)
override fun onLoad(appParam: AppParam) {

@ -1,54 +0,0 @@
/*
* This file is part of FYReader.
* FYReader is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FYReader is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FYReader. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2020 - 2022 fengyuecanzhu
*/
package xyz.fycz.dynamic.fix
import me.fycz.maple.MapleBridge
import me.fycz.maple.MapleUtils
import me.fycz.maple.MethodReplacement
import xyz.fycz.myreader.model.third3.analyzeRule.JsExtensions
import java.text.SimpleDateFormat
import java.util.*
/**
* @author fengyue
* @date 2022/8/3 12:57
*/
@AppFix([243, 244, 245, 246, 250], ["修复书源时间格式化bug"], "2022-08-03")
class App250Fix : AppFixHandle {
override fun onFix(key: String): BooleanArray {
return handleFix(
key,
"timeFormat" to { fixTimeFormat() },
)
}
fun fixTimeFormat() {
MapleUtils.findAndHookMethod(
JsExtensions::class.java,
"timeFormat",
Long::class.java,
object : MethodReplacement() {
override fun replaceHookedMethod(param: MapleBridge.MethodHookParam): Any {
val time = param.args[0] as Long
return SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(Date(time))
}
}
)
}
}
Loading…
Cancel
Save