fix: Revert previous release

The previous release depends on a version of ReVanced Patcher which prevents usage of resource patches on lower Android versions. To solve this issue temporarily, until a fix is present, the previous release is reverted.
This commit is contained in:
oSumAtrIX
2023-08-27 04:37:21 +02:00
parent ce2e46a7cb
commit 3938f2f1b3
496 changed files with 2551 additions and 2425 deletions
@@ -0,0 +1,8 @@
package app.revanced.patches.twitch.misc.integrations.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app")])
@Target(AnnotationTarget.CLASS)
internal annotation class IntegrationsCompatibility
@@ -1,9 +1,11 @@
package app.revanced.patches.twitch.misc.integrations.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patches.twitch.misc.integrations.annotations.IntegrationsCompatibility
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint
@Name("Init fingerprint")
@IntegrationsCompatibility
object InitFingerprint : IntegrationsFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/TwitchApplication;") &&
@@ -3,9 +3,11 @@ package app.revanced.patches.twitch.misc.integrations.patch
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch
import app.revanced.patches.twitch.misc.integrations.annotations.IntegrationsCompatibility
import app.revanced.patches.twitch.misc.integrations.fingerprints.InitFingerprint
@Name("Integrations")
@IntegrationsCompatibility
@RequiresIntegrations
class IntegrationsPatch : AbstractIntegrationsPatch(
"Lapp/revanced/twitch/utils/ReVancedUtils;",
@@ -1,6 +1,6 @@
package app.revanced.patches.twitch.misc.settings.bytecode.patch
import app.revanced.extensions.exception
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -10,6 +10,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
@@ -24,8 +26,8 @@ import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsUpdatedF
import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsActivityOnCreateFingerprint
import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsMenuItemEnumFingerprint
import app.revanced.patches.twitch.misc.settings.resource.patch.SettingsResourcePatch
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.immutable.ImmutableField
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.immutable.ImmutableField
import java.io.Closeable
@Patch
@@ -41,7 +43,7 @@ class SettingsPatch : BytecodePatch(
MenuGroupsOnClickFingerprint
)
), Closeable {
override fun execute(context: BytecodeContext) {
override fun execute(context: BytecodeContext): PatchResult {
// Hook onCreate to handle fragment creation
SettingsActivityOnCreateFingerprint.result?.apply {
val insertIndex = mutableMethod.implementation!!.instructions.size - 2
@@ -55,7 +57,7 @@ class SettingsPatch : BytecodePatch(
""",
ExternalLabel("no_rv_settings_init", mutableMethod.getInstruction(insertIndex))
)
} ?: throw SettingsActivityOnCreateFingerprint.exception
} ?: return SettingsActivityOnCreateFingerprint.toErrorResult()
// Create new menu item for settings menu
SettingsMenuItemEnumFingerprint.result?.apply {
@@ -65,7 +67,7 @@ class SettingsPatch : BytecodePatch(
REVANCED_SETTINGS_MENU_ITEM_TITLE_RES,
REVANCED_SETTINGS_MENU_ITEM_ICON_RES
)
} ?: throw SettingsMenuItemEnumFingerprint.exception
} ?: return SettingsMenuItemEnumFingerprint.toErrorResult()
// Intercept settings menu creation and add new menu item
MenuGroupsUpdatedFingerprint.result?.apply {
@@ -77,7 +79,7 @@ class SettingsPatch : BytecodePatch(
move-result-object p1
"""
)
} ?: throw MenuGroupsUpdatedFingerprint.exception
} ?: return MenuGroupsUpdatedFingerprint.toErrorResult()
// Intercept onclick events for the settings menu
MenuGroupsOnClickFingerprint.result?.apply {
@@ -94,12 +96,14 @@ class SettingsPatch : BytecodePatch(
""",
ExternalLabel("no_rv_settings_onclick", mutableMethod.getInstruction(insertIndex))
)
} ?: throw MenuGroupsOnClickFingerprint.exception
} ?: return MenuGroupsOnClickFingerprint.toErrorResult()
addString("revanced_settings", "ReVanced Settings", false)
addString("revanced_reboot_message", "Twitch needs to restart to apply your changes. Restart now?", false)
addString("revanced_reboot", "Restart", false)
addString("revanced_cancel", "Cancel", false)
return PatchResultSuccess()
}
internal companion object {
@@ -2,7 +2,7 @@ package app.revanced.patches.twitch.misc.settings.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import org.jf.dexlib2.AccessFlags
object MenuGroupsOnClickFingerprint : MethodFingerprint(
"V",