Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Markismus/acd39237f744331c3e8ce278b3d6b697 to your computer and use it in GitHub Desktop.
Save Markismus/acd39237f744331c3e8ce278b3d6b697 to your computer and use it in GitHub Desktop.
Onyx Boox Image Extractor
# This script is the Onyx Boox download tool
# Define your
DEVICE_NAME="Nova2"
# Install required package
sudo apt update && export DEBIAN_FRONTEND=noninteractive \
&& sudo apt -y install --no-install-recommends python3 python3-pip git brotli
pip3 install pycryptodome
# Clone the repo
# 1. decryptBooxUpdateUpx
git clone https://github.com/Hagb/decryptBooxUpdateUpx.git
# 2. sdat2img
git clone https://github.com/xpirt/sdat2img.git
# Download the latest image
urlParam='where={"buildNumber":0,"buildType":"user","deviceMAC":"","lang":"en_US","model":"'${DEVICE_NAME}'","submodel":"","fingerprint":""}'
content=$(curl -G "http://data.onyx-international.cn/api/firmware/update" --data-urlencode ${urlParam})
fingerprint=$( jq -r '.fingerprint' <<< "${content}" )
url=$( jq -r '.downloadUrlList[0]' <<< "${content}" )
printf "\nFingerprint: ${fingerprint}\n"
printf "URL: ${url}\n\n"
wget ${url}
printf "Done Downloading\n"
# Convert UPX into ZIP
printf "Start decrypting the image\n"
filename=$(basename ${url})
python3 decryptBooxUpdateUpx/DeBooxUpx.py ${DEVICE_NAME} ${filename}
printf "Image decryption completed\n"
rm ${filename}
# Extract the ZIP file
unzip update.zip system.transfer.list system.new.dat.br
rm update.zip
# Extract system.img
brotli --decompress system.new.dat.br
rm system.new.dat.br
python3 sdat2img/sdat2img.py system.transfer.list system.new.dat
rm system.transfer.list system.new.dat
# Mount system.img
mkdir output
sudo mount -t ext4 -o loop system.img output/
printf "The system partition is now mounted in output directory"
printf "After finish, please run the following command:\n"
printf " sudo umount output"

Onyx Boox Image extractor

This extractor allows you to read the image content without owning an Onyx Boox device

Running the script

Please use a Debian based linux device to run the script. Please follow the steps below:

  • Open the the table of supported device on the browser, and find the MODEL column of your desired device
  • Open download.sh, and replace DEVICE_NAME with your name of your desired device
  • Run download.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment