View Single Post
Old 10-17-2023, 11:21 AM   #33
nomoi
Junior Member
nomoi began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jun 2020
Device: pb627
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 : )"

Last edited by nomoi; 10-17-2023 at 04:55 PM.
nomoi is offline   Reply With Quote