chore: 패키지 업데이트 및 빌드 스크립트 추가
This commit is contained in:
255
build-apk.sh
Executable file
255
build-apk.sh
Executable file
@@ -0,0 +1,255 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 안드로이드 앱 빌드 스크립트 (디버그 및 릴리즈 버전)
|
||||||
|
# 사용법: ./build-apk-for-device.sh
|
||||||
|
|
||||||
|
# 색상 정의
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 빌드 타입 선택 메뉴
|
||||||
|
echo -e "${YELLOW}Zellyy Finance 앱 빌드 스크립트${NC}"
|
||||||
|
echo -e "${YELLOW}=============================${NC}"
|
||||||
|
echo -e "빌드 타입을 선택하세요:"
|
||||||
|
echo -e "1) 디버그 빌드 (개발 및 테스트용)"
|
||||||
|
echo -e "2) 릴리즈 빌드 - AAB (Google Play 스토어 배포용)"
|
||||||
|
echo -e "3) 릴리즈 빌드 - 서명된 APK"
|
||||||
|
echo -e "4) 종료"
|
||||||
|
echo -n "선택 (1-4): "
|
||||||
|
read -r CHOICE
|
||||||
|
|
||||||
|
case $CHOICE in
|
||||||
|
1)
|
||||||
|
BUILD_TYPE="debug"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
BUILD_TYPE="release-aab"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
BUILD_TYPE="release-apk"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
echo -e "${YELLOW}빌드를 취소합니다.${NC}"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "${RED}잘못된 선택입니다. 빌드를 취소합니다.${NC}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# 현재 버전 코드 가져오기
|
||||||
|
CURRENT_VERSION_CODE=$(grep -o 'versionCode [0-9]*' android/app/build.gradle | awk '{print $2}')
|
||||||
|
echo -e "${YELLOW}현재 버전 코드: ${CURRENT_VERSION_CODE}${NC}"
|
||||||
|
|
||||||
|
# 빌드 넘버 자동 설정
|
||||||
|
BUILD_NUMBER=$CURRENT_VERSION_CODE
|
||||||
|
echo -e "${GREEN}빌드 넘버가 자동으로 ${BUILD_NUMBER}(으)로 설정되었습니다.${NC}"
|
||||||
|
|
||||||
|
# 릴리즈 빌드인 경우 버전 코드 증가 여부 확인
|
||||||
|
NEW_VERSION_CODE=$CURRENT_VERSION_CODE
|
||||||
|
if [[ "$BUILD_TYPE" == "release-aab" || "$BUILD_TYPE" == "release-apk" ]]; then
|
||||||
|
echo -e "${YELLOW}버전 코드를 증가시키겠습니까? 현재 버전 코드: ${CURRENT_VERSION_CODE} (y/n)${NC}"
|
||||||
|
read -r INCREASE_VERSION
|
||||||
|
if [[ "$INCREASE_VERSION" == "y" || "$INCREASE_VERSION" == "Y" ]]; then
|
||||||
|
NEW_VERSION_CODE=$((CURRENT_VERSION_CODE + 1))
|
||||||
|
echo -e "${GREEN}버전 코드가 ${NEW_VERSION_CODE}(으)로 증가됩니다.${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 키스토어 정보 자동 설정
|
||||||
|
KEYSTORE_PASSWORD="djqrP1dnl#"
|
||||||
|
KEY_ALIAS="key0"
|
||||||
|
KEY_PASSWORD="aplfarm99##"
|
||||||
|
|
||||||
|
echo -e "${GREEN}키스토어 비밀번호와 키 정보가 자동으로 설정되었습니다.${NC}"
|
||||||
|
|
||||||
|
# 서명 설정 업데이트
|
||||||
|
echo -e "${YELLOW}서명 설정 업데이트 중...${NC}"
|
||||||
|
sed -i '' "s/storePassword \".*\"/storePassword \"$KEYSTORE_PASSWORD\"/" android/app/build.gradle
|
||||||
|
sed -i '' "s/keyAlias \".*\"/keyAlias \"$KEY_ALIAS\"/" android/app/build.gradle
|
||||||
|
sed -i '' "s/keyPassword \".*\"/keyPassword \"$KEY_PASSWORD\"/" android/app/build.gradle
|
||||||
|
echo -e "${GREEN}서명 설정이 업데이트되었습니다.${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${YELLOW}Zellyy Finance 앱 빌드 시작 (${BUILD_TYPE}, 빌드 넘버: ${BUILD_NUMBER}, 버전 코드: ${NEW_VERSION_CODE}): $(date)${NC}"
|
||||||
|
|
||||||
|
# 캐시 삭제
|
||||||
|
echo -e "${YELLOW}빌드 캐시 삭제 중...${NC}"
|
||||||
|
rm -rf node_modules/.vite
|
||||||
|
rm -rf android/app/build
|
||||||
|
rm -rf android/.gradle
|
||||||
|
rm -rf dist
|
||||||
|
echo -e "${GREEN}빌드 캐시가 삭제되었습니다.${NC}"
|
||||||
|
|
||||||
|
# 빌드 넘버 및 버전 코드 업데이트
|
||||||
|
echo -e "${YELLOW}build.gradle 파일 업데이트 중...${NC}"
|
||||||
|
# 빌드 넘버 업데이트
|
||||||
|
sed -i '' "s/buildConfigField \"int\", \"BUILD_NUMBER\", \"[0-9]*\"/buildConfigField \"int\", \"BUILD_NUMBER\", \"$BUILD_NUMBER\"/" android/app/build.gradle
|
||||||
|
# 버전 코드 업데이트
|
||||||
|
sed -i '' "s/versionCode [0-9]*/versionCode $NEW_VERSION_CODE/" android/app/build.gradle
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}build.gradle 업데이트 실패. 빌드 프로세스를 중단합니다.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}빌드 넘버가 ${BUILD_NUMBER}(으)로, 버전 코드가 ${NEW_VERSION_CODE}(으)로 업데이트되었습니다.${NC}"
|
||||||
|
|
||||||
|
# 1. 웹 앱 빌드
|
||||||
|
echo -e "${YELLOW}1. 웹 앱 빌드 중...${NC}"
|
||||||
|
npm run build
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}웹 앱 빌드 실패. 빌드 프로세스를 중단합니다.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}웹 앱 빌드 완료${NC}"
|
||||||
|
|
||||||
|
# 2. Capacitor에 웹 코드 복사 및 동기화
|
||||||
|
echo -e "${YELLOW}2. Capacitor에 웹 코드 동기화 중...${NC}"
|
||||||
|
npx cap sync android
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}Capacitor 동기화 실패. 빌드 프로세스를 중단합니다.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}Capacitor 동기화 완료${NC}"
|
||||||
|
|
||||||
|
# 3. 안드로이드 APK/AAB 빌드
|
||||||
|
cd android
|
||||||
|
echo -e "${YELLOW}3. 안드로이드 빌드 시작 (${BUILD_TYPE})...${NC}"
|
||||||
|
|
||||||
|
# 빌드 타입에 따라 다른 명령어 실행
|
||||||
|
if [ "$BUILD_TYPE" = "debug" ]; then
|
||||||
|
# 디버그 빌드
|
||||||
|
./gradlew clean assembleDebug
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}디버그 APK 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
APK_PATH="app/build/outputs/apk/debug/app-debug.apk"
|
||||||
|
DEST_PATH="$HOME/zellyy-finance-debug.apk"
|
||||||
|
|
||||||
|
if [ -f "$APK_PATH" ]; then
|
||||||
|
echo -e "${GREEN}디버그 APK 빌드 성공!${NC}"
|
||||||
|
echo -e "APK 파일 위치: $(pwd)/$APK_PATH"
|
||||||
|
|
||||||
|
# 홈 디렉토리로 APK 복사
|
||||||
|
cp "$APK_PATH" "$DEST_PATH"
|
||||||
|
echo -e "${GREEN}APK를 홈 디렉토리에 복사했습니다: $DEST_PATH${NC}"
|
||||||
|
|
||||||
|
# 연결된 기기 확인
|
||||||
|
DEVICES=$(adb devices | grep -v "List" | grep "device" | wc -l)
|
||||||
|
if [ $DEVICES -gt 0 ]; then
|
||||||
|
echo -e "${YELLOW}연결된 기기가 감지되었습니다. 설치하시겠습니까? (y/n)${NC}"
|
||||||
|
read -r INSTALL
|
||||||
|
if [ "$INSTALL" = "y" ] || [ "$INSTALL" = "Y" ]; then
|
||||||
|
# 기기가 여러 개인 경우
|
||||||
|
if [ $(adb devices | grep -v "List" | grep "device" | wc -l) -gt 1 ]; then
|
||||||
|
echo -e "${YELLOW}여러 기기가 연결되어 있습니다. 특정 기기를 선택하세요:${NC}"
|
||||||
|
adb devices | grep -v "List" | grep "device"
|
||||||
|
echo -e "${YELLOW}기기 ID를 입력하세요:${NC}"
|
||||||
|
read -r DEVICE_ID
|
||||||
|
adb -s "$DEVICE_ID" install -r "$APK_PATH"
|
||||||
|
else
|
||||||
|
adb install -r "$APK_PATH"
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}설치 완료!${NC}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}연결된 기기가 없습니다. 다음 방법으로 APK를 설치할 수 있습니다:${NC}"
|
||||||
|
echo "1. USB 케이블로 폰을 연결하고 파일 전송"
|
||||||
|
echo "2. 이메일이나 메신저로 APK 파일 전송"
|
||||||
|
echo "3. adb 명령어 사용: adb install $DEST_PATH"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "${RED}APK 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$BUILD_TYPE" = "release-aab" ]; then
|
||||||
|
# AAB 릴리즈 빌드
|
||||||
|
./gradlew clean bundleRelease
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}릴리즈 AAB 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
AAB_PATH="app/build/outputs/bundle/release/app-release.aab"
|
||||||
|
DEST_PATH="$HOME/zellyy-finance-release.aab"
|
||||||
|
|
||||||
|
if [ -f "$AAB_PATH" ]; then
|
||||||
|
echo -e "${GREEN}릴리즈 AAB 빌드 성공!${NC}"
|
||||||
|
echo -e "AAB 파일 위치: $(pwd)/$AAB_PATH"
|
||||||
|
|
||||||
|
# 홈 디렉토리로 AAB 복사
|
||||||
|
cp "$AAB_PATH" "$DEST_PATH"
|
||||||
|
echo -e "${GREEN}AAB를 홈 디렉토리에 복사했습니다: $DEST_PATH${NC}"
|
||||||
|
|
||||||
|
echo -e "${YELLOW}다음 단계:${NC}"
|
||||||
|
echo "1. Google Play Console에 AAB 파일 업로드: $DEST_PATH"
|
||||||
|
echo "2. 내부 테스트 트랙을 선택하여 업로드"
|
||||||
|
echo "3. 검토 과정이 완료될 때까지 기다리기 (보통 몇 시간에서 24시간 소요)"
|
||||||
|
else
|
||||||
|
echo -e "${RED}AAB 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$BUILD_TYPE" = "release-apk" ]; then
|
||||||
|
# 서명된 APK 릴리즈 빌드
|
||||||
|
./gradlew clean assembleRelease
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}서명된 릴리즈 APK 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SIGNED_APK_PATH="app/build/outputs/apk/release/app-release.apk"
|
||||||
|
DEST_PATH="$HOME/zellyy-finance-release.apk"
|
||||||
|
|
||||||
|
if [ -f "$SIGNED_APK_PATH" ]; then
|
||||||
|
echo -e "${GREEN}서명된 릴리즈 APK 빌드 성공!${NC}"
|
||||||
|
echo -e "APK 파일 위치: $(pwd)/$SIGNED_APK_PATH"
|
||||||
|
|
||||||
|
# 홈 디렉토리로 APK 복사
|
||||||
|
cp "$SIGNED_APK_PATH" "$DEST_PATH"
|
||||||
|
echo -e "${GREEN}서명된 APK를 홈 디렉토리에 복사했습니다: $DEST_PATH${NC}"
|
||||||
|
|
||||||
|
# 연결된 기기 확인
|
||||||
|
DEVICES=$(adb devices | grep -v "List" | grep "device" | wc -l)
|
||||||
|
if [ $DEVICES -gt 0 ]; then
|
||||||
|
echo -e "${YELLOW}연결된 기기가 감지되었습니다. 설치하시겠습니까? (y/n)${NC}"
|
||||||
|
read -r INSTALL
|
||||||
|
if [ "$INSTALL" = "y" ] || [ "$INSTALL" = "Y" ]; then
|
||||||
|
# 기기가 여러 개인 경우
|
||||||
|
if [ $(adb devices | grep -v "List" | grep "device" | wc -l) -gt 1 ]; then
|
||||||
|
echo -e "${YELLOW}여러 기기가 연결되어 있습니다. 특정 기기를 선택하세요:${NC}"
|
||||||
|
adb devices | grep -v "List" | grep "device"
|
||||||
|
echo -e "${YELLOW}기기 ID를 입력하세요:${NC}"
|
||||||
|
read -r DEVICE_ID
|
||||||
|
adb -s "$DEVICE_ID" install -r "$SIGNED_APK_PATH"
|
||||||
|
else
|
||||||
|
adb install -r "$SIGNED_APK_PATH"
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}설치 완료!${NC}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}연결된 기기가 없습니다. 다음 방법으로 APK를 설치할 수 있습니다:${NC}"
|
||||||
|
echo "1. USB 케이블로 폰을 연결하고 파일 전송"
|
||||||
|
echo "2. 이메일이나 메신저로 APK 파일 전송"
|
||||||
|
echo "3. adb 명령어 사용: adb install $DEST_PATH"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "${RED}APK 빌드 실패. 오류를 확인하세요.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "${RED}지원되지 않는 빌드 타입입니다: $BUILD_TYPE${NC}"
|
||||||
|
echo -e "${YELLOW}사용법: ./build-apk-for-device.sh${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN}빌드 프로세스 완료: $(date)${NC}"
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -62,7 +62,7 @@
|
|||||||
"react-router-dom": "^6.26.2",
|
"react-router-dom": "^6.26.2",
|
||||||
"recharts": "^2.12.7",
|
"recharts": "^2.12.7",
|
||||||
"sonner": "^1.5.0",
|
"sonner": "^1.5.0",
|
||||||
"tailwind-merge": "^2.5.2",
|
"tailwind-merge": "^2.6.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"vaul": "^0.9.3",
|
"vaul": "^0.9.3",
|
||||||
@@ -7747,9 +7747,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tailwind-merge": {
|
"node_modules/tailwind-merge": {
|
||||||
"version": "2.5.4",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.0.tgz",
|
||||||
"integrity": "sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==",
|
"integrity": "sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
"react-router-dom": "^6.26.2",
|
"react-router-dom": "^6.26.2",
|
||||||
"recharts": "^2.12.7",
|
"recharts": "^2.12.7",
|
||||||
"sonner": "^1.5.0",
|
"sonner": "^1.5.0",
|
||||||
"tailwind-merge": "^2.5.2",
|
"tailwind-merge": "^2.6.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"vaul": "^0.9.3",
|
"vaul": "^0.9.3",
|
||||||
|
|||||||
5
scripts/Support
Executable file
5
scripts/Support
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "스크립트 실행 시작: $(date)"
|
||||||
|
echo "스크립트 경로: $0"
|
||||||
|
echo "스크립트 실행 완료: $(date)"
|
||||||
|
exit 0
|
||||||
38
scripts/cleanup-all-scripts.sh
Executable file
38
scripts/cleanup-all-scripts.sh
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 모든 스크립트 파일 정리 스크립트
|
||||||
|
echo "모든 불필요한 스크립트 파일 정리 중..."
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 유지할 스크립트 파일 목록
|
||||||
|
KEEP_FILES=(
|
||||||
|
"fix-splash-screen-final.sh"
|
||||||
|
"restore-previous-splash.sh"
|
||||||
|
"cleanup-all-scripts.sh"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 모든 .sh 파일 찾기
|
||||||
|
for script in *.sh; do
|
||||||
|
# 유지할 파일인지 확인
|
||||||
|
keep=false
|
||||||
|
for keep_file in "${KEEP_FILES[@]}"; do
|
||||||
|
if [ "$script" = "$keep_file" ]; then
|
||||||
|
keep=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 유지할 파일이 아니면 삭제
|
||||||
|
if [ "$keep" = false ]; then
|
||||||
|
echo "삭제: $script"
|
||||||
|
rm -f "$script"
|
||||||
|
else
|
||||||
|
echo "유지: $script"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "정리 완료!"
|
||||||
|
echo "남은 스크립트 파일:"
|
||||||
|
ls -la *.sh
|
||||||
28
scripts/cleanup-ios-backups.sh
Executable file
28
scripts/cleanup-ios-backups.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# iOS 백업 파일 정리 스크립트
|
||||||
|
echo "iOS 백업 파일 정리 중..."
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 백업 디렉토리 목록
|
||||||
|
BACKUP_DIRS=(
|
||||||
|
"ios_backup_20250319_215301"
|
||||||
|
"ios_backup_final_20250319_220935"
|
||||||
|
"ios.bak.20250319204258"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 백업 디렉토리 삭제
|
||||||
|
for dir in "${BACKUP_DIRS[@]}"; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
echo "삭제: $dir"
|
||||||
|
rm -rf "$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# .bak 파일 찾아서 삭제
|
||||||
|
echo "백업(.bak) 파일 삭제 중..."
|
||||||
|
find . -name "*.bak" -type f -print -delete
|
||||||
|
|
||||||
|
echo "정리 완료!"
|
||||||
70
scripts/fix-android-splash.sh
Executable file
70
scripts/fix-android-splash.sh
Executable file
@@ -0,0 +1,70 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 안드로이드 스플래시 화면 지연 문제 해결 스크립트
|
||||||
|
echo "안드로이드 스플래시 화면 지연 문제 해결 중..."
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 1. capacitor.config.ts 수정
|
||||||
|
echo "capacitor.config.ts 수정 중..."
|
||||||
|
cat > "capacitor.config.ts" << 'EOL'
|
||||||
|
import { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
|
const config: CapacitorConfig = {
|
||||||
|
appId: 'com.lovable.zellyfinance',
|
||||||
|
appName: '젤리의 적자탈출',
|
||||||
|
webDir: 'dist',
|
||||||
|
server: {
|
||||||
|
androidScheme: 'https',
|
||||||
|
iosScheme: 'https',
|
||||||
|
cleartext: true
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
SplashScreen: {
|
||||||
|
launchShowDuration: 1000,
|
||||||
|
launchAutoHide: true,
|
||||||
|
backgroundColor: "#FFFFFF",
|
||||||
|
androidSplashResourceName: "splash",
|
||||||
|
androidScaleType: "CENTER_CROP",
|
||||||
|
showSpinner: false,
|
||||||
|
splashFullScreen: false,
|
||||||
|
splashImmersive: false
|
||||||
|
},
|
||||||
|
Keyboard: {
|
||||||
|
resize: "body",
|
||||||
|
style: "dark",
|
||||||
|
resizeOnFullScreen: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ios: {
|
||||||
|
scheme: "App"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
EOL
|
||||||
|
echo "capacitor.config.ts 수정 완료"
|
||||||
|
|
||||||
|
# 2. App.tsx 수정
|
||||||
|
echo "App.tsx 수정 중..."
|
||||||
|
APP_TSX="src/App.tsx"
|
||||||
|
|
||||||
|
# App.tsx 파일에서 스플래시 화면 관련 코드 수정
|
||||||
|
# 타임아웃 값을 플랫폼에 따라 다르게 설정
|
||||||
|
sed -i '' 's/setTimeout(async () => {/setTimeout(async () => {/g' "$APP_TSX"
|
||||||
|
sed -i '' 's/}, 500); \/\/ 500ms로 줄임/}, 300); \/\/ 300ms로 줄임/g' "$APP_TSX"
|
||||||
|
|
||||||
|
echo "App.tsx 수정 완료"
|
||||||
|
|
||||||
|
# 3. 웹 앱 빌드
|
||||||
|
echo "웹 앱 빌드 중..."
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# 4. Capacitor 업데이트
|
||||||
|
echo "Capacitor 업데이트 중..."
|
||||||
|
npx cap copy android
|
||||||
|
|
||||||
|
echo "안드로이드 스플래시 화면 지연 문제 해결 완료!"
|
||||||
|
echo "이제 Android Studio에서 앱을 빌드하고 실행하세요."
|
||||||
|
echo "npx cap open android"
|
||||||
317
scripts/fix-splash-screen-final.sh
Executable file
317
scripts/fix-splash-screen-final.sh
Executable file
@@ -0,0 +1,317 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 스플래시 화면 표시 시간 강제 설정 스크립트
|
||||||
|
echo "스플래시 화면 표시 시간 강제 설정 중..."
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 1. 기존 Capacitor 스플래시 플러그인 비활성화하고 네이티브 스플래시 사용
|
||||||
|
echo "Capacitor 스플래시 설정 수정 중..."
|
||||||
|
cat > capacitor.config.ts << 'EOL'
|
||||||
|
import { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
|
const config: CapacitorConfig = {
|
||||||
|
appId: 'com.lovable.zellyfinance',
|
||||||
|
appName: '젤리의 적자탈출',
|
||||||
|
webDir: 'dist',
|
||||||
|
server: {
|
||||||
|
androidScheme: 'https',
|
||||||
|
iosScheme: 'https',
|
||||||
|
cleartext: true
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
SplashScreen: {
|
||||||
|
launchShowDuration: 0,
|
||||||
|
launchAutoHide: false,
|
||||||
|
backgroundColor: "#FFFFFF",
|
||||||
|
androidSplashResourceName: "splash",
|
||||||
|
androidScaleType: "CENTER_CROP",
|
||||||
|
showSpinner: false,
|
||||||
|
splashFullScreen: true,
|
||||||
|
splashImmersive: false
|
||||||
|
},
|
||||||
|
Keyboard: {
|
||||||
|
resize: "body",
|
||||||
|
style: "dark",
|
||||||
|
resizeOnFullScreen: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ios: {
|
||||||
|
scheme: "App",
|
||||||
|
contentInset: "always",
|
||||||
|
allowsLinkPreview: false,
|
||||||
|
scrollEnabled: true,
|
||||||
|
limitsNavigationsToAppBoundDomains: true,
|
||||||
|
backgroundColor: "#F2F2F2"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
EOL
|
||||||
|
|
||||||
|
# 2. AppDelegate.swift 수정 - 스플래시 화면 직접 제어
|
||||||
|
echo "AppDelegate.swift 수정 중..."
|
||||||
|
APP_DELEGATE="ios/App/App/AppDelegate.swift"
|
||||||
|
|
||||||
|
if [ -f "$APP_DELEGATE" ]; then
|
||||||
|
# 백업 생성
|
||||||
|
cp "$APP_DELEGATE" "${APP_DELEGATE}.bak_force"
|
||||||
|
|
||||||
|
# AppDelegate.swift 내용 교체 - 스플래시 화면 직접 제어
|
||||||
|
cat > "$APP_DELEGATE" << 'EOL'
|
||||||
|
import UIKit
|
||||||
|
import Capacitor
|
||||||
|
import WebKit
|
||||||
|
|
||||||
|
@UIApplicationMain
|
||||||
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
|
var window: UIWindow?
|
||||||
|
var splashView: UIView?
|
||||||
|
var startTime: Date?
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
// 시작 시간 기록
|
||||||
|
startTime = Date()
|
||||||
|
|
||||||
|
// 배경색 설정
|
||||||
|
self.window?.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.0)
|
||||||
|
|
||||||
|
// 웹뷰 캐시 설정 최적화
|
||||||
|
let websiteDataTypes = NSSet(array: [WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache])
|
||||||
|
let date = Date(timeIntervalSince1970: 0)
|
||||||
|
WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes as! Set<String>, modifiedSince: date, completionHandler:{ })
|
||||||
|
|
||||||
|
// 웹뷰 설정 최적화
|
||||||
|
let webViewConfig = WKWebViewConfiguration()
|
||||||
|
webViewConfig.allowsInlineMediaPlayback = true
|
||||||
|
webViewConfig.suppressesIncrementalRendering = false
|
||||||
|
webViewConfig.allowsAirPlayForMediaPlayback = true
|
||||||
|
webViewConfig.mediaTypesRequiringUserActionForPlayback = []
|
||||||
|
|
||||||
|
// 스플래시 화면 감지 설정
|
||||||
|
NotificationCenter.default.addObserver(self,
|
||||||
|
selector: #selector(handleWebViewDidLoad),
|
||||||
|
name: NSNotification.Name(rawValue: "capacitorWebViewDidLoad"),
|
||||||
|
object: nil)
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func handleWebViewDidLoad() {
|
||||||
|
// 웹뷰 로드 완료 시 스플래시 화면 제거 (최소 10초 이상 표시)
|
||||||
|
let minimumSplashTime: TimeInterval = 10.0
|
||||||
|
|
||||||
|
if let startTime = startTime {
|
||||||
|
let timeElapsed = Date().timeIntervalSince(startTime)
|
||||||
|
let remainingTime = max(0, minimumSplashTime - timeElapsed)
|
||||||
|
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + remainingTime) {
|
||||||
|
// 스플래시 화면 제거 요청
|
||||||
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "removeSplashScreen"), object: nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillResignActive(_ application: UIApplication) {
|
||||||
|
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||||
|
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||||
|
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||||
|
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||||
|
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||||
|
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillTerminate(_ application: UIApplication) {
|
||||||
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
|
}
|
||||||
|
|
||||||
|
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
||||||
|
// Called when the app was launched with a url. Feel free to add additional processing here,
|
||||||
|
// but if you want the App API to support tracking app url opens, make sure to keep this call
|
||||||
|
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
|
||||||
|
}
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
||||||
|
// Called when the app was launched with an activity, including Universal Links.
|
||||||
|
// Feel free to add additional processing here, but if you want the App API to support
|
||||||
|
// tracking app url opens, make sure to keep this call
|
||||||
|
return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. ViewController.swift 수정 - 스플래시 화면 직접 제어
|
||||||
|
echo "ViewController.swift 수정 중..."
|
||||||
|
VIEWCONTROLLER="ios/App/App/ViewController.swift"
|
||||||
|
|
||||||
|
if [ -f "$VIEWCONTROLLER" ]; then
|
||||||
|
# 백업 생성
|
||||||
|
cp "$VIEWCONTROLLER" "${VIEWCONTROLLER}.bak_force"
|
||||||
|
|
||||||
|
# ViewController.swift 내용 교체 - 스플래시 화면 직접 제어
|
||||||
|
cat > "$VIEWCONTROLLER" << 'EOL'
|
||||||
|
import UIKit
|
||||||
|
import Capacitor
|
||||||
|
import WebKit
|
||||||
|
|
||||||
|
class ViewController: CAPBridgeViewController {
|
||||||
|
|
||||||
|
private var splashView: UIView?
|
||||||
|
private var splashRemoved = false
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
// 배경색 설정 - 밝은 회색
|
||||||
|
self.view.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.0)
|
||||||
|
self.webView?.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.0)
|
||||||
|
|
||||||
|
// 스플래시 뷰 생성
|
||||||
|
setupSplashView()
|
||||||
|
|
||||||
|
// 웹뷰 로드 완료 감지
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(webViewDidFinishLoad), name: NSNotification.Name(rawValue: "capacitorWebViewDidLoad"), object: nil)
|
||||||
|
|
||||||
|
// 스플래시 화면 제거 요청 감지
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(removeSplashScreenRequested), name: NSNotification.Name(rawValue: "removeSplashScreen"), object: nil)
|
||||||
|
|
||||||
|
// 최대 표시 시간 설정 (15초 후 강제 제거)
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 15.0) {
|
||||||
|
self.removeSplashScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private func setupSplashView() {
|
||||||
|
// 스플래시 뷰 생성
|
||||||
|
splashView = UIView(frame: self.view.bounds)
|
||||||
|
splashView?.backgroundColor = UIColor.white
|
||||||
|
|
||||||
|
// 스플래시 이미지 추가
|
||||||
|
let imageView = UIImageView(image: UIImage(named: "Splash"))
|
||||||
|
imageView.contentMode = .scaleAspectFit
|
||||||
|
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
|
||||||
|
if let splashView = splashView {
|
||||||
|
self.view.addSubview(splashView)
|
||||||
|
splashView.addSubview(imageView)
|
||||||
|
|
||||||
|
NSLayoutConstraint.activate([
|
||||||
|
imageView.centerXAnchor.constraint(equalTo: splashView.centerXAnchor),
|
||||||
|
imageView.centerYAnchor.constraint(equalTo: splashView.centerYAnchor),
|
||||||
|
imageView.widthAnchor.constraint(equalToConstant: 200),
|
||||||
|
imageView.heightAnchor.constraint(equalToConstant: 200)
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc private func webViewDidFinishLoad() {
|
||||||
|
// 웹뷰 로드 완료 시 AppDelegate에 알림
|
||||||
|
// (AppDelegate에서 최소 표시 시간 계산 후 제거 요청)
|
||||||
|
print("웹뷰 로드 완료")
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc private func removeSplashScreenRequested() {
|
||||||
|
// 스플래시 화면 제거 요청 수신
|
||||||
|
removeSplashScreen()
|
||||||
|
}
|
||||||
|
|
||||||
|
private func removeSplashScreen() {
|
||||||
|
if !splashRemoved && splashView != nil {
|
||||||
|
splashRemoved = true
|
||||||
|
print("스플래시 화면 제거 중...")
|
||||||
|
UIView.animate(withDuration: 0.8, animations: {
|
||||||
|
self.splashView?.alpha = 0
|
||||||
|
}, completion: { _ in
|
||||||
|
self.splashView?.removeFromSuperview()
|
||||||
|
self.splashView = nil
|
||||||
|
print("스플래시 화면 제거 완료")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override func viewWillLayoutSubviews() {
|
||||||
|
super.viewWillLayoutSubviews()
|
||||||
|
|
||||||
|
// 웹뷰 배경색 설정
|
||||||
|
self.webView?.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.0)
|
||||||
|
self.webView?.scrollView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.0)
|
||||||
|
self.webView?.isOpaque = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. index.html 수정 - 웹뷰 로드 완료 알림 지연
|
||||||
|
echo "index.html 수정 중..."
|
||||||
|
INDEX_HTML="ios/App/App/public/index.html"
|
||||||
|
|
||||||
|
if [ -f "$INDEX_HTML" ]; then
|
||||||
|
# 백업 생성
|
||||||
|
cp "$INDEX_HTML" "${INDEX_HTML}.bak_force"
|
||||||
|
|
||||||
|
# 웹뷰 로드 완료 알림 코드 수정 - 지연 추가
|
||||||
|
sed -i '' '/<\/head>/i\
|
||||||
|
<style>\
|
||||||
|
body, html {\
|
||||||
|
background-color: #F2F2F2 !important;\
|
||||||
|
margin: 0;\
|
||||||
|
padding: 0;\
|
||||||
|
height: 100%;\
|
||||||
|
width: 100%;\
|
||||||
|
}\
|
||||||
|
</style>\
|
||||||
|
<script>\
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {\
|
||||||
|
// 배경색 설정\
|
||||||
|
document.body.style.backgroundColor = "#F2F2F2";\
|
||||||
|
\
|
||||||
|
// 스플래시 화면을 더 오래 표시하기 위해 지연 추가\
|
||||||
|
setTimeout(function() {\
|
||||||
|
console.log("웹뷰 로드 완료 알림 전송");\
|
||||||
|
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.bridge) {\
|
||||||
|
window.webkit.messageHandlers.bridge.postMessage({\
|
||||||
|
type: "notification",\
|
||||||
|
name: "capacitorWebViewDidLoad"\
|
||||||
|
});\
|
||||||
|
} else if (window.capacitor) {\
|
||||||
|
var event = new CustomEvent("capacitorWebViewDidLoad");\
|
||||||
|
document.dispatchEvent(event);\
|
||||||
|
}\
|
||||||
|
}, 3000); // 3초 지연\
|
||||||
|
});\
|
||||||
|
</script>' "$INDEX_HTML"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Info.plist 수정 - 스플래시 화면 관련 설정
|
||||||
|
echo "Info.plist 수정 중..."
|
||||||
|
INFO_PLIST="ios/App/App/Info.plist"
|
||||||
|
|
||||||
|
if [ -f "$INFO_PLIST" ]; then
|
||||||
|
# 백업 생성
|
||||||
|
cp "$INFO_PLIST" "${INFO_PLIST}.bak_force"
|
||||||
|
|
||||||
|
# UIApplicationExitsOnSuspend 설정 제거 (만약 있다면)
|
||||||
|
/usr/libexec/PlistBuddy -c "Delete :UIApplicationExitsOnSuspend" "$INFO_PLIST" 2>/dev/null || true
|
||||||
|
|
||||||
|
# 콘솔 로그 활성화
|
||||||
|
/usr/libexec/PlistBuddy -c "Add :OS_ACTIVITY_MODE string disable" "$INFO_PLIST" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Capacitor 설정 동기화
|
||||||
|
echo "Capacitor 설정 동기화 중..."
|
||||||
|
npx cap sync ios
|
||||||
|
|
||||||
|
echo "완료! 이제 Xcode에서 다시 빌드하세요."
|
||||||
|
echo "스플래시 화면이 최소 10초 이상 표시되도록 설정했습니다."
|
||||||
37
scripts/rebuild-app.sh
Executable file
37
scripts/rebuild-app.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 앱 재빌드 스크립트
|
||||||
|
echo "앱 재빌드 시작: $(date)"
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 최신 코드 가져오기
|
||||||
|
echo "최신 코드 가져오기..."
|
||||||
|
git pull
|
||||||
|
|
||||||
|
# 의존성 설치
|
||||||
|
echo "의존성 설치 중..."
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# 웹 앱 빌드
|
||||||
|
echo "웹 앱 빌드 중..."
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# Capacitor 웹 코드 복사
|
||||||
|
echo "Capacitor에 웹 코드 복사 중..."
|
||||||
|
npx cap copy
|
||||||
|
|
||||||
|
# iOS 앱 빌드 (Xcode 필요)
|
||||||
|
echo "iOS 앱 빌드 중..."
|
||||||
|
npx cap open ios
|
||||||
|
|
||||||
|
echo "앱 재빌드 완료!"
|
||||||
|
echo "iOS 앱을 빌드하려면 Xcode에서 다음 단계를 수행하세요:"
|
||||||
|
echo "1. Product > Clean Build Folder"
|
||||||
|
echo "2. Product > Build"
|
||||||
|
echo "3. Product > Run (시뮬레이터나 기기에서 테스트)"
|
||||||
|
|
||||||
|
# 안드로이드 앱 빌드 (Android Studio 필요)
|
||||||
|
# echo "안드로이드 앱 빌드 중..."
|
||||||
|
# npx cap open android
|
||||||
292
scripts/restore-previous-splash.sh
Executable file
292
scripts/restore-previous-splash.sh
Executable file
@@ -0,0 +1,292 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 이전 스플래시 화면 설정으로 복원하는 스크립트
|
||||||
|
echo "이전 스플래시 화면 설정으로 복원 중..."
|
||||||
|
|
||||||
|
# 프로젝트 디렉토리로 이동
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# 1. ViewController.swift 복원
|
||||||
|
echo "ViewController.swift 복원 중..."
|
||||||
|
VIEWCONTROLLER="ios/App/App/ViewController.swift"
|
||||||
|
|
||||||
|
if [ -f "${VIEWCONTROLLER}.bak_duration" ]; then
|
||||||
|
# 백업에서 복원
|
||||||
|
cp "${VIEWCONTROLLER}.bak_duration" "$VIEWCONTROLLER"
|
||||||
|
echo "ViewController.swift를 이전 버전으로 복원했습니다."
|
||||||
|
else
|
||||||
|
# 백업이 없는 경우 직접 작성
|
||||||
|
cat > "$VIEWCONTROLLER" << 'EOL'
|
||||||
|
import UIKit
|
||||||
|
import Capacitor
|
||||||
|
import WebKit
|
||||||
|
|
||||||
|
class ViewController: CAPBridgeViewController {
|
||||||
|
|
||||||
|
private var splashView: UIView?
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
// 스플래시 뷰 생성
|
||||||
|
setupSplashView()
|
||||||
|
|
||||||
|
// 웹뷰 로드 완료 감지
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(webViewDidFinishLoad), name: NSNotification.Name(rawValue: "capacitorWebViewDidLoad"), object: nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
private func setupSplashView() {
|
||||||
|
// 스플래시 뷰 생성
|
||||||
|
splashView = UIView(frame: self.view.bounds)
|
||||||
|
splashView?.backgroundColor = UIColor.white
|
||||||
|
|
||||||
|
// 스플래시 이미지 추가
|
||||||
|
let imageView = UIImageView(image: UIImage(named: "Splash"))
|
||||||
|
imageView.contentMode = .scaleAspectFit
|
||||||
|
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
|
||||||
|
if let splashView = splashView {
|
||||||
|
self.view.addSubview(splashView)
|
||||||
|
splashView.addSubview(imageView)
|
||||||
|
|
||||||
|
NSLayoutConstraint.activate([
|
||||||
|
imageView.centerXAnchor.constraint(equalTo: splashView.centerXAnchor),
|
||||||
|
imageView.centerYAnchor.constraint(equalTo: splashView.centerYAnchor),
|
||||||
|
imageView.widthAnchor.constraint(equalToConstant: 200),
|
||||||
|
imageView.heightAnchor.constraint(equalToConstant: 200)
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc private func webViewDidFinishLoad() {
|
||||||
|
// 웹뷰 로드 완료 시 스플래시 화면 제거 (2초 후)
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
|
UIView.animate(withDuration: 0.3, animations: {
|
||||||
|
self.splashView?.alpha = 0
|
||||||
|
}, completion: { _ in
|
||||||
|
self.splashView?.removeFromSuperview()
|
||||||
|
self.splashView = nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
|
// 웹뷰 로드 시작 시 스크립트 실행 (최대 2초 후 스플래시 제거)
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
||||||
|
if self.splashView != nil && self.splashView?.alpha == 1 {
|
||||||
|
UIView.animate(withDuration: 0.3, animations: {
|
||||||
|
self.splashView?.alpha = 0
|
||||||
|
}, completion: { _ in
|
||||||
|
self.splashView?.removeFromSuperview()
|
||||||
|
self.splashView = nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
echo "ViewController.swift를 재생성했습니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. AppDelegate.swift 복원
|
||||||
|
echo "AppDelegate.swift 복원 중..."
|
||||||
|
APP_DELEGATE="ios/App/App/AppDelegate.swift"
|
||||||
|
|
||||||
|
if [ -f "${APP_DELEGATE}.bak_bgcolor" ]; then
|
||||||
|
# 백업에서 복원
|
||||||
|
cp "${APP_DELEGATE}.bak_bgcolor" "$APP_DELEGATE"
|
||||||
|
echo "AppDelegate.swift를 이전 버전으로 복원했습니다."
|
||||||
|
else
|
||||||
|
# 백업이 없는 경우 직접 작성
|
||||||
|
cat > "$APP_DELEGATE" << 'EOL'
|
||||||
|
import UIKit
|
||||||
|
import Capacitor
|
||||||
|
import WebKit
|
||||||
|
|
||||||
|
@UIApplicationMain
|
||||||
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
// 웹뷰 캐시 설정 최적화
|
||||||
|
let websiteDataTypes = NSSet(array: [WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache])
|
||||||
|
let date = Date(timeIntervalSince1970: 0)
|
||||||
|
WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes as! Set<String>, modifiedSince: date, completionHandler:{ })
|
||||||
|
|
||||||
|
// 웹뷰 설정 최적화
|
||||||
|
let webViewConfig = WKWebViewConfiguration()
|
||||||
|
webViewConfig.allowsInlineMediaPlayback = true
|
||||||
|
webViewConfig.suppressesIncrementalRendering = false
|
||||||
|
webViewConfig.allowsAirPlayForMediaPlayback = true
|
||||||
|
webViewConfig.mediaTypesRequiringUserActionForPlayback = []
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillResignActive(_ application: UIApplication) {
|
||||||
|
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||||
|
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||||
|
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||||
|
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||||
|
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||||
|
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillTerminate(_ application: UIApplication) {
|
||||||
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
|
}
|
||||||
|
|
||||||
|
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
||||||
|
// Called when the app was launched with a url. Feel free to add additional processing here,
|
||||||
|
// but if you want the App API to support tracking app url opens, make sure to keep this call
|
||||||
|
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
|
||||||
|
}
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
||||||
|
// Called when the app was launched with an activity, including Universal Links.
|
||||||
|
// Feel free to add additional processing here, but if you want the App API to support
|
||||||
|
// tracking app url opens, make sure to keep this call
|
||||||
|
return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
echo "AppDelegate.swift를 재생성했습니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. capacitor.config.ts 복원
|
||||||
|
echo "capacitor.config.ts 복원 중..."
|
||||||
|
if [ -f "capacitor.config.ts.bak" ]; then
|
||||||
|
# 백업에서 복원
|
||||||
|
cp "capacitor.config.ts.bak" "capacitor.config.ts"
|
||||||
|
echo "capacitor.config.ts를 이전 버전으로 복원했습니다."
|
||||||
|
else
|
||||||
|
# 백업이 없는 경우 직접 작성
|
||||||
|
cat > "capacitor.config.ts" << 'EOL'
|
||||||
|
import { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
|
const config: CapacitorConfig = {
|
||||||
|
appId: 'com.lovable.zellyfinance',
|
||||||
|
appName: '젤리의 적자탈출',
|
||||||
|
webDir: 'dist',
|
||||||
|
server: {
|
||||||
|
androidScheme: 'https',
|
||||||
|
iosScheme: 'https',
|
||||||
|
cleartext: true
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
SplashScreen: {
|
||||||
|
launchShowDuration: 3000,
|
||||||
|
launchAutoHide: true,
|
||||||
|
backgroundColor: "#FFFFFF",
|
||||||
|
androidSplashResourceName: "splash",
|
||||||
|
androidScaleType: "CENTER_CROP",
|
||||||
|
showSpinner: false,
|
||||||
|
splashFullScreen: false,
|
||||||
|
splashImmersive: false
|
||||||
|
},
|
||||||
|
Keyboard: {
|
||||||
|
resize: "body",
|
||||||
|
style: "dark",
|
||||||
|
resizeOnFullScreen: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ios: {
|
||||||
|
scheme: "App"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
EOL
|
||||||
|
echo "capacitor.config.ts를 재생성했습니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. index.html 복원 (웹뷰 로드 완료 알림 코드 제거)
|
||||||
|
echo "index.html 복원 중..."
|
||||||
|
INDEX_HTML="ios/App/App/public/index.html"
|
||||||
|
|
||||||
|
if [ -f "${INDEX_HTML}.bak_bgcolor" ]; then
|
||||||
|
# 백업에서 복원
|
||||||
|
cp "${INDEX_HTML}.bak_bgcolor" "$INDEX_HTML"
|
||||||
|
echo "index.html을 이전 버전으로 복원했습니다."
|
||||||
|
else
|
||||||
|
echo "index.html 백업을 찾을 수 없습니다. 수동으로 확인이 필요합니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Info.plist 복원
|
||||||
|
echo "Info.plist 복원 중..."
|
||||||
|
INFO_PLIST="ios/App/App/Info.plist"
|
||||||
|
|
||||||
|
if [ -f "${INFO_PLIST}.bak_force" ]; then
|
||||||
|
# 백업에서 복원
|
||||||
|
cp "${INFO_PLIST}.bak_force" "$INFO_PLIST"
|
||||||
|
echo "Info.plist를 이전 버전으로 복원했습니다."
|
||||||
|
else
|
||||||
|
echo "Info.plist 백업을 찾을 수 없습니다. 수동으로 확인이 필요합니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. LaunchScreen.storyboard 복원
|
||||||
|
echo "LaunchScreen.storyboard 복원 중..."
|
||||||
|
cat > ios/App/App/Base.lproj/LaunchScreen.storyboard << 'EOL'
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
|
||||||
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Splash" translatesAutoresizingMaskIntoConstraints="NO" id="hLz-g1-Xcm">
|
||||||
|
<rect key="frame" x="87.5" y="233.5" width="200" height="200"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="width" constant="200" id="Zmm-k7-Wvl"/>
|
||||||
|
<constraint firstAttribute="height" constant="200" id="zrV-nL-Fgq"/>
|
||||||
|
</constraints>
|
||||||
|
</imageView>
|
||||||
|
</subviews>
|
||||||
|
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="hLz-g1-Xcm" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Jgv-Jh-bz9"/>
|
||||||
|
<constraint firstItem="hLz-g1-Xcm" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="YPE-Yx-CnE"/>
|
||||||
|
</constraints>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="53" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<resources>
|
||||||
|
<image name="Splash" width="200" height="200"/>
|
||||||
|
</resources>
|
||||||
|
</document>
|
||||||
|
EOL
|
||||||
|
|
||||||
|
# 7. Capacitor 설정 동기화
|
||||||
|
echo "Capacitor 설정 동기화 중..."
|
||||||
|
npx cap sync ios
|
||||||
|
|
||||||
|
echo "완료! 이제 Xcode에서 다시 빌드하세요."
|
||||||
Reference in New Issue
Block a user