From 50d3c6a8e15884c9e8f4d9ad41344845814a1812 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Thu, 21 May 2026 20:13:57 +0200 Subject: [PATCH] =?UTF-8?q?fix(protection):=20Layer=202=20=E2=80=94=20Fami?= =?UTF-8?q?ly=20Controls=20default-on=20+=20Resource-Bundle-Pfad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - familyControlsEnabled jetzt default-on (Apple-Distribution-Entitlement freigegeben); nur REBREAK_ENABLE_FAMILY_CONTROLS=0 schaltet ab. - gambling-domains.json ins Pod-Verzeichnis verschoben + Podspec resource_bundles auf within-pod-Pfad korrigiert — CocoaPods buendelt keine Dateien ausserhalb des Pod-Roots (Bundle blieb sonst leer → Layer 2 griff nicht). - Layer 2 (webContent-Filter) damit verifiziert funktionierend. Co-Authored-By: Claude Opus 4.7 --- apps/rebreak-native/app.config.ts | 12 ++++++------ .../rebreak-protection/ios/RebreakProtection.podspec | 8 +++++--- .../rebreak-protection/ios}/gambling-domains.json | 0 .../plugins/with-rebreak-protection-ios.js | 8 +++++--- 4 files changed, 16 insertions(+), 12 deletions(-) rename apps/rebreak-native/{assets/protection => modules/rebreak-protection/ios}/gambling-domains.json (100%) diff --git a/apps/rebreak-native/app.config.ts b/apps/rebreak-native/app.config.ts index cd35117..11af878 100644 --- a/apps/rebreak-native/app.config.ts +++ b/apps/rebreak-native/app.config.ts @@ -138,12 +138,12 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ // // Der Wert MUSS mit dem Entitlement-Gating im Plugin übereinstimmen: // plugins/with-rebreak-protection-ios.js setzt das family-controls-Entitlement - // NUR wenn REBREAK_ENABLE_FAMILY_CONTROLS==='1'. Diese Flag ist nur in - // development-Builds gesetzt. → familyControlsEnabled IDENTISCH koppeln, - // sonst bietet die App ein Feature an das im Build sandbox-blockiert ist. - // Sobald Apple das Distribution-Entitlement freigibt: Flag in eas.json - // preview/production env setzen — dann zieht beides automatisch. - familyControlsEnabled: process.env.REBREAK_ENABLE_FAMILY_CONTROLS === "1", + // mit derselben Bedingung. Family Controls ist Kern-Funktion und Apples + // Distribution-Entitlement ist freigegeben (v0.3.4) → DEFAULT AN. Nur ein + // explizites `REBREAK_ENABLE_FAMILY_CONTROLS=0` schaltet es ab (Escape-Hatch + // für FC-lose Test-Builds). Konsequenz: jeder Build braucht ein + // Provisioning-Profil mit FC-Capability — für den ReBreak-Apple-Account gegeben. + familyControlsEnabled: process.env.REBREAK_ENABLE_FAMILY_CONTROLS !== "0", // iOS-NEURLFilter / PIR-Server. Der Auth-Token kommt aus der Build-Umgebung // (Infisical staging/PIR_AUTH_TOKEN) — NIEMALS committen. Lokaler Dev-Build: // `PIR_AUTH_TOKEN=… npx expo run:ios --device`. diff --git a/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtection.podspec b/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtection.podspec index d995fb4..37fef4b 100644 --- a/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtection.podspec +++ b/apps/rebreak-native/modules/rebreak-protection/ios/RebreakProtection.podspec @@ -27,9 +27,11 @@ Pod::Spec.new do |s| # Layer-2 (webContent-Filter): gebündelte Gambling-Domain-Liste pro Land. # Wird als eigenständiges Resource-Bundle (RebreakProtectionResources.bundle) # ins App-Bundle gepackt — RebreakProtectionModule.swift liest es zur Laufzeit - # via Bundle(for:)/url(forResource:). Pfad relativ zur Podspec → zeigt auf die - # von der Aufgabe vorgegebene Quelle apps/rebreak-native/assets/protection/. + # via RebreakProtectionResources.bundle/gambling-domains.json. + # WICHTIG: Die JSON MUSS im Pod-Verzeichnis liegen (neben dieser Podspec). + # CocoaPods bündelt resource_bundles-Dateien NICHT, wenn der Pfad aus dem + # Pod-Root herauszeigt (`../../../assets/...` → Bundle blieb leer). s.resource_bundles = { - 'RebreakProtectionResources' => ['../../../assets/protection/gambling-domains.json'] + 'RebreakProtectionResources' => ['gambling-domains.json'] } end diff --git a/apps/rebreak-native/assets/protection/gambling-domains.json b/apps/rebreak-native/modules/rebreak-protection/ios/gambling-domains.json similarity index 100% rename from apps/rebreak-native/assets/protection/gambling-domains.json rename to apps/rebreak-native/modules/rebreak-protection/ios/gambling-domains.json diff --git a/apps/rebreak-native/plugins/with-rebreak-protection-ios.js b/apps/rebreak-native/plugins/with-rebreak-protection-ios.js index eb425c5..7d1ebdd 100644 --- a/apps/rebreak-native/plugins/with-rebreak-protection-ios.js +++ b/apps/rebreak-native/plugins/with-rebreak-protection-ios.js @@ -60,9 +60,11 @@ function withMainAppEntitlements(config) { cfg.modResults['com.apple.developer.networking.networkextension'] = [ 'url-filter-provider', ]; - // Family Controls: Distribution-Entitlement — nur wenn das Env-Flag gesetzt - // ist (development-Builds bzw. nach Apple-Freigabe auch preview/production). - if (process.env.REBREAK_ENABLE_FAMILY_CONTROLS === '1') { + // Family Controls = Kern-Funktion, Apple-Distribution-Entitlement freigegeben + // (v0.3.4) → DEFAULT AN. Nur ein explizites REBREAK_ENABLE_FAMILY_CONTROLS=0 + // schaltet es ab (Escape-Hatch). Muss identisch zu app.config.ts + // `familyControlsEnabled` bleiben. + if (process.env.REBREAK_ENABLE_FAMILY_CONTROLS !== '0') { cfg.modResults['com.apple.developer.family-controls'] = true; } const groups = cfg.modResults['com.apple.security.application-groups'] || [];