Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Hide ads): Do not show error toast and hide full screen…
Browse files Browse the repository at this point in the history
… ads (#569)
  • Loading branch information
LisoUseInAIKyrios authored Feb 13, 2024
1 parent b866036 commit 0b0d46f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@SuppressWarnings("unused")
public final class AdsFilter extends Filter {
// region Fullscreen ad
private static long lastTimeClosedFullscreenAd = 0;
private static volatile long lastTimeClosedFullscreenAd;
private static final Instrumentation instrumentation = new Instrumentation();
private final StringFilterGroup fullscreenAd;

Expand Down Expand Up @@ -168,6 +168,9 @@ private static void closeFullscreenAd() {

Logger.printDebug(() -> "Closing fullscreen ad");

Utils.runOnMainThreadDelayed(() -> instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK), 1000);
Utils.runOnMainThreadDelayed(() -> {
// Must run off main thread (Odd, but whatever).
Utils.runOnBackgroundThread(() -> instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK));
}, 1000);
}
}

0 comments on commit 0b0d46f

Please sign in to comment.