Skip to content

Commit e138501

Browse files
author
LisoUseInAIKyrios
authored
fix(Threads - Hide ads): Constrain patch to the last working app target (#5189)
1 parent a9235d6 commit e138501

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,10 @@ public final class app/revanced/patches/swissid/integritycheck/RemoveGooglePlayI
958958
public static final fun getRemoveGooglePlayIntegrityCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
959959
}
960960

961+
public final class app/revanced/patches/threads/HideAdsPatchKt {
962+
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
963+
}
964+
961965
public final class app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatchKt {
962966
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
963967
}
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
package app.revanced.patches.instagram.ads
22

33
import app.revanced.patcher.patch.bytecodePatch
4+
import app.revanced.patches.meta.ads.adInjectorFingerprint
5+
import app.revanced.util.returnEarly
46

5-
@Deprecated("Patch was moved to different package: app.revanced.patches.meta.ads.hideAdsPatch")
67
@Suppress("unused")
7-
val hideAdsPatch = bytecodePatch {
8-
dependsOn(app.revanced.patches.meta.ads.hideAdsPatch)
8+
val hideAdsPatch = bytecodePatch(
9+
name = "Hide ads",
10+
) {
11+
compatibleWith("com.instagram.android")
12+
13+
execute {
14+
adInjectorFingerprint.method.returnEarly(false)
15+
}
916
}

patches/src/main/kotlin/app/revanced/patches/meta/ads/HideAdsPatch.kt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,9 @@ package app.revanced.patches.meta.ads
33
import app.revanced.patcher.patch.bytecodePatch
44
import app.revanced.util.returnEarly
55

6+
@Deprecated("Instead use the Instagram or Threads specific hide ads patch")
67
@Suppress("unused")
7-
val hideAdsPatch = bytecodePatch(
8-
name = "Hide ads",
9-
) {
10-
/**
11-
* Patch is identical for both Instagram and Threads app.
12-
*/
13-
compatibleWith(
14-
"com.instagram.android",
15-
"com.instagram.barcelona",
16-
)
17-
8+
val hideAdsPatch = bytecodePatch {
189
execute {
1910
adInjectorFingerprint.method.returnEarly(false)
2011
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package app.revanced.patches.threads
2+
3+
import app.revanced.patcher.patch.bytecodePatch
4+
import app.revanced.patches.meta.ads.adInjectorFingerprint
5+
import app.revanced.util.returnEarly
6+
7+
@Suppress("unused")
8+
val hideAdsPatch = bytecodePatch(
9+
name = "Hide ads",
10+
) {
11+
compatibleWith("com.instagram.barcelona"("382.0.0.51.85"))
12+
13+
execute {
14+
adInjectorFingerprint.method.returnEarly(false)
15+
}
16+
}

0 commit comments

Comments
 (0)