mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 10:34:33 +02:00
minor improve
This commit is contained in:
parent
17a18b59b2
commit
070b5f13fd
@ -1,5 +1,6 @@
|
|||||||
package app.revanced.patches.music.layout.blacknavbar.patch
|
package app.revanced.patches.music.layout.blacknavbar.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
@ -37,24 +38,26 @@ class BlackNavbarPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val result = TabLayoutFingerprint.result!!
|
|
||||||
val method = result.mutableMethod
|
|
||||||
|
|
||||||
val startIndex = result.scanResult.patternScanResult!!.startIndex
|
TabLayoutFingerprint.result?.let {
|
||||||
val endIndex = result.scanResult.patternScanResult!!.endIndex
|
with (it.mutableMethod) {
|
||||||
|
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val insertIndex = endIndex + 1
|
val insertIndex = endIndex + 1
|
||||||
|
|
||||||
val dummyRegister = (method.instruction(startIndex) as Instruction31i).registerA
|
val dummyRegister = (instruction(startIndex) as Instruction31i).registerA
|
||||||
val targetRegister = (method.instruction(endIndex) as Instruction11x).registerA
|
val targetRegister = (instruction(endIndex) as Instruction11x).registerA
|
||||||
|
|
||||||
method.addInstructions(
|
addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
invoke-static {}, $MUSIC_SETTINGS_PATH->enableBlackNavbar()Z
|
invoke-static {}, $MUSIC_SETTINGS_PATH->enableBlackNavbar()Z
|
||||||
move-result v$dummyRegister
|
move-result v$dummyRegister
|
||||||
if-eqz v$dummyRegister, :default
|
if-eqz v$dummyRegister, :default
|
||||||
const/high16 v$targetRegister, -0x1000000
|
const/high16 v$targetRegister, -0x1000000
|
||||||
""", listOf(ExternalLabel("default", method.instruction(insertIndex)))
|
""", listOf(ExternalLabel("default", instruction(insertIndex)))
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
} ?: return TabLayoutFingerprint.toErrorResult()
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user