Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Instagram): Add Hide ads patch #3380

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

tymmesyde
Copy link
Contributor

Hide Instagram ads

import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object AdInjectorFingerprint : MethodFingerprint(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a general ad injector or only for profiles?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General injector

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the previous timeline ads patch necessary then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, i wanted to ask if i should remove it ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Are reel ads included? If not, it may be good to add a description to explain what kind of ads are hidden.

Copy link
Contributor Author

@tymmesyde tymmesyde Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, stories, discover, profile etc..
The only place that i could still find some is when you reload your timeline by pulling the top, an ad can get injected in the first post

Copy link
Member

@oSumAtrIX oSumAtrIX Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the current timeline ads patch does hide that. Perhaps combining both patches makes sense? The only issue would be that the patch would be constrained to some older version. The alternative would be to note this behaviour in the description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add this behavior in the description

@oSumAtrIX oSumAtrIX changed the title feat(Instagram): Add Hide Ads patch feat(Instagram): Add Hide ads patch Jun 27, 2024
@oSumAtrIX oSumAtrIX merged commit c6b2f8c into ReVanced:dev Jun 27, 2024
2 checks passed
Copy link

welcome bot commented Jun 27, 2024

Thank you for contributing to ReVanced. Join us on Discord to receive a role for your contribution.

revanced-bot pushed a commit that referenced this pull request Jun 27, 2024
# [4.11.0-dev.1](v4.10.1-dev.2...v4.11.0-dev.1) (2024-06-27)

### Features

* Add `Remove share targets` patch ([#3334](#3334)) ([9414122](9414122))
* **Instagram:** Add `Hide ads` patch ([#3380](#3380)) ([c6b2f8c](c6b2f8c))
* **RAR:** Add `Hide purchase reminder` patch ([#3321](#3321)) ([8fbe7e3](8fbe7e3))
* **Stocard:** Add `Hide offers tab` and `Hide story bubbles` patch ([#3359](#3359)) ([fbd0507](fbd0507))
@cyberboh
Copy link

INFO: Hide ads succeeded
SEVERE: Hide timeline ads failed:
app.revanced.patcher.patch.PatchException: Failed to resolve ShowAdFingerprint
        at app.revanced.util.BytecodeUtilsKt.getException(BytecodeUtils.kt:27)
        at app.revanced.patches.instagram.patches.ads.timeline.HideTimelineAdsPatch.execute(HideTimelineAdsPatch.kt:61)
        at app.revanced.patches.instagram.patches.ads.timeline.HideTimelineAdsPatch.execute(HideTimelineAdsPatch.kt:16)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:173)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:205)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
        at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
        at app.revanced.cli.command.PatchCommand$run$4$1$1.invokeSuspend(PatchCommand.kt:303)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:302)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)

What's the benefit keeping both patches?
If Hide timeline ads already replaced by Hide ads, you should remove broken patches

@oSumAtrIX
Copy link
Member

Refer to #3380 (comment)

@cyberboh
Copy link

Refer to #3380 (comment)

In the descriptions:
description = "Hides ads in stories, discover, profile, etc."
Is that different from Hide timeline ads does?

@tymmesyde
Copy link
Contributor Author

Refer to #3380 (comment)

In the descriptions: description = "Hides ads in stories, discover, profile, etc." Is that different from Hide timeline ads does?

Yes, the previous patch only hid ads on the home feed
This one hides them almost everywhere

@cyberboh
Copy link

Refer to #3380 (comment)

In the descriptions: description = "Hides ads in stories, discover, profile, etc." Is that different from Hide timeline ads does?

Yes, the previous patch only hid ads on the home feed This one hides them almost everywhere

As I thought before.
So, Hide timeline ads patch should be removed in favor of Hide ads patch.
May be you can make a PR for it.

revanced-bot pushed a commit that referenced this pull request Jul 11, 2024
# [4.11.0](v4.10.0...v4.11.0) (2024-07-11)

### Bug Fixes

* **Boost for reddit - Fix missing audio in video downloads:** Replace correct strings ([#3379](#3379)) ([b43db98](b43db98))
* **Windy - Unlock pro:** Revert changing package name ([#3402](#3402)) ([541f1e7](541f1e7))
* **Windy - Unlock pro:** Use correct package name ([#3397](#3397)) ([1d8459a](1d8459a))
* **YouTube - Hide layout components:** Detect if a keyword filter hides all videos ([#3365](#3365)) ([6aa47ec](6aa47ec))
* **YouTube - Settings:** Move some settings to different menus, adjust default setting values ([#3415](#3415)) ([7201ac4](7201ac4))
* **YouTube - SponsorBlock:** Skip segments when casting ([#3331](#3331)) ([d9395fd](d9395fd))

### Features

* Add `Remove share targets` patch ([#3334](#3334)) ([9414122](9414122))
* Add translations ([#2963](#2963)) ([69ea6f3](69ea6f3))
* **Bandcamp:** Add `Remove play limits` patch ([#3366](#3366)) ([ad8d3bb](ad8d3bb))
* **Instagram:** Add `Hide ads` patch ([#3380](#3380)) ([c6b2f8c](c6b2f8c))
* **RAR:** Add `Hide purchase reminder` patch ([#3321](#3321)) ([8fbe7e3](8fbe7e3))
* **Soundcloud:** Add `Hide ads` and `Disable telemetry` patch ([#3386](#3386)) ([3c79f3d](3c79f3d))
* **Stocard:** Add `Hide offers tab` and `Hide story bubbles` patch ([#3359](#3359)) ([fbd0507](fbd0507))
E85Addict pushed a commit to E85Addict/revanced-patches that referenced this pull request Jul 11, 2024
# [4.11.0](v4.10.0...v4.11.0) (2024-07-11)

### Bug Fixes

* **Boost for reddit - Fix missing audio in video downloads:** Replace correct strings ([ReVanced#3379](https://github.com/E85Addict/revanced-patches/issues/3379)) ([b43db98](b43db98))
* **Windy - Unlock pro:** Revert changing package name ([ReVanced#3402](https://github.com/E85Addict/revanced-patches/issues/3402)) ([541f1e7](541f1e7))
* **Windy - Unlock pro:** Use correct package name ([ReVanced#3397](https://github.com/E85Addict/revanced-patches/issues/3397)) ([1d8459a](1d8459a))
* **YouTube - Hide layout components:** Detect if a keyword filter hides all videos ([ReVanced#3365](https://github.com/E85Addict/revanced-patches/issues/3365)) ([6aa47ec](6aa47ec))
* **YouTube - Settings:** Move some settings to different menus, adjust default setting values ([ReVanced#3415](https://github.com/E85Addict/revanced-patches/issues/3415)) ([7201ac4](7201ac4))
* **YouTube - SponsorBlock:** Skip segments when casting ([ReVanced#3331](https://github.com/E85Addict/revanced-patches/issues/3331)) ([d9395fd](d9395fd))

### Features

* Add `Remove share targets` patch ([ReVanced#3334](https://github.com/E85Addict/revanced-patches/issues/3334)) ([9414122](9414122))
* Add translations ([ReVanced#2963](https://github.com/E85Addict/revanced-patches/issues/2963)) ([69ea6f3](69ea6f3))
* **Bandcamp:** Add `Remove play limits` patch ([ReVanced#3366](https://github.com/E85Addict/revanced-patches/issues/3366)) ([ad8d3bb](ad8d3bb))
* **Instagram:** Add `Hide ads` patch ([ReVanced#3380](https://github.com/E85Addict/revanced-patches/issues/3380)) ([c6b2f8c](c6b2f8c))
* **RAR:** Add `Hide purchase reminder` patch ([ReVanced#3321](https://github.com/E85Addict/revanced-patches/issues/3321)) ([8fbe7e3](8fbe7e3))
* **Soundcloud:** Add `Hide ads` and `Disable telemetry` patch ([ReVanced#3386](https://github.com/E85Addict/revanced-patches/issues/3386)) ([3c79f3d](3c79f3d))
* **Stocard:** Add `Hide offers tab` and `Hide story bubbles` patch ([ReVanced#3359](https://github.com/E85Addict/revanced-patches/issues/3359)) ([fbd0507](fbd0507))

### Performance Improvements

* Personal Logo && Add upstream sync ([0d56aa1](0d56aa1))
@ani9730
Copy link

ani9730 commented Jul 12, 2024

What version of instagram is this tested on ?

@oSumAtrIX
Copy link
Member

Latest

E85Addict pushed a commit to E85Addict/revanced-patches that referenced this pull request Jul 12, 2024
# [4.11.0](v4.10.0...v4.11.0) (2024-07-12)

### Bug Fixes

* **Boost for reddit - Fix missing audio in video downloads:** Replace correct strings ([ReVanced#3379](https://github.com/E85Addict/revanced-patches/issues/3379)) ([b43db98](b43db98))
* **Windy - Unlock pro:** Revert changing package name ([ReVanced#3402](https://github.com/E85Addict/revanced-patches/issues/3402)) ([541f1e7](541f1e7))
* **Windy - Unlock pro:** Use correct package name ([ReVanced#3397](https://github.com/E85Addict/revanced-patches/issues/3397)) ([1d8459a](1d8459a))
* **YouTube - Hide layout components:** Detect if a keyword filter hides all videos ([ReVanced#3365](https://github.com/E85Addict/revanced-patches/issues/3365)) ([6aa47ec](6aa47ec))
* **YouTube - Settings:** Move some settings to different menus, adjust default setting values ([ReVanced#3415](https://github.com/E85Addict/revanced-patches/issues/3415)) ([7201ac4](7201ac4))
* **YouTube - SponsorBlock:** Skip segments when casting ([ReVanced#3331](https://github.com/E85Addict/revanced-patches/issues/3331)) ([d9395fd](d9395fd))

### Features

* Add `Remove share targets` patch ([ReVanced#3334](https://github.com/E85Addict/revanced-patches/issues/3334)) ([9414122](9414122))
* Add translations ([ReVanced#2963](https://github.com/E85Addict/revanced-patches/issues/2963)) ([69ea6f3](69ea6f3))
* **Bandcamp:** Add `Remove play limits` patch ([ReVanced#3366](https://github.com/E85Addict/revanced-patches/issues/3366)) ([ad8d3bb](ad8d3bb))
* **Instagram:** Add `Hide ads` patch ([ReVanced#3380](https://github.com/E85Addict/revanced-patches/issues/3380)) ([c6b2f8c](c6b2f8c))
* **RAR:** Add `Hide purchase reminder` patch ([ReVanced#3321](https://github.com/E85Addict/revanced-patches/issues/3321)) ([8fbe7e3](8fbe7e3))
* **Soundcloud:** Add `Hide ads` and `Disable telemetry` patch ([ReVanced#3386](https://github.com/E85Addict/revanced-patches/issues/3386)) ([3c79f3d](3c79f3d))
* **Stocard:** Add `Hide offers tab` and `Hide story bubbles` patch ([ReVanced#3359](https://github.com/E85Addict/revanced-patches/issues/3359)) ([fbd0507](fbd0507))

### Performance Improvements

* Personal Logo && Add upstream sync ([6ded142](6ded142))
@Neon329

This comment was marked as off-topic.

@cyberboh
Copy link

@Neon329 See my comment above you. That patch should be removed because already replaced by Hide ads. Exclude it and it will work.

@vsavovski
Copy link

Last working version v339.0.0.30.105, version v340.0.0.22.109 fails.

@theabhishekbhujang

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants