feat(twitch): 15.4.1 support (#2462)

This commit is contained in:
LisoUseInAIKyrios
2023-06-21 22:04:00 +04:00
committed by GitHub
parent 36e08dbe46
commit ed28862733
16 changed files with 52 additions and 91 deletions
@@ -1,10 +1,9 @@
package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsDebugConfigEnabledFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
}
)
@@ -1,10 +1,9 @@
package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsOmVerificationEnabledFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
}
)
@@ -1,10 +1,9 @@
package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ShouldShowDebugOptionsFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
}
)
@@ -1,5 +1,6 @@
package app.revanced.patches.twitch.debug.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
@@ -38,18 +39,16 @@ class DebugModePatch : BytecodePatch(
IsOmVerificationEnabledFingerprint,
ShouldShowDebugOptionsFingerprint
).forEach {
with(it.result!!) {
with(mutableMethod) {
addInstructions(
0,
"""
invoke-static {}, Lapp/revanced/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z
move-result v0
return v0
"""
)
}
}
it.result?.mutableMethod?.apply {
addInstructions(
0,
"""
invoke-static {}, Lapp/revanced/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z
move-result v0
return v0
"""
)
} ?: return it.toErrorResult()
}
SettingsPatch.PreferenceScreen.MISC.OTHER.addPreferences(