Skip to content

Commit

Permalink
Merge pull request #99 from mylxsw/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mylxsw authored Mar 8, 2024
2 parents f3258e8 + ccc760d commit eaf5453
Show file tree
Hide file tree
Showing 150 changed files with 67 additions and 71 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ build-dmg: build-macos
open build/macos/Build/Products/Package/

build-web:
flutter build web --web-renderer canvaskit --release --dart-define=FLUTTER_WEB_CANVASKIT_URL=https://resources.aicode.cc/canvaskit/
#flutter build web --web-renderer canvaskit --release --dart-define=FLUTTER_WEB_CANVASKIT_URL=https://resources.aicode.cc/canvaskit/
flutter build web --web-renderer canvaskit --release
cd scripts && go run main.go ../build/web/main.dart.js && cd ..
rm -fr build/web/fonts/ && mkdir build/web/fonts
cp -r scripts/s build/web/fonts/s

build-web-samehost:
flutter build web --web-renderer canvaskit --release --dart-define=API_SERVER_URL=/
cd scripts && go run main.go ../build/web/main.dart.js && cd ..
rm -fr build/web/fonts/ && mkdir build/web/fonts
cp -r scripts/s build/web/fonts/s

deploy-web: build-web
cd build && tar -zcvf web.tar.gz web
Expand Down
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
19 changes: 7 additions & 12 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ PODS:
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK-XCFramework (~> 2.0.2)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- image_gallery_saver (1.5.0):
- Flutter
- in_app_purchase_storekit (0.0.1):
Expand Down Expand Up @@ -105,7 +102,7 @@ PODS:
- Flutter
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- FlutterMacOS
- SwiftyGif (5.4.4)
- tobias (0.0.1):
- Flutter
Expand Down Expand Up @@ -140,7 +137,7 @@ DEPENDENCIES:
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- tobias (from `.symlinks/plugins/tobias/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
Expand All @@ -150,7 +147,6 @@ SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- FMDB
- libwebp
- Mantle
- SDWebImage
Expand Down Expand Up @@ -204,7 +200,7 @@ EXTERNAL SOURCES:
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
:path: ".symlinks/plugins/sqflite/darwin"
tobias:
:path: ".symlinks/plugins/tobias/ios"
url_launcher_ios:
Expand All @@ -220,16 +216,15 @@ SPEC CHECKSUMS:
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_localization: f43b18844a2b3d2c71fd64f04ffd6b1e64dd54d4
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
fluwx: e9e728cfdb80e82dac5f4ff974b1901a7939dcd0
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_gallery_saver: 259eab68fb271cfd57d599904f7acdc7832e7ef2
in_app_purchase_storekit: 9e9931234f0adcf71ae323f8c83785b96030edf1
in_app_purchase_storekit: 0e4b3c2e43ba1e1281f4f46dd71b0593ce529892
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
Expand All @@ -244,10 +239,10 @@ SPEC CHECKSUMS:
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
sqflite: 50a33e1d72bd59ee092a519a35d107502757ebed
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
tobias: 2aded9b83e3663b907360a800d8e3c13284f25c5
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69
Expand Down
14 changes: 4 additions & 10 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -366,7 +366,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -420,8 +420,6 @@
"-framework",
"\"DKPhotoGallery\"",
"-framework",
"\"FMDB\"",
"-framework",
"\"Foundation\"",
"-framework",
"\"ImageIO\"",
Expand Down Expand Up @@ -542,7 +540,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -591,7 +589,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -647,8 +645,6 @@
"-framework",
"\"DKPhotoGallery\"",
"-framework",
"\"FMDB\"",
"-framework",
"\"Foundation\"",
"-framework",
"\"ImageIO\"",
Expand Down Expand Up @@ -768,8 +764,6 @@
"-framework",
"\"DKPhotoGallery\"",
"-framework",
"\"FMDB\"",
"-framework",
"\"Foundation\"",
"-framework",
"\"ImageIO\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
9 changes: 9 additions & 0 deletions lib/page/component/chat/chat_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ class _ChatPreviewState extends State<ChatPreview> {
index,
);
},
onSecondaryTapDown: (details) {
_handleMessageTapControl(
context,
details.globalPosition,
message,
state,
index,
);
},
child: Stack(
children: [
Container(
Expand Down
85 changes: 43 additions & 42 deletions scripts/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package main

import (
"io"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/mylxsw/asteria/log"
Expand All @@ -18,48 +14,53 @@ func main() {
mainDartJSPath := os.Args[1]

data := string(must.Must(os.ReadFile(mainDartJSPath)))
fontRegex := regexp.MustCompile(`https://fonts\.gstatic\.com/(.*?)\.(ttf|otf|woff|woff2)`)
// 替换字体为本地 CDN
// fontRegex := regexp.MustCompile(`https://fonts\.gstatic\.com/(.*?)\.(ttf|otf|woff|woff2)`)

for _, u := range fontRegex.FindAllString(data, -1) {
savePath := must.Must(download(u))
data = strings.ReplaceAll(data, u, "https://resources.aicode.cc/fonts/"+savePath)
}
// for _, u := range fontRegex.FindAllString(data, -1) {
// savePath := must.Must(download(u))
// data = strings.ReplaceAll(data, u, "https://resources.aicode.cc/fonts/"+savePath)
// }

// 替换字体为国内镜像
data = strings.ReplaceAll(data, "fonts.gstatic.com", "global-cdn.aicode.cc")
data = strings.ReplaceAll(data, "www.gstatic.com", "global-cdn.aicode.cc")

must.NoError(os.WriteFile(mainDartJSPath, []byte(data), 0755))

log.Debugf("replace font url success")
}

func download(remoteURL string) (string, error) {
savePath := strings.TrimPrefix(remoteURL, "https://fonts.gstatic.com/")
// 检查目录是否存在,不存在则创建
if err := os.MkdirAll(filepath.Dir(savePath), 0755); err != nil {
return "", err
}

// 检查文件是否存在
if _, err := os.Stat(savePath); err == nil {
return savePath, nil
}

log.Debugf("download %s to %s", remoteURL, savePath)

// 下载文件到本地
resp, err := http.Get(remoteURL)
if err != nil {
return "", err
}
defer resp.Body.Close()

f, err := os.Create(savePath)
if err != nil {
return "", err
}
defer f.Close()

if _, err := io.Copy(f, resp.Body); err != nil {
return "", err
}

return savePath, nil
}
// func download(remoteURL string) (string, error) {
// savePath := strings.TrimPrefix(remoteURL, "https://fonts.gstatic.com/")
// // 检查目录是否存在,不存在则创建
// if err := os.MkdirAll(filepath.Dir(savePath), 0755); err != nil {
// return "", err
// }

// // 检查文件是否存在
// if _, err := os.Stat(savePath); err == nil {
// return savePath, nil
// }

// log.Debugf("download %s to %s", remoteURL, savePath)

// // 下载文件到本地
// resp, err := http.Get(remoteURL)
// if err != nil {
// return "", err
// }
// defer resp.Body.Close()

// f, err := os.Create(savePath)
// if err != nil {
// return "", err
// }
// defer f.Close()

// if _, err := io.Copy(f, resp.Body); err != nil {
// return "", err
// }

// return savePath, nil
// }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed scripts/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf
Binary file not shown.

0 comments on commit eaf5453

Please sign in to comment.