diff --git a/.ipynb_checkpoints/RELEASE-checkpoint.md b/.ipynb_checkpoints/RELEASE-checkpoint.md new file mode 100644 index 0000000..ecb92f2 --- /dev/null +++ b/.ipynb_checkpoints/RELEASE-checkpoint.md @@ -0,0 +1,89 @@ +# **AutoCatAndSoup v0.0.0** + +Date 今天晚上到圖書館 + +## 更新 +- 優化 `照相` 判斷邏輯 +- 新增 `返回設定` 按鍵 + + +## 支援 +- Cat and Soup 4.29.1 +- 解析度:720x1280 +- 繁體中文 + +--- + +# **AutoCatAndSoup v1.1.0** + +Date + +## 更新 +- 新增`應用圖標` +- 新增`語言包`功能(繁體中文, 英文) +- 修正`自動啟動`錯誤 +- 調整`玩耍`歸位精細度 +- +## 支援 +- 遊戲版本:4.29.2 +- 解析度:720x1280 +- 語言:繁體中文、English + +## Update +- Add `application icon` +- Add `language package`(Traditional chinese, English) +- Fix `Auto restart` error +- Increase `PLay` repositioning precision + +## Support +- Game version: 4.29.2 +- Resolution: 720x1280 +- Language: Traditional chinese, English + + # **AutoCatAndSoup v1.0.2** + +2026-03-04 + +## 更新 +- 修改`浮窗權限`為自動詢問 +> Note: 螢幕擷取權限無法預先獲取,保持啟動後詢問 +- 新增主頁面判斷 (可避免提前執行腳本) +- 新增`隨機任務-玩耍`誤觸退出判斷、玩具自動歸位 +- 合併一般模式以及免廣告模式下 `設施升級` 的判斷 + +## 支援 +- Cat and Soup 4.29.1 +- 解析度:720x1280 +- 繁體中文 + +# **AutoCatAndSoup v1.0.1** + +2026-02-26 + +## 更新 +- 修復`食譜升級`退出停滯 +- 修復`販賣商品`偵測問題 +- 優化`照相`執行邏輯 +- 優化`成就`執行邏輯 +- 優化`設施升級`判斷邏輯 +- 新增`成就`收取每日目標獎勵 + +## 支援 +- Cat and Soup 4.28.1 +- 解析度:720x1280 +- 繁體中文 + +# **AutoCatAndSoup v1.0.0** + +2026-02-24 + +## 實作 +- 基本任務(販賣、設施升級、食譜升級) +- 獎勵領取(掛機、罐子精靈、商人、信箱、成就) +- 隨機任務(拍照、禮物、玩耍) +- 浮動視窗暫停控制 +- 儲存上次使用功能 + +## 支援 +- Cat and Soup 4.28.1 +- 解析度:720x1280 \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md index ac66de8..ecb92f2 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -21,21 +21,22 @@ Date ## 更新 - 新增`應用圖標` - 新增`語言包`功能(繁體中文, 英文) -- 優化腳本架構 -- 增加`玩耍`歸位精細度 +- 修正`自動啟動`錯誤 +- 調整`玩耍`歸位精細度 - ## 支援 -- 遊戲版本:4.29.1 +- 遊戲版本:4.29.2 - 解析度:720x1280 - 語言:繁體中文、English ## Update - Add `application icon` - Add `language package`(Traditional chinese, English) -- d +- Fix `Auto restart` error +- Increase `PLay` repositioning precision ## Support -- Game version: 4.29.1 +- Game version: 4.29.2 - Resolution: 720x1280 - Language: Traditional chinese, English diff --git a/src/.ipynb_checkpoints/i18n-checkpoint.js b/src/.ipynb_checkpoints/i18n-checkpoint.js new file mode 100644 index 0000000..4650961 --- /dev/null +++ b/src/.ipynb_checkpoints/i18n-checkpoint.js @@ -0,0 +1,109 @@ +/** + * 專案名稱: AutoCatAndSoup + * Copyright (C) 2026 Sthkm3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const i18n = {}; + +const locale = java.util.Locale.getDefault().getLanguage(); + +let currentLang = "zh"; + +if (locale.startsWith("en")) { + currentLang = "en"; +} + +// 支援的語系定義 +const languages = { + "zh": { + // UI 標題與標籤 + "title": "Auto CatAndSoup 設定", + "basic_section": "── 基本 ──", + "collect_section": "── 領取 ──", + "random_task": "─ 隨機任務 ─", + "daily_task": "─ 每日任務 ─", + + // 選項文字 + "sell_product": "販賣商品", + "upgrade_facility": "設施升級", + "upgrade_recipe": "食譜升級", + "build_facility": "設施建設(未開發)", + "afk_reward": "掛機獎勵", + "jar_reward": "罐子精靈獎勵", + "merchant_reward": "商人獎勵", + "butterfly_reward": "黃金蝴蝶獎勵", + "frog_reward": "青蛙王子獎勵", + "mail": "信箱", + "achievement": "成就", + "take_photo": "拍攝照片", + "gift": "禮物", + "play": "玩耍", + "travel": "旅行(未開發)", + "fishing": "釣魚(未開發)", + "gacha": "扭蛋(未開發)", + "shooting": "投籃(未開發)", + + // 按鈕與提示 + "start": "啟動", + "pause": "暫停", + + "perm_floaty": "請開啟懸浮窗權限", + "perm_accessibility": "請啟用無障礙服務", + "launching": "嘗試開啟遊戲..." + }, + + "en": { + "title": "Auto CatAndSoup Settings", + "basic_section": "── Basic ──", + "collect_section": "── Collect ──", + "random_task": "─ Random Task ─", + "daily_task": "─ Daily Task ─", + + "sell_product": "Sell Products", + "upgrade_facility": "Upgrade Facility", + "upgrade_recipe": "Upgrade Recipe", + "build_facility": "Build (Dev)", + "afk_reward": "AFK Reward", + "jar_reward": "Jar Spirit", + "merchant_reward": "Merchant Reward", + "butterfly_reward": "Golden Butterfly", + "frog_reward": "Frog Prince", + "mail": "Mailbox", + "achievement": "Achievement", + "take_photo": "Take Photo", + "gift": "Gifts", + "play": "Play", + "travel": "Travel (Dev)", + "fishing": "Fishing (Dev)", + "gacha": "Gacha (Dev)", + "shooting": "Basket (Dev)", + + "start": "START", + "pause": "PAUSE", + "perm_floaty": "Please enable Floating Window permission", + "perm_accessibility": "Please enable Accessibility service", + "launching": "Launching game..." + } +}; + +function t(key){ + if(languages[currentLang] && languages[currentLang][key]){ + return languages[currentLang][key]; + } + return key; +} + +module.exports = t; diff --git a/src/.ipynb_checkpoints/main-checkpoint.js b/src/.ipynb_checkpoints/main-checkpoint.js new file mode 100644 index 0000000..5094f7a --- /dev/null +++ b/src/.ipynb_checkpoints/main-checkpoint.js @@ -0,0 +1,230 @@ +-/** + * 專案名稱: AutoCatAndSoup + * Copyright (C) 2026 Sthkm3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +"ui"; + +importClass(android.provider.Settings); + +// 基本設定 +const STORAGE = storages.create("AutoCatAndSoupConfig"); + +// 語言包 +const T = require("./i18n.js"); + +// 設定資料 +let config = { + sellProduct: STORAGE.get("sellProduct", false), + upgradeFacility: STORAGE.get("upgradeFacility", false), + upgradeRecipe: STORAGE.get("upgradeRecipe", false), + Photo: STORAGE.get("Photo", false), + Gift: STORAGE.get("Gift", false), + Play: STORAGE.get("Play", false), + receiveAFK: STORAGE.get("receiveAFK", false), + receiveJar: STORAGE.get("receiveJar", false), + receiveMerchant: STORAGE.get("receiveMerchant", false), + receiveButterfly: STORAGE.get("receiveButterfly", false), + receiveFrog: STORAGE.get("receiveFrog", false), + receiveMail: STORAGE.get("receiveMail", false), + receiveAchievement: STORAGE.get("receiveAchievement", false) +}; + +// 浮窗權限檢查 +function checkFloatyPermission() { + if (!Settings.canDrawOverlays(context)) { + toast("perm_floaty"); + var intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION); + intent.setData(Uri.parse("package:" + context.getPackageName())); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + app.startActivity(intent); + return false; + } + return true; +} + + +// 無障礙檢查 +function checkAccessibility() { + if (!auto.service) { + toast("perm_accessibility"); + app.startActivity({ + action: Settings.ACTION_ACCESSIBILITY_SETTINGS + }); + return false; + } + return true; +} + +// UI +ui.layout( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +