Skip to content

Commit

Permalink
#148 全平台计划.mp4
Browse files Browse the repository at this point in the history
注意:本版本同时提供 iOS 端 ipa 包,你需要自行进行开发者签名或使用 AltStore 等工具安装。

✨ Stapxs QQ Lite 移动端支持:iOS
🎨 Electron:缩短 log 链接
🎨 Touch Bar 功能完善
🐛 修正缩放过大无法恢复的问题 <- #142
🐛 修正了一处意外遮挡 <- #143
🐛 修正了纯文本资源加载异常的问题 <- #145
🐛 修正了表情资源无法正常显示的问题 <- #145
🐛 修正 mac 下 700px 宽度 chatPan 行为异常的
🐛 修正会话列表刷新工作异常的问题
  • Loading branch information
Stapxs authored Dec 3, 2024
2 parents 8c0819f + 4664016 commit d2cc5f2
Show file tree
Hide file tree
Showing 156 changed files with 4,118 additions and 285 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export PYTHON_PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/python
export CAPACITOR_ANDROID_STUDIO_PATH='/Users/stapxs/Applications/Android Studio.app'
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
node_modules
dist
dist_electron
dist_capacitor
out
.gitignore

src/renderer/public
src/renderer/src/assets
src/mobile

# 这个目录是个单独的项目,有自己的 eslint 配置
ssqq.capacitor-onebot-connector
2 changes: 1 addition & 1 deletion .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 在主分支上构建
name: build
name: build-app
on:
push: # push 触发
branches:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# 在主分支上构建
name: lint
on:
pull_request: # PR 触发
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ out
dev-dist
dist
dist_electron
dist_capacitor
stats.html
18 changes: 18 additions & 0 deletions bin/build-export-ipa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rm -r dist_capacitor

xcodebuild clean build \
-workspace src/mobile/ios/App/App.xcworkspace \
-scheme App \
-archivePath dist_capacitor/App.xcarchive \
-sdk iphoneos \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY="" archive

xcodebuild -exportArchive \
-archivePath dist_capacitor/App.xcarchive \
-exportPath dist_capacitor \
-exportOptionsPlist build/ExportOptions.plist \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY=""
18 changes: 18 additions & 0 deletions build/ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>development</string>
<key>signingStyle</key>
<string>manual</string>
<key>provisioningProfiles</key>
<dict/>
<key>signingCertificate</key>
<string></string>
<key>teamID</key>
<string>LZ4NKVK3NY</string>
<key>compileBitcode</key>
<false/>
</dict>
</plist>
20 changes: 20 additions & 0 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { CapacitorConfig } from '@capacitor/cli'

const config: CapacitorConfig = {
appId: 'cn.stapxs.webqq',
appName: 'Stapxs QQ Lite',
webDir: 'dist',
loggingBehavior: 'none',
ios: {
path: 'src/mobile/ios'
},
android: {
path: 'src/mobile/android'
},
// server: {
// url: 'http://localhost:8080',
// cleartext: true
// }
}

