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
@@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.interaction.downloads.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 ACLCommonShareFingerprint : MethodFingerprint(
"I",
@@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.tiktok.interaction.downloads.annotations.DownloadsCompatibility
import com.android.tools.smali.dexlib2.AccessFlags
import org.jf.dexlib2.AccessFlags
@Name("Acl common share get show type")
@DownloadsCompatibility
@@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.tiktok.interaction.downloads.annotations.DownloadsCompatibility
import com.android.tools.smali.dexlib2.AccessFlags
import org.jf.dexlib2.AccessFlags
@Name("Acl common share get transcode")
@DownloadsCompatibility
@@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.interaction.downloads.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 DownloadPathParentFingerprint : MethodFingerprint(
"V",
@@ -3,13 +3,16 @@ package app.revanced.patches.tiktok.interaction.downloads.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
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.MutableMethod
@@ -21,10 +24,10 @@ import app.revanced.patches.tiktok.interaction.downloads.fingerprints.DownloadPa
import app.revanced.patches.tiktok.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import app.revanced.patches.tiktok.misc.settings.patch.SettingsPatch
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.StringReference
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@@ -40,7 +43,7 @@ class DownloadsPatch : BytecodePatch(
SettingsStatusLoadFingerprint
)
) {
override fun execute(context: BytecodeContext) {
override fun execute(context: BytecodeContext): PatchResult {
val method1 = ACLCommonShareFingerprint.result!!.mutableMethod
method1.replaceInstructions(
0,
@@ -86,7 +89,7 @@ class DownloadsPatch : BytecodePatch(
targetOffset = index + 1
break
}
if (targetOffset == -1) throw PatchException("Can not find download path uri method.")
if (targetOffset == -1) return PatchResultError("Can not find download path uri method.")
//Change videos' download path.
val downloadUriMethod = context
.toMethodWalker(DownloadPathParentFingerprint.result!!.method)
@@ -122,5 +125,6 @@ class DownloadsPatch : BytecodePatch(
0,
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableDownload()V"
)
return PatchResultSuccess()
}
}
@@ -1,9 +0,0 @@
package app.revanced.patches.tiktok.interaction.seekbar.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ShouldShowSeekBarFingerprint : MethodFingerprint(
strings = listOf(
"can not show seekbar, state: 1, not in resume"
),
)
@@ -1,15 +1,18 @@
package app.revanced.patches.tiktok.interaction.seekbar.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
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.tiktok.interaction.seekbar.annotations.ShowSeekbarCompatibility
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.SetSeekBarShowTypeFingerprint
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.ShouldShowSeekBarFingerprint
import org.jf.dexlib2.iface.instruction.formats.Instruction22t
@Patch
@Name("Show seekbar")
@@ -18,21 +21,11 @@ import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.ShouldShowSe
class ShowSeekbarPatch : BytecodePatch(
listOf(
SetSeekBarShowTypeFingerprint,
ShouldShowSeekBarFingerprint,
)
) {
override fun execute(context: BytecodeContext) {
ShouldShowSeekBarFingerprint.result?.mutableMethod?.apply {
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
)
}
override fun execute(context: BytecodeContext): PatchResult {
SetSeekBarShowTypeFingerprint.result?.mutableMethod?.apply {
val typeRegister = implementation!!.registerCount - 1
val typeRegister = getInstruction<Instruction22t>(1).registerB
addInstructions(
0,
@@ -40,7 +33,8 @@ class ShowSeekbarPatch : BytecodePatch(
const/16 v$typeRegister, 0x64
"""
)
} ?: throw SetSeekBarShowTypeFingerprint.exception
} ?: return SetSeekBarShowTypeFingerprint.toErrorResult()
return PatchResultSuccess()
}
}
@@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.interaction.speed.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 SpeedControlParentFingerprint : MethodFingerprint(
returnType = "L",
@@ -3,13 +3,16 @@ package app.revanced.patches.tiktok.interaction.speed.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.tiktok.interaction.speed.annotations.PlaybackSpeedCompatibility
import app.revanced.patches.tiktok.interaction.speed.fingerprints.SpeedControlParentFingerprint
import com.android.tools.smali.dexlib2.Opcode
import org.jf.dexlib2.Opcode
@Patch
@Name("Playback speed")
@@ -20,7 +23,7 @@ class PlaybackSpeedPatch : BytecodePatch(
SpeedControlParentFingerprint
)
) {
override fun execute(context: BytecodeContext) {
override fun execute(context: BytecodeContext): PatchResult {
val parentMethod = SpeedControlParentFingerprint.result!!.mutableMethod
val parentMethodInstructions = parentMethod.implementation!!.instructions
for ((index, instruction) in parentMethodInstructions.withIndex()) {
@@ -38,5 +41,6 @@ class PlaybackSpeedPatch : BytecodePatch(
)
break
}
return PatchResultSuccess()
}
}