mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 05:12:17 +00:00
Compare commits
2 Commits
c014e85faa
...
df02f9f872
Author | SHA1 | Date | |
---|---|---|---|
df02f9f872 | |||
5cbb695a66 |
@ -14,7 +14,10 @@ import moe.fuqiuluo.shamrock.tools.toast
|
|||||||
import moe.fuqiuluo.shamrock.xposed.helper.AppTalker
|
import moe.fuqiuluo.shamrock.xposed.helper.AppTalker
|
||||||
import mqq.app.MobileQQ
|
import mqq.app.MobileQQ
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.util.Calendar
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
import java.util.Timer
|
||||||
|
import java.util.TimerTask
|
||||||
|
|
||||||
internal enum class Level(
|
internal enum class Level(
|
||||||
val id: Byte
|
val id: Byte
|
||||||
@ -31,7 +34,29 @@ internal object LogCenter {
|
|||||||
// 格式化时间
|
// 格式化时间
|
||||||
SimpleDateFormat("yyyy-MM-dd").format(Date())
|
SimpleDateFormat("yyyy-MM-dd").format(Date())
|
||||||
}_"
|
}_"
|
||||||
private val LogFile = MobileQQ.getContext().getExternalFilesDir(null)!!
|
private var LogFile = generateLogFile()
|
||||||
|
|
||||||
|
private val format = SimpleDateFormat("[HH:mm:ss] ")
|
||||||
|
private val timer = Timer()
|
||||||
|
|
||||||
|
init {
|
||||||
|
val now = Calendar.getInstance()
|
||||||
|
val tomorrowMidnight = Calendar.getInstance().apply {
|
||||||
|
add(Calendar.DAY_OF_YEAR, 1)
|
||||||
|
set(Calendar.HOUR_OF_DAY, 0)
|
||||||
|
set(Calendar.MINUTE, 0)
|
||||||
|
set(Calendar.SECOND, 0)
|
||||||
|
set(Calendar.MILLISECOND, 0)
|
||||||
|
}
|
||||||
|
val delay = tomorrowMidnight.timeInMillis - now.timeInMillis
|
||||||
|
timer.scheduleAtFixedRate(object : TimerTask() {
|
||||||
|
override fun run() {
|
||||||
|
LogFile = generateLogFile()
|
||||||
|
}
|
||||||
|
}, delay, 24 * 60 * 60 * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateLogFile() = MobileQQ.getContext().getExternalFilesDir(null)!!
|
||||||
.parentFile!!.resolve("Tencent/Shamrock/log").also {
|
.parentFile!!.resolve("Tencent/Shamrock/log").also {
|
||||||
if (it.exists()) it.delete()
|
if (it.exists()) it.delete()
|
||||||
it.mkdirs()
|
it.mkdirs()
|
||||||
@ -49,8 +74,6 @@ internal object LogCenter {
|
|||||||
return@let result
|
return@let result
|
||||||
}
|
}
|
||||||
|
|
||||||
private val format = SimpleDateFormat("[HH:mm:ss] ")
|
|
||||||
|
|
||||||
fun log(string: String, level: Level = Level.INFO, toast: Boolean = false) {
|
fun log(string: String, level: Level = Level.INFO, toast: Boolean = false) {
|
||||||
if (!ShamrockConfig[DebugMode] && level == Level.DEBUG) {
|
if (!ShamrockConfig[DebugMode] && level == Level.DEBUG) {
|
||||||
return
|
return
|
||||||
|
@ -39,7 +39,7 @@ class AntiDetection: IAction {
|
|||||||
if (ShamrockConfig[AntiJvmTrace])
|
if (ShamrockConfig[AntiJvmTrace])
|
||||||
antiTrace()
|
antiTrace()
|
||||||
antiMemoryWalking()
|
antiMemoryWalking()
|
||||||
antiO3Report()
|
//antiO3Report()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun antiO3Report() {
|
private fun antiO3Report() {
|
||||||
|
@ -9,11 +9,13 @@ import qq.service.QQInterfaces
|
|||||||
|
|
||||||
object SwitchStatus: IInteract, QQInterfaces() {
|
object SwitchStatus: IInteract, QQInterfaces() {
|
||||||
override fun invoke(intent: Intent) {
|
override fun invoke(intent: Intent) {
|
||||||
AppTalker.talk("switch_status") {
|
if (app.isLogin) {
|
||||||
put("account", app.currentAccountUin)
|
AppTalker.talk("switch_status") {
|
||||||
put("nickname", if (app is QQAppInterface) app.currentNickname else "unknown")
|
put("account", app.currentAccountUin)
|
||||||
put("voice", NativeLoader.isVoiceLoaded)
|
put("nickname", if (app is QQAppInterface) (app.currentNickname ?: "unknown") else "unknown")
|
||||||
put("core_version", ShamrockVersion)
|
put("voice", NativeLoader.isVoiceLoaded)
|
||||||
|
put("core_version", ShamrockVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user