[Q&A] Mr.Parkinsons DroidHD Utility 2.0 - RAZR HD Q&A, Help & Troubleshooting

Q&A for Mr.Parkinsons DroidHD Utility 2.0
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for Mr.Parkinsons DroidHD Utility 2.0. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!

Updated Droid Utility Version 2.1 Deluxe script,back to main menu option now added
Charles Branson's Updated Droid Utility Version 2.1 Deluxe script with back to main menu option now added
BEGIN >>>
@ECHO off
::This progarm is HOMEMADE by Jeff Cimmino (Otherwise known as the lovely Mr. Parkinson).
@title Charles Branson's Updated Droid Utility Version 2.1 Deluxe
echo ................................
echo . Updated Version .
echo . Mr.Parkinson's .
echo . DROID UTILITY .
echo . Version 2.1 .
echo . DANGEROUSLY REFRESHING .
echo . Deluxe Edition .
echo . Add back to main menu option .
echo ................................
pause
cls
echo 2.1 Changelog:
echo Edited by Charles Peterkin aslo known as charles Branson
echo email [email protected]
echo Add back to main menu option
echo 2.0 Changelog:
echo -Updated the layout.
echo -Did some housecleaning.
echo -Added more stock recovery options.
echo -Added remove bootloader unlock warning.
echo -Added push Batakang ROM Test 16.
echo -Created Deluxe, Lite, and Ultra-Lite Editions.
echo -Working on GUI.
echo 1.21 Changelog:
echo -Fixed a dangerous error where the recovery image wouldn't flash when recovering.
echo -Added the "Flash TWRP 2.5 Custom Recovery" program.
echo -Added an option to not flash recovery image.
echo -Added a step by step guide to see if your bootloader is unlocked.
echo -When restoring stock ROMs, you will now have the option to delete userdata.
echo 1.1 Changelog:
echo -Removed the "Push Eclipse" option from the utility.
echo 1.01 Changelog:
echo -Fixed a typo in the main menu.
echo -Changed the wording of fastboot option.
echo -Made a change to the Eclipse/GApps program.
echo 1.0 Changelog:
echo Initial Release.
pause
cls
echo A little license I wrote:
echo This program is free for PERSONAL use only.
echo Try not to use this program for a profit.
echo Before hosting this program on your website,
echo email me at [email protected].
pause
cls
echo This utility is designed for the following Devices:
echo Motorola Droid Razr / Razr Maxx HD,
echo Motorola Droid Razr M,
echo Motorola Atrix HD.
echo And some features may work on other devices.
echo Some features of this utility will only work on
echo specific devices, you will be warned in this case.
pause
cls
echo STANDARD DISCLAIMER:
echo USE THIS UTILITY AT YOUR OWN RISK.
echo ME, OR DANIEL ROSENBERG, OR ANYONE INVOLVED
echo IN THE CREATION OF THE PROGRAMS AND EXPLOITS HEREIN ARE NOT RESPONSIBLE
echo IF YOUR PHONE BRICKS, OR ANY OTHER DAMAGE OCCURS
echo WHILE USING THIS UTILITY. FOLLOW ALL INSTRUCTIONS,
echo AND YOU *SHOULD* BE FINE.
pause
:menu
cls
echo [*] Marks Experimental Program
echo Choose a Section:
echo 1: Stock Stuff
echo 2: ROMS
echo 3: Apps
echo 4: Roots, Unlocks and Recoveries
echo 5: Exit
echo 6: menu
SET /P menu=Make your selection:
IF %menu% == 1 GOTO stockstuff
IF %menu% == 2 GOTO roms
IF %menu% == 3 GOTO apps
IF %menu% == 4 GOTO rur
IF %menu% == 5 GOTO exit
echo Please select a valid option.
pause
GOTO menu
cls
:stockstuff
cls
echo Stock Stuff
echo Select an Option:
echo -------------------------------------------------
echo 1: Complete Fastboot Restore to 4.1.2 Stock (XT925/926)
echo 2: Fastboot Restore to 4.1.2 Stock (Dont Flash Recovery) (XT925/926)
echo 3: [*]Fastboot Restore to 4.1.2 Stock (Dont Flash Modem) (XT926/926)
echo 4: Fastboot Restore Stock Recovery
echo 5: Fastboot Restore Stock Modem
echo 6: Go to Main menu
SET /P stock=Make Your Selection:
IF %stock% == 1 GOTO restore
IF %stock% == 2 GOTO restorenr
IF %stock% == 3 GOTO restorenm
IF %stock% == 4 GOTO resrecovery
IF %stock% == 5 GOTO resmodem
IF %stock% == 6 GOTO menu
echo Please select a valid option.
pause
GOTO stockstuff
:roms
cls
echo *Suggest a ROM! Add to the utility thread, PM Mr. Parkinson, or email me at [email protected]!*
echo ROMs
echo Select an Option:
echo -------------------------------------------------
echo 1: Batakang ROM Test 16 for Droid Razr/ Razr Maxx HD with Gapps
echo 2: Go to Main menu
SET /P roms=Make Your Selection:
IF %roms% == 1 GOTO batakang
IF %roms% == 2 GOTO menu
echo Please select a valid option.
pause
GOTO roms
:batakang
cls
echo This program will push the Batakang ROM and its gapps package.
echo To your sdcard/downloads folder.
echo MAKE SURE YOU HAVE 411 MB OF FREE SPACE BEFORE YOU PUSH.
echo It will NOT install it, you need to do that yourself, through a custom recovery
echo or through safestrap.
echo Press any key to begin the push...
pause
echo Pushing Gapps...
adb push roms/Gapps4BatakangROMv2 sdcard/Download/Gapps4BatakangROMv2
echo Pushing Batakang ROM...
adb push roms/BatakangROM sdcard/Download/BatakangROM
echo Push complete!
echo Press any key to return to main menu...
pause
GOTO menu
:apps
cls
echo *Suggest an app! Add to the utility thread, PM Mr. Parkinson, or email me at [email protected]!*
echo Apps
echo Select an Option:
echo -------------------------------------------------
echo 1: Install Safestrap 3.05
echo 2: Install Safestrap 3.12
echo 3: Install voodoo's OTA Rootkeeper
echo 4: Install Titanium Backup
echo 5: Go to Main Menu
SET /P apps=Make Your Selection:
IF %apps% == 1 GOTO safestrap
IF %apps% == 2 GOTO safestrap3.12
IF %apps% == 3 GOTO voodoo
IF %apps% == 4 GOTO titanium
IF %apps% == 5 Go to Main menu
echo Please select a valid option.
pause
GOTO apps
:rur
cls
echo Roots, Unlocks, and Recoveries
echo Select an Option:
echo -------------------------------------------------
echo ROOTS:
echo 1: Root Your Phone! (Motochopper Method)
echo UNLOCKS:
echo 2: Unlock Your Bootloader! (Motopocalypse Method)
echo 3: Is My Bootloader Unlocked?
echo 4: Remove Bootloader Unlock Warning
echo RECOVERIES:
echo 4: Flash TWRP Custom Recovery (UNLOCKED BOOTLOADER REQUIRED)
echo 6: Main Menu
SET /P rur=Make Your Selection:
IF %rur% == 1 GOTO root
IF %rur% == 2 GOTO unlock
IF %rur% == 3 GOTO unlock2
IF %rur% == 4 GOTO rmbuwarn
IF %rur% == 5 GOTO twrp
IF %rur% == 6 Go to Main menu
echo Please select a valid option.
pause
GOTO rur
:rmbuwarn
echo This program will remove the Bootloader Unlock Warning from your phone.
echo Press any key to remove the warning...
pause
fastboot flash logo VZW_XT926_4.1.2/logo.bin
echo Your phone is now free from that pesky bootloader unlock warning!
echo Press any key to return to the main menu.
pause
GOTO menu
:restore
cls
echo *****************
echo * 4.1.2 Restore *
echo * by *
echo * Mr. Parkinson *
echo *****************
echo This program will restore your phone to Verizon stock Android 4.1.2.
echo It will also replace your custom recovery with stock, if you have one.
echo WARNING: THIS PROGRAM IS ONLY GUARANTEED FOR XT925/926 DEVICES (Droid Razr/Razr Maxx HD)!
echo USE AT YOUR OWN RISK, EVEN BETTER, IF YOUR PHONE IS NOT AN XT925/926, DO NOT USE THIS PROGRAM AT ALL.
pause
echo This program will now install stock 4.1.2 firmware to your device.
echo Before launching the utility, put your phone into Fastboot mode!
echo Turn of the phone, then, hold the vol-up and vol-down buttons,
echo while holding the power button, until the boot menu comes up.
echo Scroll down to AP FASTBOOT, and select it.
pause
fastboot flash sbl1 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sbl2 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sbl3 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot reboot-bootloader
echo. When the screen bcomes back on, press any key to continue!
pause
fastboot flash partition VZW_XT926_4.1.2/gpt_main0.bin
fastboot flash sbl1 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sbl2 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sbl3 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot flash boot VZW_XT926_4.1.2/boot.img
fastboot flash system VZW_XT926_4.1.2/system.img
fastboot flash recovery VZW_XT926_4.1.2/recovery.img
fastboot flash modem VZW_XT926_4.1.2/NON-HLOS.bin
fastboot flash devtree VZW_XT926_4.1.2/device_tree.bin
fastboot flash logo VZW_XT926_4.1.2/logo.bin
fastboot flash cdrom VZW_XT926_4.1.2/cdrom
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg VZW_XT926_4.1.2/fsg.mbn
fastboot erase cache
fastboot erase tombstones
echo After this point, the utility will erase userdata.
echo It is recommended you do this, but not required.
set /p z=Would you like to erase userdata? (Y/N CASE SENSITIVE)
IF %z%==Y GOTO restore2
IF %z%==N GOTO restorecomplete
:restore2
fastboot erase userdata
fastboot flash modem VZW_XT926_4.1.2/NON-HLOS
fastboot erase modemst1
fastboot erase modemst2
:restorecomplete
fastboot reboot
echo You are now on stock 4.1.2 for XT925/926 devices!
echo Pressing any key will return to the main menu.
pause
goto menu
:restorenr
cls
echo *****************
echo * 4.1.2 Restore *
echo * by *
echo * Mr. Parkinson *
echo * No Recovery *
echo *****************
echo This program will restore your phone to Verizon stock Android 4.1.2.
echo This will NOT flash the stock recovery.
echo WARNING: THIS PROGRAM IS ONLY GUARANTEED FOR XT925/926 DEVICES (Droid Razr/Razr Maxx HD)!
echo USE AT YOUR OWN RISK, EVEN BETTER, IF YOUR PHONE IS NOT AN XT925/926, DO NOT USE THIS PROGRAM AT ALL.
pause
echo This program will now install stock 4.1.2 firmware to your device.
echo Before launching the utility, put your phone into Fastboot mode!
echo Turn of the phone, then, hold the vol-up and vol-down buttons,
echo while holding the power button, until the boot menu comes up.
echo Scroll down to AP FASTBOOT, and select it.
pause
fastboot flash sb11 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sb12 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sb13 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot reboot-bootloader
echo. When the screen bcomes back on, press any key to continue!
pause
fastboot flash partition VZW_XT926_4.1.2/gpt_main0.bin
fastboot flash sb11 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sb12 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sb13 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot flash boot VZW_XT926_4.1.2/boot.img
fastboot flash system VZW_XT926_4.1.2/system.img
fastboot flash modem VZW_XT926_4.1.2/NON-HLOS.bin
fastboot flash devtree VZW_XT926_4.1.2/device_tree.bin
fastboot flash logo VZW_XT926_4.1.2/logo.bin
fastboot flash cdrom VZW_XT926_4.1.2/cdrom
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg VZW_XT926_4.1.2/fsg.mbn
fastboot erase cache
fastboot erase tombstones
echo After this point, the utility will erase userdata.
echo It is recommended you do this, but not required.
set /p x=Would you like to erase userdata? (Y/N CASE SENSITIVE)
IF %x%==Y GOTO restorenr2
IF %x%==N GOTO restorenrcomplete
:restorenr2
fastboot erase userdata
fastboot flash modem VZW_XT926_4.1.2/NON-HLOS
fastboot erase modemst1
fastboot erase modemst2
:restorenrcomplete
fastboot reboot
echo You are now on stock 4.1.2 for XT925/926 devices!
echo Pressing any key will return to the main menu.
pause
goto menu
:restorenm
cls
echo *****************
echo * 4.1.2 Restore *
echo * by *
echo * Mr. Parkinson *
echo * No Modem *
echo *****************
echo This program will restore your phone to Verizon stock Android 4.1.2.
echo This will NOT flash the stock modem.
echo WARNING: THIS PROGRAM IS ONLY GUARANTEED FOR XT925/926 DEVICES (Droid Razr/Razr Maxx HD)!
echo USE AT YOUR OWN RISK, EVEN BETTER, IF YOUR PHONE IS NOT AN XT925/926, DO NOT USE THIS PROGRAM AT ALL.
pause
echo This program will now install stock 4.1.2 firmware to your device.
echo Before launching the utility, put your phone into Fastboot mode!
echo Turn of the phone, then, hold the vol-up and vol-down buttons,
echo while holding the power button, until the boot menu comes up.
echo Scroll down to AP FASTBOOT, and select it.
pause
fastboot flash sb11 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sb12 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sb13 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot reboot-bootloader
echo. When the screen bcomes back on, press any key to continue!
pause
fastboot flash partition VZW_XT926_4.1.2/gpt_main0.bin
fastboot flash sb11 VZW_XT926_4.1.2/sbl1.mbn
fastboot flash sb12 VZW_XT926_4.1.2/sbl2.mbn
fastboot flash sb13 VZW_XT926_4.1.2/sbl3.mbn
fastboot flash rpm VZW_XT926_4.1.2/rpm.mbn
fastboot flash tz VZW_XT926_4.1.2/tz.mbn
fastboot flash aboot VZW_XT926_4.1.2/emmc_appboot.mbn
fastboot flash boot VZW_XT926_4.1.2/boot.img
fastboot flash system VZW_XT926_4.1.2/system.img
fastboot flash recovery VZW_XT926_4.1.2/recovery.img
fastboot flash devtree VZW_XT926_4.1.2/device_tree.bin
fastboot flash logo VZW_XT926_4.1.2/logo.bin
fastboot flash cdrom VZW_XT926_4.1.2/cdrom
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg VZW_XT926_4.1.2/fsg.mbn
fastboot erase cache
fastboot erase tombstones
echo After this point, the utility will erase userdata.
echo It is recommended you do this, but not required.
set /p x=Would you like to erase userdata? (Y/N CASE SENSITIVE)
IF %x%==Y GOTO restorenr2
IF %x%==N GOTO restorenrcomplete
:restorenm2
fastboot erase userdata
fastboot erase modemst1
fastboot erase modemst2
:restorenmcomplete
fastboot reboot
echo You are now on stock 4.1.2 for XT925/926 devices!
echo Pressing any key will return to the main menu.
pause
goto menu
:rescovery
cls
echo This program will restore the stock 4.1.2 recovery for XT925/926 devices.
echo Press any key to start the restore.
pause
fastboot flash recovery VZW_XT926_4.1.2/recovery.img
fastboot erase cache
fastboot erase tombstones
fastboot reboot
echo You are now running the stock recovery!
echo Pressing any key will return to the main menu.
pause
goto menu
:resmodem
cls
echo This program will restore the stock 4.1.2 modem for XT925/926 devices.
echo Press any key to start the restore.
pause
fastboot flash modem VZW_XT926_4.1.2/NON-HLOS.bin
fastboot erase cache
fastboot erase tombstones
fastboot reboot
echo You are now running the stock modem!
echo Pressing any key will return to the main menu.
pauseg
goto menu
:root
cls
echo This program will give you root privelages.
echo Thank Dan Rosenberg (Djrbliss) for this root exploit!
echo Feel free to donate to him for his hard work!
echo Press any key to root your phone.
pause
adb kill-server
echo [*] Waiting for device...
adb wait-for-device
echo [*] Device found.
echo [*] Pushing exploit...
adb push root/pwn /data/local/tmp/pwn
adb shell chmod 755 /data/local/tmp/pwn
echo [*] Pushing root tools...
adb push root/su /data/local/tmp/su
adb push root/busybox /data/local/tmp/busybox
adb install apps/Superuser.apk
echo [*] Rooting phone...
adb shell /data/local/tmp/pwn
echo [*] Cleaning up...
adb shell rm /data/local/tmp/pwn
adb shell rm /data/local/tmp/su
adb shell rm /data/local/tmp/busybox
echo [*] Exploit complete. Press enter to reboot and exit.
pause
adb reboot
adb kill-server
goto menu
:safestrap
cls
echo This program will install Safestrap 3.05 to your phone.
echo Enable USB Debugging!
echo *Requires Root Privelages to work!*
pause
adb wait-for-device
adb install apps/RAZR-HD-Safestrap-3.05.17.apk
adb kill-server
echo Install complete!
echo Press any key to return to the main menu.
pause
goto menu
:safestrap3.12
cls
echo This program will install Safestrap 3.12 to your phone.
echo Enable USB Debugging!
echo *Requires Root Privelages to work!*
pause
adb wait-fordevice
adb install apps/safestrap3.12.apk
adb kill-server
echo Install complete!
echo Press any key to return to the main menu.
pause
goto menu
:twrp
cls
echo This program will now flash the TWRP Custom Recovery.
echo Before we do this, your bootloader needs to be unlocked!
set /p b=Is your bootloader unlocked? (Y/N/NotSure CASE SENSITIVE)
IF %b%==Y GOTO twrp1
IF %b%==N GOTO unlock
IF %b%==NotSure GOTO unlock2
:twrp1
echo Press any key to flash TWRP!
pause
fastboot flash recovery twrp/twrp-2.5.0.0-recovery-vanquish.img
echo Flash complete.
echo Press any key to return to the main menu.
pause
GOTO menu
:voodoo
cls
echo This program will install voodoo's OTA Rootkeeper.
echo Enable USB Debugging!
pause
adb wait-for-device
adb install apps/org.projectvoodoo.otarootkeeper-1.apk
adb kill-server
echo Install complete!
echo Press any key to return to the main menu.
pause
goto menu
:titanium
cls
echo This program will install Titanium Backup Pro.
echo Enable USB Debugging!
echo *Requires Root Privelages to work!*
pause
adb wait-for-device
adb install apps/TBackuppro.apk
adb kill-server
echo Install complete!
echo Press any key to return to the main menu.
pause
goto menu
:unlock
cls
echo This program will unlock your Motorola device bootloader.
echo Works with Razr /Razr Maxx HD, Razr M, and Atrix HD.
echo Thank Dan Rosenberg (Djrbliss) for his hard work!
echo Feel free to donate to him for this fantastic exploit!
echo *Requires Root Privelages to work!*
pause
echo WARNING! UNLOCKING YOUR BOOTLOADER WILL RESULT IN A MAJOR SECURITY HOLE IN YOUR PHONE.
echo ANY THEIF WITH ENOUGH KNOW HOW COULD STEAL ALL THE DATA ON YOUR PHONE, REGARDLESS OF A LOCK SCREEN.
echo IT IS RECOMMENDED THAT YOU ENCRYPT YOUR PHONE AFTERWARDS.
echo THIS PROGRAM ALSO PERMANANTLY UNLOCKS THE BOOTLAODER, AKA: PERMANANTLY VOIDS YOUR WARRANTY.
echo NOONE INVOLVED IN MAKING THIS PROGRAM IS RESPONSIBLE FOR ANY DAMAGE TO YOUR PHONE.
echo RUN THIS PROGRAM AT YOUR OWN RISK.
set /p q=Are you sure you want to unlock your bootloader? (Y/N CASE SENSITIVE)
IF %q%==Y GOTO unlock1
IF %q%==N GOTO menu
:unlock1
cls
echo You have chosen to unlock your bootloader.
pause
cls
adb kill-server
echo [*] Waiting for device...
adb wait-for-device
echo [*] Device found.
echo [*] Pushing unlock tool...
adb push unlock/unlock /data/local/tmp
adb shell chmod 755 /data/local/tmp/unlock
echo [*] Unlocking phone...
adb shell su -c /data/local/tmp/unlock
echo [*] Cleaning up...
adb shell rm /data/local/tmp/unlock
echo [*] Unlocking complete. Rebooting into bootloader mode.
adb reboot bootloader
echo [*] Press enter once the phone has rebooted into bootloader mode.
pause
echo [*] Displaying bootloader variables:
fastboot getvar all
echo [*] Press enter to reboot and exit.
pause
fastboot continue
adb kill-server
echo Congratulations! Your phone's bootloader is now unlocked!
pause
goto menu
:unlock2
cls
echo How to tell if your bootloader is unlocked:
echo Step 1: Power off your phone.
pause
cls
echo Step 2: Boot into AP Fastboot mode
echo (Hold the VOL-Down and VOL-Up buttons as you push the power button.
echo When the menu shows up, scroll down to AP FASTBOOT and select it.)
pause
cls
echo Step 3: Check your status,
echo If it says Status 0, then your bootloader is locked.
echo If it says Status 1, then your bootloader is unlocked!
echo Pressing any key will return to the main menu.
pause
GOTO menu
:exit
cls
echo Thank you for using the DroidHD Utility by Mr. Parkinson!
echo Contact me at [email protected]!
echo (I do websites too!)
pause
<<< END

