finish merge

This commit is contained in:
LisoUseInAIKyrios
2025-09-18 10:18:33 +04:00
parent 97ce498368
commit bb671766f6
3 changed files with 12 additions and 14 deletions

View File

@@ -1,20 +1,11 @@
package app.revanced.patches.instagram.feed
import app.revanced.patcher.fingerprint
import app.revanced.patcher.patch.BytecodePatchContext
internal val mainFeedRequestClassFingerprint = fingerprint {
internal val mainFeedRequestClassFingerprint by fingerprint {
strings("Request{mReason=", ", mInstanceNumber=")
}
context(BytecodePatchContext)
internal val initMainFeedRequestFingerprint get() = fingerprint {
custom { method, classDef ->
method.name == "<init>" &&
classDef == mainFeedRequestClassFingerprint.classDef
}
}
internal val mainFeedHeaderMapFinderFingerprint = fingerprint {
internal val mainFeedHeaderMapFinderFingerprint by fingerprint {
strings("pagination_source", "FEED_REQUEST_SENT")
}

View File

@@ -2,6 +2,7 @@ package app.revanced.patches.instagram.feed
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch
import app.revanced.util.getReference
@@ -40,6 +41,12 @@ val limitFeedToFollowedProfiles = bytecodePatch(
}
}
val initMainFeedRequestFingerprint by fingerprint {
custom { method, classDef ->
method.name == "<init>" &&
classDef == mainFeedRequestClassFingerprint.classDef
}
}
initMainFeedRequestFingerprint.method.apply {
// Finds the instruction where the map is being initialized in the constructor
val getHeaderIndex = indexOfFirstInstructionOrThrow {

View File

@@ -2,7 +2,6 @@ package app.revanced.patches.viber.ads
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
import app.revanced.util.returnEarly
@@ -30,12 +29,13 @@ val hideAdsPatch = bytecodePatch(
val targetClass = method.getInstruction<ReferenceInstruction>(typeRefIndex).reference as TypeReference
// Patch the ads-free method to always return true
fingerprint {
val adFreeFingerprint by fingerprint {
returns("I")
parameters()
custom { method, classDef ->
classDef == targetClass
}
}.method.returnEarly(1)
}
adFreeFingerprint.method.returnEarly(1)
}
}