Skip to content

ndk installation#880

Merged
davidschachterADFA merged 2 commits intostagefrom
task/ADFA-2179-ndk-install
Jan 26, 2026
Merged

ndk installation#880
davidschachterADFA merged 2 commits intostagefrom
task/ADFA-2179-ndk-install

Conversation

@jomen-adfa
Copy link
Contributor

ndk installation only

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Release Notes - NDK Installation Feature

Features

  • NDK Installation Support: Added automatic NDK (Native Development Kit) installation functionality

    • Extracts NDK archive (ndk-cmake.tar.xz) to Android home directory
    • Uses bash command with tar.xz decompression via Termux shell
    • Implements 2-minute timeout for extraction operations
    • Automatically removes archive file after successful extraction
  • Enhanced Progress Reporting: Updated asset installation progress snapshot display

    • Displays "Post install processing in progress...." message when progress reaches 99%+
    • Maintains detailed per-entry status lines for progress < 99%
  • Environment Configuration: Added NDK directory constants and initialization

    • New NDK_TAR_XZ constant for archive naming
    • New NDK_DIR field initialized as ANDROID_HOME/ndk
    • Automatic NDK directory setup during environment initialization
  • Updated SDK Size Expectations:

    • BundledAssetsInstaller: ANDROID_SDK_ZIP updated to 254814511L bytes
    • SplitAssetsInstaller: ANDROID_SDK_ZIP updated to 286625871L bytes

Logging

  • Added dedicated logger for BaseAssetsInstaller using LoggerFactory
  • Logs NDK extraction process output, success, and cleanup operations

⚠️ Risks & Best Practice Considerations

  1. Hard-coded Timeout Risk: 2-minute timeout for NDK extraction may be insufficient on slower devices or networks. Consider making this configurable or implementing adaptive timeouts based on file size.

  2. Platform/Environment Dependency: NDK extraction relies on bash via Termux shell. This creates a dependency on:

    • Termux availability
    • Bash command availability
    • May fail on devices where bash is not installed or accessible
  3. Silent File Deletion: Archive file is deleted after successful extraction without user confirmation. Recommend implementing recovery options if extraction fails after deletion is attempted.

  4. Size Constant Updates: SDK size constants have been significantly updated (54MB→254MB for bundled, 85MB→286MB for split). Verify these values are accurate to prevent false validation failures or misleading progress indicators.

  5. Concurrent Output Reading: Uses dedicated thread to read process output concurrently, but ensure proper thread synchronization and error handling in edge cases (e.g., process crash, unexpected output format).

  6. Missing Error Recovery: No explicit rollback mechanism if NDK installation fails partway through. Consider implementing cleanup of partial extractions.

Walkthrough

This PR adds NDK installation infrastructure and refines assets installation workflows. New private installNdk() method extracts tar.xz archives via bash with process management and logging. Progress snapshot display changes to show a static message at 99%+ completion. Environment constants and Android SDK expected sizes are updated.

Changes

Cohort / File(s) Summary
NDK Installation Logic
app/src/main/java/com/itsaky/androidide/assets/BaseAssetsInstaller.kt
New private installNdk() method implements tar.xz extraction via bash command with 2-minute timeout, output logging, and archive cleanup. Logger property added. postInstall() now calls installNdk().
Progress Display
app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.kt
Progress snapshots at 99%+ completion show static "Post install processing in progress...." message instead of multi-line per-entry status lines. Unused import removed.
Expected Size Configuration
app/src/main/java/com/itsaky/androidide/assets/BundledAssetsInstaller.kt, SplitAssetsInstaller.kt
Android SDK expected sizes updated: BundledAssetsInstaller from 53226785L to 254814511L, SplitAssetsInstaller from 85024182L to 286625871L.
Environment Setup
common/src/main/java/com/itsaky/androidide/utils/Environment.java
New public constant NDK_TAR_XZ ("ndk-cmake.tar.xz") and static field NDK_DIR added. Environment.init() assigns NDK_DIR to ANDROID_HOME/ndk.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • jatezzz
  • Daniel-ADFA

Poem

🐰 Hops of joy through NDK paths so true,
Assets bundle up, fresh and new!
Progress bars shine at ninety-nine,
Extraction flows in timed design,
Installation magic, swift and divine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ndk installation' accurately reflects the main objective of the PR, which introduces NDK installation functionality across multiple files.
Description check ✅ Passed The description 'ndk installation only' is directly related to the changeset, clearly indicating the scope of changes is limited to NDK installation features.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@davidschachterADFA davidschachterADFA merged commit c126e14 into stage Jan 26, 2026
2 checks passed
@davidschachterADFA davidschachterADFA deleted the task/ADFA-2179-ndk-install branch January 26, 2026 07:56
@coderabbitai coderabbitai bot mentioned this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants