feat(gelderlander): stop ad SDK initialisation at startup #25

Closed
opened 2026-10-10 12:22:34 +02:00 by midas · 0 comments
Owner

Part of #16.

Feature description

Hide ads prevents ad requests in De Gelderlander, but the ad stack still initialises at app start. Skip that init, as an extension of Hide ads.

Findings (9.21.1, obfuscated: use the anchors)

DPG AdvertisingSDK (pd, implements rd)

  • Anchors: "be.persgroep.advertising.banner.AdvertisingSDK$1", ...AdvertisingSDK$registerOnStartApp$2, and fetchConfig.
  • Its init coroutine pd$a warms up Prebid through be.persgroep.advertising.banner.config.c.a(Context, InitConfig.HeaderBidding.Prebid, cont).
  • It also runs SDKsInitializer (be/persgroep/advertising/banner/config/g, anchor "be.persgroep.advertising.banner.config.SDKsInitializer"). That initialises Xandr through ihe: XandrAd.init(memberId, ctx, true, false, cb), log "Xandr SDK failed to initialize: ".
  • pb.d(Application, hp3): rd builds the SDK with new Platform("gelderlander"); pb.c(rd, gt4): id wraps it.
  • The wrapped id is injected into MainApplication.advertisementHandler, so the SDK is built at app start.

Other ad SDKs

  • Google Mobile Ads: the manifest MobileAdsInitProvider (APPLICATION_ID ca-app-pub-9227299877260903~1209779587, AD_MANAGER_APP, OPTIMIZE_INITIALIZATION). No explicit MobileAds.initialize in app code.
  • Pinch opt-out ads: nl.pinch.optoutadvertising.sdk.OptOutAdvertising.INSTANCE.initialize/loadAd, coordinated by ir8 (anchor "be.persgroep.advertising.optout.OptOutAdvertisingManager$load$1"). These are contextual ads for users without consent.
    • Check that Hide ads already blocks Pinch's loadAd path; if not, add it there.
  • The user profile SDK is initialised by gnd.c(ctx, env) in MainApplication.onCreate. It is shared with tracking and consent; leave it alone unless #20 decides otherwise.

Approach

  • Return early from SDKsInitializer init and from the Prebid warm-up. Both are fingerprinted on the coroutine/class-name strings above.
  • Remove or disable MobileAdsInitProvider with a manifest resource patch.
  • Pinch: no-op OptOutAdvertising.initialize (unobfuscated SDK class).

Done when

  • Build passes; patch applied on 9.21.1.
  • Device check (after asking): start, feed, article, video; no ad SDK init in logcat; no crash from a missing init.
  • docs/apps/gelderlander.md updated.
Part of #16. ## Feature description **Hide ads** prevents ad requests in De Gelderlander, but the ad stack still initialises at app start. Skip that init, as an extension of **Hide ads**. ## Findings (9.21.1, obfuscated: use the anchors) ### DPG AdvertisingSDK (`pd`, implements `rd`) - Anchors: `"be.persgroep.advertising.banner.AdvertisingSDK$1"`, `...AdvertisingSDK$registerOnStartApp$2`, and `fetchConfig`. - Its init coroutine `pd$a` warms up Prebid through `be.persgroep.advertising.banner.config.c.a(Context, InitConfig.HeaderBidding.Prebid, cont)`. - It also runs SDKsInitializer (`be/persgroep/advertising/banner/config/g`, anchor `"be.persgroep.advertising.banner.config.SDKsInitializer"`). That initialises Xandr through `ihe`: `XandrAd.init(memberId, ctx, true, false, cb)`, log "Xandr SDK failed to initialize: ". - `pb.d(Application, hp3): rd` builds the SDK with `new Platform("gelderlander")`; `pb.c(rd, gt4): id` wraps it. - The wrapped `id` is injected into `MainApplication.advertisementHandler`, so the SDK is built at app start. ### Other ad SDKs - Google Mobile Ads: the manifest `MobileAdsInitProvider` (APPLICATION_ID `ca-app-pub-9227299877260903~1209779587`, AD_MANAGER_APP, OPTIMIZE_INITIALIZATION). No explicit `MobileAds.initialize` in app code. - Pinch opt-out ads: `nl.pinch.optoutadvertising.sdk.OptOutAdvertising.INSTANCE.initialize/loadAd`, coordinated by `ir8` (anchor `"be.persgroep.advertising.optout.OptOutAdvertisingManager$load$1"`). These are contextual ads for users without consent. - Check that **Hide ads** already blocks Pinch's `loadAd` path; if not, add it there. - The user profile SDK is initialised by `gnd.c(ctx, env)` in `MainApplication.onCreate`. It is shared with tracking and consent; leave it alone unless #20 decides otherwise. ## Approach - Return early from SDKsInitializer `init` and from the Prebid warm-up. Both are fingerprinted on the coroutine/class-name strings above. - Remove or disable `MobileAdsInitProvider` with a manifest resource patch. - Pinch: no-op `OptOutAdvertising.initialize` (unobfuscated SDK class). ## Done when - [ ] Build passes; patch applied on 9.21.1. - [ ] Device check (after asking): start, feed, article, video; no ad SDK init in logcat; no crash from a missing init. - [ ] `docs/apps/gelderlander.md` updated.
midas closed this issue 2026-10-10 23:26:48 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/midas-patches#25
No description provided.