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

89 lines
2.8 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: Nuclear iOS Clean + Rebuild
#
# Wann brauchst du das?
# - Build-Errors die nach Native-Code-Änderung aus dem Nichts kommen
# - "fmt consteval", "Hermes", "RCT-Folly" Compile-Errors in Pods
# - Stale DerivedData-Cache nach Xcode-Upgrade
# - Nach App-Bundle-ID/Entitlement-Änderungen
# - Nach Hinzufügen/Entfernen von Native Modules oder Config-Plugins
#
# Was es NICHT zerstört:
# - Code in app/, components/, modules/, plugins/ (alles was in git getrackt ist)
# - node_modules
#
# Was es zerstört:
# - ios/Pods, ios/Podfile.lock, ios/build (vollständig regeneriert via prebuild)
# - DerivedData-Cache von Xcode (wird beim nächsten Build neu aufgebaut)
#
# Modi:
# ./clean-ios.sh → clean + prebuild + pod install (kein Build)
# ./clean-ios.sh --build → + zusätzlich pnpm ios am Ende (wirft App auf Sim/Device)
# ./clean-ios.sh --xcode → + zum Schluss Xcode-Workspace öffnen
set -e
cd "$(dirname "$0")"
MODE="${1:-}"
# FamilyControls-Flag: default ON für lokale Dev-Builds (= entitlement aktiv).
# Override via `REBREAK_ENABLE_FAMILY_CONTROLS=0 ./clean-ios.sh ...`.
# Wird von plugins/with-rebreak-protection-ios.js + app.config.ts gelesen.
export REBREAK_ENABLE_FAMILY_CONTROLS="${REBREAK_ENABLE_FAMILY_CONTROLS:-1}"
echo "🧹 Rebreak Native iOS Clean"
echo "==========================="
echo ""
# 1. Wipe Pods, Lockfile, Build-Output
echo "→ rm -rf ios/Pods ios/Podfile.lock ios/build"
rm -rf ios/Pods ios/Podfile.lock ios/build
# 2. Wipe Xcode DerivedData (nur für Rebreak — nicht das ganze ~/Library)
DERIVED_DATA="$HOME/Library/Developer/Xcode/DerivedData"
if [ -d "$DERIVED_DATA" ]; then
echo "→ rm -rf $DERIVED_DATA/Rebreak-*"
rm -rf "$DERIVED_DATA"/Rebreak-* 2>/dev/null || true
fi
# 3. Prebuild: regeneriert ios/ aus app.config.ts + Config-Plugins
# Dank with-fmt-consteval-fix-Plugin wird das Podfile auto-gepatcht.
echo "→ pnpm expo prebuild --clean"
pnpm expo prebuild --clean
# 4. Pod install
echo "→ cd ios && pod install"
(cd ios && pod install)
echo ""
echo "✅ Clean done."
echo ""
case "$MODE" in
--build|build)
echo "🔨 Building + running on connected device/simulator..."
pnpm ios
;;
--xcode|xcode)
echo "🔨 Opening Xcode-Workspace..."
osascript -e 'tell application "Xcode" to close every window whose name contains "Rebreak.xcodeproj"' 2>/dev/null || true
open -a Xcode ios/Rebreak.xcworkspace
echo ""
echo " In Xcode: Cmd+R für Build & Run"
;;
"")
echo " Nächste Schritte:"
echo " ./dev-ios.sh # Xcode öffnen (manueller Build)"
echo " pnpm ios # CLI-Build auf Sim/Device"
echo " ./clean-ios.sh --build # alles in einem Rutsch"
;;
*)
echo "Unknown mode: $MODE"
echo "Usage: ./clean-ios.sh [--build|--xcode]"
exit 1
;;
esac