Is there any way to root in fastboot mode???
If so, using what utility?
Thanks in advance.
I guess I am asking if issuing the following commands on a RAZR through adb while in fastboot result in root? This is for ICS.
These command are from DroidRAZRUtility .bat file.
echo [*] Waiting for device...
adb wait-for-device
echo [*] Device found.
adb shell "rm -r /data/local/12m/batch 2>/dev/null"
adb shell "ln -s /data /data/local/12m/batch"
echo [*] Rebooting device...
adb reboot
echo [*] Waiting for device to reboot...
adb wait-for-device
adb shell "rm /data/local.prop"
adb shell "echo 'ro.sys.atvc_allow_all_adb=1' > /data/local.prop"
echo [*] Rebooting device again...
adb reboot
echo [*] Waiting for device to reboot...
adb wait-for-device
echo [*] Attemping persistence...
adb remount
adb push su /system/bin/su
adb shell "chmod 6755 /system/bin/su"
adb shell "ln -s /system/bin/su /system/xbin/su 2>/dev/null"
adb push busybox /system/xbin/busybox
adb shell "chmod 755 /system/xbin/busybox"
adb shell "/system/xbin/busybox --install /system/xbin"
adb push Superuser.apk /system/app/Superuser.apk
echo [*] Cleaning up...
adb shell "rm /data/local.prop"
adb shell "rm /data/local/12m/batch"
adb shell "chmod 771 /data"
adb shell "chown system.system /data"
echo [*] Rebooting...
adb reboot
adb wait-for-device
echo [*] Exploit complete!
Click to expand...
Click to collapse
Okay, So I am working on a project for my work. We need to locate and test a tablet to sell to a client. The client needs it rooted. So We got in this Pipo M1. Nice unit for the price. I rooted it via VonDroid-Root and changed the default storage location from the ROM to the internal storage. I let the battery die on it to test battery life, now it will not charge. Two chargers and it never seems to detect a charger, and will not charge. Just boots, shuts down, and repeats. Anyone have any thoughts or Ideas?
Here is the Root script that I ran on it.
Code:
echo off
cls
echo *---* VonDroid.com N101 II Root Tool based on work by sunnydavid *---*
echo --- Plug in your device, make sure debugging is enabled in Developer Options
echo --- This script will now copy files over to your N101 II
echo.
adb shell mv /data/local/tmp /data/local/tmp.bak
adb shell ln -s /data /data/local/tmp
adb reboot
echo --- Reboot 1/3 - Press Space Bar once the device has rebooted
pause
adb shell rm /data/local.prop > nul
adb shell "echo \"ro.kernel.qemu=1\" > /data/local.prop"
adb reboot
echo --- Reboot 2/3 - Press Space Bar once the device has rebooted
pause
adb shell id
echo --- If the ID shows as 0/root then continue, otherwise CTRL+C to cancel and start over
pause
adb remount
adb push su /system/bin/su
adb shell chown root.shell /system/bin/su
adb shell chmod 6755 /system/bin/su
adb push busybox /system/bin/busybox
adb shell chown root.shell /system/bin/busybox
adb shell chmod 0755 /system/bin/busybox
echo --- Installing SuperSU
adb shell chown root.root /system/app/SuperSU.apk
adb shell chmod 0644 /system/app/SuperSU.apk
adb push RootExplorer.apk /system/app/RootExplorer.apk
adb shell chown root.root /system/app/RootExplorer.apk
adb shell chmod 0644 /system/app/RootExplorer.apk
echo Completing Root
adb shell rm /data/local.prop
adb shell rm /data/local/tmp
adb shell mv /data/local/tmp.bak /data/local/tmp
adb reboot
echo echo --- Reboot 3/3 - Your N101 II should now be rooted
pause
echo on
OK i got given a file to supposedly root a phone and without thinking to question it i went along and ran it
The root did work but it has now seemed to have enabled dual sim options on the phone, but the phone no longer detects the sim in slot 1 or 2 software side.
As android was booting i got the updating android message and then seen the 2 sim slots near the clock
Can't figure out what it's done but heres the batch file after changing the extension from exe to rar
Code:
ÿþ::%%a %%a
ECHO OFF
TITLE ÖÐÐËV956 Ò??üROOT???ß By ?ã?úÈ?-?ÁÄ?Ö?ÐÇ
color 3f
:STARTS
CLS
ECHO. ÖÐÐËV956 Ò??üROOT???ß
ECHO. =============================================================================
ECHO. ??Òâ?º
ECHO. 1.ÇëÏÈ????ºÃÊÖ?úÇý??
ECHO.
ECHO. 2.ϵÍ?ÉèÖÃ----???ª??ÕßÑ?Ïî---???ª??ÕßÑ?Ïî ?ò?ª----??USBµ?ÊÔ ??Ñ?
ECHO.
ECHO. 3.ROOTÊ?ÊÖ?úÓ???ÓÚ?ª?ú??Ì???Çë?Ø?ÕµçÄÔ?˵ÄÊÖ?ú?ÜÀíÈí?þ
ECHO.
ECHO. 4.ROOTÇ???Ö?µç?صçÁ?ÔÚ ?µ???? ÒÔÉÏ????ÇÒµçÄÔÕýÈ?????V956µÄÇý????
ECHO. Õû?ö?ý?ÌV956??ÖØÆôÁ??Î
ECHO.
ECHO.
ECHO. ??ÊõÖ??Ö?º?ÁÄ?Ö?ÐÇ
ECHO.
ECHO. ??Ó??ÃÎÊ?ã?úÈ?ÂÛÌ??ºwww.gaojiquan.com
ECHO. =============================================================================
pause
:ROOT
CLS
adb kill-server >NUL 2>NUL
ECHO. --- µÈ?ýÉè??
ECHO. Èç?û??ÔÚÕâ?ß:
ECHO. ÇëÈ???ÒÑ?ò?ªµ?ÊÔ?òÕß????Çý??
adb wait-for-device >NUL 2>NUL
ECHO. --- ??ÏÖÉè??
ECHO. ÉÔºóÊÖ?ú?á?øÈëfastboot
adb reboot bootloader
ECHO. --- µÈ?ýÉè??
ECHO ***************************************************************************
ECHO * Èç?ûÒ?Ö???ÔÚ??waiting for device?? *
ECHO * ÇëÔÚ?ËÊ?ÓÃÍã???Ô?òÕßÊÖ?úÖúÊÖÁ??Ó *
ECHO * ?áÌáÊ?ÏÂÔØ??????Çý?? *
ECHO ***************************************************************************
fastboot boot Superboot.img
ECHO. --- ÊÖ?úÕýÔÚÖØÆô??µÚ1?Î????2?Î??????
ECHO. ÖØÆôÍê?ɺó?á?Ô???ÌÐø
ECHO. --- µÈ?ýÉè??
ping 127.0.0.1 -n 15 >NUL
adb kill-server >NUL 2>NUL
adb wait-for-device >NUL 2>NUL
ping 127.0.0.1 -n 5 >NUL
ECHO. --- ??ÏÖÉè????ROOTÖÐ
adb remount
adb shell rm /system/bin/su >NUL 2>NUL
adb shell rm /system/xbin/su >NUL 2>NUL
adb shell rm /system/app/Superuser.apk >NUL 2>NUL
adb shell rm /system/app/superuser.apk >NUL 2>NUL
adb push su /system/bin/su
adb shell chown 0.0 /system/bin/su
adb shell chmod 06755 /system/bin/su
adb shell ln -s /system/bin/su /system/xbin/su
adb push Superuser.apk /system/app/Superuser.apk
adb shell chown 0.0 /system/app/Superuser.apk
adb shell chmod 0644 /system/app/Superuser.apk
ECHO. --- ÊÖ?úÕýÔÚÖØÆô??µÚ2?Î????2?Î??????
ECHO. --- ÖØÆôÍê?ɺó??ROOTÍê?É
adb reboot
adb kill-server >NUL 2>NUL
ECHO.
ECHO.
ECHO. ??ÈÎÒâ?üÍË?ö?ÌÐò...
pause >NUL
EXIT
any help at all, never normally so naive but got stupid for all of 30 seconds
ando_uk said:
OK i got given a file to supposedly root a phone and without thinking to question it i went along and ran it
The root did work but it has now seemed to have enabled dual sim options on the phone, but the phone no longer detects the sim in slot 1 or 2 software side.
As android was booting i got the updating android message and then seen the 2 sim slots near the clock
Can't figure out what it's done but heres the batch file after changing the extension from exe to rar
Code:
ÿþ::%%a %%a
ECHO OFF
TITLE ÖÐÐËV956 Ò??üROOT???ß By ?ã?úÈ?-?ÁÄ?Ö?ÐÇ
color 3f
:STARTS
CLS
ECHO. ÖÐÐËV956 Ò??üROOT???ß
ECHO. =============================================================================
ECHO. ??Òâ?º
ECHO. 1.ÇëÏÈ????ºÃÊÖ?úÇý??
ECHO.
ECHO. 2.ϵÍ?ÉèÖÃ----???ª??ÕßÑ?Ïî---???ª??ÕßÑ?Ïî ?ò?ª----??USBµ?ÊÔ ??Ñ?
ECHO.
ECHO. 3.ROOTÊ?ÊÖ?úÓ???ÓÚ?ª?ú??Ì???Çë?Ø?ÕµçÄÔ?˵ÄÊÖ?ú?ÜÀíÈí?þ
ECHO.
ECHO. 4.ROOTÇ???Ö?µç?صçÁ?ÔÚ ?µ???? ÒÔÉÏ????ÇÒµçÄÔÕýÈ?????V956µÄÇý????
ECHO. Õû?ö?ý?ÌV956??ÖØÆôÁ??Î
ECHO.
ECHO.
ECHO. ??ÊõÖ??Ö?º?ÁÄ?Ö?ÐÇ
ECHO.
ECHO. ??Ó??ÃÎÊ?ã?úÈ?ÂÛÌ??ºwww.gaojiquan.com
ECHO. =============================================================================
pause
:ROOT
CLS
adb kill-server >NUL 2>NUL
ECHO. --- µÈ?ýÉè??
ECHO. Èç?û??ÔÚÕâ?ß:
ECHO. ÇëÈ???ÒÑ?ò?ªµ?ÊÔ?òÕß????Çý??
adb wait-for-device >NUL 2>NUL
ECHO. --- ??ÏÖÉè??
ECHO. ÉÔºóÊÖ?ú?á?øÈëfastboot
adb reboot bootloader
ECHO. --- µÈ?ýÉè??
ECHO ***************************************************************************
ECHO * Èç?ûÒ?Ö???ÔÚ??waiting for device?? *
ECHO * ÇëÔÚ?ËÊ?ÓÃÍã???Ô?òÕßÊÖ?úÖúÊÖÁ??Ó *
ECHO * ?áÌáÊ?ÏÂÔØ??????Çý?? *
ECHO ***************************************************************************
fastboot boot Superboot.img
ECHO. --- ÊÖ?úÕýÔÚÖØÆô??µÚ1?Î????2?Î??????
ECHO. ÖØÆôÍê?ɺó?á?Ô???ÌÐø
ECHO. --- µÈ?ýÉè??
ping 127.0.0.1 -n 15 >NUL
adb kill-server >NUL 2>NUL
adb wait-for-device >NUL 2>NUL
ping 127.0.0.1 -n 5 >NUL
ECHO. --- ??ÏÖÉè????ROOTÖÐ
adb remount
adb shell rm /system/bin/su >NUL 2>NUL
adb shell rm /system/xbin/su >NUL 2>NUL
adb shell rm /system/app/Superuser.apk >NUL 2>NUL
adb shell rm /system/app/superuser.apk >NUL 2>NUL
adb push su /system/bin/su
adb shell chown 0.0 /system/bin/su
adb shell chmod 06755 /system/bin/su
adb shell ln -s /system/bin/su /system/xbin/su
adb push Superuser.apk /system/app/Superuser.apk
adb shell chown 0.0 /system/app/Superuser.apk
adb shell chmod 0644 /system/app/Superuser.apk
ECHO. --- ÊÖ?úÕýÔÚÖØÆô??µÚ2?Î????2?Î??????
ECHO. --- ÖØÆôÍê?ɺó??ROOTÍê?É
adb reboot
adb kill-server >NUL 2>NUL
ECHO.
ECHO.
ECHO. ??ÈÎÒâ?üÍË?ö?ÌÐò...
pause >NUL
EXIT
any help at all, never normally so naive but got stupid for all of 30 seconds
Click to expand...
Click to collapse
any ideas anyone?
nvm figured it out
the superboot.img messed up the radio, factory reset solved the problem
This is a tool to capture screenshots while in Recovery or the Aroma Installer.
Support has ended, due to the possibility of pixel formats changing from each recovery update you receive.
But I did make a better Recovery Screenshot that handles this problem, and it can be found here or below.:cyclops:
http://forum.xda-developers.com/showthread.php?p=50029759
It's no big secret around XDA that you can use the program FFmpeg to convert your raw framebuffer file into a normal image file. I've found the values for the Nexus 5 and made a batch script that incorporates the programs adb, and ffmpeg; to save screenshots to your computer. I don't have a Nexus 5, but thanks to an XDA user, @ikslawlok, who posted his raw framebuffer from TWRP 2.6.3.4 on another website, I was able to get it working. Also thanks to @rootSU for testing in Philz, a CWM based recovery. This should work on all versions of Windows. I have only tested in Windows 7 personally. The process, as far as using ffmpeg and adb, used here is also possible in Linux. Some versions of ffmpeg for Linux are antiquated, hence there isn't really a write one script; work for all.
Why would anyone use this or do this?
Most people, that probably includes you reading this, have actually no use for it, nor can you think of a reason too. The uses of this are limited to people that write tutorials, custom recovery themes, and the rare event that you have an anomaly in your recovery and you can't describe it.
I owe a big thanks to @Whiskey103 with his work in this thread over in the HTC One forum. :good:
You have to have the adb drivers installed before you can do anything. Go here for more information.
This rar file contains the programs adb and ffmpeg. This 32-bit version of ffmpeg is one of the newest versions available on their downloads page. You must have adb.exe, ffmpeg.exe, and the two dll files for adb in the same directory as the batch file. The easiest thing to do is just extract the rar to a new directory, then run the file named "RUNrsn511.bat" The screenshots you capture will be saved in the same folder that you unzipped everything in as 'timestamp'.png
Thank you @weihan1102 for helping me test and providing your framebuffer from the modified version of TWRP for multirom!
Download Recovery Screenshot v1.1
If you have already downloaded the original version, and wish to update with support for the modified twrp for multirom without downloading the whole new rar, then hit the button below.
The only difference is the RUNrs.bat batch script. You may wish to just download the new batch file here, it is only 1.7KB zipped. It is RUNrsn511.rar and can just be unzipped into the folder you originally unzipped the other files into. I would then delete the original batch file.
An easier way, I think, is to click show content below and click anywhere in the box. Hit Ctrl+A to select everything, hit Ctrl+C to copy it to the clipboard. Then right click on your original RUNrs.bat file, and select edit. Click in that screen anywhere, hit Ctrl+A to select everything in there, then Ctrl+V to paste the new batch script into RUNrs.bat.
Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot v1.1
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
REM @ECHO ON
SET "ffdebug=-loglevel debug"
SET "ffshowb=%"
MODE CON:COLS=140 LINES=250
COLOR 07
ECHO __________________________________________________________________
ECHO DEBUG INFO
ECHO __________________________________________________________________
)
:START
ECHO[
ECHO ______________________________________________________
ECHO This will pull a screenshot from your Nexus 5 and
ECHO save it to the directory that you ran this bat
ECHO file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO Thanks to Whiskey103 for the idea!!
ECHO Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause
ECHO Press 1 or 2
ECHO 1 - Save a screenshot using multirom twrp recovery
ECHO 2 - Save a screenshot using other recoveries
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 SET "pixfmt=-pix_fmt rgb565"
IF %K%==2 SET "pixfmt=-pix_fmt rgb0"
:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
SET TS="NOGOOD"
ECHO ______________________________________________________
ECHO Adb is not properly connected.
ECHO Try "Safely Removing" your N5 from your computer
ECHO Then unplug your usb cable, and reinsert it.
ECHO ______________________________________________________
ECHO[
ECHO[
ECHO Press any key to try again.
ECHO[
ECHO[
PAUSE >nul
CLS
GOTO START
)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO Screenshot saved as %TS%
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH
:NOFILES
CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit
PAUSE >nul
EXIT
:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard. This
ECHO will save an image of the current window in memory on your clipboard. Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image. Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer. To figure out the resolution to use, try adding 4,8, or 16 to your native width to make it
ECHO evenly divisible by 32. Example resolution is 1080x1920..1080^/32^=33.75 ^< not right, so try 1088^/32^=34 ^< good
ECHO Only worry about width (left to right), height is stored orderly in memory.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
MODE CON:COLS=52 LINES=200
ffmpeg -hide_banner -pix_fmts
pause
GOTO FINISH)
IF %K%==2 GOTO FINISH
:FINISH
ADB kill-server -d
EXIT
I have more screenshots at my 2013 Nexus 7 thread.
Batch script v1.1
Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot v1.1
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
REM @ECHO ON
SET "ffdebug=-loglevel debug"
SET "ffshowb=%"
MODE CON:COLS=140 LINES=250
COLOR 07
ECHO __________________________________________________________________
ECHO DEBUG INFO
ECHO __________________________________________________________________
)
:START
ECHO[
ECHO ______________________________________________________
ECHO This will pull a screenshot from your Nexus 5 and
ECHO save it to the directory that you ran this bat
ECHO file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO Thanks to Whiskey103 for the idea!!
ECHO Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause
ECHO Press 1 or 2
ECHO 1 - Save a screenshot using multirom twrp recovery
ECHO 2 - Save a screenshot using other recoveries
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 SET "pixfmt=-pix_fmt rgb565"
IF %K%==2 SET "pixfmt=-pix_fmt rgb0"
:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
SET TS="NOGOOD"
ECHO ______________________________________________________
ECHO Adb is not properly connected.
ECHO Try "Safely Removing" your N5 from your computer
ECHO Then unplug your usb cable, and reinsert it.
ECHO ______________________________________________________
ECHO[
ECHO[
ECHO Press any key to try again.
ECHO[
ECHO[
PAUSE >nul
CLS
GOTO START
)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO Screenshot saved as %TS%
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH
:NOFILES
CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit
PAUSE >nul
EXIT
:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard. This
ECHO will save an image of the current window in memory on your clipboard. Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image. Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer. To figure out the resolution to use, try adding 4,8, or 16 to your native width to make it
ECHO evenly divisible by 32. Example resolution is 1080x1920..1080^/32^=33.75 ^< not right, so try 1088^/32^=34 ^< good
ECHO Only worry about width (left to right), height is stored orderly in memory.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
MODE CON:COLS=52 LINES=200
ffmpeg -hide_banner -pix_fmts
pause
GOTO FINISH)
IF %K%==2 GOTO FINISH
:FINISH
ADB kill-server -d
EXIT
Batch script v1
Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
REM @ECHO ON
SET "ffdebug=-loglevel debug"
SET "ffshowb=%"
MODE CON:COLS=140 LINES=250
COLOR 07
ECHO __________________________________________________________________
ECHO DEBUG INFO
ECHO __________________________________________________________________
)
:START
ECHO[
ECHO ______________________________________________________
ECHO This will pull a screenshot from your Nexus 5 and
ECHO save it to the directory that you ran this bat
ECHO file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO Thanks to Whiskey103 for the idea!!
ECHO Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause
ECHO Press any key when you are ready.
PAUSE >nul
:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
SET TS="NOGOOD"
ECHO ______________________________________________________
ECHO Adb is not properly connected.
ECHO Try "Safely Removing" your N5 from your computer
ECHO Then unplug your usb cable, and reinsert it.
ECHO ______________________________________________________
ECHO[
ECHO[
ECHO Press any key to try again.
ECHO[
ECHO[
PAUSE >nul
CLS
GOTO START
)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo -pix_fmt rgb0 -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO Screenshot saved as %TS%
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH
:NOFILES
CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit
PAUSE >nul
EXIT
:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo -pix_fmt rgb0 -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard. This
ECHO will save an image of the current window in memory on your clipboard. Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image. Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer. To figure out the resolution to use, try adding 4,8,16, or 32 to your native width to make
ECHO room for the extra data, ioctrls?, at the end of each pixel row. Experiment with different pixel formats
ECHO also.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
MODE CON:COLS=52 LINES=200
ffmpeg -hide_banner -pix_fmts
pause
GOTO FINISH)
IF %K%==2 GOTO FINISH
:FINISH
ADB kill-server -d
EXIT
Great! It worked!
I've just test it on my Nexus5.
Thanks!
Thanks! but seems like the color isn't correct and it content 4 screenshot in a single png file.
weihan1102 said:
Thanks! but seems like the color isn't correct and it content 4 screenshot in a single png file.
Click to expand...
Click to collapse
It looks like the multirom twrp uses a different kernel.
Can you do me a favor and substitute '-pix_fmt rgb0' with '-pix_fmt rgba' in the batch file?
To edit the batch file just right click it and choose edit. Find the lines, there's two of them, that start with ffmpeg..... and replace the part above. Save it and try again.
makers_mark said:
It looks like the multirom twrp uses a different kernel.
Can you do me a favor and substitute '-pix_fmt rgb0' with '-pix_fmt rgba' in the batch file?
To edit the batch file just right click it and choose edit. Find the lines, there's two of them, that start with ffmpeg..... and replace the part above. Save it and try again.
Click to expand...
Click to collapse
No, the color change but still not the correct color
weihan1102 said:
No, the color change but still not the correct color
Click to expand...
Click to collapse
Can you change the pix_fmt to bgra? I could figure it out later if you could upload your framebuffer file later, I won't be able to be around a computer for about 11 or 12 hours from now.
To save the framebuffer to your computer : shift + right click on the folder adb and other files are in, and select run cmd here. In the command window type 'adb pull /dev/graphics/fb0 rawfb0.raw'. The file rawfb0.raw will be in that same folder now.
makers_mark said:
Can you change the pix_fmt to bgra? I could figure it out later if you could upload your framebuffer file later, I won't be able to be around a computer for about 11 or 12 hours from now.
To save the framebuffer to your computer : shift + right click on the folder adb and other files are in, and select run cmd here. In the command window type 'adb pull /dev/graphics/fb0 rawfb0.raw'. The file rawfb0.raw will be in that same folder now.
Click to expand...
Click to collapse
bgra didn't work.
and the rawfb0.raw, here you are
https://drive.google.com/file/d/0B5FN-6JxBhASempFLTFUSDlkX3c/edit?usp=sharing
weihan1102 said:
bgra didn't work.
and the rawfb0.raw, here you are
https://drive.google.com/file/d/0B5FN-6JxBhASempFLTFUSDlkX3c/edit?usp=sharing
Click to expand...
Click to collapse
Thank you so much! I will fix it when I get home.