mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 13:47:42 +02:00
fix(Reddit/Settings): patch option RVX settings menu name
does not apply to header in ReVanced Extended settings
This commit is contained in:
@ -33,14 +33,27 @@ object SettingsBytecodePatch : BytecodePatch(
|
|||||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||||
"$INTEGRATIONS_PATH/settings/ActivityHook;->initialize(Landroid/app/Activity;)V"
|
"$INTEGRATIONS_PATH/settings/ActivityHook;->initialize(Landroid/app/Activity;)V"
|
||||||
|
|
||||||
|
private lateinit var acknowledgementsLabelBuilderMethod: MutableMethod
|
||||||
private lateinit var settingsStatusLoadMethod: MutableMethod
|
private lateinit var settingsStatusLoadMethod: MutableMethod
|
||||||
|
|
||||||
internal fun updateSettingsStatus(description: String) {
|
internal fun updateSettingsLabel(label: String) =
|
||||||
|
acknowledgementsLabelBuilderMethod.apply {
|
||||||
|
val insertIndex =
|
||||||
|
getWideLiteralInstructionIndex(LabelAcknowledgements) + 3
|
||||||
|
val insertRegister =
|
||||||
|
getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
|
||||||
|
|
||||||
|
addInstruction(
|
||||||
|
insertIndex,
|
||||||
|
"const-string v$insertRegister, \"$label\""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun updateSettingsStatus(description: String) =
|
||||||
settingsStatusLoadMethod.addInstruction(
|
settingsStatusLoadMethod.addInstruction(
|
||||||
0,
|
0,
|
||||||
"invoke-static {}, $INTEGRATIONS_PATH/settings/SettingsStatus;->$description()V"
|
"invoke-static {}, $INTEGRATIONS_PATH/settings/SettingsStatus;->$description()V"
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
@ -62,19 +75,9 @@ object SettingsBytecodePatch : BytecodePatch(
|
|||||||
/**
|
/**
|
||||||
* Replace settings label
|
* Replace settings label
|
||||||
*/
|
*/
|
||||||
AcknowledgementsLabelBuilderFingerprint.resultOrThrow().let {
|
acknowledgementsLabelBuilderMethod = AcknowledgementsLabelBuilderFingerprint
|
||||||
it.mutableMethod.apply {
|
.resultOrThrow()
|
||||||
val insertIndex =
|
.mutableMethod
|
||||||
getWideLiteralInstructionIndex(LabelAcknowledgements) + 3
|
|
||||||
val insertRegister =
|
|
||||||
getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
|
|
||||||
|
|
||||||
addInstruction(
|
|
||||||
insertIndex,
|
|
||||||
"const-string v$insertRegister, \"ReVanced Extended\""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize settings activity
|
* Initialize settings activity
|
||||||
|
@ -54,5 +54,7 @@ object SettingsPatch : BaseResourcePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsBytecodePatch.updateSettingsLabel(settingsLabel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user