diff --git a/APK.md b/APK.md new file mode 100644 index 0000000..2a1bebf --- /dev/null +++ b/APK.md @@ -0,0 +1,116 @@ +# ทำ CamCat เป็นไฟล์ .apk + +## ตอบสั้น ๆ + +ทำได้ — แต่ "เว็บแอป" คอมไพล์เป็น APK ตรง ๆ ไม่ได้ ต้องห่อด้วย **Capacitor (WebView + native bridge)** +ซึ่งจะได้ APK จริงที่เข้าถึง **กล้อง**, **ไฟล์ในเครื่อง** และ **share sheet ของ Android** ได้เต็มกว่าเดิม + +| ทาง | ได้อะไร | ข้อจำกัด | +|---|---|---| +| PWA (ตอนนี้) | ติดตั้งจาก Chrome, กล้อง, ZIP ดาวน์โหลด | ไฟล์ลง Download, แชร์ไฟล์ได้จำกัด, ไม่มีไอคอนแอปจริง | +| TWA (Bubblewrap/PWABuilder) | APK จาก Play Store ได้ | ยังเป็นเว็บล้วน — เข้าถึงไฟล์/แชร์ได้เท่าเดิม | +| **Capacitor WebView** (แนะนำ) | APK + ปลั๊กอิน Filesystem/Share/Camera | ต้อง build ด้วย Android SDK, APK ใหญ่ขึ้น ~4–6 MB | + +## สิ่งที่ปรับในโค้ดแล้ว + +- `app/js/native.js` — bridge ตรวจว่ากำลังรันใน APK (`Capacitor.isNativePlatform()`) + - `savePhoto()` → เขียนรูปจริงที่ `Documents/CamCat/<ชื่อโฟลเดอร์>/<ไฟล์>.jpg` + - `saveZip()` → เขียน ZIP ที่ `Documents/CamCat-ZIP/` + - `shareItems()` → เปิด share sheet ของ Android ด้วย FileProvider (รูปเดี่ยว/หลายรูป/ZIP) + - บนเว็บทุกฟังก์ชันคืน `null` → ใช้ทางเดิม (ดาวน์โหลด/Web Share) ไม่กระทบ PWA +- ถ่ายรูปใน APK = บันทึกทั้งใน IndexedDB **และ** ลงโฟลเดอร์จริงในเครื่องทันที +- ปุ่ม ZIP (โฟลเดอร์เดียว / ทุกโฟลเดอร์) ใน APK = เขียนลง `Documents/CamCat-ZIP` แทนการดาวน์โหลด +- หน้า diagnostics เพิ่มบรรทัด “โหมดแอป” และ “ที่เก็บไฟล์” + +## build + +ต้องมี **JDK 17** และ **Android SDK** (ยังไม่มีในเครื่องนี้) + +```bash +# 1) JDK 17 (Temurin) → ตั้ง JAVA_HOME +# 2) Android SDK commandline-tools → ตั้ง ANDROID_HOME + sdkmanager --licenses +# ติดตั้ง: platform-tools, platforms;android-34, build-tools;34.0.0 + +cd +./scripts/build-apk.sh # npm install → cap add android → cap sync → assembleDebug +# APK: android/app/build/outputs/apk/debug/app-debug.apk +``` + +ติดตั้งลงเครื่อง: เปิด “ติดตั้งจากแหล่งที่ไม่รู้จัก” แล้วกดไฟล์ APK (หรือ `adb install -r app-debug.apk`) + +## สิทธิ์ใน AndroidManifest (Capacitor สร้างให้บางส่วน — เติมเอง) + +```xml + + + +``` + +## กล้องใน WebView + +`getUserMedia()` ใน WebView ต้องมีสิทธิ์ CAMERA และ WebChromeClient อนุญาตคำขอ +ถ้าเปิดแอปแล้วภาพกล้องไม่ขึ้น ให้เพิ่มใน `MainActivity` (fallback): + +```java +@Override +public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) { + super.onRequestPermissionsResult(requestCode, permissions, results); + // Capacitor จะส่งต่อผลให้ WebView เองในเวอร์ชันใหม่ +} +``` + +ถ้ายังไม่ขึ้น ทางเลือกที่เสถียรกว่า: ใช้ `@capacitor/camera` ถ่ายภาพนิ่ง (ได้ JPEG + EXIF เต็ม) +แล้วคงพรีวิวด้วย `getUserMedia` — โค้ดฝั่งเว็บแยกอยู่แล้วที่ `js/camera.js` + +## แชร์ “โฟลเดอร์” + +Android แชร์ URI ของ **โฟลเดอร์** ผ่าน share sheet ไม่ได้ (intent รับได้เฉพาะไฟล์) +จึงมี 2 ทางที่ทำได้จริง: + +1. **แชร์ ZIP** — โฟลเดอร์อยู่ข้างใน zip (โครงสร้าง `<ชื่อโฟลเดอร์>/<รูป>.jpg`) +2. **แชร์หลายรูปพร้อมกัน** — `shareItems([{name, blob}, …])` ส่งหลาย URI ในครั้งเดียว + +## เซ็น release (ภายหลัง) + +```bash +keytool -genkey -v -keystore camcat.jks -keyalg RSA -keysize 2048 -validity 10000 -alias camcat +# android/key.properties + build.gradle signingConfigs → assembleRelease +``` + + +## APK ที่ build แล้ว (เครื่องนี้) + +| รายการ | ค่า | +|---|---| +| ไฟล์ | `dist/CamCat-1.0-debug.apk` (3.8 MB) | +| Package | `com.camcat.app` · label `CamCat` | +| Permissions | CAMERA, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION, WRITE_EXTERNAL_STORAGE (≤API 29) | +| Build | Gradle 8.2.1 + AGP + SDK 34, debug keystore | +| Toolchain ที่ติดตั้ง | `D:\AndroidToolchain\jdk-17.0.13`, `D:\AndroidToolchain\Sdk` | + +ติดตั้ง: คัดลอก APK ไปมือถือ → เปิด “ติดตั้งจากแหล่งที่ไม่รู้จัก” → กดติดตั้ง +หรือ `adb install -r dist/CamCat-1.0-debug.apk` + +### ที่เก็บไฟล์ใน APK + +`native.js` จะลองเขียน `DOCUMENTS` ก่อน (Android ≤10 เห็นใน My Files/Pictures) +ถ้าระบบปฏิเสธ (Android 11+ scoped storage) จะ fallback ไป app-specific external +(`Android/data/com.camcat.app/files/CamCat/...`) — ยังเข้าถึงได้ทาง USB/File Manager +ถ้าต้องการให้ลง `Documents`/`DCIM` จริงบน Android 11+ ต้องเพิ่มปลั๊กอิน MediaStore +(`@capacitor-community/media`) หรือขอ MANAGE_EXTERNAL_STORAGE (ข้อจำกัดของ Play Store) + + +## v1.1 (ล่าสุด) + +- ล็อกแนวตั้ง `android:screenOrientation="portrait"` — ถือแนวนอน UI ไม่หมุน +- เลือกอัตราส่วนภาพ 4:3 / 3:4 ได้ (กรอบพรีวิว + ครอปไฟล์จริง + เก็บใน meta.ratio) +- กันกล้องค้าง: `takePhoto()` timeout 4s, capture timeout 12s, watchdog 20s +- APK: `dist/CamCat-1.1-debug.apk` + + +## v1.2 + +- Auto-orient: อ่าน EXIF Orientation → bake พิกเซลให้ตรง → เขียน Orientation = 1 (กันแอปอื่นหมุนซ้ำ) +- ปุ่มหมุนซ้าย/ขวา 90° ในชีตรูป (บันทึกลง DB + เขียน EXIF ใหม่) +- ปุ่ม Volume up/down เป็นชัตเตอร์ (MainActivity → CustomEvent `camcat:shutter`, debounce 0.6s) +- APK: `dist/CamCat-1.2-debug.apk` diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..48354a3 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,101 @@ +# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore + +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ + +# Android Profiling +*.hprof + +# Cordova plugins for Capacitor +capacitor-cordova-android-plugins + +# Copied web assets +app/src/main/assets/public + +# Generated Config files +app/src/main/assets/capacitor.config.json +app/src/main/assets/capacitor.plugins.json +app/src/main/res/xml/config.xml diff --git a/android/app/.gitignore b/android/app/.gitignore new file mode 100644 index 0000000..043df80 --- /dev/null +++ b/android/app/.gitignore @@ -0,0 +1,2 @@ +/build/* +!/build/.npmkeep diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..6f84c34 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,54 @@ +apply plugin: 'com.android.application' + +android { + namespace "com.camcat.app" + compileSdk rootProject.ext.compileSdkVersion + defaultConfig { + applicationId "com.camcat.app" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + aaptOptions { + // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. + // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 + ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +repositories { + flatDir{ + dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' + } +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" + implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" + implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" + implementation project(':capacitor-android') + testImplementation "junit:junit:$junitVersion" + androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" + androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" + implementation project(':capacitor-cordova-android-plugins') +} + +apply from: 'capacitor.build.gradle' + +try { + def servicesJSON = file('google-services.json') + if (servicesJSON.text) { + apply plugin: 'com.google.gms.google-services' + } +} catch(Exception e) { + logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") +} diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle new file mode 100644 index 0000000..fa6803c --- /dev/null +++ b/android/app/capacitor.build.gradle @@ -0,0 +1,20 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN + +android { + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } +} + +apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" +dependencies { + implementation project(':capacitor-filesystem') + implementation project(':capacitor-share') + +} + + +if (hasProperty('postBuildExtras')) { + postBuildExtras() +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..f2c2217 --- /dev/null +++ b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.getcapacitor.myapp; + +import static org.junit.Assert.*; + +import android.content.Context; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.getcapacitor.app", appContext.getPackageName()); + } +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c3e76cd --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/com/camcat/app/MainActivity.java b/android/app/src/main/java/com/camcat/app/MainActivity.java new file mode 100644 index 0000000..91668c3 --- /dev/null +++ b/android/app/src/main/java/com/camcat/app/MainActivity.java @@ -0,0 +1,36 @@ +package com.camcat.app; + +import android.view.KeyEvent; + +import com.getcapacitor.BridgeActivity; + +/** + * CamCat — ใช้ปุ่มเพิ่ม/ลดเสียงเป็นชัตเตอร์ (เฉพาะ APK) + * ปุ่มเสียงถูกระบบกลืนก่อนถึง WebView จึงต้องดักที่ Activity แล้วส่ง event เข้า JS + */ +public class MainActivity extends BridgeActivity { + + @Override + public boolean dispatchKeyEvent(KeyEvent event) { + int code = event.getKeyCode(); + if (code == KeyEvent.KEYCODE_VOLUME_UP || code == KeyEvent.KEYCODE_VOLUME_DOWN) { + if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) { + triggerShutter(code == KeyEvent.KEYCODE_VOLUME_UP ? "up" : "down"); + } + return true; // ไม่ให้ event ไปเปลี่ยนระดับเสียง + } + return super.dispatchKeyEvent(event); + } + + private void triggerShutter(final String key) { + if (getBridge() == null || getBridge().getWebView() == null) return; + getBridge().getWebView().post(new Runnable() { + @Override + public void run() { + String js = "window.dispatchEvent(new CustomEvent('camcat:shutter',{detail:{key:'" + + key + "'}}));"; + getBridge().getWebView().evaluateJavascript(js, null); + } + }); + } +} diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png new file mode 100644 index 0000000..e31573b Binary files /dev/null and b/android/app/src/main/res/drawable-land-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png new file mode 100644 index 0000000..f7a6492 Binary files /dev/null and b/android/app/src/main/res/drawable-land-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png new file mode 100644 index 0000000..8077255 Binary files /dev/null and b/android/app/src/main/res/drawable-land-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png new file mode 100644 index 0000000..14c6c8f Binary files /dev/null and b/android/app/src/main/res/drawable-land-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png new file mode 100644 index 0000000..244ca25 Binary files /dev/null and b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png new file mode 100644 index 0000000..74faaa5 Binary files /dev/null and b/android/app/src/main/res/drawable-port-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png new file mode 100644 index 0000000..e944f4a Binary files /dev/null and b/android/app/src/main/res/drawable-port-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png new file mode 100644 index 0000000..564a82f Binary files /dev/null and b/android/app/src/main/res/drawable-port-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png new file mode 100644 index 0000000..bfabe68 Binary files /dev/null and b/android/app/src/main/res/drawable-port-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png new file mode 100644 index 0000000..6929071 Binary files /dev/null and b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..c7bd21d --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..d5fccc5 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png new file mode 100644 index 0000000..f7a6492 Binary files /dev/null and b/android/app/src/main/res/drawable/splash.png differ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..b5ad138 --- /dev/null +++ b/android/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..c023e50 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..2127973 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..b441f37 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..72905b8 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..8ed0605 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..9502e47 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..4d1e077 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..df0f158 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..853db04 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..6cdf97c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..2960cbb Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..8e3093a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..46de6e2 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..d2ea9ab Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..a40d73e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..c5d5899 --- /dev/null +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..64c42c5 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + + CamCat + CamCat + com.camcat.app + com.camcat.app + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..be874e5 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000..bd0c4d8 --- /dev/null +++ b/android/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java new file mode 100644 index 0000000..0297327 --- /dev/null +++ b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java @@ -0,0 +1,18 @@ +package com.getcapacitor.myapp; + +import static org.junit.Assert.*; + +import org.junit.Test; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..85a5dda --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,29 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.google.gms:google-services:4.4.0' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +apply from: "variables.gradle" + +allprojects { + repositories { + google() + mavenCentral() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle new file mode 100644 index 0000000..3d2db97 --- /dev/null +++ b/android/capacitor.settings.gradle @@ -0,0 +1,9 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN +include ':capacitor-android' +project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') + +include ':capacitor-filesystem' +project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android') + +include ':capacitor-share' +project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android') diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..2e87c52 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,22 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..033e24c Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..c747538 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100644 index 0000000..fcb6fca --- /dev/null +++ b/android/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..93e3f59 --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..3b4431d --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,5 @@ +include ':app' +include ':capacitor-cordova-android-plugins' +project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') + +apply from: 'capacitor.settings.gradle' \ No newline at end of file diff --git a/android/variables.gradle b/android/variables.gradle new file mode 100644 index 0000000..8ef305d --- /dev/null +++ b/android/variables.gradle @@ -0,0 +1,16 @@ +ext { + minSdkVersion = 22 + compileSdkVersion = 34 + targetSdkVersion = 34 + androidxActivityVersion = '1.8.0' + androidxAppCompatVersion = '1.6.1' + androidxCoordinatorLayoutVersion = '1.2.0' + androidxCoreVersion = '1.12.0' + androidxFragmentVersion = '1.6.2' + coreSplashScreenVersion = '1.0.1' + androidxWebkitVersion = '1.9.0' + junitVersion = '4.13.2' + androidxJunitVersion = '1.1.5' + androidxEspressoCoreVersion = '3.5.1' + cordovaAndroidVersion = '10.1.1' +} \ No newline at end of file diff --git a/app/README.md b/app/README.md index 283b95a..87136c5 100644 --- a/app/README.md +++ b/app/README.md @@ -5,15 +5,23 @@ PWA ถ่ายรูปหน้างาน แยกโฟลเดอร์ ## Features -- กล้องหลัง/หน้า, ไฟแฟลช (torch), ซูมแบบ pills 1×/2×/3×, เส้นแบ่ง 3 ส่วน +- กล้องหลัง/หน้า, ไฟแฟลช (torch), ซูมแบบ pills 1×/2×/3×, เส้นแบ่ง 3 ส่วน, อัตราส่วนภาพ 4:3 / 3:4 (ครอปจริง) +- จัดทิศทางภาพอัตโนมัติ (EXIF Orientation → หมุนพิกเซล → Orientation=1) + ปุ่มหมุนซ้าย/ขวาในชีตรูป +- APK: ปุ่มเพิ่ม/ลดเสียง = ชัตเตอร์, ล็อกแนวตั้ง - ถ่ายด้วย `ImageCapture.takePhoto()` (ความละเอียดเต็ม) fallback เป็น canvas -- เขียน EXIF ลงไฟล์จริง (Make/Model/DateTimeOriginal/GPS) ก่อนบันทึก → ติดไปตอนแชร์ -- โฟลเดอร์ชื่อเริ่มต้น `Site A <ปี พ.ศ.>-<เดือน>-<วัน>` อัตโนมัติ (Asia/Bangkok) -- ZIP **ทุกรูปในโฟลเดอร์** + `metadata.json` แล้วดาวน์โหลดลงเครื่อง -- ปุ่มแชร์ = สร้าง ZIP แล้วส่งเข้า share sheet ของ Samsung ไปแอปอื่น (fallback = ดาวน์โหลด) +- เขียน EXIF มาตรฐานลงไฟล์จริงก่อนบันทึก (Make/Model/Software/DateTimeOriginal/ExifVersion/ColorSpace/Resolution/ImageUniqueID + GPS ละเอียด/เวลา/ความแม่นยำ) → ติดไปตอนแชร์ +- โฟลเดอร์ชื่อเริ่มต้นอัตโนมัติ: `Site <ตัวอักษร> <ปี พ.ศ.>.<เดือน>.<วัน>.<ชั่วโมง>.<นาที>` + - ตัวอักษรไล่ a…z แล้วต่อ aa, ab … az, ba … (แบบคอลัมน์ Excel) + - ปุ่ม `+` บนหัวแอป = สร้างทันที · ปุ่ม "โฟลเดอร์ใหม่" = เปิดชีตแก้ชื่อก่อนสร้าง · เปลี่ยนชื่อทีหลังได้ (ปุ่มดินสอ) +- นำเข้าโฟลเดอร์ทีละหลายรายการจาก CSV (ดูหัวตารางด้านล่าง) — ไฟล์เปล่า: `templates/folders-template.csv` +- ZIP **ทุกรูปในโฟลเดอร์** (มีแต่ JPEG — metadata อยู่ใน EXIF ของแต่ละไฟล์) แล้วดาวน์โหลดลงเครื่อง + - โครงสร้างใน zip = `<ชื่อโฟลเดอร์>/<ไฟล์>.jpg` → แตกออกมาเป็นโฟลเดอร์จริง +- ปุ่ม **ZIP ทุกโฟลเดอร์** ที่หน้าโฟลเดอร์ → ไฟล์เดียว `CamCat-all-.zip` แยกโฟลเดอร์ย่อยครบทุกโฟลเดอร์ +- ปุ่ม ZIP = รวมทุกรูปในโฟลเดอร์แล้วดาวน์โหลดลงเครื่อง (ปุ่มแชร์ ZIP ถูกถอดออกตามคำสั่ง) - ธีมสว่าง/มืด/ตามระบบ (จำค่าไว้), safe-area, 100dvh, ปุ่ม ≥44px ตาม One UI - QR ลิงก์ทดสอบบนมือถือ (ต้อง HTTPS) + หน้าข้อมูลอุปกรณ์/กล้อง (diagnostics) - Offline: Service Worker + IndexedDB, ติดตั้งเป็น PWA ได้ +- คู่มือใช้งานหน้าเดียว (standalone HTML, พิมพ์/บันทึก PDF ได้): `manual.html` → เปิดที่ `/manual.html` ## Design (One UI) @@ -27,6 +35,44 @@ PWA ถ่ายรูปหน้างาน แยกโฟลเดอร์ | Accessibility | ข้อความ ≥4.5:1, ปุ่ม ≥44px, reduced-motion, focus ring | | หน้าเมนูกล้อง | โครมดำทั้งหน้าแบบ One UI Camera | +## นำเข้าโฟลเดอร์จาก CSV + +หัวตาราง 4 คอลัมน์ (ทุกคอลัมน์เว้นว่างได้): + +| คอลัมน์ | ความหมาย | +|---|---| +| `site` | คำนำหน้า เช่น `Site` (เว้นว่าง = `Site`) | +| `letter` | `a`…`z`, `aa`… (เว้นว่าง = ไล่ต่อจากโฟลเดอร์ที่มีอยู่ให้อัตโนมัติ) | +| `datetime` | `2569.10.25.21.45` (รับ `-` `/` `:` หรือ ค.ศ. ได้ เช่น `2026-10-25 21:45`) | +| `name` | ชื่อเต็ม ถ้าใส่จะใช้ค่านี้แทนการประกอบชื่อ | + +ตัวอย่าง: + +```csv +site,letter,datetime,name +Site,a,2569.10.25.21.45, +Site,b,2569.10.25.22.10, +Site,,2569.10.26.08.00,หน้างานพิเศษ +``` + +กติกาที่ระบบบังคับ: `letter` ต้อง a-z · `datetime` ต้องอ่านเป็นวันเวลาได้ · ชื่อซ้ำจะถูกข้ามพร้อมรายงานแถวที่ผิด + +## ปุ่มแชร์ ZIP (Web Share) + +1. ZIP ถูกสร้างล่วงหน้าหลังเปิดแกลเลอรี → กด "แชร์ ZIP" แล้วเรียก `navigator.share({files})` ทันทีในจังหวะแตะ (ไม่ให้ user activation หมดอายุ) +2. ถ้ายังไม่มี ZIP / เบราว์เซอร์ตัดสิทธิ์ → เปิดชีต "ZIP พร้อมแล้ว" ให้กด "แชร์ไปแอปอื่น" อีกครั้ง (activation ใหม่) หรือ "บันทึกไฟล์" +3. เบราว์เซอร์ที่ไม่รองรับแชร์ไฟล์ (เช่น Samsung Internet บางเวอร์ชัน) → ปุ่มแชร์ถูกปิด พร้อมปุ่มบันทึกไฟล์แทน + +## EXIF ที่ฝังในไฟล์ (per photo) + +| IFD | tag | +|---|---| +| IFD0 | 270 ImageDescription (`CamCat · <โฟลเดอร์>`) · 271 Make `samsung` · 272 Model `SM-S911B` · 274 Orientation · 282/283/296 Resolution · 305 Software · 306 DateTime | +| Exif | 36864 ExifVersion 0232 · 36867/36868 DateTimeOriginal/Digitized · 37121 ComponentsConfiguration · 37380 ExposureBias · 40961 ColorSpace sRGB · 40962/40963 Pixel dims · 41985–41994 (rendering modes) · 42016 ImageUniqueID | +| GPS | 0 Version · 1/2 LatRef+Lat · 3/4 LonRef+Lon · 5/6 Altitude · 7 TimeStamp · 27 ProcessingMethod · 29 DateStamp · 31 HPositioningError (±เมตร) | + +ไม่มีไฟล์ JSON แยก — เปิดรูปด้วยแอป Samsung Gallery / Google Photos / exiftool แล้วเห็นค่าพวกนี้ทันที + ## รันทดสอบ ```bash diff --git a/app/css/app.css b/app/css/app.css index 558a825..f642aa3 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -185,6 +185,11 @@ header h1 { } .icon-round svg { width: 22px; height: 22px; } .icon-round:active { transform: scale(0.94); background: var(--bg-2); } +.icon-round.primary { background: var(--accent); color: var(--on-accent); } +.icon-round.primary:active { background: var(--accent); filter: brightness(0.94); } + +.head-btns { display: flex; gap: 8px; align-items: center; } +.head-btns .btn { min-height: 40px; padding: 0 14px; font-size: 13px; } /* ── Main ────────────────────────────────────────────────── */ main { @@ -267,6 +272,27 @@ nav button:active .tab-ico { background: var(--bg-2); } min-height: 0; overflow: hidden; background: #000; + display: flex; + align-items: center; + justify-content: center; +} + +/* กรอบพรีวิวตามอัตราส่วนที่เลือก — เห็นอะไร ได้อย่างนั้น */ +.frame { + position: relative; + overflow: hidden; + background: #000; +} +/* ขนาดกรอบคำนวณด้วย JS (fitFrame) เพื่อไม่ให้ aspect-ratio ถูก max-height บิด */ +.frame.ratio-43, .frame.ratio-34 { width: 100%; height: 100%; } + +.cam-chip.ratio-chip { + width: auto; + min-width: 52px; + padding: 0 14px; + font-size: 13px; + font-weight: 700; + letter-spacing: 0.02em; } #video { @@ -276,6 +302,8 @@ nav button:active .tab-ico { background: var(--bg-2); } display: block; background: #000; } +.frame > #video, .frame > .grid-lines { position: absolute; inset: 0; } +.grid-lines { position: absolute; } .grid-lines { position: absolute; @@ -521,6 +549,9 @@ nav button:active .tab-ico { background: var(--bg-2); } .icon-btn:active { background: var(--bg-2); } .icon-btn.danger { color: var(--danger); } +.folder-bulk { padding: 4px var(--pad) 12px; } +.folder-bulk .btn { min-height: 50px; } + .storage-line { padding: 4px var(--pad) calc(20px + 4px); font-size: 12.5px; @@ -530,11 +561,14 @@ nav button:active .tab-ico { background: var(--bg-2); } } /* ── Gallery ─────────────────────────────────────────────── */ +.folder-view, .gallery-view { display: flex; flex-direction: column; min-height: 100%; } +.folder-view .folder-list { flex: 1; } +.folder-view .storage-line { padding-bottom: 6px; } .gallery-view .gallery-grid { flex: 1; align-content: start; } .gallery-grid { diff --git a/app/index.html b/app/index.html index ac20de5..f0a6b95 100644 --- a/app/index.html +++ b/app/index.html @@ -27,6 +27,9 @@
+ @@ -106,7 +109,7 @@ export function hero(kind, { title, text = "", steps = [], action = null, note =
`; } -export function syncCameraControls({ torchAvailable, torchOn, zoomRange, zoomValue, gridOn, count, thumbUrl, ready }) { +export function syncCameraControls({ torchAvailable, torchOn, zoomRange, zoomValue, gridOn, count, thumbUrl, ready, ratio }) { const chip = document.getElementById("chip-torch"); if (chip) { chip.hidden = !torchAvailable; @@ -134,6 +137,15 @@ export function syncCameraControls({ torchAvailable, torchOn, zoomRange, zoomVal } } + const frame = document.getElementById("cam-frame"); + const ratioChip = document.getElementById("chip-ratio"); + if (frame) { + const portrait = ratio === "3:4"; + frame.classList.toggle("ratio-43", !portrait); + frame.classList.toggle("ratio-34", portrait); + } + if (ratioChip) ratioChip.textContent = ratio || "4:3"; + const grid = document.getElementById("grid-lines"); if (grid) grid.classList.toggle("on", !!gridOn); const cnt = document.getElementById("shot-count"); @@ -147,9 +159,12 @@ export function syncCameraControls({ torchAvailable, torchOn, zoomRange, zoomVal // ── Folders ── export function renderFolders({ folders, counts, activeId, storage }) { const total = counts.reduce((a, b) => a + b, 0); - let html = `
+ let html = `

โฟลเดอร์

${folders.length} โฟลเดอร์ · ${total} รูป
- +
+ + +
`; if (!folders.length) { @@ -173,11 +188,17 @@ export function renderFolders({ folders, counts, activeId, storage }) { html += `
`; } + html += `
+ +
`; + html += `
พื้นที่เก็บในเครื่อง${storage ? ` · ใช้ ${fmtBytes(storage.usage)} จาก ${fmtBytes(storage.quota)}` : ""}
`; + + html += `
`; return html; } @@ -205,9 +226,8 @@ export function renderGallery({ folder, images, thumbUrl }) { html += ``; html += `
- - -
`; + + `; return html; } @@ -234,6 +254,12 @@ export function photoSheet({ record, url, folderName }) { } if (m.exif?.orientation) rows.push(["Orientation", String(m.exif.orientation)]); if (m.exif?.dateTimeOriginal) rows.push(["EXIF DateTimeOriginal", m.exif.dateTimeOriginal]); + if (m.exif?.software) rows.push(["Software", m.exif.software]); + if (m.exif?.gps?.dateStamp) { + const t = Array.isArray(m.exif.gps.timeStamp) ? m.exif.gps.timeStamp.map((x) => String(Math.round(x)).padStart(2, "0")).join(":") : ""; + rows.push(["GPS date/time", `${m.exif.gps.dateStamp}${t ? " " + t : ""}`]); + } + if (m.exif?.uniqueId) rows.push(["ImageUniqueID", m.exif.uniqueId.slice(0, 16) + "…"]); const rowsHtml = rows .map(([k, v]) => `
${esc(k)}${esc(v)}
`) @@ -244,7 +270,18 @@ export function photoSheet({ record, url, folderName }) {
${esc(humanDateTime(record.createdAt))}
${rowsHtml}
+
ข้อมูลทั้งหมดฝังอยู่ในไฟล์ JPEG (EXIF) แล้ว — ติดไปกับรูปตอนแชร์/ดาวน์โหลด ไม่มีไฟล์แยก
+ + +
+
@@ -265,9 +302,9 @@ export function folderSheet(mode, { id = "", name = "", suggested = "", count = } const isNew = mode === "new"; return `

${isNew ? "โฟลเดอร์ใหม่" : "เปลี่ยนชื่อโฟลเดอร์"}

-
ชื่อเริ่มต้นอิงวันที่ไทย (พ.ศ.) ของวันนี้ — แก้ไขได้
+
ชื่อเริ่มต้น = Site + ตัวอักษรถัดไป + ปี.เดือน.วัน.ชั่วโมง.นาที (แก้ได้)
+ value="${esc(isNew ? suggested : name)}" placeholder="Site a 2569.10.25.21.45"> ${isNew ? `
ถ้าชื่อซ้ำ ระบบจะเติม (2) ให้อัตโนมัติ
` : ""}
@@ -290,6 +327,64 @@ export function qrSheet(url) {
`; } +// ── CSV import ────────────────────────────────────────────── +export function csvSheet() { + return `

นำเข้าโฟลเดอร์จาก CSV

+
สร้างทีละหลายโฟลเดอร์ในครั้งเดียว — ชื่อที่ได้จะใช้กฎ Site + ตัวอักษร + ปี.เดือน.วัน.ชั่วโมง.นาที
+
+
siteคำนำหน้า เช่น Site (เว้นว่าง = Site)
+
lettera…z, aa… (เว้นว่าง = ไล่ต่ออัตโนมัติ)
+
datetime2569.10.25.21.45
+
nameชื่อเต็ม (ถ้าใส่ จะทับชื่อที่ประกอบ)
+
+
ตัวอย่างแถว
Site,a,2569.10.25.21.45,
Site,b,2569.10.25.22.10,
+
+ ไฟล์เปล่า + +
+
+ +
`; +} + +export function importResultSheet({ created, skipped, errors = [], total }) { + const list = errors.length + ? `
+ ข้าม ${skipped} แถว +
    ${errors.slice(0, 12).map((e) => `
  1. แถว ${e.row}: ${esc(e.reason)}
  2. `).join("")}
+ ${errors.length > 12 ? `
…อีก ${errors.length - 12} แถว
` : ""} +
` + : ""; + return `

สร้างโฟลเดอร์แล้ว ${created} รายการ

+
อ่าน ${total} แถว · สำเร็จ ${created} · ข้าม ${skipped}
+ ${list} +
+ +
`; +} + +// ── พร้อมแชร์ (หลังสร้าง ZIP) ──────────────────────────────── +export function shareReadySheet({ name, size, canShare, reason }) { + const status = canShare ? "พร้อมส่งเข้าแอปอื่น" : "เบราว์เซอร์นี้ไม่รองรับการแชร์ไฟล์"; + const note = canShare + ? "แตะปุ่มด้านล่างเพื่อเปิด share sheet ของ Samsung" + : "บันทึกไฟล์แล้วแชร์ผ่าน Files/My Files หรือเปิดด้วย Chrome"; + return `

ZIP พร้อมแล้ว

+
+
ไฟล์${esc(name)}
+
ขนาด${esc(fmtBytes(size))}
+
การแชร์${esc(status)}
+
+
${esc(note)}${reason ? " · " + esc(reason) : ""}
+
+ + +
+
+ +
`; +} + // ── Diagnostics ── export function diagnosticsSheet(rows) { const body = rows diff --git a/app/manual.html b/app/manual.html new file mode 100644 index 0000000..c232926 --- /dev/null +++ b/app/manual.html @@ -0,0 +1,682 @@ + + + + + + + + +คู่มือใช้งาน CamCat · CamCat Manual + + + + +
+
+
+ +

คู่มือใช้งาน CamCat + ถ่ายรูปแยกโฟลเดอร์ · Web App (PWA) · v2.2.2 +

+
+
+ + +
+
+
+ +
+ + +
+
+

แอปนี้ทำอะไร

+

CamCat คือเว็บแอป (ติดตั้งเป็น PWA ได้) สำหรับถ่ายรูปหน้างานบนมือถือ จัดกลุ่มเป็นโฟลเดอร์ตามไซต์ + พร้อมฝังข้อมูล EXIF/GPS ลงในไฟล์รูป รวบทั้งโฟลเดอร์เป็น ZIP แล้วดาวน์โหลดเก็บไว้

+
+ ถ่ายรูป + ไฟแฟลช + ซูม + โฟลเดอร์ Site a 2569.10.25.21.45 + นำเข้า CSV + EXIF + GPS ในไฟล์ + ZIP ทั้งโฟลเดอร์ + ใช้ได้แม้ออฟไลน์ +
+
+ + +
+

1เริ่มใช้งาน

+
เปิดผ่าน HTTPS เท่านั้น — กล้องจะทำงานเฉพาะหน้าเว็บที่ปลอดภัย
+ +

เปิดแอป

+
    +
  1. สแกน QR ที่ผู้ดูแลส่งให้ ด้วยกล้องมือถือ → เปิดลิงก์ใน Chrome
  2. +
  3. หรือพิมพ์ URL ที่ขึ้นต้นด้วย https:// ใน Chrome
  4. +
  5. อนุญาต กล้อง และ ตำแหน่ง (ตำแหน่งใช้ฝัง GPS ลงรูป)
  6. +
  7. ติดตั้งเป็นแอป: เมนู ⋮ → เพิ่มไปที่หน้าจอหลัก / ติดตั้งแอป
  8. +
+ +
+ ทำไมต้อง HTTPS + เบราว์เซอร์อนุญาต getUserMedia เฉพาะ secure context ถ้าเปิดด้วย + http://192.168.x.x จะไม่เห็นกล้องและมักไม่ขึ้น error ที่ชัดเจน +
+ +
+
ติดตั้งแล้วเปิดจากไอคอนบนหน้าจอหลัก ทำงานเต็มจอ (standalone)
+
ออฟไลน์เปิดแอปและถ่ายรูปได้ ข้อมูลเก็บในเครื่อง (IndexedDB)
+
ข้อมูลอยู่เครื่องไม่มีเซิร์ฟเวอร์เก็บรูป ลบแอป/ล้างข้อมูล = รูปหาย
+
+
+ + +
+

2สิทธิ์กล้องและตำแหน่ง

+
ครั้งแรกจะมีหน้าต่างขออนุญาต — ต้องกด “อนุญาต”
+ + + + + + + +
สิทธิ์ใช้ทำอะไรถ้าไม่อนุญาต
กล้อง (Camera)แสดงภาพสดและถ่ายรูปขึ้นหน้าแจ้งพร้อมปุ่ม “ลองใหม่”
ตำแหน่ง (Location)ฝังพิกัด GPS + ความแม่นยำลง EXIFถ่ายได้ปกติ แต่รูปไม่มี GPS
+ +

ถ้าเผลอกดบล็อกไปแล้ว (Samsung / Android)

+
    +
  1. การตั้งค่า → แอป → Chrome → สิทธิ์ → กล้อง → อนุญาต
  2. +
  3. ทำแบบเดียวกันกับ ตำแหน่ง
  4. +
  5. หรือกดไอคอนกุญแจ/แถบที่อยู่ → การอนุญาตของไซต์ → รีเซ็ตสิทธิ์
  6. +
  7. กลับมาเปิดแอปใหม่ แล้วกด “ลองใหม่”
  8. +
+ +
+ ถ้ากล้องไม่ขึ้นเลยทั้งที่อนุญาตแล้ว + มักเปิดผ่าน http:// อยู่ — ตรวจว่า URL ขึ้นต้นด้วย https:// + หรือเปิดในแท็บที่ไม่ได้ติดตั้งจากลิงก์ tunnel ที่หมดอายุ +
+
+ + +
+

3หน้าถ่ายรูป

+
แถบเมนูล่างมี 3 แท็บ: กล้อง · โฟลเดอร์ · รูปภาพ
+ + + + + + + + + + + + + + + + +
ปุ่มทำอะไร
มุมขวาบนสร้างโฟลเดอร์ใหม่ทันที (ชื่อตามกฎ) — ใช้บ่อยตอนเริ่มงาน
สลับธีม ตามระบบ → สว่าง → มืด
ข้อมูลอุปกรณ์และกล้อง (diagnostics)
วงกลมขาวตรงกลางชัตเตอร์ — ถ่ายและบันทึกเข้าช่องโฟลเดอร์ที่ใช้งาน
ปุ่มเพิ่ม/ลดเสียงชัตเตอร์สำรอง (เฉพาะ APK) — กดค้าง/กดรัวมี debounce 0.6 วิ
ไฟแฟลช (torch) — แสดงเฉพาะเครื่องที่รองรับ (S23 รองรับ)
สลับกล้องหน้า/หลัง
เปิด/ปิดเส้นแบ่ง 3 ส่วน
1× 2× 3×ซูมแบบแตะ (แสดงตามความสามารถของกล้อง)
4:3 / 3:4สลับอัตราส่วนภาพ — กรอบพรีวิวเปลี่ยนตาม และไฟล์ที่ได้ถูกครอปตามจริง
รูปย่อซ้ายล่างเปิดรูปล่าสุดที่เพิ่งถ่าย
+ +

ระหว่างถ่าย

+
    +
  • รูปถูกบันทึกทันทีที่กดชัตเตอร์ พร้อม EXIF และ GPS (ถ้าอนุญาต)
  • +
  • เลขมุมขวาล่างบอกจำนวนรูปในโฟลเดอร์ปัจจุบัน
  • +
  • ออกจากแท็บกล้อง กล้องจะหยุดเพื่อประหยัดแบต — กลับมาเปิดใหม่ให้อัตโนมัติ
  • +
  • สลับแอประหว่างถ่าย กล้องจะถูกปิดและเปิดใหม่เมื่อกลับมา
  • +
+ +
+ ภาพตั้งตรงอัตโนมัติ + หลังถ่าย ระบบอ่าน EXIF Orientation ของไฟล์ → หมุนพิกเซลให้ตั้งตรง → เขียน Orientation = 1 กลับ + (ถ้าเบราว์เซอร์หมุนให้อยู่แล้วจะ bake ทับ ไม่หมุนซ้ำ) · ถ้าภาพยังเอียง ใช้ปุ่มหมุนซ้าย/ขวาในชีตรูป +
+ +
+ แนวนอนไม่พัง + เวอร์ชัน APK ล็อกแนวตั้ง (screenOrientation=portrait) — ถือมือถือแนวนอน UI ไม่หมุนตาม + ยังกดชัตเตอร์ถ่ายได้ปกติ · บนเว็บ เบราว์เซอร์อาจหมุนจอเองแต่ปุ่มยังอยู่ในกรอบ +
+ +
+ ได้ความละเอียดเท่าไร + แอปจะใช้ ImageCapture.takePhoto() เพื่อดึงภาพนิ่งความละเอียดสูงสุดที่เบราว์เซอร์อนุญาต + ถ้าเครื่องนั้นไม่รองรับ จะถ่ายเฟรมจากวิดีโอแทน (ความละเอียดเท่าสตรีม เช่น 1920×1080) + ดูค่าจริงได้ที่ปุ่ม → “สตรีมกล้อง” +
+
+ + +
+

4โฟลเดอร์และกฎการตั้งชื่อ

+
ชื่อเริ่มต้นสร้างให้อัตโนมัติ ไม่ต้องพิมพ์
+ +

รูปแบบ: Site <ตัวอักษร> <ปี พ.ศ.>.<เดือน>.<วัน>.<ชั่วโมง>.<นาที>

+
Site a 2569.10.25.21.45
+Site b 2569.10.25.22.10
+Site c 2569.10.26.08.00
+ +

ตัวอักษรไล่อย่างไร

+

นับแบบคอลัมน์ Excel: a … z → aa, ab … az → ba … bz → ca … ไปเรื่อย ๆ + ระบบเลือกตัวอักษรถัดไปจากชื่อโฟลเดอร์ที่มีอยู่จริง จึงไม่ชนกันแม้ลบหรือเปลี่ยนชื่อโฟลเดอร์เก่า

+ + + + + + + + + + + +
ปุ่มในหน้าโฟลเดอร์ผล
+ โฟลเดอร์ใหม่เปิดชีตให้ตรวจ/แก้ชื่อก่อนสร้าง
CSVสร้างหลายโฟลเดอร์พร้อมกันจากไฟล์ (ดูข้อ 5)
ZIP ทุกโฟลเดอร์รวมทุกโฟลเดอร์เป็น ZIP เดียว แล้วดาวน์โหลด (แต่ละโฟลเดอร์เป็นโฟลเดอร์ย่อย)
เปลี่ยนชื่อโฟลเดอร์ (เปลี่ยนได้ตลอด ไม่กระทบรูป)
ลบโฟลเดอร์ และรูปทั้งหมดในนั้น — กู้คืนไม่ได้
แตะที่แถวโฟลเดอร์ตั้งเป็นโฟลเดอร์ที่ใช้งาน (pill ใต้ชื่อแอปจะเปลี่ยน)
+ +
+ ลบโฟลเดอร์ = ลบรูปในเครื่องถาวร + ถ้ารูปสำคัญ ให้ ZIP ออกมาก่อนทุกครั้ง +
+
+ + +
+

5นำเข้าโฟลเดอร์จาก CSV

+
สร้างทีละหลายโฟลเดอร์จากไฟล์ Excel / Google Sheets ที่บันทึกเป็น CSV
+ +

หัวตาราง 4 คอลัมน์

+
+ + + + + + + + +
คอลัมน์ค่าเว้นว่างได้
siteคำนำหน้า เช่น Siteได้ → ใช้ Site
lettera…z, aa…ได้ → ไล่ต่ออัตโนมัติ
datetime2569.10.25.21.45 (รับ 2026-10-25 21:45 ด้วย)ไม่ได้ ถ้าไม่มี name
nameชื่อเต็ม — ถ้าใส่ จะใช้แทนชื่อที่ประกอบขึ้นได้
+
+ +

ตัวอย่างไฟล์

+
site,letter,datetime,name
+Site,a,2569.10.25.21.45,
+Site,b,2569.10.25.22.10,
+Site,,2569.10.26.08.00,หน้างานพิเศษ
+ +

ไฟล์เปล่า (หัวตารางเท่านั้น) ดาวน์โหลดได้ในชีต CSV → ปุ่ม ไฟล์เปล่า + หรือที่ templates/folders-template.csv

+ +

วิธีใช้

+
    +
  1. เปิดแท็บ โฟลเดอร์ → กด CSV
  2. +
  3. กด เลือกไฟล์ CSV แล้วเลือกไฟล์จากเครื่อง
  4. +
  5. ระบบสร้างโฟลเดอร์ทีละรายการ แล้วสรุปผลให้ดู
  6. +
+ +
+ แถวที่ถูกข้าม + ระบบจะบอกเลขแถวและเหตุผล เช่น แถว 5: datetime "bad" อ่านไม่ได้ หรือ + ชื่อซ้ำ: Site g 2569.10.26.11.00 — แถวที่ถูกต้องยังถูกสร้างตามปกติ +
+ +

ข้อควรระวังของไฟล์

+
    +
  • บันทึกเป็น CSV UTF-8 (Excel: “CSV UTF-8 (comma delimited)”) เพื่อให้ชื่อไทยไม่เพี้ยน
  • +
  • คั่นด้วย comma หรือ semicolon หรือ tab ก็ได้ (ระบบตรวจให้อัตโนมัติ)
  • +
  • ชื่อที่มี comma ให้ครอบด้วย "…"
  • +
  • ปีที่กรอกเป็น ค.ศ. ระบบแปลงเป็น พ.ศ. ให้ (บวก 543)
  • +
+
+ + + + + +
+

7ZIP และการแชร์

+
รวมทุกรูปในโฟลเดอร์เป็นไฟล์เดียว แล้วดาวน์โหลดลงเครื่อง
+ +

ในแท็บ รูปภาพ มีปุ่มเดียวที่แถบล่าง: ZIP ทั้งโฟลเดอร์ (N รูป)

+ +

สิ่งที่ได้ในไฟล์ ZIP

+
Site b 2569.10.25.23.10.zip
+└── Site b 2569.10.25.23.10/        ← โฟลเดอร์จริงในไฟล์ zip
+    ├── Site_b_2569.10.25.23.10_0001.jpg
+    └── Site_b_2569.10.25.23.10_0002.jpg
+
    +
  • แตกไฟล์แล้วได้ โฟลเดอร์ ไม่ใช่รูปกระจัดกระจายที่ root
  • +
  • ไฟล์ JPEG ทุกรูปอยู่ข้างใน (ไม่บีบอัดซ้ำ เพื่อความเร็วบนมือถือ)
  • +
  • ไม่มีไฟล์ JSON แยก — metadata อยู่ใน EXIF ของแต่ละรูป (ดูข้อ 8)
  • +
+ +

ZIP ทุกโฟลเดอร์ (ครั้งเดียว)

+

หน้าโฟลเดอร์ → ปุ่ม ZIP ทุกโฟลเดอร์ (N รูป) ได้ไฟล์เดียวชื่อ + CamCat-all-YYYYMMDD-HHMM.zip โดยแต่ละโฟลเดอร์เป็นโฟลเดอร์ย่อยของตัวเอง:

+
CamCat-all-20261029-0002.zip
+├── Site a 2569.10.25.21.45/
+│   └── Site_a_2569.10.25.21.45_0001.jpg
+└── Site b 2569.10.25.23.10/
+    └── Site_b_2569.10.25.23.10_0001.jpg
+ +

ปลายทางของไฟล์

+
    +
  • Chrome จะบันทึกที่โฟลเดอร์ Download ของเครื่อง (ดูได้ใน My Files → Downloads)
  • +
  • ชื่อไฟล์ zip ใช้ชื่อโฟลเดอร์ เช่น Site a 2569.10.25.22.15.zip
  • +
  • ต้องมีพื้นที่ว่างพอ — ขนาด zip ≈ ผลรวมขนาดรูป (บวกไม่กี่ KB)
  • +
+ +
+ ปุ่มแชร์ ZIP ถูกถอดออกแล้ว + ถ้าต้องการส่งเข้าแอปอื่น ให้ดาวน์โหลด ZIP แล้วแชร์จาก My Files + ส่วนการส่งรูปเดี่ยวใช้ปุ่ม แชร์รูปนี้ ในชีตรูปได้ทันที +
+
+ + +
+

8EXIF ที่ฝังอยู่ในไฟล์

+
เปิดรูปด้วย Samsung Gallery / Google Photos / exiftool แล้วเห็นข้อมูลทันที
+ +
+ + + + + + + +
กลุ่ม (IFD)แท็กที่เขียน
IFD0ImageDescription (CamCat · ชื่อโฟลเดอร์), Make, Model, Artist, Orientation, X/YResolution + Unit, Software, DateTime
ExifExifVersion 0232, DateTimeOriginal, DateTimeDigitized, ComponentsConfiguration, ColorSpace (sRGB), PixelXDimension, PixelYDimension, ExposureBias, ExposureMode/WhiteBalance/DigitalZoomRatio/Contrast/Saturation/Sharpness, ImageUniqueID
GPSGPSVersionID, Latitude/Longitude (องศา-ลิปดา-ฟิลิปดา), Altitude, GPSTimeStamp, GPSDateStamp, GPSProcessingMethod, GPSHPositioningError (± เมตร)
+
+ +
+ ชื่อโฟลเดอร์ภาษาไทย + แท็ก ASCII เก็บได้เฉพาะอักษรละติน ระบบจึงเก็บชื่อไทยไว้ใน XPComment / XPKeywords + (UTF-16LE) ทำให้เปิดใน Windows Explorer หรือโปรแกรมที่อ่าน XP tags แล้วเห็นชื่อไทยครบ +
+ +
+ สิ่งที่เบราว์เซอร์ทำให้ไม่ได้ + ไม่สามารถสร้าง MakerNote เฉพาะของ Samsung (โหมดถ่าย, เลนส์, ค่าเฉพาะเครื่อง) หรือไฟล์ HEIF ได้ + เพราะเป็นข้อมูล proprietary ของแอปกล้องเครื่อง — EXIF มาตรฐานตามตารางข้างบนครบถ้วน +
+
+ + +
+

9ธีม & ข้อมูลเครื่อง

+ +

ธีม

+

ปุ่ม ☾/☀ บนหัวแอป วน 3 สถานะ: ตามระบบ → สว่าง → มืด ค่าถูกจำไว้ในเครื่อง

+ +

ข้อมูลอุปกรณ์และกล้อง

+

กด บนหัวแอป หรือปุ่มในหน้าโฟลเดอร์ จะเห็น:

+
    +
  • รุ่นเครื่อง (เช่น Galaxy S23 (SM-S911B)) และเวอร์ชัน Android/Chrome
  • +
  • ขนาดหน้าจอ CSS, DPR, visualViewport, โหมดติดตั้ง PWA
  • +
  • สถานะ HTTPS (จำเป็นต่อกล้อง), URL ปัจจุบัน
  • +
  • ความละเอียดสตรีมกล้อง, กล้องหน้า/หลัง, การรองรับ ImageCapture
  • +
  • ไฟแฟลช, ช่วงซูม, โหมดโฟกัส, การรองรับแชร์ไฟล์
  • +
  • พื้นที่เก็บข้อมูลที่ใช้ไป และจำนวนโฟลเดอร์/รูป
  • +
+ +

QR ลิงก์ทดสอบ

+

หน้าโฟลเดอร์ → QR ลิงก์ทดสอบ แสดง QR ของ URL ที่กำลังเปิดอยู่ + ใช้ส่งต่อให้เครื่องอื่น หรือเช็กว่าลิงก์เป็น https:// จริง

+
+ + +
+

10ปัญหาที่พบบ่อย

+ +

เปิดแอปแล้วไม่เห็นภาพกล้อง

+
    +
  • URL ต้องเป็น https:// (ไม่ใช่ http:// และไม่ใช่ IP ใน LAN ตรง ๆ)
  • +
  • ตรวจสิทธิ์กล้องของ Chrome ตามข้อ 2
  • +
  • ปิดแอปอื่นที่ใช้กล้องอยู่ (กล้อง/วิดีโอคอล) แล้วกด “ลองใหม่”
  • +
+ +

ไม่มี GPS ในรูป

+
    +
  • ยังไม่ได้อนุญาตสิทธิ์ตำแหน่ง → อนุญาตแล้วถ่ายใหม่
  • +
  • อยู่ในที่ร่ม/ในอาคาร GPS อาจไม่ล็อกภายใน 7 วินาที (แอปจะบันทึกรูปโดยไม่มีพิกัด)
  • +
+ +

รูปที่ถ่ายได้ความละเอียดไม่สูง

+
    +
  • เครื่องนั้นไม่รองรับ ImageCapture → ระบบใช้เฟรมวิดีโอ (ดู “ที่มาไฟล์” ในชีตรูป)
  • +
  • ตรวจค่าจริงได้ที่หน้า diagnostics → “สตรีมกล้อง”
  • +
+ +

กด ZIP แล้วไม่มีไฟล์

+
    +
  • ดูที่ Chrome → ดาวน์โหลด (หรือ My Files → Downloads)
  • +
  • ถ้าพื้นที่เครื่องเต็ม การดาวน์โหลดจะล้มเหลว — ลบรูปเก่าหรือย้าย ZIP ออกก่อน
  • +
+ +

ลิงก์ที่ได้มาเปิดไม่ได้

+
    +
  • ลิงก์ tunnel เป็นลิงก์ชั่วคราว ถ้าเซิร์ฟเวอร์/เครื่องแม่ข่ายปิด จะใช้ไม่ได้ทันที — ขอ QR ใหม่
  • +
+ +

ข้อมูลในแอปหายหลังล้างข้อมูลเบราว์เซอร์

+
    +
  • รูปเก็บใน IndexedDB ของเบราว์เซอร์ การ “ล้างข้อมูลไซต์” หรือถอนการติดตั้งจะลบทั้งหมด → ZIP เก็บไว้เป็นประจำ
  • +
+
+ + +
+

11ข้อจำกัดที่ควรรู้

+
    +
  • ต้องมี HTTPS — ไม่มีทางเลี่ยงได้บนมือถือ (ยกเว้นตั้งค่า chrome://flags เป็นกรณียกเว้น)
  • +
  • EXIF เฉพาะมาตรฐาน — ไม่มี MakerNote ของ Samsung/HEIF
  • +
  • ข้อมูลอยู่ในเครื่องนี้เท่านั้น — ไม่ซิงก์ข้ามเครื่อง ไม่มี backup อัตโนมัติ
  • +
  • พื้นที่เก็บ — เบราว์เซอร์ให้พื้นที่ตาม quota ของเครื่อง (ดูในหน้า diagnostics)
  • +
  • การแชร์ไฟล์ — ใช้ได้เฉพาะเบราว์เซอร์ที่รองรับ Web Share ระดับไฟล์ (Chrome Android รองรับ)
  • +
+
+ + +
+

12สำหรับผู้ดูแลระบบ

+ +

รันบนเครื่องทดสอบ

+
cd app
+python -m http.server 8099 --bind 0.0.0.0
+
+# กล้องต้องใช้ HTTPS → เปิด tunnel
+cloudflared tunnel --url http://127.0.0.1:8099 --no-autoupdate
+ +

ไฟล์สำคัญ

+
+ + + + + + + + + + + + + + +
ไฟล์หน้าที่
index.htmlโครงหน้า + header/nav
css/app.cssDesign tokens + คอมโพเนนต์ (light/dark)
js/main.jsstate, event, ธีม, diagnostics
js/camera.jsgetUserMedia, ImageCapture, torch, zoom
js/exif.jsเขียน/อ่าน EXIF (piexifjs)
js/csv.jsparse CSV + วางแผนสร้างโฟลเดอร์
js/naming.jsกฎชื่อ Site + ตัวอักษร + เวลาไทย
js/archive.jsสร้าง ZIP + ดาวน์โหลด/แชร์
sw.js / manifest.jsonPWA cache + ข้อมูลติดตั้ง
templates/folders-template.csvไฟล์ CSV เปล่า (หัวตาราง)
+
+ +
+ อัปเดตแอปแล้วไม่เห็นของใหม่ + Service Worker จะถือไฟล์เวอร์ชันเก่า — เพิ่มเลข CACHE ใน sw.js + แล้วปิด/เปิดแท็บใหม่ หรือล้างข้อมูลไซต์ +
+
+
+
+ +
CamCat v2.2.2 · เอกสารหน้าเดียว (standalone) · พิมพ์/บันทึกเป็น PDF ได้จากปุ่มพิมพ์มุมขวาบน
+ + + + diff --git a/app/sw.js b/app/sw.js index e435eb6..9609ffc 100644 --- a/app/sw.js +++ b/app/sw.js @@ -1,10 +1,11 @@ // Service Worker — CamCat 2.0 // กลยุทธ์: navigation = network-first (ได้เวอร์ชันใหม่ก่อน) · asset = stale-while-revalidate -const CACHE = "camcat-v2.1.1"; +const CACHE = "camcat-v2.6.0"; const ASSETS = [ "./", "./index.html", + "./manual.html", "./manifest.json", "./css/app.css", "./js/config.js", @@ -14,11 +15,15 @@ const ASSETS = [ "./js/device.js", "./js/camera.js", "./js/archive.js", + "./js/csv.js", + "./js/native.js", + "./js/orient.js", "./js/ui.js", "./js/main.js", "./vendor/jszip.min.js", "./vendor/piexif.js", "./vendor/qrcode.min.js", + "./templates/folders-template.csv", "./icon-192.png", "./icon-512.png", ]; diff --git a/app/templates/folders-template.csv b/app/templates/folders-template.csv new file mode 100644 index 0000000..5d12b46 --- /dev/null +++ b/app/templates/folders-template.csv @@ -0,0 +1 @@ +site,letter,datetime,name diff --git a/capacitor.config.json b/capacitor.config.json new file mode 100644 index 0000000..38c5856 --- /dev/null +++ b/capacitor.config.json @@ -0,0 +1,19 @@ +{ + "appId": "com.camcat.app", + "appName": "CamCat", + "webDir": "app", + "bundledWebRuntime": false, + "android": { + "allowMixedContent": false, + "webContentsDebuggingEnabled": true + }, + "server": { + "androidScheme": "https" + }, + "plugins": { + "SplashScreen": { + "launchAutoHide": true, + "backgroundColor": "#F2F3F5" + } + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..aa93cc7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1279 @@ +{ + "name": "camcat", + "version": "2.3.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "camcat", + "version": "2.3.0", + "dependencies": { + "@capacitor/android": "^6.2.0", + "@capacitor/core": "^6.2.0", + "@capacitor/filesystem": "^6.0.1", + "@capacitor/share": "^6.0.2" + }, + "devDependencies": { + "@capacitor/cli": "^6.2.0" + } + }, + "node_modules/@capacitor/android": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-6.2.3.tgz", + "integrity": "sha512-1x7HUUy5XdQUmAwkMcI8qz0pAmSDXGHVq0XVdCvFswqbE74VGxRuGeo7hUGcgQUWkmqXkVWzMSlAm3Z8NrmQjA==", + "license": "MIT", + "peerDependencies": { + "@capacitor/core": "^6.2.0" + } + }, + "node_modules/@capacitor/cli": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-6.2.3.tgz", + "integrity": "sha512-jqmqpe8K/kdw2/imsii+taG7qsv0bbYKsxwrOfcgPpm+omxBGg4j81Hf9FIvlxB3zV2EAORPBKeUfCkkV+o83A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ionic/cli-framework-output": "^2.2.5", + "@ionic/utils-fs": "^3.1.6", + "@ionic/utils-subprocess": "2.1.11", + "@ionic/utils-terminal": "^2.3.3", + "commander": "^9.3.0", + "debug": "^4.3.4", + "env-paths": "^2.2.0", + "kleur": "^4.1.4", + "native-run": "^2.0.0", + "open": "^8.4.0", + "plist": "^3.0.5", + "prompts": "^2.4.2", + "rimraf": "^4.4.1", + "semver": "^7.3.7", + "tar": "^6.1.11", + "tslib": "^2.4.0", + "xml2js": "^0.5.0" + }, + "bin": { + "cap": "bin/capacitor", + "capacitor": "bin/capacitor" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@capacitor/core": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.2.3.tgz", + "integrity": "sha512-zajW/Fu1RFi42CC6KDjjgOIJ57hCl0Mo9FixpWpm6wXYAsFOU04dk+CBLvRt6rtO3sd6Lce4xxu68Pvi1oR99w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@capacitor/filesystem": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-6.0.4.tgz", + "integrity": "sha512-eFlg/ZrwYA4Y6ClLRRikudVu2XvuZxfX/XC0ky9MgfbC9dyqTnVkkEoWM6vr1xR89YNY4mB0EeVTet1m1Jcumw==", + "license": "MIT", + "peerDependencies": { + "@capacitor/core": "^6.0.0" + } + }, + "node_modules/@capacitor/share": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@capacitor/share/-/share-6.0.4.tgz", + "integrity": "sha512-Ij8C3as4n6L+SUj3M1ko+DGIsrDw2VTkn5Y/pQnFRI9dRk6YoSpGKLN54yOyN7ew3N9bVa8Rko+dFwdcNg7ESA==", + "license": "MIT", + "peerDependencies": { + "@capacitor/core": "^6.0.0" + } + }, + "node_modules/@ionic/cli-framework-output": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/@ionic/cli-framework-output/-/cli-framework-output-2.2.8.tgz", + "integrity": "sha512-TshtaFQsovB4NWRBydbNFawql6yul7d5bMiW1WYYf17hd99V6xdDdk3vtF51bw6sLkxON3bDQpWsnUc9/hVo3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ionic/utils-terminal": "2.3.5", + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@ionic/utils-array": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-array/-/utils-array-2.1.5.tgz", + "integrity": "sha512-HD72a71IQVBmQckDwmA8RxNVMTbxnaLbgFOl+dO5tbvW9CkkSFCv41h6fUuNsSEVgngfkn0i98HDuZC8mk+lTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-fs": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@ionic/utils-fs/-/utils-fs-3.1.7.tgz", + "integrity": "sha512-2EknRvMVfhnyhL1VhFkSLa5gOcycK91VnjfrTB0kbqkTFCOXyXgVLI5whzq7SLrgD9t1aqos3lMMQyVzaQ5gVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/fs-extra": "^8.0.0", + "debug": "^4.0.0", + "fs-extra": "^9.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@ionic/utils-object": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-object/-/utils-object-2.1.5.tgz", + "integrity": "sha512-XnYNSwfewUqxq+yjER1hxTKggftpNjFLJH0s37jcrNDwbzmbpFTQTVAp4ikNK4rd9DOebX/jbeZb8jfD86IYxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-process": { + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.10.tgz", + "integrity": "sha512-mZ7JEowcuGQK+SKsJXi0liYTcXd2bNMR3nE0CyTROpMECUpJeAvvaBaPGZf5ERQUPeWBVuwqAqjUmIdxhz5bxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ionic/utils-object": "2.1.5", + "@ionic/utils-terminal": "2.3.3", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "tree-kill": "^1.2.2", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-process/node_modules/@ionic/utils-terminal": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.3.tgz", + "integrity": "sha512-RnuSfNZ5fLEyX3R5mtcMY97cGD1A0NVBbarsSQ6yMMfRJ5YHU7hHVyUfvZeClbqkBC/pAqI/rYJuXKCT9YeMCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/slice-ansi": "^4.0.0", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-stream": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz", + "integrity": "sha512-hkm46uHvEC05X/8PHgdJi4l4zv9VQDELZTM+Kz69odtO9zZYfnt8DkfXHJqJ+PxmtiE5mk/ehJWLnn/XAczTUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-subprocess": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/@ionic/utils-subprocess/-/utils-subprocess-2.1.11.tgz", + "integrity": "sha512-6zCDixNmZCbMCy5np8klSxOZF85kuDyzZSTTQKQP90ZtYNCcPYmuFSzaqDwApJT4r5L3MY3JrqK1gLkc6xiUPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ionic/utils-array": "2.1.5", + "@ionic/utils-fs": "3.1.6", + "@ionic/utils-process": "2.1.10", + "@ionic/utils-stream": "3.1.5", + "@ionic/utils-terminal": "2.3.3", + "cross-spawn": "^7.0.3", + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-subprocess/node_modules/@ionic/utils-fs": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@ionic/utils-fs/-/utils-fs-3.1.6.tgz", + "integrity": "sha512-eikrNkK89CfGPmexjTfSWl4EYqsPSBh0Ka7by4F0PLc1hJZYtJxUZV3X4r5ecA8ikjicUmcbU7zJmAjmqutG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/fs-extra": "^8.0.0", + "debug": "^4.0.0", + "fs-extra": "^9.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-subprocess/node_modules/@ionic/utils-terminal": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.3.tgz", + "integrity": "sha512-RnuSfNZ5fLEyX3R5mtcMY97cGD1A0NVBbarsSQ6yMMfRJ5YHU7hHVyUfvZeClbqkBC/pAqI/rYJuXKCT9YeMCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/slice-ansi": "^4.0.0", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-terminal": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.5.tgz", + "integrity": "sha512-3cKScz9Jx2/Pr9ijj1OzGlBDfcmx7OMVBt4+P1uRR0SSW4cm1/y3Mo4OY3lfkuaYifMNBW8Wz6lQHbs1bihr7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/slice-ansi": "^4.0.0", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@types/fs-extra": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.5.tgz", + "integrity": "sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-+OpjSaq85gvlZAYINyzKpLeiFkSC4EsC6IIiT6v6TLSU5k5U83fHGj9Lel8oKEXM0HqgrMVCjXPDPVICtxF7EQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@xmldom/xmldom": { + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.9.12.tgz", + "integrity": "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/big-integer": { + "version": "1.6.52", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", + "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", + "dev": true, + "license": "Unlicense", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/bplist-parser": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz", + "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "big-integer": "1.6.x" + }, + "engines": { + "node": ">= 5.10.0" + } + }, + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/elementtree": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz", + "integrity": "sha512-wkgGT6kugeQk/P6VZ/f4T+4HB41BVgNBq5CDIZVbQ02nvTVqAiVTbskxxu3eA/X96lMlfYOwnLQpN2v5E1zDEg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "sax": "1.1.4" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.7.tgz", + "integrity": "sha512-V+1uQNdzybxa14e/p00HZnQNNcTjnRJjDxg2V8wtkjFctq4M7hXFws4oekyTP0Jebeq7QYtpFyOeBAjc88zvYg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/native-run": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/native-run/-/native-run-2.0.3.tgz", + "integrity": "sha512-U1PllBuzW5d1gfan+88L+Hky2eZx+9gv3Pf6rNBxKbORxi7boHzqiA6QFGSnqMem4j0A9tZ08NMIs5+0m/VS1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ionic/utils-fs": "^3.1.7", + "@ionic/utils-terminal": "^2.3.4", + "bplist-parser": "^0.3.2", + "debug": "^4.3.4", + "elementtree": "^0.1.7", + "ini": "^4.1.1", + "plist": "^3.1.0", + "split2": "^4.2.0", + "through2": "^4.0.2", + "tslib": "^2.6.2", + "yauzl": "^2.10.0" + }, + "bin": { + "native-run": "bin/native-run" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/plist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.1.tgz", + "integrity": "sha512-ZIfcLJC+7E7FBFnDxm9MPmt7D+DidyQ26lewieO75AdhA2ayMtsJSES0iWzqJQbcVRSrTufQoy0DR94xHue0oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@xmldom/xmldom": "^0.9.10", + "base64-js": "^1.5.1", + "xmlbuilder": "^15.1.1" + }, + "engines": { + "node": ">=10.4.0" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prompts/node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rimraf": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", + "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", + "integrity": "sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==", + "dev": true, + "license": "ISC" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xml2js/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..aebdf26 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "camcat", + "version": "2.3.0", + "private": true, + "description": "CamCat — field photo capture, folders, EXIF, ZIP", + "scripts": { + "cap:add": "cap add android", + "cap:sync": "cap sync android", + "apk": "cap sync android && cd android && gradlew.bat assembleDebug", + "apk:release": "cap sync android && cd android && gradlew.bat assembleRelease" + }, + "dependencies": { + "@capacitor/android": "^6.2.0", + "@capacitor/core": "^6.2.0", + "@capacitor/filesystem": "^6.0.1", + "@capacitor/share": "^6.0.2" + }, + "devDependencies": { + "@capacitor/cli": "^6.2.0" + } +} diff --git a/scripts/build-apk.sh b/scripts/build-apk.sh new file mode 100644 index 0000000..d46ec61 --- /dev/null +++ b/scripts/build-apk.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# สร้าง APK (ต้องมี JDK 17 + Android SDK; node/npm มีอยู่แล้ว) +set -euo pipefail +cd "$(dirname "$0")/.." + +echo "== 1) ติดตั้ง dependencies ==" +npm install + +if [ ! -d android ]; then + echo "== 2) เพิ่ม platform android ==" + npx cap add android +fi + +echo "== 3) copy เว็บแอป (app/) เข้า android ==" +npx cap sync android + +echo "== 4) build APK (debug) ==" +cd android +if [ -f gradlew.bat ]; then ./gradlew.bat assembleDebug; else ./gradlew assembleDebug; fi + +APK="app/build/outputs/apk/debug/app-debug.apk" +echo +echo "APK: android/$APK" +ls -lh "$APK" || true