Android App Publishing Skill
Build a release APK and submit it to the five major Android app stores (Tencent MyApp / Xiaomi / Huawei / OPPO / vivo) for review – fully end-to-end automated.
Execution Instructions
When the user requests "package and submit" (or "build release" / "publish" / "distribute app" / "multi-channel submission", etc.):
- Confirm update description: If not specified by the user, use the default "Fixed known issues, optimized user experience", or ask the user.
- Execute the all-in-one command:
PUBLISH_CONFIRM_SUBMIT=YES python3 ~/.codex/skills/android-publish/scripts/build_and_submit.py \ --i-know-this-submits-to-production \ --update-desc "<update description>" \ <project root> - Monitor output: The script completes all steps automatically (pre-check → build → Bugly → multi-channel submission → Git tag), no manual intervention required.
- Report results: Summarize the success/failure status of each channel to the user.
- Error handling: If pre-check fails (signing / version number), stop and inform the user of the specific reason; failure on one channel does not affect other channels.
Build Only Without Submission (Dry-Run)
Only Tencent MyApp supports dry-run (upload without submitting for review). Xiaomi / Huawei / OPPO / vivo submit immediately upon upload, so dry-run skips them automatically:
python3 ~/.codex/skills/android-publish/scripts/build_and_submit.py \
--dry-run --store yyb \
<project root>
Specify a Single Channel
PUBLISH_CONFIRM_SUBMIT=YES python3 ~/.codex/skills/android-publish/scripts/build_and_submit.py \
--store yyb|xiaomi|huawei|oppo|vivo \
--i-know-this-submits-to-production \
--update-desc "<update description>" \
<project root>
Skip Steps
--skip-build: Skip building and use an existing APK--skip-bugly: Skip Bugly symbol table upload--skip-git: Skip Git tagging--skip-check: Skip pre-check
Automation Flow
| Step | Script | Description |
|---|---|---|
| Step 0 Pre-check | pre_check.py | Verify release signing config is signingConfigs.release + local versionCode > online version number |
| Step 1 Build | ./gradlew clean assembleRelease | Locate app-arm64-v8a-release.apk (only upload 64-bit packages) |
| Step 1.5 Bugly | upload_bugly_symbol.py | Upload mapping.txt (non-blocking; failure does not affect submission) |
| Step 2 Multi-channel submission | Per-channel *_submit.py | Upload to each configured channel sequentially, with independent safety locks |
| Step 3 Git tag | git_tag.py | After all succeed, merge to master + create version tag + push |
Supported Channels
| Channel | Identifier | Signing Method | Dry-Run | API Limits |
|---|---|---|---|---|
| Tencent MyApp | yyb | HmacSHA256 | Supported | 100 uploads/day, 50 updates/day |
| Xiaomi App Store | xiaomi | RSA (X.509 certificate) | Not supported (upload = submit) | None |
| Huawei AppGallery | huawei | OAuth2 (API Client) | Not supported | None |
| OPPO App Market | oppo | HmacSHA256 | Not supported | 50 requests/day/API |
| vivo App Store | vivo | HmacSHA256 | Not supported | 50 requests/day/API |
All channels support Chinese update descriptions passed uniformly via --update-desc. Huawei additionally sets a user-visible newFeatures field.
Safety Lock
Submitting for review is a write operation on the live environment and requires both:
- The
--i-know-this-submits-to-productioncommand line flag - The environment variable
PUBLISH_CONFIRM_SUBMIT=YES(for multi-channel) or the corresponding per-channel variable
build_and_submit.py automatically sets the appropriate environment variables for child processes when --confirm is used, so you only need to set PUBLISH_CONFIRM_SUBMIT=YES.
Channel Characteristics
- Tencent MyApp: Upload and submission are separate; supports dry-run. Limits: 100 uploads/day, 50 updates/day.
- Xiaomi: Upload triggers immediate submission; only needs APK + updateDesc. No API limits.
- Huawei: Token → upload to OBS → update file info → update language info (update description) → wait 2 minutes → submit. Team-level credentials are shared across apps.
- OPPO: The publish API has many fields, but automatically reuses existing values from query results. Limit: 50 requests/day/API.
- vivo: Uploading APK returns a transaction ID + versionCode; the update API requires few mandatory fields. Limit: 50 requests/day/API.
Prerequisites
- Each app store must have the app registered and successfully published online.
- The project root must contain
.publish_env(already in.gitignore) with credentials for each channel. - The Xiaomi public key certificate file must be placed in the project root directory and added to
.gitignore. - The local machine must have Python 3.8+,
requests,pycryptodome, andcryptography. - The project root must contain
gradlewwith Java / Android SDK configured.
Single Channel Operations
Each channel supports independent query and submission. See README.md for details.
Bugly Symbol Table
After building, mapping.txt is automatically uploaded to Bugly (non-blocking) to ensure crash stack traces can be deobfuscated. The jar tool is bundled in the skill's tools/ directory; credentials are read from .publish_env (BUGLY_APP_ID / BUGLY_APP_KEY).