-
Notifications
You must be signed in to change notification settings - Fork 119
feat: support android app #891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e333e2e
7a3f06e
8f20382
2ce5fe9
8070420
840a3fd
26ad6cb
098e3ad
3eea944
38106f9
11cbb87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| name: Build Release APK | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "android-v*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| maafw_tag: | ||
| description: "MaaFramework release tag" | ||
| required: false | ||
| default: "latest" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: macos-latest | ||
| timeout-minutes: 90 | ||
| env: | ||
| PI_PROFILE: ${{ github.workspace }}/Android/profile.yaml | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: "25" | ||
| distribution: temurin | ||
|
|
||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| - name: Install NDK and CMake | ||
| run: sdkmanager --install "ndk;29.0.13113456" "cmake;3.22.1" | ||
|
|
||
| - name: Cache Gradle | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: gradle-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/**/*.gradle.kts', 'Android/MaaFwApp/**/gradle-wrapper.properties', 'Android/MaaFwApp/**/libs.versions.toml') }} | ||
| restore-keys: | | ||
| gradle-${{ runner.os }}- | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
Comment on lines
+49
to
+52
|
||
|
|
||
| - name: Cache MaaFramework zips | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: Android/MaaFwApp/.maa-cache | ||
| key: maa-fw-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/scripts/setup_maa_framework.py') }} | ||
|
|
||
| - name: Cache agent core | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: Android/MaaFwApp/.maafw | ||
| key: maa-agent-core-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/scripts/build_agent_bundle.py') }} | ||
|
|
||
| - name: Download and deploy MaaFramework | ||
| working-directory: Android/MaaFwApp | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| TAG_ARG="" | ||
| MAAFW_TAG="${{ github.event.inputs.maafw_tag }}" | ||
| if [ -n "$MAAFW_TAG" ] && [ "$MAAFW_TAG" != "latest" ]; then | ||
| TAG_ARG="--tag $MAAFW_TAG" | ||
| fi | ||
| python scripts/setup_maa_framework.py $TAG_ARG | ||
|
|
||
| - name: Build agent runtime | ||
| working-directory: Android/MaaFwApp | ||
| run: | | ||
| python scripts/build_agent_bundle.py \ | ||
| --out "${GITHUB_WORKSPACE}/Android/agent-dist" \ | ||
| --abi arm64-v8a \ | ||
| --requirements "${GITHUB_WORKSPACE}/requirements.txt" \ | ||
| --exclude pillow --require pillow==11.0.0 \ | ||
| --extra-index-url https://chaquo.com/pypi-13.1/ | ||
|
|
||
| - name: Decode keystore | ||
| env: | ||
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | ||
| run: echo "$KEYSTORE_BASE64" | base64 -d > ${{ github.workspace }}/release.jks | ||
|
|
||
| - name: Write local.properties | ||
| working-directory: Android/MaaFwApp | ||
| run: | | ||
| echo "sdk.dir=${ANDROID_HOME}" > local.properties | ||
| echo "pi.profile=${PI_PROFILE}" >> local.properties | ||
|
Comment on lines
+93
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): 对齐 debug 和 release 构建之间的 ABI 配置,避免出现意外的多 ABI 构建。 在 debug 工作流中,你在 建议实现方式:
Original comment in Englishsuggestion (bug_risk): Align ABI configuration between debug and release builds to avoid unexpected multi-ABI builds. In the debug workflow you set Suggested implementation:
|
||
|
|
||
| - name: Build Release APK | ||
| working-directory: Android/MaaFwApp | ||
| env: | ||
| KEYSTORE_PATH: ${{ github.workspace }}/release.jks | ||
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
| run: | | ||
| chmod +x ./gradlew | ||
| ./gradlew clean assembleRelease | ||
|
|
||
| - name: Rename APK | ||
| run: | | ||
| cd Android/MaaFwApp/app/build/outputs/apk/release | ||
| TAG="${GITHUB_REF_NAME:-dev}" | ||
| for f in *.apk; do | ||
| mv "$f" "M9A-Meow-${TAG}-arm64-v8a.apk" | ||
| done | ||
|
|
||
| - name: Upload APK | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-apk-arm64-v8a | ||
| path: Android/MaaFwApp/app/build/outputs/apk/release/*.apk | ||
|
|
||
| - name: Upload R8 mapping | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-mapping-arm64-v8a | ||
| path: Android/MaaFwApp/app/build/outputs/mapping/release/mapping.txt | ||
| if-no-files-found: error | ||
|
|
||
| release: | ||
| if: startsWith(github.ref, 'refs/tags/android-v') | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download all APK artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: release-apk-* | ||
| merge-multiple: true | ||
| path: apks | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} | ||
| files: apks/*.apk | ||
| generate_release_notes: true | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,191 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| name: Build Dev APK | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main, master] | ||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||
| - "Android/**" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "agent/**" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "requirements.txt" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "interface.json" | ||||||||||||||||||||||||||||||||||||||||||||||
| - ".github/workflows/android.yml" | ||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||
| - "Android/**" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "agent/**" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "requirements.txt" | ||||||||||||||||||||||||||||||||||||||||||||||
| - "interface.json" | ||||||||||||||||||||||||||||||||||||||||||||||
| - ".github/workflows/android.yml" | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 监听所有 APK 打包输入。
建议修改 - "agent/**"
+ - "tasks/**"
+ - "resource/**"
+ - "data/**"
+ - "config/**"
+ - "logo.ico"
+ - "CONTACT"
+ - "LICENSE"
- "requirements.txt"
- "interface.json"🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||||||||
| assemble: | ||||||||||||||||||||||||||||||||||||||||||||||
| description: "debug 或 release" | ||||||||||||||||||||||||||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||||||||||||||||||||||||
| - debug | ||||||||||||||||||||||||||||||||||||||||||||||
| - release | ||||||||||||||||||||||||||||||||||||||||||||||
| default: debug | ||||||||||||||||||||||||||||||||||||||||||||||
| maafw_tag: | ||||||||||||||||||||||||||||||||||||||||||||||
| description: "MaaFramework release tag" | ||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||
| default: "latest" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||
| group: android-dev-${{ github.ref }} | ||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-latest | ||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 60 | ||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||
| PI_PROFILE: ${{ github.workspace }}/Android/profile.yaml | ||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||
| submodules: recursive | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up JDK | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| java-version: "25" | ||||||||||||||||||||||||||||||||||||||||||||||
| distribution: temurin | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Android SDK | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: android-actions/setup-android@v3 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install NDK and CMake | ||||||||||||||||||||||||||||||||||||||||||||||
| run: sdkmanager --install "ndk;29.0.13113456" "cmake;3.22.1" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache Gradle | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||||||||||||||||||||
| ~/.gradle/caches | ||||||||||||||||||||||||||||||||||||||||||||||
| ~/.gradle/wrapper | ||||||||||||||||||||||||||||||||||||||||||||||
| key: gradle-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/**/*.gradle.kts', 'Android/MaaFwApp/**/gradle-wrapper.properties', 'Android/MaaFwApp/**/libs.versions.toml') }} | ||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||
| gradle-${{ runner.os }}- | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| python-version: "3.12" | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+75
to
+78
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache MaaFramework zips | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/MaaFwApp/.maa-cache | ||||||||||||||||||||||||||||||||||||||||||||||
| key: maa-fw-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/scripts/setup_maa_framework.py') }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache agent core | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/MaaFwApp/.maafw | ||||||||||||||||||||||||||||||||||||||||||||||
| key: maa-agent-core-${{ runner.os }}-${{ hashFiles('Android/MaaFwApp/scripts/build_agent_bundle.py') }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache agent bundle | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/agent-dist | ||||||||||||||||||||||||||||||||||||||||||||||
| key: m9a-agent-${{ runner.os }}-${{ hashFiles('requirements.txt', 'Android/MaaFwApp/scripts/build_agent_bundle.py') }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+92
to
+97
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download and deploy MaaFramework | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: Android/MaaFwApp | ||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| TAG_ARG="" | ||||||||||||||||||||||||||||||||||||||||||||||
| MAAFW_TAG="${{ github.event.inputs.maafw_tag }}" | ||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$MAAFW_TAG" ] && [ "$MAAFW_TAG" != "latest" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| TAG_ARG="--tag $MAAFW_TAG" | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| python scripts/setup_maa_framework.py --abi arm64-v8a $TAG_ARG | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+98
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 禁止把 输入中的双引号和 shell 元字符可以改变赋值语句后的 shell 语法。Release workflow 随后使用签名密钥构建 APK。攻击者可以在较早步骤修改工作区中的构建文件,并在后续步骤获取密钥。
建议修改 env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ MAAFW_TAG: ${{ github.event.inputs.maafw_tag }}
run: |
- TAG_ARG=""
- MAAFW_TAG="${{ github.event.inputs.maafw_tag }}"
if [ -n "$MAAFW_TAG" ] && [ "$MAAFW_TAG" != "latest" ]; then
- TAG_ARG="--tag $MAAFW_TAG"
+ python scripts/setup_maa_framework.py --abi arm64-v8a --tag "$MAAFW_TAG"
+ else
+ python scripts/setup_maa_framework.py --abi arm64-v8a
fi
- python scripts/setup_maa_framework.py --abi arm64-v8a $TAG_ARG📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.29.0)[error] 97-97: code injection via template expansion (template-injection): may expand into attacker-controllable code (template-injection) 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build agent runtime | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: Android/MaaFwApp | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| if [ -x "${GITHUB_WORKSPACE}/Android/agent-dist/arm64-v8a/bundle/bin/python3" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "agent bundle cache hit" | ||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| python scripts/build_agent_bundle.py \ | ||||||||||||||||||||||||||||||||||||||||||||||
| --out "${GITHUB_WORKSPACE}/Android/agent-dist" \ | ||||||||||||||||||||||||||||||||||||||||||||||
| --abi arm64-v8a \ | ||||||||||||||||||||||||||||||||||||||||||||||
| --requirements "${GITHUB_WORKSPACE}/requirements.txt" \ | ||||||||||||||||||||||||||||||||||||||||||||||
| --exclude pillow --require pillow==11.0.0 \ | ||||||||||||||||||||||||||||||||||||||||||||||
| --extra-index-url https://chaquo.com/pypi-13.1/ | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+112
to
+122
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Write local.properties | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: Android/MaaFwApp | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "sdk.dir=${ANDROID_HOME}" | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "pi.profile=${PI_PROFILE}" | ||||||||||||||||||||||||||||||||||||||||||||||
| if [ "${{ github.event.inputs.assemble || 'debug' }}" != "release" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "build.debugAbi=arm64-v8a" | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| } > local.properties | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Decode keystore | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble == 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | ||||||||||||||||||||||||||||||||||||||||||||||
| run: echo "$KEYSTORE_BASE64" | base64 -d > ${{ github.workspace }}/release.jks | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build Debug APK | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble != 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: Android/MaaFwApp | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x ./gradlew | ||||||||||||||||||||||||||||||||||||||||||||||
| ./gradlew clean assembleDebug | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build Release APK | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble == 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: Android/MaaFwApp | ||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||
| KEYSTORE_PATH: ${{ github.workspace }}/release.jks | ||||||||||||||||||||||||||||||||||||||||||||||
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||||||||||||||||||||||||||||||||||||||||||||||
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||||||||||||||||||||||||||||||||||||||||||||||
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x ./gradlew | ||||||||||||||||||||||||||||||||||||||||||||||
| ./gradlew clean assembleRelease | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Rename Release APK | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble == 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| cd Android/MaaFwApp/app/build/outputs/apk/release | ||||||||||||||||||||||||||||||||||||||||||||||
| TAG="${GITHUB_REF_NAME:-dev}" | ||||||||||||||||||||||||||||||||||||||||||||||
| for f in *.apk; do | ||||||||||||||||||||||||||||||||||||||||||||||
| mv "$f" "M9A-Meow-${TAG}-arm64-v8a.apk" | ||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+160
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 规范化 分支名和标签名可以包含 建议修改 cd Android/MaaFwApp/app/build/outputs/apk/release
TAG="${GITHUB_REF_NAME:-dev}"
+ TAG="${TAG//\//-}"
for f in *.apk; do
mv "$f" "M9A-Meow-${TAG}-arm64-v8a.apk"
done📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload Debug APK | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble != 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| name: debug-apk | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/MaaFwApp/app/build/outputs/apk/debug/*.apk | ||||||||||||||||||||||||||||||||||||||||||||||
| if-no-files-found: error | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload Release APK | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble == 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| name: release-apk-arm64-v8a | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/MaaFwApp/app/build/outputs/apk/release/*.apk | ||||||||||||||||||||||||||||||||||||||||||||||
| if-no-files-found: error | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload R8 mapping | ||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ github.event.inputs.assemble == 'release' }} | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| name: release-mapping-arm64-v8a | ||||||||||||||||||||||||||||||||||||||||||||||
| path: Android/MaaFwApp/app/build/outputs/mapping/release/mapping.txt | ||||||||||||||||||||||||||||||||||||||||||||||
| if-no-files-found: error | ||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,8 @@ maafw.log | |
|
|
||
| # node 相关 | ||
| .pnpm-store/ | ||
| .idea | ||
| # Android 客户端:agent 产物在子模块外,必须在这里忽略 | ||
| Android/agent-dist/ | ||
| *.jks | ||
| *.jks.b64 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| [submodule "MaaCommonAssets"] | ||
| path = MaaCommonAssets | ||
| url = https://github.com/MaaXYZ/MaaCommonAssets.git | ||
| [submodule "Android/MaaFwApp"] | ||
| path = Android/MaaFwApp | ||
| url = https://github.com/Aliothmoon/MaaFwApp.git | ||
| branch = main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
限制
buildjob 的GITHUB_TOKEN权限。buildjob 未声明permissions,因此令牌权限取决于仓库默认设置。该 job 会执行子模块脚本和 Gradle。将权限固定为只读。建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Linters/SAST tools