mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-25 04:05:50 +01:00
fix(YouTube - Hide ads): Do not show error toast and hide full screen ads (#569)
This commit is contained in:
parent
b866036715
commit
0b0d46f518
@ -14,7 +14,7 @@ import app.revanced.integrations.youtube.StringTrieSearch;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public final class AdsFilter extends Filter {
|
public final class AdsFilter extends Filter {
|
||||||
// region Fullscreen ad
|
// region Fullscreen ad
|
||||||
private static long lastTimeClosedFullscreenAd = 0;
|
private static volatile long lastTimeClosedFullscreenAd;
|
||||||
private static final Instrumentation instrumentation = new Instrumentation();
|
private static final Instrumentation instrumentation = new Instrumentation();
|
||||||
private final StringFilterGroup fullscreenAd;
|
private final StringFilterGroup fullscreenAd;
|
||||||
|
|
||||||
@ -168,6 +168,9 @@ public final class AdsFilter extends Filter {
|
|||||||
|
|
||||||
Logger.printDebug(() -> "Closing fullscreen ad");
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user