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