Related

[MISC] 1click tools (Windows only)

S-Off + Perm root is required to use this tools!
there are 3 batch files inside:
_Radio.bat
_Recovery.bat
_EngBootloader.bat
how to use:
_EngBootloader - run and follow instructions
_Radio.bat - download radio image, rename it to radio.img and put it into the directory, run _Radio.bat
_Recovery.bat - download recovery image, rename it to recovery.img and put it into directory, run _Recovery.bat
don't know if all of you think that those tools are useful, but for some people it may be useful cause they aren't familar with cmd & adb
code for the batch files are included in the 2nd post, executables (no drivers) for adb and fastboot are included in the attachment
_EngBootloader.bat
Code:
@echo off
cls
adb devices
echo If your device is not listed exit this program now, enable usb debugging and try again.
pause
cls
adb push hboot.img /data/local/tmp
adb shell chmod 777 /data/local/tmp/hboot.img
echo Please accept superuser request on your phone
adb shell su
pause
adb shell dd if=/dev/block/mmcblk0p18 of=/sdcard/backup.img
adb shell dd if=/data/local/tmp/hboot.img of=/dev/block/mmcblk0p18
echo Bootloader should be flashed to your device now, backup from old bootloader is saved at /sdcard/backup.img
pause
adb reboot bootloader
_Radio.bat
Code:
@echo off
cls
adb devices
echo If your device is not listed exit this program now, enable usb debugging and try again.
pause
cls
echo Please accept superuser request on your phone
adb shell su
pause
echo Phone should reboot now to bootloader, please wait for it to boot
adb reboot bootloader
pause
echo Wait for flash to finish
fastboot flash radio radio.img
pause
fastboot reboot
_Recovery.bat
Code:
@echo off
cls
adb devices
echo If your device is not listed exit this program now, enable usb debugging and try again.
pause
cls
echo Please accept superuser request on your phone
adb shell su
pause
echo Phone should reboot now to bootloader, please wait for it to boot
adb reboot bootloader
pause
echo Wait for flash to finish
fastboot flash recovery recovery.img
pause
fastboot reboot
is this method for s off DS without xtc clip?
jalal.arkat said:
is this method for s off DS without xtc clip?
Click to expand...
Click to collapse
No, unfortunately these are a group off tools that can only be used once you are S-OFF.
So S-ON need not apply
@Blezz : thanks these will be useful
i don't know if they will be useful, they are still simply work.. it's more for... lazy people

