mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-03 16:14:28 +02:00
feat(music) add hide-tooltip-content
patch
This commit is contained in:
parent
45fcce50c8
commit
2d9daa0518
@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.music.general.tooltip.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.ToolTipContentView
|
||||||
|
import app.revanced.util.bytecode.isWideLiteralExists
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object TooltipContentViewFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("L"),
|
||||||
|
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ToolTipContentView) }
|
||||||
|
)
|
@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.music.general.tooltip.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.music.general.tooltip.fingerprints.TooltipContentViewFingerprint
|
||||||
|
import app.revanced.patches.music.utils.annotations.MusicCompatibility
|
||||||
|
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("Hide tooltip content")
|
||||||
|
@Description("Hides the tooltip box that appears on first install.")
|
||||||
|
@DependsOn([SharedResourceIdPatch::class])
|
||||||
|
@MusicCompatibility
|
||||||
|
class TooltipContentViewPatch : BytecodePatch(
|
||||||
|
listOf(TooltipContentViewFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
|
TooltipContentViewFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
|
0,
|
||||||
|
"return-void"
|
||||||
|
) ?: throw TooltipContentViewFingerprint.exception
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -26,6 +26,7 @@ class SharedResourceIdPatch : ResourcePatch {
|
|||||||
var PrivacyTosFooter: Long = -1
|
var PrivacyTosFooter: Long = -1
|
||||||
var QualityTitle: Long = -1
|
var QualityTitle: Long = -1
|
||||||
var Text1: Long = -1
|
var Text1: Long = -1
|
||||||
|
var ToolTipContentView: Long = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: ResourceContext) {
|
override fun execute(context: ResourceContext) {
|
||||||
@ -44,6 +45,7 @@ class SharedResourceIdPatch : ResourcePatch {
|
|||||||
PrivacyTosFooter = find(ID, "privacy_tos_footer")
|
PrivacyTosFooter = find(ID, "privacy_tos_footer")
|
||||||
QualityTitle = find(STRING, "quality_title")
|
QualityTitle = find(STRING, "quality_title")
|
||||||
Text1 = find(ID, "text1")
|
Text1 = find(ID, "text1")
|
||||||
|
ToolTipContentView = find(LAYOUT, "tooltip_content_view")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user