@ -5,17 +5,15 @@ 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.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.tiktok.ad.annotations.HideAdsCompatibility
|
||||
import app.revanced.patches.tiktok.ad.fingerprints.ConvertHelpFeedItemListFingerprint
|
||||
import app.revanced.patches.tiktok.ad.fingerprints.FeedItemListCloneFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Patch
|
||||
@Name("Hide ads")
|
||||
@ -27,7 +25,7 @@ class HideAdsPatch : BytecodePatch(
|
||||
ConvertHelpFeedItemListFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
listOf(
|
||||
FeedItemListCloneFingerprint,
|
||||
ConvertHelpFeedItemListFingerprint
|
||||
@ -48,8 +46,7 @@ class HideAdsPatch : BytecodePatch(
|
||||
)
|
||||
return@forEach
|
||||
}
|
||||
return PatchResultError("Can not find required instruction.")
|
||||
throw PatchException("Can not find required instruction.")
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.feedfilter.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object FeedApiServiceLIZFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC,
|
||||
|
@ -5,8 +5,6 @@ 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.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.tiktok.feedfilter.annotations.FeedFilterCompatibility
|
||||
@ -14,8 +12,8 @@ import app.revanced.patches.tiktok.feedfilter.fingerprints.FeedApiServiceLIZFing
|
||||
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 org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@ -28,7 +26,7 @@ class FeedFilterPatch : BytecodePatch(
|
||||
SettingsStatusLoadFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
val method = FeedApiServiceLIZFingerprint.result!!.mutableMethod
|
||||
for ((index, instruction) in method.implementation!!.instructions.withIndex()) {
|
||||
if (instruction.opcode != Opcode.RETURN_OBJECT) continue
|
||||
@ -44,6 +42,5 @@ class FeedFilterPatch : BytecodePatch(
|
||||
0,
|
||||
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableFeedFilter()V"
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
@ -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 org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.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 org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.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 org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.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 org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object DownloadPathParentFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
|
@ -3,16 +3,13 @@ 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.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
@ -24,10 +21,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 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
|
||||
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
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@ -43,7 +40,7 @@ class DownloadsPatch : BytecodePatch(
|
||||
SettingsStatusLoadFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
val method1 = ACLCommonShareFingerprint.result!!.mutableMethod
|
||||
method1.replaceInstructions(
|
||||
0,
|
||||
@ -89,7 +86,7 @@ class DownloadsPatch : BytecodePatch(
|
||||
targetOffset = index + 1
|
||||
break
|
||||
}
|
||||
if (targetOffset == -1) return PatchResultError("Can not find download path uri method.")
|
||||
if (targetOffset == -1) throw PatchException("Can not find download path uri method.")
|
||||
//Change videos' download path.
|
||||
val downloadUriMethod = context
|
||||
.toMethodWalker(DownloadPathParentFingerprint.result!!.method)
|
||||
@ -125,6 +122,5 @@ class DownloadsPatch : BytecodePatch(
|
||||
0,
|
||||
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableDownload()V"
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
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,18 +1,15 @@
|
||||
package app.revanced.patches.tiktok.interaction.seekbar.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
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.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 org.jf.dexlib2.iface.instruction.formats.Instruction22t
|
||||
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.ShouldShowSeekBarFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("Show seekbar")
|
||||
@ -21,11 +18,21 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction22t
|
||||
class ShowSeekbarPatch : BytecodePatch(
|
||||
listOf(
|
||||
SetSeekBarShowTypeFingerprint,
|
||||
ShouldShowSeekBarFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
ShouldShowSeekBarFingerprint.result?.mutableMethod?.apply {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
SetSeekBarShowTypeFingerprint.result?.mutableMethod?.apply {
|
||||
val typeRegister = getInstruction<Instruction22t>(1).registerB
|
||||
val typeRegister = implementation!!.registerCount - 1
|
||||
|
||||
addInstructions(
|
||||
0,
|
||||
@ -33,8 +40,7 @@ class ShowSeekbarPatch : BytecodePatch(
|
||||
const/16 v$typeRegister, 0x64
|
||||
"""
|
||||
)
|
||||
} ?: return SetSeekBarShowTypeFingerprint.toErrorResult()
|
||||
return PatchResultSuccess()
|
||||
} ?: throw SetSeekBarShowTypeFingerprint.exception
|
||||
}
|
||||
|
||||
}
|
@ -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 org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object SpeedControlParentFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
|
@ -3,16 +3,13 @@ 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 org.jf.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
@Patch
|
||||
@Name("Playback speed")
|
||||
@ -23,7 +20,7 @@ class PlaybackSpeedPatch : BytecodePatch(
|
||||
SpeedControlParentFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
val parentMethod = SpeedControlParentFingerprint.result!!.mutableMethod
|
||||
val parentMethodInstructions = parentMethod.implementation!!.instructions
|
||||
for ((index, instruction) in parentMethodInstructions.withIndex()) {
|
||||
@ -41,6 +38,5 @@ class PlaybackSpeedPatch : BytecodePatch(
|
||||
)
|
||||
break
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.tiktok.misc.integrations.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.ss.android.ugc.trill"),
|
||||
Package("com.zhiliaoapp.musically")
|
||||
]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class IntegrationsCompatibility
|
@ -3,11 +3,9 @@ package app.revanced.patches.tiktok.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.tiktok.misc.integrations.annotations.IntegrationsCompatibility
|
||||
import app.revanced.patches.tiktok.misc.integrations.fingerprints.InitFingerprint
|
||||
|
||||
@Name("Integrations")
|
||||
@IntegrationsCompatibility
|
||||
@RequiresIntegrations
|
||||
class IntegrationsPatch : AbstractIntegrationsPatch(
|
||||
"Lapp/revanced/tiktok/utils/ReVancedUtils;",
|
||||
|
@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
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.patches.tiktok.misc.login.disablerequirement.annotations.DisableLoginRequirementCompatibility
|
||||
import app.revanced.patches.tiktok.misc.login.disablerequirement.fingerprints.MandatoryLoginServiceFingerprint
|
||||
@ -22,7 +20,7 @@ class DisableLoginRequirementPatch : BytecodePatch(
|
||||
MandatoryLoginServiceFingerprint2
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
listOf(
|
||||
MandatoryLoginServiceFingerprint,
|
||||
MandatoryLoginServiceFingerprint2
|
||||
@ -36,6 +34,5 @@ class DisableLoginRequirementPatch : BytecodePatch(
|
||||
"""
|
||||
)
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.misc.login.fixgoogle.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object GoogleAuthAvailableFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
|
@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.misc.login.fixgoogle.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object GoogleOneTapAuthAvailableFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
|
@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
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.patches.tiktok.misc.login.fixgoogle.annotations.FixGoogleLoginCompatibility
|
||||
import app.revanced.patches.tiktok.misc.login.fixgoogle.fingerprints.GoogleAuthAvailableFingerprint
|
||||
@ -22,7 +20,7 @@ class FixGoogleLoginPatch : BytecodePatch(
|
||||
GoogleAuthAvailableFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
listOf(
|
||||
GoogleOneTapAuthAvailableFingerprint,
|
||||
GoogleAuthAvailableFingerprint
|
||||
@ -37,6 +35,5 @@ class FixGoogleLoginPatch : BytecodePatch(
|
||||
)
|
||||
}
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object AddSettingsEntryFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
|
@ -1,6 +1,6 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
@ -8,17 +8,15 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
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.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.tiktok.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.tiktok.misc.settings.annotations.SettingsCompatibility
|
||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.*
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@ -33,12 +31,12 @@ class SettingsPatch : BytecodePatch(
|
||||
SettingsEntryInfoFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// Find the class name of classes which construct a settings entry
|
||||
val settingsButtonClass = SettingsEntryFingerprint.result?.classDef?.type?.toClassName()
|
||||
?: return SettingsEntryFingerprint.toErrorResult()
|
||||
?: throw SettingsEntryFingerprint.exception
|
||||
val settingsButtonInfoClass = SettingsEntryInfoFingerprint.result?.classDef?.type?.toClassName()
|
||||
?: return SettingsEntryInfoFingerprint.toErrorResult()
|
||||
?: throw SettingsEntryInfoFingerprint.exception
|
||||
|
||||
// Create a settings entry for 'revanced settings' and add it to settings fragment
|
||||
AddSettingsEntryFingerprint.result?.apply {
|
||||
@ -66,7 +64,7 @@ class SettingsPatch : BytecodePatch(
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return AddSettingsEntryFingerprint.toErrorResult()
|
||||
} ?: throw AddSettingsEntryFingerprint.exception
|
||||
|
||||
// Initialize the settings menu once the replaced setting entry is clicked.
|
||||
AdPersonalizationActivityOnCreateFingerprint.result?.mutableMethod?.apply {
|
||||
@ -87,9 +85,7 @@ class SettingsPatch : BytecodePatch(
|
||||
""",
|
||||
ExternalLabel("notrevanced", getInstruction(initializeSettingsIndex))
|
||||
)
|
||||
} ?: return AdPersonalizationActivityOnCreateFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
} ?: throw AdPersonalizationActivityOnCreateFingerprint.exception
|
||||
}
|
||||
|
||||
private fun String.toClassName(): String {
|
||||
|
@ -8,8 +8,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
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.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
@ -17,10 +15,10 @@ 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 app.revanced.patches.tiktok.misc.spoof.sim.annotations.SpoofSimCompatibility
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Patch(false)
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@ -39,7 +37,7 @@ class SpoofSimPatch : BytecodePatch() {
|
||||
)
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// Find all api call to check sim information
|
||||
buildMap {
|
||||
context.classes.forEach { classDef ->
|
||||
@ -89,8 +87,6 @@ class SpoofSimPatch : BytecodePatch() {
|
||||
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableSimSpoof()V"
|
||||
)
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
// Patch Android API and return fake sim information
|
||||
|
Reference in New Issue
Block a user