[SCRIPT] Common ADB/FASTBOOT Functions

DISCLAIMER: I TAKE NO RESPONSIBILITY FOR DAMAGE CAUSED TO ANYONE OR ANYTHING BY USING MY SCRIPT. USE THIS AT YOUR OWN RISK.
So pretty much this is a script that can:
1. Flash a new boot animation without going through all the hassle of entering remounting commands. (Main reason why I wrote this) (Requires root and maybe adb insecure by chainfire)
2. Flash a new startup logo. (Requires unlocked bootloader)
3. Basic reboot commands with the press of a number.
4. Push and Pull files without entering commands, just need to specify the file location by dragging and dropping into the command window. (Some cases may need root. If your case does not need root, and the script says failed to restart adb as root, your command will still work, hopefully)
5. Install an apk the same way as 4. (If it says failed to restart as root it will still work in most cases)
6. Extremely noob friendly :laugh:.
Just a small little script to make your life a bit easier.
I tested this numerous times on a Moto G xt1032 running cyanogenmod 11 m4 and it showed no flaws. If this does not work for you try installing adb insecure by chainfire.
This works on windows only (I think).
If you find any bugs please tell me and I will try to fix even though I am just starting out with the wonders of developing. Some of the functions of the script need root access!
To use this, just copy and paste the lines below into a notepad window. Then save the file as something.bat Make sure to change the dropdown menu from txt document to all files when saving. Put the script in the folder where adb.exe and fastboot.exe are located. Double-click and enjoy!
Press "Click to show content" below!
@ECHO off
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo IF YOUR DEVICE IS LISTED BELOW TYPE 1
echo ELSE TYPE 2 TO EXIT
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb devices
SET /p startcheck= Type your choice:
if "%startcheck%" =="1" goto menu
if "%startcheck%" =="2" goto exit
:menu
cls
echo Type 0 for Device Check
echo Type 1 to Flash Boot Animation (ADB root required)
echo Type 2 to Flash Startup Logo
echo Type 3 to Reboot to Bootloader
echo Type 4 to Reboot
echo Type 5 to Pull a File
echo Type 6 to Push a File
echo Type 7 to Install Apk
echo Type 8 to Run ADB as Root
echo Type 9 to Browse and Copy Apps to Computer (ADB root required)
echo Type 10 to Browse and Copy SYSTEM Apps to Computer (ADB root required)
echo Type 11 to Exit
SET /p choice= Type your choice:
if "%choice%" =="0" goto devcheck
if "%choice%" =="1" goto anim
if "%choice%" =="2" goto logo
if "%choice%" =="3" goto rebootloader
if "%choice%" =="4" goto reboot
if "%choice%" =="5" goto adbpull
if "%choice%" =="6" goto adbpush
if "%choice%" =="7" goto apk
if "%choice%" =="8" goto adbroot
if "%choice%" =="9" goto apps
if "%choice%" =="10" goto sysapps
if "%choice%" =="11" goto exit
goto end
:end
cls
echo Type 1 to restart program
echo Type 2 to exit
SET /p restart= Type your choice
if "%restart%" =="1" goto menu
if "%restart%" =="2" goto exit
:exit
exit
:anim
cls
adb kill-server
adb start-server
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo IF YOUR DEVICE IS LISTED BELOW TYPE 1
echo ELSE TYPE 2 TO EXIT
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb devices
SET /p adb= Type your choice
if "%adb%" =="2" goto menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR YOUR bootanimation.zip
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p bapath= Type your path here and press enter:
cls
adb wait-for-device root
timeout -t 1 > nul
echo Remounting system in read-write mode!
adb wait-for-device remount
timeout -t 2 > nul
adb wait-for-device shell "su -c 'mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system'"
echo Deleting existing bootanimation!
adb wait-for-device shell "su -c 'rm /system/media/bootanimation.zip'"
echo Sending new bootanimation!
adb push %bapath% /system/media
echo Remounting system in read-only mode!
adb wait-for-device shell "su -c 'mount -o ro,remount -t yaffs2 /dev/block/mtdblock1 /system'"
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press 1 to reboot!
echo Press 2 to exit!
SET /p dm= Type your choice
if "%dm%" =="1" goto reboot
if "%dm%" =="2" goto end
:logo
cls
echo Rebooting to bootloader...
adb reboot-bootloader
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo When device is in bootloader press any key to continue!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PAUSE
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo IF YOUR DEVICE IS LISTED BELOW TYPE 1
echo ELSE TYPE 2 TO EXIT
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fastboot devices
SET /p fbdev= Type your choice
if "%fbdev%" =="2" goto menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR YOUR logo.bin
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p lopath= Type your path here and press enter:
cls
echo Sending new logo!
fastboot flash logo %lopath%
echo Rebooting...
fastboot reboot
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press any key to return to menu!
PAUSE
goto menu
:reboot
cls
adb reboot
echo Rebooting...
timeout -t 3 > nul
goto menu
:rebootloader
cls
adb reboot-bootloader
echo Rebooting to bootloader...
timeout -t 3 > nul
goto menu
:adbpull
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR THE FILE TO PULL
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p adbpullpath= Type your path here and press enter:
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR THE FILE TO SAVE
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p adbpullsave= Type your path here and press enter:
cls
echo !!!IF THIS ACTION NEEDS ROOT RUN OPTION 8 FROM MENU FIRST!!!
timeout -t 2 > nul
echo Pulling File!
adb wait-for-device pull %adbpullpath% %adbpullsave%
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press any key to return to menu!
PAUSE
goto menu
:adbpush
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR THE FILE TO PUSH
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p adbpushpath= Type your path here and press enter:
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR THE DIRECTORY TO PUSH TO
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p adbpushsave= Type your path here and press enter:
cls
echo !!!IF THIS ACTION NEEDS ROOT RUN OPTION 8 FROM MENU FIRST!!!
timeout -t 2 > nul
echo Pushing File!
adb wait-for-device push %adbpushpath% %adbpushsave%
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press any key to return to menu!
PAUSE
goto menu
:apk
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo IF YOUR DEVICE IS LISTED BELOW TYPE 1
echo ELSE TYPE 2 TO EXIT
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb devices
SET /p apkcheck= Type your choice
if "%apkcheck%" =="2" goto exit
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR THE APK TO INSTALL
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p apkinstall= Type your path here and press enter:
cls
echo !!!IF THIS ACTION NEEDS ROOT RUN OPTION 8 FROM MENU FIRST!!!
timeout -t 2 > nul
echo Installing Apk!
adb wait-for-device install %apkinstall%
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press any key to return to menu!
PAUSE
goto menu
:devcheck
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo DEVICE CONNECTION CHECK
echo Your device should be listed below!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb devices
PAUSE
goto menu
:adbroot
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Trying to run ADB as root!
adb wait-for-device root
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo !!!ONCE DEVICE RECONNECTS TO COMPUTER PRESS ANY KEY TO GET TO MENU!!!
PAUSE
goto menu
:apps
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb wait-for-device shell "su -c 'ls /data/app'"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Do you want to copy an app to the computer?
set /p appans= (Y or N):
if "%appans%" =="N" goto menu
if "%appans%" =="n" goto menu
if "%appans%" =="no" goto menu
if "%appans%" =="No" goto menu
if "%appans%" =="NO" goto menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb wait-for-device shell "su -c 'ls /data/app'"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Type the app's name EXACTLY including the .apk extension
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /p appcp= Type the name EXACTLY as it appears:
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Type the destination directory
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /p appdd= Destination Directory:
cls
echo Copying App!
adb pull /data/app/%appcp% %appdd%
echo Done!
PAUSE
goto menu
:sysapps
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb wait-for-device shell "su -c 'ls /system/app'"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Do you want to copy an app to the computer?
set /p sappans= (Y or N):
if "%sappans%" =="N" goto menu
if "%sappans%" =="n" goto menu
if "%sappans%" =="no" goto menu
if "%sappans%" =="No" goto menu
if "%sappans%" =="NO" goto menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb wait-for-device shell "su -c 'ls /system/app'"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Type the app's name EXACTLY including the .apk extension
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /p sappcp= Type the name EXACTLY as it appears:
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Type the destination directory
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /p sappdd= Destination Directory:
cls
echo Copying App!
adb pull /system/app/%sappcp% %sappdd%
echo Done!
PAUSE
goto menu

