feat: skip puzzle ads in Edition games #192
No reviewers
Labels
No labels
area/architecture
area/build-ci
area/bytecode
area/code-quality
area/docs
area/extension
area/fingerprint
area/security
area/tests
Bug report
Feature request
review
sev/low
sev/medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midas/midas-patches!192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/168-edition-game-ads"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #168 (only open point: the device test below).
New named patch Skip puzzle ads (Edition: de Volkskrant, Trouw, Het Parool) with Midas Settings toggle
skip_game_ads("Sla puzzelreclame over", Advertenties en promotie), default on.Analysis (decompile Het Parool 7.55.0 / 7.54.0, Volkskrant 7.55.0 dex)
startAdBreak) goes throughGameAdViewModel.bindView: it starts a 5 s load timeout, emitsLoadingand builds aGameAdPlayer, whose constructor callsAdsLoader.requestAds.GameAdPlayer.reportAdError-> stateError-> view model emitsGameAdEvent.Error.Generic.Completedonly becomesGameAdEvent.Completedafter a started ad, otherwise alsoError.Generic, so "completion" can't be faked without faking ad-start tracking.Error.Generic:onPrerollError->Playing, nothing reported;AdBreakEnded("reward-rejected"), container ->Playing, snackbar "Probeer later nog eens om een beloning te ontvangen",AdRewardRejectedreported viaReportTaPlayerExceptionUsecase.The game WebView stays loaded; nothing in the host waits after the error. The game's own reaction to
reward-rejectedis in remote web code (not in the APK), but it is the same answer it gets on every no-fill and on the app's own timeout.player4(pgsdk4) ad-break path is dead code here (Pgsdk4GameContainerViewModelconstructor isthrow null). Kubus apps have noGameAdPlayer.Hook
Not in
GameAdPlayeras the issue suggested, but one step up: at the start ofbindView,GameAds.skipGameAd(mutableEvents, GameAdEvent.Error.Generic.INSTANCE); when true,return-void. The extension posts the event and emits it once the flow has a collector (no replay;bindViewruns in theAndroidViewfactory, before theLaunchedEffectcollects). A synchronousreportAdErrorin the constructor would emit before that collector exists (inferred from Compose ordering) and the game would wait for the 5 s timeout, which also records aGameAdTimeoutExceptionto Crashlytics. Returning early also means no IMAAdsLoader, no ad request, no timeout.thiscopied viamove-object/from16,requireLocalRegisters(2), patch-time checks for themutableEventsfield andError$Generic.INSTANCE.edition/GameAds.java: never-throw wrapper (falls back to the originalbindView), 7 unit tests.kotlinx.coroutines.flow.MutableSharedFlow/StateFlowinstubs/edition(unobfuscated in the dex).docs/apps/edition.md, section "Puzzle ads", with evidence labels.Default on because the decompile shows the host continuing the game on this route in both the preroll and the rewarded case; the only loss is the reward (the toggle brings ads and rewards back, live).
Verification
gradlew buildAndroid(incl. contract check):extensions:extension:testDebugUnitTestcheck-stubs.shHet Parool 7.55.0 / 7.54.0check-patches.shVolkskrant 7.55.0check-patches.shTrouw 7.55.0check-patches.shVolkskrant 7.54.0Not device-tested. To do: open a puzzle with a preroll (starts straight away?), ask for a rewarded reward (snackbar, puzzle still playable?), logcat
MidasSettings(no "no collector" warning).🤖 Generated with Claude Code
Merged into dev through the integration PR #195 (same commits), released as v1.11.0-dev.10.
Pull request closed