mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 13:20:19 +02:00
fix(enable-black-navbar): cannot switch off when amoled
patch is included
This commit is contained in:
parent
c93e3ce789
commit
59d465a8ef
@ -12,7 +12,6 @@ import app.revanced.patcher.patch.PatchResult
|
|||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
|
||||||
import app.revanced.patches.music.layout.blacknavbar.fingerprints.TabLayoutFingerprint
|
import app.revanced.patches.music.layout.blacknavbar.fingerprints.TabLayoutFingerprint
|
||||||
import app.revanced.patches.music.misc.resourceid.patch.SharedResourceIdPatch
|
import app.revanced.patches.music.misc.resourceid.patch.SharedResourceIdPatch
|
||||||
import app.revanced.patches.music.misc.settings.resource.patch.MusicSettingsPatch
|
import app.revanced.patches.music.misc.settings.resource.patch.MusicSettingsPatch
|
||||||
@ -20,7 +19,6 @@ import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
|
|||||||
import app.revanced.util.enum.CategoryType
|
import app.revanced.util.enum.CategoryType
|
||||||
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
|
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("enable-black-navbar")
|
@Name("enable-black-navbar")
|
||||||
@ -42,20 +40,16 @@ class BlackNavbarPatch : BytecodePatch(
|
|||||||
|
|
||||||
TabLayoutFingerprint.result?.let {
|
TabLayoutFingerprint.result?.let {
|
||||||
with (it.mutableMethod) {
|
with (it.mutableMethod) {
|
||||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
|
||||||
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val insertIndex = endIndex + 1
|
val insertIndex = endIndex + 1
|
||||||
|
|
||||||
val dummyRegister = (instruction(startIndex) as Instruction31i).registerA
|
|
||||||
val targetRegister = (instruction(endIndex) as Instruction11x).registerA
|
val targetRegister = (instruction(endIndex) as Instruction11x).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
invoke-static {}, $MUSIC_LAYOUT->enableBlackNavbar()Z
|
invoke-static {}, $MUSIC_LAYOUT->enableBlackNavbar()I
|
||||||
move-result v$dummyRegister
|
move-result v$targetRegister
|
||||||
if-eqz v$dummyRegister, :default
|
"""
|
||||||
const/high16 v$targetRegister, -0x1000000
|
|
||||||
""", listOf(ExternalLabel("default", instruction(insertIndex)))
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return TabLayoutFingerprint.toErrorResult()
|
} ?: return TabLayoutFingerprint.toErrorResult()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user