diff --git a/.gitignore b/.gitignore index 2e54170..fda970f 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,11 @@ yarn-error.log* next-env.d.ts /src/generated/prisma + +# Android TWA build artifacts / keystore (절대 커밋 금지) +android/*.keystore +android/*.jks +android/*.aab +android/*.apk +android/app/ +android/.gradle/ diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..b9e1be5 --- /dev/null +++ b/android/README.md @@ -0,0 +1,37 @@ +# 모모유통 ERP — Android(TWA) 빌드 + +웹앱(momotogether.com)을 감싸는 **TWA(Trusted Web Activity)** 패키지 빌드 설정입니다. +패키지명 `com.momotogether.app` — `public/.well-known/assetlinks.json` 의 지문과 짝을 이룹니다. + +## 스토어 업로드 형식 +- **Google Play 스토어 → AAB** (필수) +- 직접 배포(사이드로드) → APK + +## ⚠️ 서명키(중요) +반드시 **기존에 쓰던 keystore 그대로** 사용해야 합니다. +다른 키로 서명하면 `assetlinks.json` 지문이 안 맞아 주소창이 다시 뜨고 **알림 위임(푸시)** 이 깨집니다. +- 기존 지문: `2A:55:B2:9E:03:51:2B:DE:28:E2:A4:34:15:9C:23:1F:21:B6:C0:43:9C:10:3B:6C:E2:D5:46:F7:AF:42:C3:97` +- Play App Signing 을 쓰는 경우, Play Console 의 **앱 서명 인증서 SHA-256** 도 assetlinks 에 포함되어야 합니다. + +## 방법 A — PWABuilder (권장, 로컬 툴 불필요) +1. https://www.pwabuilder.com 에서 `https://momotogether.com` 입력 +2. **Package For Stores → Android Package** +3. 옵션에서 **Notification delegation(알림 위임) 켜기** ✅ (이게 켜져야 "삼성 인터넷" 대신 앱 이름으로 알림이 옵니다) +4. **기존 서명키 업로드**(처음 만들 때 받은 keystore) — 새로 만들지 말 것 +5. **versionCode 를 현재 게시 버전보다 +1** 로 +6. 생성된 **.aab** 를 Play Console 에 새 버전으로 업로드 + +## 방법 B — Bubblewrap CLI (이 폴더의 twa-manifest.json 사용) +JDK 17 + Android SDK 필요. +```bash +npm i -g @bubblewrap/cli +cd android +# 기존 keystore 를 ./android.keystore 로 복사 (signingKey.path 와 일치) +bubblewrap build # app-release-bundle.aab(스토어용) + app-release-signed.apk(사이드로드용) 생성 +``` +- `twa-manifest.json` 의 `enableNotifications: true` 가 알림 위임 활성화 키입니다. +- 새 버전 낼 때마다 `appVersionCode` 를 올리세요. + +## 설치 후 (사용자) +홈화면 설치 → 첫 실행 시 **알림 권한 허용** → 출고요청 화면의 **알림 스위치 ON**. +그러면 새 품목 등록 시 "모모유통" 이름·아이콘으로 푸시가 옵니다. diff --git a/android/twa-manifest.json b/android/twa-manifest.json new file mode 100644 index 0000000..a045805 --- /dev/null +++ b/android/twa-manifest.json @@ -0,0 +1,40 @@ +{ + "packageId": "com.momotogether.app", + "host": "momotogether.com", + "name": "모모유통 ERP", + "launcherName": "모모ERP", + "display": "standalone", + "themeColor": "#1f2937", + "themeColorDark": "#1f2937", + "navigationColor": "#1f2937", + "navigationColorDark": "#1f2937", + "navigationDividerColor": "#1f2937", + "navigationDividerColorDark": "#1f2937", + "backgroundColor": "#ffffff", + "enableNotifications": true, + "startUrl": "/m/login", + "iconUrl": "https://momotogether.com/icon-512.png", + "maskableIconUrl": "https://momotogether.com/icon-512.png", + "monochromeIconUrl": "https://momotogether.com/badge-96.png", + "shortcuts": [], + "generatorApp": "bubblewrap-cli", + "webManifestUrl": "https://momotogether.com/manifest.json", + "fallbackType": "customtabs", + "features": {}, + "alphaDependencies": { "enabled": false }, + "enableSiteSettingsShortcut": true, + "isChromeOSOnly": false, + "isMetaQuest": false, + "fullScopeUrl": "https://momotogether.com/", + "minSdkVersion": 21, + "orientation": "portrait", + "fingerprints": [], + "additionalTrustedOrigins": [], + "retainedBundles": [], + "appVersion": "1.0.1", + "appVersionCode": 2, + "signingKey": { + "path": "./android.keystore", + "alias": "android" + } +}