Open XAPK File

Information, tips and instructions

XAPK File Structure

XAPK is a compressed file which contains all files necessary for application installation on the Android platform. During XAPK installation files inside it are extracted and placed to the correct places on Android device. In this article we will cover how XAPK file should be structured to be processed correctly.

XAPK file typically consists of APK file, OBB files, manifest.json and icon.png.

APK file is the main installation file for the Android application and should be placed in the root folder of the XAPK file. APK file should be named as ${ApplicationId}.apk where ${ApplicationId} is the package identifier of the application.

OBB files are expansion files where additional resources and data are stored for the Android application. Typically there could be one or two OBB files in the installation package.

  • Main.${versionCode}.${ApplicationId}.obb - this file contains rarely changed data and resources for the app. It is not supposed to be updated frequently by the app.
  • Patch.${versionCode}.${ApplicationId}.obb - this file contains frequently changed data and resources for the app. It can be updated with every version of the app if necessary.

Both OBB files need to be placed to the Android/obb/${ApplicationId}/ folder inside the XAPK file.

You should also place icon.png file which contains the icon of the app to the XAPK file if you want the icon of the app to be displayed properly.

Each XAPK file needs to contain manifest.json file which describes locations of the files in the XAPK package and specifies version, permissions and SDK restrictions. Below is an example of XAPK manifest.json template you can use to create XAPK file.

{
"xapk_version":1,
"package_name":"${ApplicationId}",
"name":"${AppName}",
"version_code":"${versionCode}",
"version_name":"${versionName}",
"min_sdk_version":"${minSdkVersion}",
"target_sdk_version":"${targetSdkVersion}",
"permissions":[
    "android.permission.INTERNET"
],
"total_size":65535,
"expansions":[
  {
    "file":"Android/obb/${ApplicationId}/main.${versionCode}.${ApplicationId}.obb",
    "install_location":"EXTERNAL_STORAGE",
    "install_path":"Android/obb/${ApplicationId}/main.${versionCode}.${ApplicationId}.obb"
  }
]
}

You can place additional files to the XAPK files if necessary, but they will be ignored by most of the XAPK installers. To compress the resulting XAPK file use any available ZIP compression program. Do not use other compression methods because XAPK installers will not understand it.