mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-24 03:35:49 +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")
|
||||
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;
|
||||
|
||||
@ -168,6 +168,9 @@ public final class AdsFilter extends Filter {
|
||||
|
||||
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