View Single Post
Old 01-18-2024, 04:45 PM   #42
dcarvil
Enthusiast
dcarvil began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jan 2024
Device: Boox Note Air 3
Quote:
Originally Posted by nomoi View Post
Hello @Renate, hello @Chitter, thanks to both of your efforts and thorough descriptions I wrote a script for Linux users (please use at your own risk and go line by line if unsure):
Code:
#!/usr/bin/env bash
read -erp '> please make sure adb and fastboot are working (press <Return>)'

_OLDDIR=$PWD
_WORKINGDIR=na2p
mkdir $_WORKINGDIR
cd $_WORKINGDIR
echo "> using ${_WORKINGDIR}"

### prerequisites
echo '> installing Magisk..'
wget 'https://github.com/topjohnwu/Magisk/releases/download/v26.3/Magisk.v26.3.apk' # get magisk
adb install Magisk.v26.3.apk 

### optional programs
echo '> installing F-Droid..'
wget 'https://f-droid.org/F-Droid.apk'
adb install F-Droid.apk 

echo '> installing AFWall..'
wget 'https://github.com/ukanth/afwall/releases/download/v3.6.0/AFWall_3.6.0_Free.apk'
adb install AFWall_3.6.0_Free.apk 

### EDL
echo '> installing EDL (cf. https://github.com/bkerler/edl)'
git clone https://github.com/bkerler/edl
cd edl
git submodule update --init --recursive
pip3 install -r requirements.txt

### optionally install the following loader (the included EDL loader worked fine for me)
# curl 'https://www.mobileread.com/forums/attachment.php?attachmentid=192603&d=1646588825' --output 662.elf.zip # get EDL loader
# unzip 662.elf.zip

# EDL mode
cd ..
adb reboot edl # reboot to edl
# ./edl/edl --loader=Qualcomm_662_loader.elf &&\
./edl/edl --loader=./edl/Loaders/qualcomm/factory/sdm662/0014d0e100000000_d40eee56f3194665_FHPRG.bin &&\
    ./edl/edl r boot_a boot_a &&\
    ./edl/edl reset # use EDL loader, pull boot_a and reset 

t=45; echo "> waiting ${t}s for reboot" && sleep $t
adb push boot_a /sdcard/Download/
read -erp '> please install via Magisk and press <Return> when finished..'
patchedfile=$(adb shell 'ls -1 /sdcard/Download/' | tail -1 | grep patched)
adb pull /sdcard/Download/$patchedfile
adb reboot bootloader
t=15; echo "waiting ${t}s for bootloader" && sleep $t

read -erp '> flash (1); boot only (2): ' prompt
case $prompt in
    1) fastboot flash boot $patchedfile ;;
    2) fastboot boot $patchedfile ;;
    *) echo "no valid option; exiting, but remaining in fastboot mode. You may try 'fastboot flash boot ${patchedfile}' for flashing or 'fastboot boot ${patchedfile}' for testing yourself." && exit 1
esac
echo "> booting $patchedfile"
cd $_OLDDIR
echo "> all done; I hope it worked : )"

Thank you for the script. It is very informative, since I am on Linux. I was hoping it would also work on my Boox NoteAir 3 with 3.5 firmware, but unfortunately the edl commands fail with this error:

sahara - [LIB]: Error: Cannot receive specified number of program headers

I know nothing about edl, but see no obvious errors prior to that. Can you suggest anything else I can try?

The console output is:
Code:
xfx:~/oldhome/Phone/boox/na2p $ adb reboot edl
xfx:~/oldhome/Phone/boox/na2p $ ./edl/edl --loader=./edl/Loaders/qualcomm/factory/sdm662/0014d0e100000000_d40eee56f3194665_FHPRG.bin
Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2023.
main - Using loader ./edl/Loaders/qualcomm/factory/sdm662/0014d0e100000000_d40eee56f3194665_FHPRG.bin ...
main - Waiting for the device
main - Device detected :)
sahara - Protocol version: 2, Version supported: 1
main - Mode detected: sahara
sahara - 
Version 0x2
------------------------
HWID:              0x001b80e100000000 (MSM_ID:0x001b80e1,OEM_ID:0x0000,MODEL_ID:0x0000)
CPU detected:      "divar"
PK_HASH:           0xd40eee56f3194665574109a39267724ae7944134cd53cb767e293d3c40497955bc8a4519ff992b031fadc6355015ac87
Serial:            0xdab958fb

sahara - Protocol version: 2, Version supported: 1
sahara - Uploading loader ./edl/Loaders/qualcomm/factory/sdm662/0014d0e100000000_d40eee56f3194665_FHPRG.bin ...
sahara - 64-Bit mode detected.
sahara - Firehose mode detected, uploading...
sahara - Loader successfully uploaded.


xfx:~/oldhome/Phone/boox/na2p $ ./edl/edl r boot_a boot_a
Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
main - Device detected :)
sahara - Protocol version: 2, Version supported: 1
main - Mode detected: sahara
sahara - 
Version 0x2
------------------------
HWID:              0x001b80e100000000 (MSM_ID:0x001b80e1,OEM_ID:0x0000,MODEL_ID:0x0000)
CPU detected:      "divar"
PK_HASH:           0xd40eee56f3194665574109a39267724ae7944134cd53cb767e293d3c40497955bc8a4519ff992b031fadc6355015ac87
Serial:            0xdab958fb

sahara - Possibly unfused device detected, so any loader should be fine...
sahara - Possible loader available: /ext4-store/home/dcarvil/Phone/boox/na2p/edl/edlclient/../Loaders/lenovo_motorola/001b80e100000000_503b13f78c1e5374_fhprg.bin
sahara - Trying loader: /ext4-store/home/dcarvil/Phone/boox/na2p/edl/edlclient/../Loaders/lenovo_motorola/001b80e100000000_503b13f78c1e5374_fhprg.bin
sahara - Protocol version: 2, Version supported: 1
sahara - Uploading loader /ext4-store/home/dcarvil/Phone/boox/na2p/edl/edlclient/../Loaders/lenovo_motorola/001b80e100000000_503b13f78c1e5374_fhprg.bin ...
sahara - 64-Bit mode detected.
sahara - Firehose mode detected, uploading...
sahara
sahara - [LIB]: Error: Cannot receive specified number of program headers
Connection detected, quiting.
Thank you for any help you can provide.
dcarvil is offline   Reply With Quote