feat: stop dormant auto-initialising SDKs (Facebook, Piano/Cxense, Viafoura) #32

Closed
opened 2026-10-10 12:22:50 +02:00 by midas · 1 comment
Owner

Part of #16. Implement according to the decision in #20.

Feature description

Both apps contain SDKs that start automatically, through manifest content providers or androidx.startup, or unconditionally in Application.onCreate, although the app barely uses them. Removing their auto-init saves startup work and network calls.

Findings

Facebook SDK

  • Volkskrant: com.facebook.internal.FacebookInitProvider is in the manifest. There is no facebook_app_id / ApplicationId meta-data and no app code that uses it, so the SDK is effectively dead.
  • Gelderlander: the manifest has AutoInit, AutoLog and AdvertiserID all false. g9d.f (TrackingStarter) turns them on (setAutoLogAppEventsEnabled, setAutoInitEnabled, setAdvertiserIDCollectionEnabled, fullyInitialize) when the MARKETING consent purpose is allowed.

Piano/Cxense

  • io.piano.android.cxense.CxSdkInitializer runs through androidx.startup in both apps.
  • It is not consent-gated, and neither app was found to use it directly.
  • Piano Composer itself is off in Gelderlander (FEATURE_SECTION_PIANO / FEATURE_ARTICLE_PIANO are disabled in BuildConfig).

Viafoura (Gelderlander)

  • tx5.invoke() initialises the Viafoura comments SDK unconditionally in MainApplication.onCreate, although commenting is disabled (FEATURE_COMMENTING_VIAFOURA defaults to "disabled").
  • See also #42.

Gemius

  • Volkskrant: a no-op (CimTrackerNoop).
  • Gelderlander: the SDK is bundled, but no direct init was found. It is probably pulled in by the ad stack. Verify.

Approach

  • Resource patch on AndroidManifest.xml:
    • remove FacebookInitProvider;
    • remove the CxSdkInitializer <meta-data> under androidx.startup.InitializationProvider.
  • Gelderlander: skip the Facebook block in g9d.f; no-op Viafoura init only together with #42, or verify that comments don't need it.
  • Make sure nothing later calls these SDKs and expects them to be initialised. Facebook throws if it is used uninitialised.

Done when

  • Build passes; the patch applies on both apps.
  • Device check (after asking) on both apps: clean start, no graph.facebook.com / Cxense requests, no crashes when opening articles, video and settings.
  • Documented in both docs/apps/*.md.
Part of #16. Implement according to the decision in #20. ## Feature description Both apps contain SDKs that start automatically, through manifest content providers or `androidx.startup`, or unconditionally in `Application.onCreate`, although the app barely uses them. Removing their auto-init saves startup work and network calls. ## Findings ### Facebook SDK - Volkskrant: `com.facebook.internal.FacebookInitProvider` is in the manifest. There is no `facebook_app_id` / ApplicationId meta-data and no app code that uses it, so the SDK is effectively dead. - Gelderlander: the manifest has AutoInit, AutoLog and AdvertiserID all false. `g9d.f` (TrackingStarter) turns them on (`setAutoLogAppEventsEnabled`, `setAutoInitEnabled`, `setAdvertiserIDCollectionEnabled`, `fullyInitialize`) when the MARKETING consent purpose is allowed. ### Piano/Cxense - `io.piano.android.cxense.CxSdkInitializer` runs through `androidx.startup` in both apps. - It is not consent-gated, and neither app was found to use it directly. - Piano Composer itself is off in Gelderlander (FEATURE_SECTION_PIANO / FEATURE_ARTICLE_PIANO are disabled in BuildConfig). ### Viafoura (Gelderlander) - `tx5.invoke()` initialises the Viafoura comments SDK unconditionally in `MainApplication.onCreate`, although commenting is disabled (`FEATURE_COMMENTING_VIAFOURA` defaults to "disabled"). - See also #42. ### Gemius - Volkskrant: a no-op (`CimTrackerNoop`). - Gelderlander: the SDK is bundled, but no direct init was found. It is probably pulled in by the ad stack. Verify. ## Approach - Resource patch on `AndroidManifest.xml`: - remove `FacebookInitProvider`; - remove the `CxSdkInitializer` `<meta-data>` under `androidx.startup.InitializationProvider`. - Gelderlander: skip the Facebook block in `g9d.f`; no-op Viafoura init only together with #42, or verify that comments don't need it. - Make sure nothing later calls these SDKs and expects them to be initialised. Facebook throws if it is used uninitialised. ## Done when - [ ] Build passes; the patch applies on both apps. - [ ] Device check (after asking) on both apps: clean start, no `graph.facebook.com` / Cxense requests, no crashes when opening articles, video and settings. - [ ] Documented in both `docs/apps/*.md`.
Author
Owner

Implemented and verified on device in ab05dc1 as part of the Disable tracking patch.

Implemented and verified on device in ab05dc1 as part of the Disable tracking patch.
midas closed this issue 2026-10-10 15:24:57 +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#32
No description provided.