Skip to content

fix(android): install Marketplace packs from app cache - #879

Merged
H-Chris233 merged 1 commit into
Open-Less:betafrom
HKLHaoBin:fix/android-marketplace-install
Aug 2, 2026
Merged

H-Chris233 merged 1 commit into
Open-Less:betafrom
HKLHaoBin:fix/android-marketplace-install

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Summary

  • Store Marketplace install/upload temporary ZIPs under Android app-private Context.getCacheDir() while preserving the existing desktop temp-directory behavior.
  • Use unique RAII-managed archives, serialize concurrent installs, and add phase-specific sanitized logs for diagnosis.
  • Add installing/disabled UI state, pack-scoped inline failure details, translations, and regression tests.

Root cause

On Android 12 and earlier, std::env::temp_dir() can resolve to /data/local/tmp, where the app cannot create the downloaded Marketplace ZIP. The existing app-private persistence fix did not cover this intermediate archive.

Scope

  • Based on the latest upstream/beta.
  • Contains only the Marketplace install/upload, shared Android cache helper, UI feedback, logging, and tests.
  • Excludes all ADB specialist tooling and CI debug-only changes from special/android-adb-debug-kit.

Validation

  • npm test passed: frontend production build plus 28 tests.
  • Android Cargo metadata validation passed for aarch64-linux-android.
  • Android debug CI compiled and uploaded all ABI artifacts: https://github.com/HKLHaoBin/openless/actions/runs/30736275536
  • Verified by the reporting user on Honor Play 20 / Magic UI 4.0 / Android 10: “Install locally” now succeeds.

Fixes #878


PR Type

Bug fix, Tests, Enhancement


Description

  • Fix Android Marketplace install temp directory to use app cache.

  • Add unique RAII temp archives and serialize concurrent installs.

  • Add installing/disabled UI state with inline error messages.

  • Add sanitized phase logging and regression tests.


Diagram Walkthrough

flowchart LR
  UI["Marketplace install UI"] --> CMD["marketplace_install"]
  CMD --> ROOT["marketplace_temp_root"]
  ROOT --> CACHE["Android app cache dir"]
  ROOT --> TMP["Desktop temp dir"]
  CMD --> ARCH["unique temp archive"]
  ARCH --> IMPORT["StylePack import"]
  CMD --> LOCK["serialize installs"]
  CMD --> LOG["sanitized phase logs"]
  IMPORT --> RESULT["UI installed/error feedback"]
Loading

File Walkthrough

Relevant files
Enhancement
3 files
jni.rs
Add app_cache_dir JNI helper for Android cache                     
+29/-0   
marketplaceInstall.ts
Add marketplace install state helper functions                     
+29/-0   
Marketplace.tsx
Add installing state, inline errors, and client logging   
+45/-10 
Refactoring
1 files
updater.rs
Reuse shared app_cache_dir in updates cache path                 
+2/-16   
Bug fix
1 files
marketplace.rs
Use app cache for temp archives, add lock and logs             
+295/-32
Tests
3 files
style_pack_tests.rs
Pre-create stale zip to cover overwrite round-trip             
+1/-0     
marketplaceInstall.test.ts
Add tests for marketplace install state helpers                   
+24/-0   
marketplace-install-contract.test.mjs
Add contract test for fire-and-forget error logging           
+15/-0   
Localization
5 files
en.ts
Add English installing button translation                               
+1/-0     
ja.ts
Add Japanese installing button translation                             
+1/-0     
ko.ts
Add Korean installing button translation                                 
+1/-0     
zh-CN.ts
Add Simplified Chinese installing button translation         
+1/-0     
zh-TW.ts
Add Traditional Chinese installing button translation       
+1/-0     

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

878 - Partially compliant

Compliant requirements:

  • Android install temporary files now use app-private cache via Context.getCacheDir().
  • Marketplace install and upload share MarketplaceTempArchive with unique create_new paths and Drop-based cleanup.
  • The install button shows an installing label, is disabled during install, and pack-scoped inline errors are displayed; a new attempt clears the previous error.
  • Sanitized phase logging was added for Marketplace install.
  • Tests cover temp archive uniqueness/cleanup, Android cache path resolution, install lock behavior, log sanitization, and install-state helper logic.

Non-compliant requirements:

  • No acceptance-criteria item was found unfulfilled from the code diff.

Requires further human verification:

  • Actual on-device success on Honor Play 20 / Android 10 is claimed in the PR description but cannot be confirmed solely by code review.
  • Cross-platform no-regression on Android 13+, Windows, macOS, and Linux is not fully demonstrated by the diff.
  • Visual/UX behavior of the inline error and disabled install button on narrow mobile screens should be manually confirmed.
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233
H-Chris233 merged commit 2409036 into Open-Less:beta Aug 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(android): 荣耀畅玩 20 风格市场“安装到本地”无响应

2 participants