|
|
@ -7,6 +7,7 @@ import me.fycz.maple.MapleBridge |
|
|
|
import me.fycz.maple.MapleUtils |
|
|
|
import me.fycz.maple.MapleUtils |
|
|
|
import me.fycz.maple.MethodHook |
|
|
|
import me.fycz.maple.MethodHook |
|
|
|
import xyz.fycz.myreader.application.App |
|
|
|
import xyz.fycz.myreader.application.App |
|
|
|
|
|
|
|
import xyz.fycz.myreader.ui.activity.MainActivity |
|
|
|
import xyz.fycz.myreader.util.utils.AdUtils |
|
|
|
import xyz.fycz.myreader.util.utils.AdUtils |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -20,8 +21,11 @@ class AppLoadImpl : IAppLoader { |
|
|
|
override fun onLoad(appParam: AppParam) { |
|
|
|
override fun onLoad(appParam: AppParam) { |
|
|
|
if (App.getVersionCode() == 243) { |
|
|
|
if (App.getVersionCode() == 243) { |
|
|
|
val key = "2022-03-31" |
|
|
|
val key = "2022-03-31" |
|
|
|
|
|
|
|
var fx1 = false |
|
|
|
|
|
|
|
var fx2 = false |
|
|
|
try { |
|
|
|
try { |
|
|
|
App243Fix.fixGetAllNoLocalSource() |
|
|
|
App243Fix.fixGetAllNoLocalSource() |
|
|
|
|
|
|
|
fx1 = true |
|
|
|
fixResult(key, "getAllNoLocalSource", true) |
|
|
|
fixResult(key, "getAllNoLocalSource", true) |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
MapleUtils.log(e) |
|
|
|
MapleUtils.log(e) |
|
|
@ -29,19 +33,22 @@ class AppLoadImpl : IAppLoader { |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
App243Fix.fixAdTimeout() |
|
|
|
App243Fix.fixAdTimeout() |
|
|
|
|
|
|
|
fx2 = true |
|
|
|
fixResult(key, "adTimeout", true) |
|
|
|
fixResult(key, "adTimeout", true) |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
MapleUtils.log(e) |
|
|
|
MapleUtils.log(e) |
|
|
|
fixResult(key, "adTimeout", false) |
|
|
|
fixResult(key, "adTimeout", false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val msg = "$key\n更新内容:\n1、修复软件无法打开的问题(超时时间为5s):$fx1\n" + |
|
|
|
|
|
|
|
"2、修复DIY书源重复显示订阅书源的问题:$fx2" |
|
|
|
|
|
|
|
announce("插件更新", msg, key) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun announce(appParam: AppParam, title: String, msg: String, key: String) { |
|
|
|
private fun announce(title: String, msg: String, key: String) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
MapleUtils.findAndHookMethod( |
|
|
|
MapleUtils.findAndHookMethod( |
|
|
|
"xyz.fycz.myreader.ui.activity.MainActivity", |
|
|
|
MainActivity::class.java, |
|
|
|
appParam.classLoader, |
|
|
|
|
|
|
|
"onCreate", |
|
|
|
"onCreate", |
|
|
|
Bundle::class.java, |
|
|
|
Bundle::class.java, |
|
|
|
object : MethodHook() { |
|
|
|
object : MethodHook() { |
|
|
@ -52,14 +59,13 @@ class AppLoadImpl : IAppLoader { |
|
|
|
AlertDialog.Builder(context) |
|
|
|
AlertDialog.Builder(context) |
|
|
|
.setTitle(title) |
|
|
|
.setTitle(title) |
|
|
|
.setMessage(msg) |
|
|
|
.setMessage(msg) |
|
|
|
.setPositiveButton("我知道了") { _, _ -> |
|
|
|
.setPositiveButton("我知道了", null) |
|
|
|
|
|
|
|
.create().show() |
|
|
|
}.create().show() |
|
|
|
|
|
|
|
spu.edit().run { |
|
|
|
spu.edit().run { |
|
|
|
putBoolean(key, true) |
|
|
|
putBoolean(key, true) |
|
|
|
apply() |
|
|
|
apply() |
|
|
|
} |
|
|
|
} |
|
|
|
AdUtils.adRecord("plugin", "adSuccess") |
|
|
|
AdUtils.adRecord("plugin", "fxRecord") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|