feat: hide business mode toggle in consumer APK, update 4-variant build script

- soul_screen.dart: pass showBusinessMode: isBusinessApp to OtherSettingsSection
  so the toggle is hidden when built with IS_BUSINESS_APP=false
- build_4_apks.sh: rewrite for current strategy (consumer/business x maita/eiji)
  Pro variants removed; set_lite_app_id() restores gradle before each build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ponshu Developer 2026-04-05 10:11:54 +09:00
parent 4db63eb05a
commit 7797f4eed7
2 changed files with 104 additions and 0 deletions

102
build_4_apks.sh Normal file
View File

@ -0,0 +1,102 @@
#!/bin/bash
# ============================================================================
# Ponshu Room - 4バリアント一括ビルドスクリプト
# consumer × {maita, eiji} + business × {maita, eiji}
# Pro版は不要のため含まない
# ============================================================================
set -e
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
OUTPUT_DIR="build/apk_releases/$TIMESTAMP"
mkdir -p "$OUTPUT_DIR"
# APIキー (.env から読み込む)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
export $(grep -v '^#' "$SCRIPT_DIR/.env" | xargs)
fi
MAITA_KEY="${MAITA_API_KEY:?MAITA_API_KEY is not set in .env}"
EIJI_KEY="${EIJI_API_KEY:?EIJI_API_KEY is not set in .env}"
GRADLE_FILE="android/app/build.gradle.kts"
BACKUP_FILE="android/app/build.gradle.kts.backup"
cp "$GRADLE_FILE" "$BACKUP_FILE"
cleanup() {
if [ -f "$BACKUP_FILE" ]; then
cp "$BACKUP_FILE" "$GRADLE_FILE"
rm "$BACKUP_FILE"
echo "Restored build.gradle.kts"
fi
}
trap cleanup EXIT
# applicationId を Lite に固定(バックアップから毎回復元して書き換え)
set_lite_app_id() {
cp "$BACKUP_FILE" "$GRADLE_FILE"
sed -i 's/applicationId = "com.posimai.ponshu_room"/applicationId = "com.posimai.ponshu_room_lite"/' "$GRADLE_FILE"
}
echo "============================================================================"
echo "Ponshu Room - 4 Variant APK Build"
echo "Output: $OUTPUT_DIR"
echo "============================================================================"
echo ""
# --- [1/4] Consumer / Maita ---
echo "[1/4] Building Consumer - Maita..."
set_lite_app_id
flutter build apk --release \
--dart-define=GEMINI_API_KEY=$MAITA_KEY \
--dart-define=IS_BUSINESS_APP=false \
--dart-define=IS_PRO_VERSION=false \
--dart-define=USE_PROXY=false
cp build/app/outputs/flutter-apk/app-release.apk "$OUTPUT_DIR/ponshu_room_consumer_maita.apk"
echo "Saved: ponshu_room_consumer_maita.apk"
echo ""
# --- [2/4] Consumer / Eiji ---
echo "[2/4] Building Consumer - Eiji..."
set_lite_app_id
flutter build apk --release \
--dart-define=GEMINI_API_KEY=$EIJI_KEY \
--dart-define=IS_BUSINESS_APP=false \
--dart-define=IS_PRO_VERSION=false \
--dart-define=USE_PROXY=false
cp build/app/outputs/flutter-apk/app-release.apk "$OUTPUT_DIR/ponshu_room_consumer_eiji.apk"
echo "Saved: ponshu_room_consumer_eiji.apk"
echo ""
# --- [3/4] Business / Maita ---
echo "[3/4] Building Business - Maita..."
set_lite_app_id
flutter build apk --release \
--dart-define=GEMINI_API_KEY=$MAITA_KEY \
--dart-define=IS_BUSINESS_APP=true \
--dart-define=IS_PRO_VERSION=false \
--dart-define=USE_PROXY=false
cp build/app/outputs/flutter-apk/app-release.apk "$OUTPUT_DIR/ponshu_room_business_maita.apk"
echo "Saved: ponshu_room_business_maita.apk"
echo ""
# --- [4/4] Business / Eiji ---
echo "[4/4] Building Business - Eiji..."
set_lite_app_id
flutter build apk --release \
--dart-define=GEMINI_API_KEY=$EIJI_KEY \
--dart-define=IS_BUSINESS_APP=true \
--dart-define=IS_PRO_VERSION=false \
--dart-define=USE_PROXY=false
cp build/app/outputs/flutter-apk/app-release.apk "$OUTPUT_DIR/ponshu_room_business_eiji.apk"
echo "Saved: ponshu_room_business_eiji.apk"
echo ""
echo "============================================================================"
echo "All 4 variants built successfully!"
echo "============================================================================"
ls -lh "$OUTPUT_DIR"
echo ""
echo "Consumer APKs: IS_BUSINESS_APP=false (ビジネスモードトグル非表示)"
echo "Business APKs: IS_BUSINESS_APP=true (デモ・ヒアリング用)"
echo "============================================================================"

View File

@ -13,6 +13,7 @@ import '../widgets/gamification/badge_case.dart';
import '../widgets/gamification/activity_stats.dart'; import '../widgets/gamification/activity_stats.dart';
import '../theme/app_colors.dart'; import '../theme/app_colors.dart';
import '../services/mbti_types.dart'; // Needed for type title display import '../services/mbti_types.dart'; // Needed for type title display
import '../main.dart' show isBusinessApp;
class SoulScreen extends ConsumerStatefulWidget { class SoulScreen extends ConsumerStatefulWidget {
const SoulScreen({super.key}); const SoulScreen({super.key});
@ -127,6 +128,7 @@ class _SoulScreenState extends ConsumerState<SoulScreen> {
// other Settings // other Settings
OtherSettingsSection( OtherSettingsSection(
title: t['otherSettings'], title: t['otherSettings'],
showBusinessMode: isBusinessApp,
), ),
const SizedBox(height: 24), const SizedBox(height: 24),