[SCRIPT] Bootanimation.zip Flasher

This is a simple script that automatically flashes a new boot animation. It does the remount and deletion commands automatically to provide an easy and fast way to flash boot animations.
ADB ROOT command must be functioning for this to work properly.
DISCLAIMER: THE CREATOR IS NOT RESPONSIBLE FOR DAMAGE CAUSED BY THE USE OF THIS SCRIPT! USE THIS AT YOUR OWN RISK!!!
1. Copy the code below into a new notepad window.
2. Save the file as bootanimation flasher.bat in the folder where adb and its components are located. (MAKE SURE YOU HAVE THE .bat EXTENSION)
3. Run the script!
Common Errors:
"error protocol failure" - this error occurs when the command adb root did not function properly. Fix the issue and try again. Try and re-enable usb debugging if it still doesn't work.
Try and use this app to get adb root functioning: http://forum.xda-developers.com/showthread.php?t=1687590
This was tried and tested with success on a oneplus one and a moto g (1st gen)
Script (click button to show):
@echo off
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ROOT ACCESS IS REQUIRED. ADB ROOT COMMAND MUST BE FUNCTIONING.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo THE CREATOR OF THIS SCRIPT IS NOT RESPONSIBLE FOR ANY DAMAGE!
echo USE THIS AT YOUR OWN RISK!!!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PAUSE
cls
echo Starting ADB!
adb kill-server > nul
adb start-server > nul
echo Done!
timeout -t 1 > nul
:menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo IF YOUR DEVICE IS LISTED BELOW TYPE 1
echo TYPE 2 TO TRY AGAIN
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adb devices
SET /p startcheck= Type your choice:
if "%startcheck%" =="1" goto ask
if "%startcheck%" =="2" goto menu
goto menu
:ask
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE 1 TO FLASH BOOTANIMATION!
echo TYPE 2 TO BACKUP EXISTING BOOTANIMATION THEN FLASH!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p askbackup= Type your choice:
if "%askbackup%" =="1" goto anim
if "%askbackup%" =="2" goto backup
goto menu
:backup
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH TO BACKUP BOOTANIMATION TO!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p backuppath= Type your path and press enter:
cls
echo Backing Up!
adb pull /system/media/bootanimation.zip %backuppath%
echo Done
PAUSE
goto anim
:anim
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo TYPE THE PATH FOR YOUR bootanimation.zip
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET /p bapath= Type your path here and press enter:
cls
echo Running command adb root...
adb wait-for-device root > nul
timeout -t 1 > nul
echo Success, Root Access obtained!
echo Remounting system in read-write mode!
adb wait-for-device remount > nul
timeout -t 1 > nul
adb wait-for-device shell "su -c 'mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system'"
echo Remount Succeded!
echo Deleting existing bootanimation!
adb wait-for-device shell "su -c 'rm /system/media/bootanimation.zip'"
echo Sending new bootanimation!
adb push %bapath% /system/media
echo Remounting system in read-only mode!
adb wait-for-device shell "su -c 'mount -o ro,remount -t yaffs2 /dev/block/mtdblock1 /system'"
echo Done!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo Press 1 to Reboot!
echo Press 2 to Exit!
SET /p dm= Type your choice
if "%dm%" =="1" goto reboot
if "%dm%" =="2" goto exit
:reboot
cls
echo Rebooting!
adb reboot
timeout -t 1 > nul
PAUSE
:exit
exit

