xapkConvert

Simple bulk .xapk -> .apk unpacker script for Apkpure downloaded Android apps

1
0
1
PowerShell
public

XAPK Extractor

Overview

This PowerShell script automates the handling of .xapk files, which are extended Android application packages.
It performs the following tasks:

  • Renames .xapk files to .zip
  • Extracts their contents
  • Collects all .apk files into a single destination folder
  • Optionally removes temporary files and folders after processing

This tool is useful for developers or testers managing multiple .xapk distributions at once.


Features

  • Automatically creates a Removed_APKs folder
  • Converts .xapk.zip and extracts contents
  • Recursively locates all .apk files
  • Moves .apk files (excluding those containing “config”) into a single destination folder
  • Optional cleanup step removes intermediate archives and folders
  • Graceful error handling — continues processing other files even if one fails

Directory Structure

After execution, your working directory will look similar to this:

YourFolder/
│
├── Removed_APKs/
│   ├── app1.apk
│   ├── app2.apk
│   └── ...
│
├── app1/
│   ├── manifest.json
│   ├── APK/
│   └── ...
│
├── app1.zip
├── app2.zip
└── xapk.ps1

Usage Instructions

  1. Place xapk.ps1 in the same directory as your .xapk files.

  2. Open PowerShell in that directory.

  3. Run the script:

    .\xapk.ps1
    
  4. The script will:

    • Create the Removed_APKs directory (if missing)
    • Process each .xapk file sequentially
    • Move resulting .apk files into the destination folder

Optional Cleanup

To automatically remove extracted .zip files and temporary folders,
uncomment the following lines near the end of the script:

# Remove-Item -Path $zipName -Force
# Remove-Item -Path $extractionPath -Recurse -Force
# Write-Host "Cleaned up '$zipName' and '$extractionPath'"

Example Console Output

Created destination folder: C:\Projects\Removed_APKs
Processing file: sample.xapk
Renamed 'sample.xapk' to 'sample.zip'
Created extraction folder: C:\Projects\sample
Extracted 'sample.zip' to 'C:\Projects\sample'
Moved 'C:\Projects\sample\base.apk' to 'C:\Projects\Removed_APKs'
All files have been processed successfully.

Error Handling

  • If directory creation fails, the script stops and reports the error.
  • Errors during file extraction or movement are shown as warnings.
  • Other .xapk files continue processing even after one fails.

Requirements

  • Windows PowerShell 5.1 or PowerShell 7+
v0.3.1[beta]