From ed80c5c53746373907ed69b5de5a8f20c820dc4f Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Tue, 29 Sep 2026 18:35:36 +0200 Subject: [PATCH] Remove Firebase push integration from Posthog (#7810) This causes issues with F-Droid, since now Posthog unconditionally references some Firebase classes, which are detected by their checks. Note these don't do anything if Firebase messaging isn't included, which is already the case for the F-droid variant of the app. The R8 changes should remove any code referencing Firebase in Posthog, making the offending classes unused and removing them from the final APKs. This is not the ideal fix, that would be Posthog actually extracting these classes to an optional dependency, but it's a workaround to be able to publish F-droid versions. --- app/proguard/foss/default-proguard-rules.keep | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/proguard/foss/default-proguard-rules.keep b/app/proguard/foss/default-proguard-rules.keep index a6dce2f0ce..604e1c55fd 100644 --- a/app/proguard/foss/default-proguard-rules.keep +++ b/app/proguard/foss/default-proguard-rules.keep @@ -1,2 +1,9 @@ # Don't obfuscate anything for non-enterprise builds -dontobfuscate + +# Strip PostHog's Firebase push token integration. We don't use it and it breaks F-Droid. +# Removing the contents of this method will mark the Firebase-related classes as unused, +# which will allow R8 to remove them from the final build. +-assumevalues class com.posthog.android.PostHogAndroidConfig { + boolean getCapturePushNotificationSubscriptions() return false; +}