|
|
@ -22,13 +22,13 @@ import android.app.AlertDialog |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import android.content.SharedPreferences |
|
|
|
import android.content.SharedPreferences |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
|
|
|
|
import android.util.Log |
|
|
|
import me.fycz.maple.MapleBridge |
|
|
|
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.dynamic.fix.App243Fix |
|
|
|
import xyz.fycz.dynamic.fix.App243Fix |
|
|
|
import xyz.fycz.dynamic.fix.App244Fix |
|
|
|
import xyz.fycz.dynamic.fix.App244Fix |
|
|
|
import xyz.fycz.dynamic.fix.AppFix |
|
|
|
import xyz.fycz.dynamic.fix.AppFix |
|
|
|
import xyz.fycz.dynamic.fix.AppFixHandle |
|
|
|
|
|
|
|
import xyz.fycz.myreader.application.App |
|
|
|
import xyz.fycz.myreader.application.App |
|
|
|
import xyz.fycz.myreader.ui.activity.MainActivity |
|
|
|
import xyz.fycz.myreader.ui.activity.MainActivity |
|
|
|
import xyz.fycz.myreader.util.utils.AdUtils |
|
|
|
import xyz.fycz.myreader.util.utils.AdUtils |
|
|
@ -52,27 +52,30 @@ class AppLoadImpl : IAppLoader { |
|
|
|
|
|
|
|
|
|
|
|
override fun onLoad(appParam: AppParam) { |
|
|
|
override fun onLoad(appParam: AppParam) { |
|
|
|
val sb = StringBuilder() |
|
|
|
val sb = StringBuilder() |
|
|
|
var index = 1 |
|
|
|
|
|
|
|
fixList.forEach { |
|
|
|
fixList.forEach { |
|
|
|
val annotation = it.getAnnotation(AppFix::class.java)!! |
|
|
|
val annotation = it.getAnnotation(AppFix::class.java)!! |
|
|
|
annotation.version.forEach { version -> |
|
|
|
for (version in annotation.versions){ |
|
|
|
if (App.getVersionCode() == version) { |
|
|
|
if (App.getVersionCode() == version) { |
|
|
|
val fix = it.newInstance() |
|
|
|
val fix = it.newInstance() |
|
|
|
val fixResult = fix.onFix(annotation.date) |
|
|
|
val fixResult = fix.onFix(annotation.date) |
|
|
|
if (!spu.getBoolean(annotation.date, false)) { |
|
|
|
if (!spu.getBoolean(annotation.date, false)) { |
|
|
|
|
|
|
|
if (sb.isNotEmpty()) sb.append("\n") |
|
|
|
|
|
|
|
sb.append("${annotation.date}\n") |
|
|
|
fixResult.forEachIndexed { i, b -> |
|
|
|
fixResult.forEachIndexed { i, b -> |
|
|
|
sb.append("${index++}、${annotation.fixLog[i]}:${if (b) "成功" else "失败"}\n") |
|
|
|
sb.append("${i+1}、${annotation.fixLog[i]}:${if (b) "成功" else "失败"}\n") |
|
|
|
} |
|
|
|
} |
|
|
|
spu.edit().run { |
|
|
|
spu.edit().run { |
|
|
|
putBoolean(annotation.date, true) |
|
|
|
putBoolean(annotation.date, true) |
|
|
|
apply() |
|
|
|
apply() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (sb.lastIndexOf("\n") > 0) sb.substring(0, sb.length - 1) |
|
|
|
if (sb.isNotEmpty()) sb.substring(0, sb.length - 1) |
|
|
|
announce("插件更新", "2022-04-25更新内容:\n$sb", "fix244") |
|
|
|
Log.i(spuName, "更新内容:$sb") |
|
|
|
|
|
|
|
announce("插件更新", "更新内容:\n$sb", "fix244") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun announce(title: String, msg: String, key: String) { |
|
|
|
private fun announce(title: String, msg: String, key: String) { |
|
|
@ -95,7 +98,6 @@ class AppLoadImpl : IAppLoader { |
|
|
|
putBoolean(key, true) |
|
|
|
putBoolean(key, true) |
|
|
|
apply() |
|
|
|
apply() |
|
|
|
} |
|
|
|
} |
|
|
|
AdUtils.adRecord("plugin", "fxRecord") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|