Installing factory image Android 6.0

Iv'e tried to install the android 6.0 factory image on nexus 5
I unlocked the bootloader and ran “flash-all.bat” and after few minutes I got this error:
What shuold I do?
Try flashing them individually !
code3h said:
Try flashing them individually !
Click to expand...
Click to collapse
Iv'e just tried to power on the phone as it is and it started up and everything seems to work fine.
but I wonder if that error can cause problems in the future..
should I reinstall or leave it like that?
i had a problem with the bat file as well
it said it couldnt find boot.img ... but the rom.zip was of coure in the same dictionary
after flashing everything individually it worked fine
N5 cm12.1n twrp
win10
Don't like the included bat
I made my own bat file, I hated the one that's included and I mostly only flash minor version updates so I'd just dirty flash because it's okay to and I'd keep all my stuff.
Anyway if you want to use my bat, in the platform-tools folder, create a folder called "images" and extract the zip in there, then extract the images zip into the same folder so you should have all the files there boot.img, userdata.img etc... Open notepad and paste the bat script below, save as "WhateverYouWant.bat" in the platform-tools folder and then run it, for me it works without running as admin so you shouldn't need to do that.
Bat script (This will delete all user data since its a major version update, so backup before!)
Code:
@echo off
color 0A
echo This will dirty flash the device. Place all images in the folder named "images".
pause
cls
adb start-server
cls
echo Booting to bootloader
color 0F
adb reboot-bootloader
cls
color 0E
echo Waiting for device
color 0C
echo If your device has booted and you can still see "waiting for device", then your device is NOT being detected by Fastboot. Check your drivers.
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
cls
color 0A
echo Flashing bootloader
fastboot flash bootloader ./images/bootloader-hammerhead-hhz12h.img
cls
color 0E
echo Waiting for device
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
cls
color 0A
echo Flashing radio
fastboot flash radio ./images/radio-hammerhead-m8974a-2.0.50.2.27.img
cls
color 0E
echo Waiting for device
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
cls
color 0A
echo Flashing boot partition
fastboot flash boot ./images/boot.img
cls
echo Flashing cache partition
fastboot flash cache ./images/cache.img
cls
echo Flashing recovery partition
fastboot flash recovery ./images/recovery.img
cls
echo Flashing system partition
fastboot flash system ./images/system.img
cls
echo Flashing userdata partition
fastboot flash userdata ./images/userdata.img
cls
color 0E
echo Rebooting
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
cls
echo Waiting for device
fastboot continue
cls
color 0A
echo Finished
pause
Tlazipex said:
Iv'e just tried to power on the phone as it is and it started up and everything seems to work fine.
but I wonder if that error can cause problems in the future..
should I reinstall or leave it like that?
Click to expand...
Click to collapse
* If your phone is up and running, nothing to worry about (All good)
* It must not cause any error, even if it does, you know where to post
* Its completely up to you. Since you asked, I would recommend to use it for couple of days, if your notice any thing unusual then you can reinstall any how.
Note : "Nexus Root Tool-kit" is worth trying to flash (Comes very handy)

