I had many problems trying to use the flash-all.sh script provided with the Stock image.
Problems included while flashing:
FAILED (remote: 'Partition should be flashed in fastbootd')
FAILED (remote : variable not found)
extracting product.img (1985 MB) to disk...W/ziparchive( 6677): Zip: unable to truncate file to ........: File too large error:
failed to extract 'system.img': I/O error
Solution:
I was able to finally get my phone flashed by downloading the official crosshatch image and Extracting it to a folder with the official platform-tools located inside.
1) Install the updated adb tool files from google official framework website: (platform-tools-latest-linux.zip)
2) download the factory image file and unzip it inside a folder. (PIXEL_FLASH)
3) after unzipping the rom file, you will find another rom file, unzip it also to the same folder (PIXEL_FLASH)
4) unzip the adb tool downloaded from step 1 and put them in the same folder (PIXEL_FLASH)
5) chmod +x Custom_Flash.sh
6) ./Custom_Flash.sh
7) Happy Flashing (.)(.)
## vim Custom_Flash.sh (i for insert mode, & paste the code block <ESC> :wq)
## chmod +x Custom_Flash.sh
## ./Custom_Flash.sh
Code:
#!/bin/bash
YLW='\e[93m' #${WHT}
WHT='\e[97m' #${YLW}
NC='\e[0m' #${NC}
BLD='\e[1m' #${BLD}
NRM='\e[0m' #${NRM}
RST='\e[22m' #${RST}
clear
echo -e "${YLW}#############################################################################"
echo -e "# ${BLD}Custom Flashin Script${RST} #"
echo -e "#############################################################################"
echo -e "#${WHT} Flashing Notes:${YLW} #"
echo -e "#${WHT} FASTBOOTD --> fastboot reboot fastboot${YLW} #"
echo -e "#${WHT} SIDELOAD --> Enter Recovery --> Update via ADB${YLW} #"
echo -e "#${WHT} adb sideload <zipfile>.zip${YLW} #"
echo -e "${YLW}#############################################################################${WHT} "
files=( adb fastboot )
for i in "${files[@]}"; do
if [ -f "$i" ]; then
echo -e "[\xE2\x9C\x94] $i exists";
else
echo -e "[\xE2\x9D\x8C] $i missing"
err="$err $i"
fi
done
if [ -z "$err" ]; then
echo "Found Dependencies, Moving on...";
else
echo -e "Could not find dependencies: $err \nPlease place in $(pwd)\n"
while true; do
read -p "Would you like for me to retrieve it for you?" yn
case $yn in
[Yy]* ) curl -O https://dl.google.com/android/repository/platform-tools_r29.0.5-linux.zip && unzip platform*.zip && mv platform-tools/* ./ && rmdir platform-tools;break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
fi
factory="crosshatch-qp1a.*.zip"
if test -n "$(find . -maxdepth 1 -name $factory -print -quit)";then
echo -e "[\xE2\x9C\x94] $factory exists ... Continuing with script"
files=( boot.img bootloader* dtbo.img product.img radio* system.img system_other.img vbmeta.img vendor.img )
for i in "${files[@]}"; do
if [ -f "$i" ]; then
echo -e "[\xE2\x9C\x94] $i exists";
else
echo -e "[\xE2\x9D\x8C] $i missing"
err="$err $i"
fi
done
if [ -z "$err" ]; then
echo "Found images, Moving on...";
else
echo -e "Could not find all images: $err \nPlease place in $(pwd)\n"
sleep 5
echo -e "Trying to extract them for you!"
unzip $factory && mv crosshatch*/* ./ && unzip image-crosshatch*.zip && rmdir crosshatch*
fi
else
echo -e "Unable to locate $factory.\nPlease make sure that file is in: $(pwd)."
echo -e "You can manually download factory image & place in current folder with Custom_Flash.sh"
echo -e "Factory download location: https://developers.google.com/android/images\n"
while true; do
read -p "Would you like for me to retrieve it for you?" yn
case $yn in
[Yy]* ) link=$(curl -s https://developers.google.com/android/images | egrep "crosshatch-qp1a.*-factory-.*.zip" | cut -d '"' -f 2 | tail -n 1); curl -O $link;find . -maxdepth 1 -name "crosshatch*.zip" -exec unzip {} \;mv crosshatch*/* ./ && rmdir crosshatch*;break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
fi
export PATH=$PATH:$(pwd)
mkdir tmp
TMPDIR="$PWD/tmp"
echo -e '#############################################################################'
echo -e '# Checking Variables & free space #'
echo -e '#############################################################################'
echo "PATH: ";echo $PATH
df -h /tmp
echo -e '#############################################################################'
echo -e '# Enviroment Checks out - Staring the procedure #'
echo -e '#############################################################################'
echo -e '#############################################################################'
echo -e '# Flashing BOOTLOADER A #'
echo -e '#############################################################################'
sleep 5
fastboot flash bootloader_a bootloader*.img
fastboot reboot-bootloader
echo -e '#############################################################################'
echo -e '# Flashing BOOTLOADER B #'
echo -e '#############################################################################'
sleep 5
fastboot flash bootloader_b bootloader*.img
fastboot reboot-bootloader
echo -e '#############################################################################'
echo -e '# Flashing RADIO A #'
echo -e '#############################################################################'
sleep 5
fastboot flash radio_a radio*.img
fastboot reboot-bootloader
echo -e '#############################################################################'
echo -e '# Flashing RADIO B #'
echo -e '#############################################################################'
sleep 5
fastboot flash radio_b radio*.img
fastboot reboot-bootloader
sleep 7
echo -e '#############################################################################'
echo -e '# Prepping Slot A #'
echo -e '#############################################################################'
sleep 3
fastboot --set-active=_a
fastboot --set-active=a
echo -e '#############################################################################'
echo -e '# Flashing Slot A #'
echo -e '#############################################################################'
sleep 3
##Flashing Slot A
fastboot flash abl_a abl.img
fastboot flash aop_a aop.img
fastboot flash boot_a boot.img
fastboot flash cmnlib_a cmnlib.img
fastboot flash cmnlib64_a cmnlib64.img
fastboot flash devcfg_a devcfg.img
fastboot flash dtbo_a dtbo.img
fastboot flash hyp_a hyp.img
fastboot flash keymaster_a keymaster.img
fastboot flash modem_a modem.img
fastboot flash qupfw_a qupfw.img
fastboot flash tz_a tz.img
fastboot flash vbmeta_a vbmeta.img
fastboot flash xbl_a xbl.img
fastboot flash xbl_config_a xbl_config.img
echo -e '#############################################################################'
echo -e '# Prepping Slot B #'
echo -e '#############################################################################'
sleep 3
fastboot --set-active=_b
fastboot --set-active=b
echo -e '#############################################################################'
echo -e '# Flashing Slot B #'
echo -e '#############################################################################'
sleep 3
##Flashing Slot B
fastboot flash abl_b abl.img
fastboot flash aop_b aop.img
fastboot flash boot_b boot.img
fastboot flash cmnlib_b cmnlib.img
fastboot flash cmnlib64_b cmnlib64.img
fastboot flash devcfg_b devcfg.img
fastboot flash dtbo_b dtbo.img
fastboot flash hyp_b hyp.img
fastboot flash keymaster_b keymaster.img
fastboot flash modem_b modem.img
fastboot flash qupfw_b qupfw.img
fastboot flash tz_b tz.img
fastboot flash vbmeta_b vbmeta.img
fastboot flash xbl_b xbl.img
fastboot flash xbl_config_b xbl_config.img
sleep 3
echo -e '#############################################################################'
echo -e '# Rebooting to fastbootd #'
echo -e '#############################################################################'
sleep 10
fastboot reboot fastboot
sleep 4
echo -e '#############################################################################'
echo -e '# Flashing PRODUCT, VENDOR & SYSTEM A #'
echo -e '#############################################################################'
fastboot flash product_a product.img
fastboot flash vendor_a vendor.img
fastboot flash system_a system.img
echo -e '#############################################################################'
echo -e '# Flashing PRODUCT, VENDOR & SYSTEM B #'
echo -e '#############################################################################'
fastboot flash product_b product.img
fastboot flash system_b system_other.img
fastboot flash vendor_b vendor.img
echo -e '#############################################################################'
echo -e '# Switching to Slot A #'
echo -e '#############################################################################'
fastboot --set-active=_a
fastboot --set-active=a
sleep 4
echo -e '#############################################################################'
echo -e '# Reboot Device #'
echo -e '#############################################################################'
fastboot reboot
rmdir tmp
sleep 10
Those errors mean your adb and fastboot are out of date...
fastbootd is a new userspace fastboot that is used for the newer Pixel partitioning. Updating those tools will allow you to use the factory images as intended.
Related
I am simply reposting this from the mytouch thread by elegos, who is the creator of this script, I take no credit for this whatsoever.
Hello there!
This is a G1 / Magic tool to easily convert images in splash screen ones.
This tool is based upon ffmpeg and you need it installed on your system before proceeding (it will prompt you about the program missing in any case)
REQUIREMENTS
ffmpeg installed on your system
Code:
$ sudo apt-get install ffmpeg
a 320x480 image
a 320x480 device (i.e. G1 / Magic) with engineering SPL (S-OFF)
USAGE
Code:
./file [--help][-h]
Prints out how to use the script
Code:
./file your_image_file
Converts your image into a flashable splash screen, if you want the script will continue flashing the file directly.
NOTE: if you wish to make this script work with the Nexus One or any other device which doesn't share the same 320x480 resolution, just change these two variables:
Code:
size_check=307200
size_desc="320x480"
size_check is in bytes, size_desc is just a descriptive string.
I ASSUME NO RESPONSABILITY ABOUT THE USAGE OF THIS SCRIPT. USE IT "AS IS", LOOK AT THE OUTPUTS AND YOU'LL AVOID BRICKS!
Please, if you wish to redistribute this script, give the right credits and don't change the prog_header please (maybe link this discussion in a text file)!
Edit: I have added a already to use script for 320x480 devices only! Or you can make your own script using elegos's code. The script should already be marked as executable, if not then make executable:
http://www.mediafire.com/?wz83iff1eg3fv38
Usage for this script:
Code:
$ ./splash_creator fileimagename.whatever
Here the code is, just slap it in a text file, give it the executive permission (chmod +x filename) and use it!
Code:
#!/bin/bash
prog_header() {
echo "###############################"
echo "####### EleGoS's FFMPEG #######"
echo "# G1/Sapphire/MyTouch3G/Magic #"
echo "### Splash Screen converter ###"
echo "###############################"
echo "version 1.0"
echo ""
}
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
prog_header
echo "Usage"
echo "$0 your_image_file"
exit 0
fi
warning() {
printf "\e[0;31m$1\e[0m \n"
}
check_ok() {
printf "\e[0;32m$1\e[0m \n"
}
ffmpeg_check=$(which ffmpeg)
size_check=307200
size_desc="320x480"
if [ "$ffmpeg_check" != "" ]; then
OUTPUT=$(echo "$1" | cut -d'.' -f1).raw565
clear
prog_header
ffmpeg -i $1 -f rawvideo -pix_fmt rgb565 $OUTPUT
clear
prog_header
FILESIZE=$(cat $OUTPUT | wc -c)
if [ $FILESIZE -eq $size_check ]; then
check_ok "$OUTPUT is ready to be flashed."
else
rm $OUTPUT
warning "$OUTPUT filesize mismatches! Wrong image size ($size_desc)? Aborted."
exit 0
fi
echo "In order to flash this image you have to plug your phone in fastboot mode."
read -p "Flash it now? (y/n) "
if [ "$REPLY" == "y" ] || [ "$REPLY" == "Y" ]; then
fastboot devices | grep -q "fastboot"
if [ $? -ne 0 ]; then
warning "The USB cable is not plugged, or the device is not in fastboot mode."
echo "To flash the splash screen, manually execute this command once in fastboot mode:"
echo "fastboot flash splash1 $OUTPUT"
exit 0
else
fastboot flash splash1 $OUTPUT
fi
else
echo "To flash the splash screen, execute this command once in fastboot mode:"
echo "fastboot flash splash1 $OUTPUT"
exit 0
fi
else
warning "ffmpeg not found! Please install it before running this script!\ni.e. (DEBIAN) apt-get install ffmpeg / (OSX) sudo port install ffmpeg"
fi
Edit:
elegos said:
- Open the terminal -> nano splash_creator
- copy / paste the code
- [CTRL]+O, then [ENTER]. [CTRL]+X
- chmod +x splash_creator
- Put the image you want as splash screen in a folder where the script is (it is actually in your home)
- Open terminal -> cd your/folder/here
- ./splash_creator your_image_here.whatever
Click to expand...
Click to collapse
Also feel free to post your splash screens here as well
Splash screens
So here's one that mjybarr made, and one I'm using right now, both very nice splash screens
Works like a dream! Thanks for providing this tut.
Hi All,
Want to ask, is there any way I go root my .21 TF101. Just got the device today at a good price 2nd hand.
Did not know that .21 was un-rootable. The various un-root methods I have tried on this website like Vipermod does not work.
Or if .21 is not rootable, is there anyway to downgrade to .17 to perform to root?
Thanks and Regards,
Joel
No rooting method for now with .21. The only way you can go back is if you have an sbk v1 tf.
You can learn more about sbk and nvflash here
http://forum.xda-developers.com/showthread.php?p=22465766
Oh joy. Found out that my B70 is sbk v2.
Will wait for someone to figure out how to root .21.
On a side note, Questions and Answer-type posts should go here.
http://forum.xda-developers.com/forumdisplay.php?f=1205
But it seems like the mods dont really care (or are around at this point), so you're probably safe from harm for now
Blew me away, but I was actually able to root my tf101 with 9.2.1.24 using the old universal.sh linux script! Everything appears to be working perfectly!
Neato, mind linking the script so I can take a look at the code?
Thing O Doom said:
Neato, mind linking the script so I can take a look at the code?
Click to expand...
Click to collapse
this i think
http://forum.xda-developers.com/showthread.php?t=1198303
Here's the basis of the script.
Code:
#!/bin/bash
BACKUP_DIR="tf101-backup-`date +%Y%m%d%H%M%S`"
mkdir $BACKUP_DIR
clear
echo -e "\nAsus Transformer TF101 Universal Root"
echo -e "==================================================="
echo -e "Disconnect your tablet from usb (if connected) and turn it off (if it's not)."
echo -e "Press and hold the UP Volume and the power button for ~5sec."
echo -e "For now the tablet screen should stay off, it's perfectly normal"
echo -e "Now connect to usb"
read -p "Press any key when you're ready."
cd root
./nvflash --bct transformer.bct --setbct --configfile flash.cfg --bl bootloader.bin --odmdata 0x300d8011 --sbk 0x1682CCD8 0x8A1A43EA 0xA532EEB6 0xECFE1D98 --sync
echo -e "\nMaking a backup of your boot and recovery partitions in $BACKUP_DIR... \n"
./nvflash --resume --read 6 ../$BACKUP_DIR/boot.img
./nvflash --resume --read 5 ../$BACKUP_DIR/recovery.img
if [ -f ../$BACKUP_DIR/boot.img ] && [ -f ../$BACKUP_DIR/recovery.img ]; then
cp ../$BACKUP_DIR/boot.img ./
cp ../$BACKUP_DIR/recovery.img ./
chmod +x insecure.sh
./insecure.sh boot.img
else
echo -e "\n!!ERROR!!: Unable to read boot and/or recovery image from your tablet\n\n"
read -p "Press any key to exit"
exit 1
fi
if [ -f my_boot.img ]; then
echo -e "\nWrite back the modified boot partition... \n"
./nvflash --resume --download 6 my_boot.img
else
echo -e "\nThere were some ERRORS creating boot image\n"
echo -e "\nThe script will now exit\n"
echo -e "\n\tYour tablet is NOT rooted.\n"
read -p "Press any key to exit"
exit 1
fi
clear
while true; do
echo -e "ClockWorkMod (CWM)"
echo -e "====================================="
echo -e "ClockWorkMod recovery is a recovery image that let's you do some funny things like make a nandroid backup, installing custom rom and much more"
echo -e "This is not necessary for root\n"
echo -e "NOTE: if you install CWM you won't be able to update your tablet with the OTA firmware from ASUS, until you revert back to the stock recovery\n"
read -p "Do you wish to install clockworkmod recovery? [y/N]" yn
if [ ! "$yn" ]; then
yn="n"
fi
case $yn in
[Yy]* ) chmod +x recovery.sh ; ./recovery.sh recovery.img ; break;;
[Nn]* ) break;;
* ) clear ; echo -e "Please answer yes or no.\n";;
esac
done
if [ -f my_recovery.img ]; then
echo -e "\nWrite back the modified recovery partition... \n"
./nvflash --resume --download 5 my_recovery.img
fi
clear
echo -e "\nNow press and hold the power button for ~10sec."
echo -e "\nYour tablet should reboot. When android is fully loaded, go to Settings -> Applications -> Development and make sure USB Debugging is enabled."
read -p "Press any key when you're ready."
./adb remount
./adb push su /system/xbin/su
./adb shell chmod 6755 /system/xbin/su
./adb push Superuser.apk /system/app/Superuser.apk
./adb reboot
rm -f my_boot.img
rm -f my_recovery.img
cd ..
clear
echo -e "Done.\nYour tablet is now rooted.\n\nEnjoy!.\n"
Now, the one thing I noticed I needed to do after the flash was update the version of superuser.apk and su that the universal installer comes with. I got those new versions here:
EDIT: I can't post outside links yet so you'll have to decipher it. http colon whack/whack/ androidsu dot com whack/ superuser whack/
then placed them in the relavent locations so the script would push them up. I also didn't do CWM. personal choice.
Test only!
Don't flash to phone.
Try with "fastboot boot recovery.img".
Pure TWRP:
https://github.com/yangyangnau/andr....0.2-with-linux-3.18.20-g39aa441-for-redmi-3s
TWRP with cofface‘s patch:
https://github.com/yangyangnau/andr...face-with-linux-3.18.20-g39aa441-for-redmi-3s
Please rename to recovery.img after download.
If you want remove dm-verity, you can cook twrp yourself or look here http://en.miui.com/thread-310923-1-1.html.
I'm porting kernel for redmi 3s.
https://github.com/yangyangnau/android_kernel_xiaomi_msm8937
http://forum.xda-developers.com/redmi-3/development/port-linux-kernel-source-xiaomi-redmi3s-t3469965
get stock ROM adb root shell for kernel testing
boot.img from stock ROM.
kernel wlan.ko from your kernel.
twrp-recovery.img from TWRP.
mkboot script from https://github.com/xiaolu/mkbootimg_tools.
Code:
#!/bin/sh
[ -f boot.img ] || exit 0
[ -f kernel ] || exit 0
[ -f wlan.ko ] || exit 0
[ -f twrp-recovery.img ] || exit 0
mkboot boot.img myboot
cp -a kernel myboot/
sed -i -e '/ro.adb.secure=/s+1+0+' \
-e '/ro.secure=/s+1+0+' \
-e '/security.perf_harden=/s+1+0+' \
-e '/ro.allow.mock.location=/s+0+1+' \
-e '/ro.debuggable/s+0+1+' \
-e '/persist.sys.usb.config=/s+none+adb+' \
-e '/ro.secureboot.devicelock/s/^/#/' myboot/ramdisk/default.prop
#echo 'persist.service.adb.enable=1' >> myboot/ramdisk/default.prop
#echo 'persist.service.debuggable=1' >> myboot/ramdisk/default.prop
cat ~/.android/adbkey.pub >> myboot/ramdisk/bin/adb_keys
sed -i "/cmd_line=/s/'$/ androidboot.selinux=permissive'/" myboot/img_info
sed -i -e 's+,verify++g' \
-e 's+forceencrypt+encryptable+g' myboot/ramdisk/fstab.qcom
mkboot myboot myboot.img
fastboot flash boot myboot.img
mkboot twrp-recovery.img twrp-recovery
cp -a twrp-recovery/ramdisk/supersu/su .
fastboot boot twrp-recovery.img
sleep 10s
adb shell mount /system
adb push su /system/bin/su
adb push su /system/xbin/su
adb shell mv /system/lib/modules/wlan.ko{,-}
adb push wlan.ko /system/lib/modules/wlan.ko
adb shell mv /system/bin/install-recovery.sh{,-}
adb shell umount /system
rm -rf myboot twrp-recovery
#adb push ~/.android/adbkey.pub /data/misc/adb/adb_keys
get adb root shell
Code:
adb shell
su -
Someone had tested? Its ok?
plz port Radon kernal for redmi 3s
how to boot into recovery? is it same twrp by flour_mo
Tried to boot the both versions. It boots, but wants some password to encrypt data. TWRP I have installed can decrypt data without wanting me to enter password (and I don't know what password should it be)
Plz bring custom kernel for land # devs
Good news. We finally booted a 4.9 on land
Hi all,
You may or may not already be familiar with it, but there was a very nice script created by Joseph Miller to install new factory images (with or without locking the device). What I would like to do is to see how much of the script can be migrated to work with Pixel 4/4 XL.
Based on your experience with updating your 4/4 XL, do you see anything in the deuce script for the Pixel 2 that would need to be revised for use on a Pixel 4?
I'm certainly willing to test on my own device and any feedback would be appreciated. (I am relatively new to the Pixel 4 XL but very familiar with the Pixel 2 XL.)
.sh version is below:
Code:
#!/bin/sh
echo "Welcome to Deuces Flashing Script!"
echo "v5.0-Linux"
#to create a log, run: "script -c ./deuce-flash-all-v5.0.sh logfile.log"
echo "Checking if Fastboot binary is accessible.."
if [ -f "fastboot" ];
then
echo "\033[32m fastboot binary exists in script directory.\033[0m"
fb="./fastboot"
else
echo "\033[33mfastboot binary does not exist in script directory\033[0m" >&2
command -v fastboot | ( read fb; echo "\033[33mFound $fb. Will try to use this.\033[0m" )
fb="fastboot"
fi
echo "Checking if Fastboot works correctly"
if $fb --version
then
echo "\033[32m fastboot returned a version, continuing..\033[0m"
else
echo "\033[31m fastboot not working correctly.\033[0m"
exit 1
fi
echo "Checking if device is detected via Fastboot."
if [ -z $($fb devices -l) 2> /dev/null ]
then
echo "\033[31mDevice not detected in fastboot.\033[0m"
exit 1
else
echo "\033[32m Device detected!\033[0m"
fi
echo "Insuring unzip package is installed and accessible"
if unzip 1> /dev/null
then
echo "\033[32m unzip detected!\033[0m"
else
echo "\033[31m unzip is not installed, or is not working correctly!\033[0m"
echo "\033[33mplease install via:\033[0m"
echo "\033[33msudo apt install unzip\033[0m"
echo "\033[33mor\033[0m"
echo "\033[33msudo yum install unzip\033[0m"
exit 1
fi
zipcount="$(ls *.zip 2>/dev/null | wc -l)"
if [ "${zipcount}" -eq 1 ]
then
zipname="$(ls *.zip)"
echo ""
echo "\033[32mImage to flash: ${zipname}\033[0m"
elif [ "${zipcount}" -gt 1 ]
then
echo "\033[31m More than 1 zip!\033[0m"
echo "\033[31mPlease have only 1 zip file in the script folder.\033[0m"
zipnames="$(ls *.zip)"
echo "\033[33m${zipnames}\033[0m"
exit 1
else
echo "no zip files!"
exit 1
fi
echo -n "Are you SURE you want to continue? (y/N) "
read answer1
if echo "$answer1" | grep -iq "^y" ;then
echo "\033[33mThis Tool will reformat partitions in your device!\033[0m"
echo "\033[33mIt will attempt to keep your user data!\033[0m"
echo "\033[33mData could be lost! - Use At Your Own Risk!\033[0m"
echo -n "Continue? (y/N) "
read answer2
if echo "$answer2" | grep -iq "^y" ;then
echo "Checking if bootloader is unlocked."
echo "Look at device to confirm if script is waiting..."
$fb flashing unlock
echo "There will be errors if already unlocked, ignore."
else
echo "Aborting..."
exit 1
fi
else
echo "Aborting..."
exit 1
fi
echo "extracting the main image zip..."
unzip -j -o ${zipname} -d _work/
echo "setting active partition slot to A"
$fb --set-active=a
echo "flashing bootloader & radio..."
$fb flash bootloader _work/bootloader*.img
rm -rf _work/bootloader*.img
$fb reboot-bootloader
sleep 5
$fb flash radio _work/radio*.img
rm -rf _work/radio*.img
$fb reboot-bootloader
echo "extracting secondary image zip..."
zipname2="$(ls _work/*.zip)"
unzip -j -o ${zipname2} -d _work/
mkdir _work/_ 2>/dev/null
mv _work/*_other.img _work/_/ 2>/dev/null
echo "setting active partition slot to B"
$fb --set-active=b
bimgs="$(ls _work/_/*.img)"
for bimg in $bimgs
do
part=$(ls _work/_/*_other.img | cut -d "_" -f3 | cut -d "/" -f2)
echo $part
$fb flash $part $bimg
rm -rf $bimg
done
rm -rf _work/_
echo "setting active partition slot to A"
$fb --set-active=a
aimgs=$(ls _work/*.img)
for aimg in $aimgs
do
part=$(echo $aimg | cut -d "/" -f2 | cut -d "." -f1)
echo $part
$fb flash $part $aimg
rm -rf $aimg
done
echo -n "\033[33mDo you want to format user data? (y/N) \033[0m"
read answer3
if echo "$answer3" | grep -iq "^y" ;then
echo "\033[33m!!!This will wipe all your data!!!\033[0m"
echo -n "\033[31mAre you SURE? (y/N) \033[0m"
read answer4
if echo "$answer4" | grep -iq "^y" ;then
echo "Formatting user data.."
$fb format userdata 2>/dev/null
$fb reboot-recovery 2>/dev/null
echo "\033[32mDone!\033[0m"
else
echo "\033[36mSkipped formatting userdata.\033[0m"
echo "\033[32mDone!\033[0m"
exit
fi
else
echo "\033[36mSkipped formatting userdata.\033[0m"
echo "\033[32mDone!\033[0m"
exit
fi
exit
.bat version is here.
Note: I recommend placing the latest flashboot somewhere in your $PATH and running the script from within the unzipped factory image folder (where you have also unzipped the image zip).
Edit: Updated deuce script to v5.0 (thanks quorn23!)
Just a heads up, you're using an older version of the script, see original thread https://forum.xda-developers.com/pixel-2-xl/development/tool-deuces-bootloop-recovery-flashing-t3704761
I haven't tested it yet, but the 5.0 apparently works with A10 skimming through the last few pages in the thread. Once the Kernel is updated with the new sources (dez broke face unlock) i might have a look. What i probably would do is prepatch the boot image with magisk, besides that i would assume it's pretty straight forward, as it's AOSP.
Edit: as context, i'm coming from the pixel 2xl as well, i generally been using the Deuce script to update the 2 XL, if i recall correctly the only change i made was to adapt it to flash TWRP as well, which is currently not needed as not available for the 4 XL. (Devs wife is pregnant, so he's busy with more important personal life stuff currenty)
quorn23 said:
What i probably would do is prepatch the boot image with magisk, besides that i would assume it's pretty straight forward, as it's AOSP.
Click to expand...
Click to collapse
Out of habit, I've always re-added magisk manually, but you're right, this will require some additional dance steps without twrp. What i like about the original sh script is that the core dependency (for most scenarios) is a recent fastboot.
So I just wondering if I use the EDL method to flash my stock rom having all my .img files in the folder and running batch file flash all would I run the risk of permabricking my phone or should I be safe to do?
I managed to EDL flash with the .raw file but just want to be sure it's safe for me to do flash all.
Thanks
So I have edited the flash_all batch file to find SM8350 but Mi Flash is giving me error Mismatching images and devices.
I did a payload dump from UL-ASUS_I005_1-ASUS-18.0840.2111.196-1.1.101-user zip file.
This is the info in my flash_all batch file
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *SM8350" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *SM8350" || exit /B 1
fastboot %* flash partition "%~dp0images\gpt_both0.bin" || @ECHO "Flash partition" && exit /B 1
fastboot %* getvar board_version 2>&1 | findstr /r /c:"^board_version: *4.4" && echo Missmatching board version
fastboot %* getvar board_version 2>&1 | findstr /r /c:"^board_version: *4.4" && exit /B 1
fastboot %* getvar board_version 2>&1 | findstr /r /c:"^board_version: *5.[0-9]" && echo Missmatching board version
fastboot %* getvar board_version 2>&1 | findstr /r /c:"^board_version: *5.[0-9]" && exit /B 1
fastboot %* flash tz %~dp0images\tz.mbn
fastboot %* flash dbi %~dp0images\sdi.mbn
fastboot %* flash sbl1 %~dp0images\sbl1.mbn
fastboot %* flash rpm %~dp0images\rpm.mbn
fastboot %* flash aboot %~dp0images\emmc_appsboot.mbn
fastboot %* erase boot
fastboot %* erase DDR
fastboot %* flash misc %~dp0images\misc.img
fastboot %* flash modem+modem1 %~dp0images\NON-HLOS.bin
fastboot %* flash system+system1 %~dp0images\system.img
fastboot %* flash cache %~dp0images\cache.img
fastboot %* flash userdata %~dp0images\userdata.img
fastboot %* flash recovery %~dp0images\recovery.img
fastboot %* flash boot+boot1 %~dp0images\boot.img
fastboot %* reboot
Anyone able to help me out?
Thanks