Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions scripts/setup-android-maafw.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# MaaFramework Android .so 库集成脚本
# 用途:将 MaaFramework 的 Android aarch64 .so 文件复制到 jniLibs 目录
#
# 使用前:
# 1. 从 https://github.com/MaaXYZ/MaaFramework/releases 下载 MAA-android-aarch64-*.tar.gz
# 2. 解压到任意目录
# 3. 运行此脚本: .\scripts\setup-android-maafw.ps1 -MaaFwDir <解压目录>

param(
[Parameter(Mandatory=$true)]
[string]$MaaFwDir
)

$jniLibsDir = Join-Path $PSScriptRoot "..\src-tauri\gen\android\app\src\main\jniLibs\arm64-v8a"

if (-not (Test-Path $jniLibsDir)) {
New-Item -ItemType Directory -Path $jniLibsDir -Force | Out-Null
}

$soFiles = @(
"libMaaFramework.so",
"libMaaToolkit.so",
"libonnxruntime.so",
"libfastdeploy_ppocr.so",
"libMaaAgentBinary.so"
)

$copied = 0
foreach ($soFile in $soFiles) {
$sourcePath = Join-Path $MaaFwDir $soFile
if (Test-Path $sourcePath) {
Copy-Item -Path $sourcePath -Destination $jniLibsDir -Force
Write-Host " Copied: $soFile" -ForegroundColor Green
$copied++
} else {
# try lib/ subdirectory
$sourcePath = Join-Path $MaaFwDir "lib" $soFile
if (Test-Path $sourcePath) {
Copy-Item -Path $sourcePath -Destination $jniLibsDir -Force
Write-Host " Copied: $soFile (from lib/)" -ForegroundColor Green
$copied++
} else {
Write-Host " Not found: $soFile (optional)" -ForegroundColor Yellow
}
}
}

# Also copy MaaAgentBinary directory if it exists
$agentDir = Join-Path $MaaFwDir "MaaAgentBinary"
if (Test-Path $agentDir) {
$destAgentDir = Join-Path $PSScriptRoot "..\src-tauri\gen\android\app\src\main\assets\MaaAgentBinary"
if (-not (Test-Path $destAgentDir)) {
New-Item -ItemType Directory -Path $destAgentDir -Force | Out-Null
}
Copy-Item -Path "$agentDir\*" -Destination $destAgentDir -Recurse -Force
Write-Host " Copied: MaaAgentBinary directory" -ForegroundColor Green
}

Write-Host ""
Write-Host "Done! $copied .so files copied to $jniLibsDir" -ForegroundColor Cyan
147 changes: 2 additions & 145 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ crate-type = ["staticlib", "cdylib", "rlib"]
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2", features = ["image-png", "image-ico", "tray-icon"] }
tauri = { version = "2", features = ["image-png", "image-ico"] }
tauri-plugin-opener = "2"
tauri-plugin-fs = "2"
tauri-plugin-dialog = "2"
tauri-plugin-http = "2"
tauri-plugin-log = "2"
tauri-plugin-process = "2"
tauri-plugin-global-shortcut = "2"
tauri-plugin-autostart = "2"
log = "0.4"
chrono = "0.4"
serde = { version = "1", features = ["derive"] }
Expand All @@ -37,17 +35,22 @@ zip = "7.2.0"
flate2 = "1.0"
tar = "0.4"
tokio = { version = "1", features = ["rt", "sync"] }
reqwest = { version = "0.12", features = ["stream", "blocking", "json"] }
reqwest = { version = "0.12", default-features = false, features = ["stream", "blocking", "json", "rustls-tls"] }
futures-util = "0.3"
bytes = "1"
libc = "0.2.180"
semver = "1.0"
os_info = "3"
urlencoding = "2.1"
notify-rust = "4"
shell-words = "1.1.1"
maa-framework = { version = "1", features = ["dynamic"] }

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri = { version = "2", features = ["tray-icon"] }
tauri-plugin-global-shortcut = "2"
tauri-plugin-autostart = "2"
notify-rust = "4"

[profile.release]
# 保留调试符号以生成 PDB 文件,便于崩溃分析
debug = true
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"description": "Capability for the desktop main window",
"platforms": ["linux", "macOS", "windows"],
"windows": ["main"],
"permissions": [
"core:default",
Expand Down
Loading
Loading