diff --git a/app-icon.png b/app-icon.png index 6b27e501e..13ad54c56 100644 Binary files a/app-icon.png and b/app-icon.png differ diff --git a/app/src/main/assets/custom.js b/app/src/main/assets/custom.js index 50f02af29..e9bd3bba4 100644 --- a/app/src/main/assets/custom.js +++ b/app/src/main/assets/custom.js @@ -1,26 +1,31 @@ -//console.log( -// '%cbuild from PakePlus: https://github.com/Sjj1024/PakePlus', -// 'color:orangered;font-weight:bolder' -//) -// -//// very important, if you don't know what it is, don't touch it -//// 非常重要,不懂代码不要动 -//const hookClick = (e) => { -// const origin = e.target.closest('a') -// const isBaseTargetBlank = document.querySelector( -// 'head base[target="_blank"]' -// ) -// console.log('origin', origin, isBaseTargetBlank) -// if ( -// (origin && origin.href && origin.target === '_blank') || -// (origin && origin.href && isBaseTargetBlank) -// ) { -// e.preventDefault() -// console.log('handle origin', origin) -// location.href = origin.href -// } else { -// console.log('not handle origin', origin) -// } -//} -// -//document.addEventListener('click', hookClick, { capture: true }) +console.log( + '%cbuild from PakePlus: https://github.com/Sjj1024/PakePlus', + 'color:orangered;font-weight:bolder' +) + +// very important, if you don't know what it is, don't touch it +// 非常重要,不懂代码不要动,这里可以解决80%的问题,也可以生产1000+的bug +const hookClick = (e) => { + const origin = e.target.closest('a') + const isBaseTargetBlank = document.querySelector( + 'head base[target="_blank"]' + ) + console.log('origin', origin, isBaseTargetBlank) + if ( + (origin && origin.href && origin.target === '_blank') || + (origin && origin.href && isBaseTargetBlank) + ) { + e.preventDefault() + console.log('handle origin', origin) + location.href = origin.href + } else { + console.log('not handle origin', origin) + } +} + +window.open = function (url, target, features) { + console.log('open', url, target, features) + location.href = url +} + +document.addEventListener('click', hookClick, { capture: true }) diff --git a/scripts/ppconfig.json b/scripts/ppconfig.json index 364da9be8..8bc7d9578 100644 --- a/scripts/ppconfig.json +++ b/scripts/ppconfig.json @@ -1,167 +1 @@ -{ - "name": "", - "url": "", - "showName": "", - "appid": "", - "icon": "", - "iconRound": true, - "state": true, - "single": true, - "injectJq": true, - "tauriApi": false, - "devbug": false, - "version": "0.0.1", - "platform": "desktop", - "width": 800, - "height": 600, - "desc": "", - "jsFile": [], - "filterCss": "", - "customJs": "", - "isHtml": false, - "htmlPath": "", - "htmlFiles": [], - "more": { - "windows": { - "label": "", - "title": "", - "url": "", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", - "width": 800, - "height": 600, - "theme": null, - "resizable": true, - "fullscreen": false, - "maximized": false, - "minWidth": 400, - "minHeight": 300, - "maxWidth": 1920, - "maxHeight": 1080, - "decorations": true, - "transparent": false, - "titleBarStyle": "Visible", - "visible": true, - "focus": true, - "closable": true, - "minimizable": true, - "maximizable": true, - "alwaysOnTop": false, - "alwaysOnBottom": false, - "center": false, - "skipTaskbar": false, - "tabbingIdentifier": null, - "parent": null, - "dragDropEnabled": true, - "browserExtensionsEnabled": false, - "devtools": true, - "contentProtected": false, - "hiddenTitle": false, - "incognito": false, - "proxyUrl": null, - "useHttpsScheme": false, - "zoomHotkeysEnabled": false, - "acceptFirstMouse": false, - "create": false - } - }, - "phone": { - "safeArea": { - "top": 0, - "bottom": 0, - "left": 0, - "right": 0 - }, - "header": { - "show": false, - "title": "", - "backgroundColor": "", - "color": "", - "fontSize": 16, - "fontWeight": "bold", - "loading": false, - "toolBar": false, - "toolBarBackgroundColor": "", - "toolBarColor": "", - "toolBarFontSize": 16, - "toolBarFontWeight": "bold" - }, - "siderMenu": { - "show": false, - "width": 0, - "backgroundColor": "", - "color": "", - "fontSize": 16, - "fontWeight": "bold", - "title": "", - "titleColor": "", - "titleFontSize": 16, - "titleFontWeight": "bold" - }, - "tabBar": { - "show": false, - "backgroundColor": "", - "color": "", - "activeColor": "", - "fontSize": 16, - "fontWeight": "bold", - "tabBarItem": [] - }, - "webview": { - "userAgent": "", - "javaScriptEnabled": true, - "domStorageEnabled": true, - "allowFileAccess": true, - "loadWithOverviewMode": true, - "setSupportZoom": true, - "clearCache": true - } - }, - "ios": { - "name": "PakePlus", - "showName": "PakePlus", - "version": "0.0.1", - "webUrl": "https://juejin.cn/", - "id": "com.oaikes.app", - "icon": "./app-icon.png", - "desc": "PakePlus Project by 1024xiaoshen", - "pubBody": "PakePlus ios build body", - "isHtml": false, - "debug": false - }, - "android": { - "name": "PakePlus", - "showName": "PakePlus", - "version": "0.0.1", - "webUrl": "https://juejin.cn/", - "id": "com.oaikes.pakeplus.android", - "icon": "./app-icon.png", - "input": "./app-icon.png", - "output": "./res", - "rounded": true, - "copyTo": "./app/src/main/res", - "androidResDir": "./app/src/main/res", - "desc": "PakePlus Project by 1024xiaoshen", - "pubBody": "PakePlus android build body", - "isHtml": false, - "debug": false - }, - "desktop": { - "name": "PakePlus2", - "showName": "oaikes", - "version": "0.0.2", - "id": "com.oaikes.app", - "desc": "PakePlus Project by 1024xiaoshen", - "webUrl": "https://juejin.cn/", - "iconPath": "../app-icon.png", - "inputPath": "../app-icon.png", - "tempPath": "./processed-image.png", - "icnsPath": "../src-tauri/icons/icon.icns", - "pubBody": "PakePlus desktop build body", - "isHtml": false, - "single": true, - "state": true, - "injectJq": false, - "tauriApi": false, - "debug": false - } -} +{"name":"sillytavern","url":"https://st.4011999.xyz","showName":"SillyTavern","appid":"com.sillytavern.app","icon":"","iconRound":true,"state":true,"single":true,"injectJq":true,"tauriApi":false,"devbug":true,"version":"0.0.4","preview":"Android","platform":["1-1","1-2","2-1","2-2"],"width":412,"height":915,"desc":"","jsFile":[],"filterCss":"","customJs":"console.log(\r\n '%cbuild from PakePlus: https://github.com/Sjj1024/PakePlus',\r\n 'color:orangered;font-weight:bolder'\r\n)\r\n\r\n// very important, if you don't know what it is, don't touch it\r\n// 非常重要,不懂代码不要动,这里可以解决80%的问题,也可以生产1000+的bug\r\nconst hookClick = (e) => {\r\n const origin = e.target.closest('a')\r\n const isBaseTargetBlank = document.querySelector(\r\n 'head base[target=\"_blank\"]'\r\n )\r\n console.log('origin', origin, isBaseTargetBlank)\r\n if (\r\n (origin && origin.href && origin.target === '_blank') ||\r\n (origin && origin.href && isBaseTargetBlank)\r\n ) {\r\n e.preventDefault()\r\n console.log('handle origin', origin)\r\n location.href = origin.href\r\n } else {\r\n console.log('not handle origin', origin)\r\n }\r\n}\r\n\r\nwindow.open = function (url, target, features) {\r\n console.log('open', url, target, features)\r\n location.href = url\r\n}\r\n\r\ndocument.addEventListener('click', hookClick, { capture: true })\r\n","isHtml":false,"htmlPath":"","htmlFiles":[],"more":{"windows":{"label":"sillytavern","title":"SillyTavern","url":"https://st.4011999.xyz","userAgent":"Mozilla/5.0 (Linux; Android 14; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36","width":412,"height":915,"theme":null,"resizable":true,"fullscreen":false,"maximized":false,"minWidth":400,"minHeight":300,"maxWidth":1920,"maxHeight":1080,"decorations":true,"transparent":false,"titleBarStyle":"Visible","visible":true,"focus":true,"closable":true,"minimizable":true,"maximizable":true,"alwaysOnTop":false,"alwaysOnBottom":false,"center":false,"skipTaskbar":false,"tabbingIdentifier":null,"parent":null,"dragDropEnabled":true,"browserExtensionsEnabled":false,"devtools":true,"contentProtected":false,"hiddenTitle":false,"incognito":false,"proxyUrl":null,"useHttpsScheme":false,"zoomHotkeysEnabled":false,"acceptFirstMouse":false,"create":false}},"phone":{"safeArea":{"top":0,"bottom":0,"left":0,"right":0},"header":{"show":false,"title":"","backgroundColor":"","color":"","fontSize":16,"fontWeight":"bold","loading":false,"toolBar":false,"toolBarBackgroundColor":"","toolBarColor":"","toolBarFontSize":16,"toolBarFontWeight":"bold"},"siderMenu":{"show":false,"width":0,"backgroundColor":"","color":"","fontSize":16,"fontWeight":"bold","title":"","titleColor":"","titleFontSize":16,"titleFontWeight":"bold"},"tabBar":{"show":false,"backgroundColor":"","color":"","activeColor":"","fontSize":16,"fontWeight":"bold","tabBarItem":[]},"webview":{"userAgent":"","javaScriptEnabled":true,"domStorageEnabled":true,"allowFileAccess":true,"loadWithOverviewMode":true,"setSupportZoom":true,"clearCache":true}},"ios":{"name":"sillytavern","showName":"SillyTavern","version":"0.0.4","webUrl":"https://st.4011999.xyz","id":"com.sillytavern.app.ios","icon":"./app-icon.png","desc":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途)","pubBody":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途)","isHtml":false,"debug":true},"android":{"name":"sillytavern","showName":"SillyTavern","version":"0.0.4","webUrl":"https://st.4011999.xyz","id":"com.sillytavern.app.android","icon":"./app-icon.png","input":"./app-icon.png","output":"./res","rounded":true,"copyTo":"./app/src/main/res","androidResDir":"./app/src/main/res","desc":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途)","pubBody":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途)","isHtml":false,"debug":true},"desktop":{"name":"sillytavern","showName":"SillyTavern","version":"0.0.4","id":"com.sillytavern.app.desktop","desc":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途,否则后果自负)","webUrl":"https://st.4011999.xyz","iconPath":"../app-icon.png","inputPath":"../app-icon.png","tempPath":"./processed-image.png","icnsPath":"../src-tauri/icons/icon.icns","pubBody":"Package for personal use only, please do not use for commercial purposes(打包仅限个人使用,请勿传播或商业用途,否则后果自负)","isHtml":false,"single":true,"state":true,"injectJq":false,"tauriApi":false,"buildMethod":"cloud","debug":false}} \ No newline at end of file