chahinebrini 917361131d fix(native/dev): default REBREAK_ENABLE_FAMILY_CONTROLS=1 in local dev scripts
When developing on a physical iPhone via `./dev-iphone.sh`, Metro runs
with whatever env the user's shell has — and the FamilyControls flag
was missing unless the user remembered to prefix every command with
`REBREAK_ENABLE_FAMILY_CONTROLS=1 …`. Forgetting it meant
`app.config.ts` evaluated `process.env.REBREAK_ENABLE_FAMILY_CONTROLS`
to falsy, so the JS bundle had `extra.familyControlsEnabled = false`
and the Blocker page kept showing "App-Lock — Bald" instead of the
real LayerSwitchCard, even though the dev binary did have the FC
entitlement.

Local dev scripts now default the var to "1" with shell-level
override (e.g. `REBREAK_ENABLE_FAMILY_CONTROLS=0 ./dev-iphone.sh`
when you want to verify the TestFlight/prod fallback UI). EAS
profile env (eas.json) keeps its own explicit setting and is
unaffected.
2026-05-15 23:46:28 +02:00

42 lines
1.7 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Rebreak Native — Dev auf physischem iPhone (kein Simulator).
#
# Was es macht:
# - Killt alte Metro-Instanzen auf 8081 (saubere Session)
# - Startet Metro mit --host lan damit iPhone via WiFi connecten kann
# - Druckt deine LAN-IP zum manuellen Eintragen falls Bonjour failt
#
# Auf iPhone:
# 1. Mac + iPhone müssen im SELBEN WiFi sein
# 2. App komplett killen (App-Switcher → swipe up)
# 3. App neu öffnen — dev-client sollte Metro automatisch finden
# 4. Falls nicht: dev-launcher → "Enter URL manually" → http://<LAN-IP>:8081
#
# WICHTIG: Im Metro-Terminal NICHT `i` drücken — sonst startet Simulator!
# Nur `r` für Reload.
set -e
cd "$(dirname "$0")"
# FamilyControls-Flag: default ON für lokale Dev-Builds, override via
# REBREAK_ENABLE_FAMILY_CONTROLS=0 ./dev-iphone.sh
# wenn man bewusst ohne FC testen will (z.B. TestFlight-Parity-Check).
# app.config.ts liest die Var um Constants.expoConfig.extra.familyControlsEnabled
# zu setzen → lib/protection.ts.FAMILY_CONTROLS_AVAILABLE → Blocker-UI.
export REBREAK_ENABLE_FAMILY_CONTROLS="${REBREAK_ENABLE_FAMILY_CONTROLS:-1}"
echo "🧹 Killing old Metro on port 8081..."
lsof -ti:8081 | xargs kill -9 2>/dev/null || true
echo ""
echo "📡 Mac LAN-IP für iPhone:"
ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null || echo " (kein WiFi/Ethernet detected)"
echo ""
echo " Falls dev-client Metro nicht automatisch findet:"
echo " im iPhone-Launcher → 'Enter URL manually' → http://<LAN-IP>:8081"
echo ""
echo "🚀 Starting Metro with --host lan..."
echo " (Drücke 'r' für Reload, NICHT 'i' — sonst startet Simulator!)"
echo ""
exec pnpm expo start --host lan --clear --dev-client