LineageOS 19.1 + Magisk. Script to help automate rooting after LOS OTA.

After setting up Magisk root and MagiskHide Props, I was a bit disappointed to learn that you loose root after a LOS OTA update (which comes out every week). So, I decided to make a bash script to help me automate restoring root. This script still needs to run on your computer rather than on the phone, but it is still a major improvement to the manual process. I am sure smart people can adapt this script to be a BAT script that will work on Windows.
Prerequisites
USB Debugging enabled on your OnePlus 6.
ADB/Fastboot installed on your computer.
It is assumed that you already have root, you just temporarily lost it after an OTA update.
You will need python 3. You will also need to install at least re and requests packages using pip.
Python script for extracting boot.img from the payload.bin provided here https://wiki.lineageos.org/extracti...ing-proprietary-blobs-from-payload-based-otas
It is expected that you put it into `scripts` folder within your current working directory (from where you run the script).
Python script to download the latest LOS zip from the website created by me. Here are the contents of that downloadLOS.py script which is expected to be in your working directory.
Python:
import re
import requests
# Get HTML text of the downloads webpage
webpage = requests.get("https://download.lineageos.org/enchilada").text
# Get the firmware urls
pattern = r"(https:.*nightly.*signed\.zip)\""
matches = re.findall(pattern, webpage, flags=0)
matches.sort(reverse=True)
# Get the latest firmware URL
latestOSURL = matches[0]
# Extract firmware name
name = latestOSURL.split('/')[-1]
print("Latest firmware: " + name)
print("Download link: " + latestOSURL)
# Download the latest firmware
print("Downloading...")
with open(name, "wb") as f:
f.write(requests.get(latestOSURL).content)
print("Done!")
Magisk Root Automation Script
Before running the script, install the latest OTA update through the updater app and reboot once that is done.
The script is quite self explanatory. The steps are:
Download the latest LOS zip using downloadLOS.py script.
Extract boot.img and vbmeta.img from the zip using unzip and update-payload-extractor. These are needed for rooting.
Copy boot.img to phone's Download folder.
Here the script pauses, waiting for you to go into Magisk app to patch the boot.img that was just copied. Hit any key once you are done.
The patched boot image is copied to your computer and both boot images are removed from the phone.
The phone now reboots into bootloader. The script pauses. Hit any key once your phone is in bootloader.
Both boot_a and boot_b are flashed with patched boot image. vbmeta partition is also flashed.
The phone reboots.
Firmware files are cleaned from your folder.
flash.sh
Bash:
#!/bin/bash
echo "Launching python script to download latest firmware ..."
python3 ./downloadLOS.py
echo ""
echo "Extracting boot.img ..."
echo "----"
unzip lineage*.zip 'payload.bin'
python3 ./scripts/update-payload-extractor/extract.py payload.bin --output_dir ./ --partitions boot vbmeta
echo "----"
echo ""
echo "Copying boot.img to phone... "
echo "----"
adb push ./boot.img /storage/emulated/0/Download
echo "----"
echo ""
read -t 1 -n 1
echo "Press any key after done patching boot... "
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break ;
else
continue ;
fi
done
echo "Copying patched boot.img to PC... "
echo "----"
adb shell mv /storage/emulated/0/Download/magisk_patched* /storage/emulated/0/Download/magisk_patched.img
adb pull /storage/emulated/0/Download/magisk_patched.img magisk_patched.img
echo "----"
echo ""
echo "Removing boot images from phone... "
echo "----"
adb shell rm /storage/emulated/0/Download/boot.img
adb shell rm /storage/emulated/0/Download/magisk_patched.img
echo ""
echo "Rebooting to bootloader... "
echo "----"
adb reboot bootloader
read -t 1 -n 1
echo "Press any key when in bootloader... "
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break ;
else
continue ;
fi
done
echo "----"
echo "Flashing both boots... "
echo "----"
fastboot flash boot_a magisk_patched.img
fastboot flash boot_b magisk_patched.img
echo "----"
echo ""
echo "Flashing vbmeta... "
echo "----"
fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
echo "----"
echo ""
fastboot reboot
echo ""
echo "Done rooting!"
echo "Cleaning up local files ..."
rm *.img
rm *.bin
rm *.zip
echo "Complete!"
Notes
If you have slow internet and do not want to download the update twice. You could remove the whole downloadLOS.py section and use a separate script pullLOS.sh to pull the LOS update from your phone BEFORE YOU REBOOT after installing the update. After you reboot you loose root and cannot access it. For this you will need to enable rooted debugging in developer options.
Bash:
#!/bin/bash
adb root
echo "Copying update zip from the phone ..."
adb shell mv /data/lineageos_updates/lineage* /data/lineageos_updates/lineage.zip
adb pull /data/lineageos_updates/lineage.zip lineage.zip
adb shell rm /data/lineageos_updates/lineage.zip
echo "----"
echo ""
Attachment
Attachments contains:
scripts folder for your convenience containing LOS extractor scripts. Feel free to remove and re-download from source.
downloadLOS.py python script to download the latest LOS zip from the website.
flash.sh the main script
pullLOS.sh optional script for those who want to avoid re-downloading OTA update.
I hope you guys find it helpful! Let me know if you encounter any problems.
Doesn’t your device factory reset afterwards?
Will it copy your data over to your device again?
I think you are misunderstanding something. This is only if you already have LineageOS 19.1 and Magisk root.
LineageOS has over the air (OTA) updates. They release them every week. They do not touch your data. You just install through Settings -> System -> Updater, reboot and you are good to go. The same way OTAs work in OOS.
The problem is that you loose your Magisk root. In order to bring it back you need to patch and flash a boot partition again (and also vbmeta). Flashing boot partition does not do anything to your data. The script just automates what you would have to do by hand.
Isn't it the same outcome as with Magisk "Install on inactive partition after OTA" option?
I always install OTAs and select that option on Magisk and reboot.
jfromeo said:
Isn't it the same outcome as with Magisk "Install on inactive partition after OTA" option?
I always install OTAs and select that option on Magisk and reboot.
Click to expand...
Click to collapse
You could be right, but I have never seen / not been able to find this option. Maybe it is only available right after an OTA, don't know.

Categories

Resources