export default config
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 基础配置
appId: com.stapxs.qqweb
appId: cn.stapxs.qqweb
productName: Stapxs QQ Lite
copyright: Copyright © 2022-2024 Stapx Steve [林槐]
directories:
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@
"type": "module",
"scripts": {
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
"typecheck": "tsc --noEmit -p tsconfig.node.json --composite false && vue-tsc --noEmit -p tsconfig.web.json --composite false",
"start": "vite preview",
"start:electron": "electron-vite preview",
"dev": "vite dev",
"dev:electron": "electron-vite dev",
"dev:ios": "capacitor sync ios && capacitor run ios",
"dev:android": "capacitor sync android && capacitor run android",
"build": "vite build",
"build:electron": "electron-vite build",
"postinstall": "electron-builder install-app-deps",
"build:unpack": "electron-vite build && electron-builder --dir",
"build:win": "electron-vite build && electron-builder --win",
"build:mac": "electron-vite build && electron-builder --mac",
"build:linux": "electron-vite build && electron-builder --linux"
"build:linux": "electron-vite build && electron-builder --linux",
"build:ios": "vite build && capacitor sync ios && capacitor open ios",
"build:android": "vite build && capacitor sync android && capacitor open android"
},
"dependencies": {
"@electron-toolkit/preload": "^3.0.0",
Expand All @@ -33,6 +31,12 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@capacitor/android": "^6.2.0",
"@capacitor/app": "^6.0.2",
"@capacitor/cli": "^6.2.0",
"@capacitor/core": "^6.2.0",
"@capacitor/ios": "^6.2.0",
"@capacitor/local-notifications": "^6.1.1",
"@electron-toolkit/eslint-config": "^1.0.2",
"@electron-toolkit/eslint-config-ts": "^2.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
Expand All @@ -45,10 +49,12 @@
"@stapxs/umami-logger-typescript": "^1.0.12",
"@types/jsonpath": "^0.2.4",
"@types/node": "^20.14.8",
"@untiny/capacitor-safe-area": "^1.0.3",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/eslint-config-typescript": "^13.0.0",
"animejs": "^3.2.2",
"browser-image-compression": "^2.0.2",
"capacitor-onebot-connctor": "./ssqq.capacitor-onebot-connector",
"detect-browser": "^5.3.0",
"electron": "^31.0.2",
"electron-builder": "^24.13.3",
Expand Down
11 changes: 11 additions & 0 deletions src/main/function/elements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface NotifyInfo {
base_type: string,

title: string
body: string
tag: string
icon: string
image?: string
type: string
is_important: boolean
}
47 changes: 37 additions & 10 deletions src/main/function/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Store from 'electron-store'
import path from 'path'
import os from 'os'
import log4js from 'log4js'

import {
ipcMain,
Expand All @@ -14,9 +15,11 @@ import {
import { runCommand } from './util.ts'
import { win, touchBarInstance } from '../index.ts'
import { Connector } from './connector.ts'
import { logLevel } from '../index.ts'

let connector = undefined as Connector | undefined
const store = new Store()
const logger = log4js.getLogger('ipc')
let template = [] as any[]

// 消息缓存,key 为 tag
Expand Down Expand Up @@ -186,6 +189,13 @@ export function regIpcListener() {
})
// 发送通知
ipcMain.on('sys:sendNotice', async (_, data) => {
logger.level = logLevel
logger.info('创建通知:' + data.tag + ' - ' + data.body)
// MacOS: 刷新 TouchBar
if(touchBarInstance && data.base_type === 'msg') {
touchBarInstance.newMessage(data)
}

const userId = data.tag.split('/')[0]
const msgId = data.tag.split('/')[1]

Expand Down Expand Up @@ -260,21 +270,38 @@ export function regIpcListener() {
})
// 关闭通知
ipcMain.on('sys:closeNotice', (_, tag) => {
if (noticeList[tag]) {
if(noticeList[tag]) {
logger.level = logLevel
logger.info('关闭通知:' + tag)
noticeList[tag].close()
delete noticeList[tag]
// macOS: 刷新 TouchBar
if(touchBarInstance) {
touchBarInstance.removeMessage(tag)
}
}
})
// 清空通知
ipcMain.on('sys:clearNotice', () => {
Object.keys(noticeList).forEach((key) => {
logger.level = logLevel
logger.info('清空通知')
noticeList[key].close()
delete noticeList[key]
})
})
// 关闭指定 ID 的所有通知
ipcMain.on('sys:closeAllNotice', (_, id) => {
Object.keys(noticeList).forEach((key) => {
if (key.startsWith(id)) {
if(key.startsWith(id)) {
logger.level = logLevel
logger.info('关闭所有通知:' + id)
noticeList[key].close()
delete noticeList[key]
// macOS: 刷新 TouchBar
if(touchBarInstance) {
touchBarInstance.removeMessage(key)
}
}
})
})
Expand Down Expand Up @@ -484,23 +511,23 @@ export function regIpcListener() {
})
function sendMenuClick(name: string, value = undefined as any) {
if (win) {
win.focus()
if (value) {
win.webContents.send(name, value)
} else {
win.webContents.send(name)
}
}
}
// MacOS:刷新 touchBar 消息列表
ipcMain.on('sys:flushTouchBar', (_, list) => {
if (touchBarInstance) {
touchBarInstance.flush(list)
// MacOS:touchBar 相关功能
ipcMain.on('sys:flushOnMessage', (_, list) => {
if(touchBarInstance) {
touchBarInstance.flushOnMessage(list)
}
})
// MacOS:新消息,刷新 touchBar
ipcMain.on('sys:newMessage', (_, data) => {
if (touchBarInstance) {
touchBarInstance.newMessage(data)
ipcMain.on('sys:flushFriendSearch', (_, list) => {
if(touchBarInstance) {
touchBarInstance.flushFriendSearch(list)
}
})
}
Loading

0 comments on commit d2cc5f2

Please sign in to comment.