mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-24 18:42:09 +02:00
refactor
This commit is contained in:
parent
e7ccaf312e
commit
b1e3a350c0
@ -47,9 +47,9 @@ enum class ConfigProperty(
|
|||||||
ConfigStateListValue(
|
ConfigStateListValue(
|
||||||
listOf("snap", "chat", "typing"),
|
listOf("snap", "chat", "typing"),
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
"snap" to true,
|
"snap" to false,
|
||||||
"chat" to true,
|
"chat" to false,
|
||||||
"typing" to true
|
"typing" to false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -11,10 +11,6 @@ class MediaQualityLevelOverride : Feature("MediaQualityLevelOverride", loadParam
|
|||||||
override fun init() {
|
override fun init() {
|
||||||
val enumQualityLevel = context.mappings.getMappedClass("enums", "QualityLevel")
|
val enumQualityLevel = context.mappings.getMappedClass("enums", "QualityLevel")
|
||||||
|
|
||||||
Hooker.hookConstructor(context.androidContext.classLoader.loadClass("hfj"), HookStage.AFTER) {
|
|
||||||
Logger.log(it.thisObject())
|
|
||||||
}
|
|
||||||
|
|
||||||
Hooker.hook(context.mappings.getMappedClass("MediaQualityLevelProvider"),
|
Hooker.hook(context.mappings.getMappedClass("MediaQualityLevelProvider"),
|
||||||
context.mappings.getMappedValue("MediaQualityLevelProviderMethod"),
|
context.mappings.getMappedValue("MediaQualityLevelProviderMethod"),
|
||||||
HookStage.BEFORE,
|
HookStage.BEFORE,
|
||||||
|
@ -190,12 +190,12 @@ class Notifications : Feature("Notifications", loadParams = FeatureLoadParams.IN
|
|||||||
notificationDataQueue[messageId.toLong()] = notificationData
|
notificationDataQueue[messageId.toLong()] = notificationData
|
||||||
|
|
||||||
val callback = CallbackBuilder(fetchConversationWithMessagesCallback)
|
val callback = CallbackBuilder(fetchConversationWithMessagesCallback)
|
||||||
.override("onFetchConversationWithMessagesComplete") { param ->
|
.override("onFetchConversationWithMessagesComplete") { callbackParam ->
|
||||||
val messageList = (param.arg(1) as List<Any>).map { msg -> Message(msg) }
|
val messageList = (callbackParam.arg(1) as List<Any>).map { msg -> Message(msg) }
|
||||||
fetchMessagesResult(conversationId, messageList)
|
fetchMessagesResult(conversationId, messageList)
|
||||||
}
|
}
|
||||||
.override("onError") { param ->
|
.override("onError") {
|
||||||
Logger.xposedLog("Failed to fetch message ${param.arg(0) as Any}")
|
Logger.xposedLog("Failed to fetch message ${it.arg(0) as Any}")
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
fetchConversationWithMessagesMethod.invoke(conversationManager, SnapUUID.fromString(conversationId).instanceNonNull(), callback)
|
fetchConversationWithMessagesMethod.invoke(conversationManager, SnapUUID.fromString(conversationId).instanceNonNull(), callback)
|
||||||
|
@ -169,8 +169,8 @@ class FriendFeedInfoMenu : AbstractMenu() {
|
|||||||
switch.text = context.translation.get(text)
|
switch.text = context.translation.get(text)
|
||||||
switch.isChecked = isChecked()
|
switch.isChecked = isChecked()
|
||||||
applyTheme(viewModel, switch)
|
applyTheme(viewModel, switch)
|
||||||
switch.setOnCheckedChangeListener { _: CompoundButton?, isChecked: Boolean ->
|
switch.setOnCheckedChangeListener { _: CompoundButton?, checked: Boolean ->
|
||||||
toggle(isChecked)
|
toggle(checked)
|
||||||
}
|
}
|
||||||
viewConsumer(switch)
|
viewConsumer(switch)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user