Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
ci: fix package
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 10, 2023
1 parent 59be75e commit 4e73469
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 2 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ jobs:
npm run build
cd ..
- name: Prepare MaaFramework
run: |
cd server
wget https://github.com/MaaAssistantArknights/MaaFramework/releases/download/v0.3.5/MAA-win-x86_64-v0.3.5.zip -O maa.zip
mkdir maaframework
cd maaframework
unzip ../maa.zip
rm -r docs
rm -r include
rm -r lib
mv share/MaaAgentBinary .
rm -r share
cd ../..
- name: Prepare Model
run: |
cd server
git clone https://github.com/MaaAssistantArknights/MAA1999 --depth=1
cp -r MAA1999/assets/resource/model framework/
cd ..
- name: Build Package
run: |
cd server
Expand All @@ -60,9 +81,12 @@ jobs:
zip res.zip test.json
npx pkg . -t node18-x64-windows
mkdir -p out/web
mkdir -p out/library
mkdir -p out/saves
mkdir -p out/web
cp assets/config.json out/
mv maaframework out/library/
cp assets/controller_config.json out/library/maaframework/
cp -r web/* out/web/
cp -r res.zip out/saves/
Expand Down
2 changes: 1 addition & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ MaaAgentBinary
*.zip
config.json

!assets/config.json
!assets/*.json
165 changes: 165 additions & 0 deletions server/assets/controller_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"prebuilt": {
"minicap": {
"root": "./library/maaframework/MaaAgentBinary/minicap",
"arch": ["x86", "armeabi-v7a", "armeabi"],
"sdk": [31, 29, 28, 27, 26, 25, 24, 23, 22, 21, 19, 18, 17, 16, 15, 14]
},
"minitouch": {
"root": "./library/maaframework/MaaAgentBinary/minitouch",
"arch": ["x86_64", "x86", "arm64-v8a", "armeabi-v7a", "armeabi"]
},
"maatouch": {
"root": "./library/maaframework/MaaAgentBinary/maatouch",
"package": "com.shxyke.MaaTouch.App"
}
},
"argv": {
"Connect": ["{ADB}", "connect", "{ADB_SERIAL}"],
"KillServer": ["{ADB}", "kill-server"],
"UUID": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"settings get secure android_id"
],
"Resolution": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+"
],
"StartApp": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"am start -n {INTENT}"
],
"StopApp": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"am force-stop {INTENT}"
],
"Click": ["{ADB}", "-s", "{ADB_SERIAL}", "shell", "input tap {X} {Y}"],
"Swipe": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"input swipe {X1} {Y1} {X2} {Y2} {DURATION}"
],
"PressKey": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"input keyevent {KEY}"
],
"ForwardSocket": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"forward",
"tcp:{FOWARD_PORT}",
"localabstract:{LOCAL_SOCKET}"
],
"NetcatAddress": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"cat /proc/net/arp | grep : "
],
"ScreencapRawByNetcat": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"exec-out",
"screencap | nc -w 3 {NETCAT_ADDRESS} {NETCAT_PORT}"
],
"ScreencapRawWithGzip": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"exec-out",
"screencap | gzip -1"
],
"ScreencapEncode": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"exec-out",
"screencap -p"
],
"ScreencapEncodeToFile": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"screencap -p > \"/data/local/tmp/{TEMP_FILE}\""
],
"PullFile": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"pull",
"/data/local/tmp/{TEMP_FILE}",
"{DST_PATH}"
],
"Abilist": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"getprop ro.product.cpu.abilist | tr -d '\n\r'"
],
"SDK": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"getprop ro.build.version.sdk | tr -d '\n\r'"
],
"Orientation": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]"
],
"PushBin": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"push",
"{BIN_PATH}",
"/data/local/tmp/{BIN_WORKING_FILE}"
],
"ChmodBin": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"chmod 700 \"/data/local/tmp/{BIN_WORKING_FILE}\""
],
"InvokeBin": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"export LD_LIBRARY_PATH=/data/local/tmp/; \"/data/local/tmp/{BIN_WORKING_FILE}\" {BIN_EXTRA_PARAMS}"
],
"InvokeApp": [
"{ADB}",
"-s",
"{ADB_SERIAL}",
"shell",
"export CLASSPATH=\"/data/local/tmp/{APP_WORKING_FILE}\"; app_process /data/local/tmp {PACKAGE_NAME}"
]
}
}

0 comments on commit 4e73469

Please sign in to comment.