Hello . . .
I really glad to be an XDA member.
Here is a batch script for downloading coolpad android firmwares.
First of all you have to download the zip file .
Extract the zip file.
Run Coolpad Firmware Downloader.bat.
Click on the android model you wish to download.
Your default browser will open a new tab.
IDM or your some other downloader will capture a download link.
That's it.
Download Links :
Oh, I'm only a user. So, I cannot post any download links and images. Maybe later.
With best wishes,
Ye Naing.
The script . . .
@ECHO off
cd bin
set file=1.mp3
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs
title Coolpad Firmware Downloader Batch Script
setlocal enabledelayedexpansion
mode con cols=45 lines=50
graphic.exe hidecursor
color 1F
:menu
cls
echo *********************************************
echo Coolpad Firmware Downloader Batch Script
echo *********************************************
cmdmenusel f770 "Coolpad 9976A" "Coolpad 8295M" "Coolpad 8190Q" "Coolpad 8297 " "Coolpad 7296" "Coolpad 7295C " "Coolpad 7295 " "Coolpad 7298A " "Coolpad 7270 " "Coolpad 7231 " "Coolpad 8122 " "Coolpad 8076 SC8810 " "Exit tool"
if %errorlevel% == 1 goto MAIN1
if %errorlevel% == 2 goto MAIN2
if %errorlevel% == 3 goto MAIN3
if %errorlevel% == 4 goto MAIN4
if %errorlevel% == 5 goto MAIN5
if %errorlevel% == 6 goto MAIN6
if %errorlevel% == 7 goto MAIN7
if %errorlevel% == 8 goto MAIN8
if %errorlevel% == 9 goto MAIN9
if %errorlevel% == 10 goto MAIN10
if %errorlevel% == 11 goto MAIN11
if %errorlevel% == 12 goto MAIN12
if %errorlevel% == 13 exit
goto menu
:MAIN1
cls
color 2F
echo.
echo *********************************************
echo Coolpad 9976A FlashTool Firmware
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN2
cls
color 3F
echo.
echo *********************************************
echo Coolpad 8295M FlashTool Firmware
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN3
cls
color 4F
echo.
echo *********************************************
echo Coolpad 8190Q
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN4
cls
color 5F
echo.
echo *********************************************
echo Coolpad 8297
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN5
cls
color 6F
echo.
echo *********************************************
echo Coolpad 7296 Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
:MAIN6
cls
color 7F
echo.
echo *********************************************
echo Coolpad 7295C Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
:MAIN7
cls
color AF
echo.
echo *********************************************
echo Coolpad 7295 Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
:MAIN8
cls
color 8F
echo.
echo *********************************************
echo Coolpad 7298A Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
:MAIN9
cls
color 9F
echo.
echo *********************************************
echo Coolpad 7270 Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
:MAIN10
cls
color 0F
echo.
echo *********************************************
echo Coolpad 7231 Firmware
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN11
cls
color CF
echo.
echo *********************************************
echo Coolpad 8122 Firmware
echo *********************************************
echo.
pause
start htt
start m.vbs
goto menu
:MAIN12
cls
color AF
echo.
echo *********************************************
echo Coolpad 8076 SC8810 Firmware
echo *********************************************
echo.
pause
start http
start m.vbs
goto menu
Related
Mod please close this thread .
Thank you
Regards,
ImbaWind
Haven't download it yet but I'm just curious. Is this a "sync" followed by echoing "3" to the drop_cache file?
Sent from my Nexus S using xda premium
kοng said:
Haven't download it yet but I'm just curious. Is this a "sync" followed by echoing "3" to the drop_cache file?
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
and followed by a echo 1 to let the system continue create caches
Should the terminal emulator typing repeat in every reboot (soft reset)?
imbawind said:
Adrenaline Shot
This script act like an adrenaline shot for your phone.
It helps you to clear your system cache, get more free ram for you and gravely boost your phone's performance !
Click to expand...
Click to collapse
sync;
sleep 1
echo "3" > /proc/sys/vm/drop_caches;
echo "1" > /proc/sys/vm/drop_caches;
sleep 1
echo " ** Turbo Boosted ** ";
Is that all?
Not new. This script persists already in a lot of ROMs and tweaks.
My engine flush script included with V6 SuperCharger... it haz...
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Just type "flush" in terminal
And what's up with the naming?
There is a well known Adrenaline Shot script plus there is a certain 3G TurboCharger but anyway instead of using 2 names (?) you should call it "Adrenaline Boost" or something
jolas said:
Should the terminal emulator typing repeat in every reboot (soft reset)?
Click to expand...
Click to collapse
whenever u feel lag
alexdoux25 said:
sync;
sleep 1
echo "3" > /proc/sys/vm/drop_caches;
echo "1" > /proc/sys/vm/drop_caches;
sleep 1
echo " ** Turbo Boosted ** ";
Is that all?
Not new. This script persists already in a lot of ROMs and tweaks.
Click to expand...
Click to collapse
really ?0.0
for my device this script echo 3 drop cache is indeed included in many script but none of them works
zeppelinrox said:
My engine flush script included with V6 SuperCharger... it haz...
Just type "flush" in terminal
And what's up with the naming?
There is a well known Adrenaline Shot script plus there is a certain 3G TurboCharger but anyway instead of using 2 names (?) you should call it "Adrenaline Boost" or something
Click to expand...
Click to collapse
okay I'll make changes
but I really don't know tat ur v6 can clear ram by terminal..
and isit ur script only echo 3 without echo 1 back and sync
correct me if i'm wrong
zeppelinrox said:
My engine flush script included with V6 SuperCharger... it haz...
Just type "flush" in terminal
And what's up with the naming?
There is a well known Adrenaline Shot script plus there is a certain 3G TurboCharger but anyway instead of using 2 names (?) you should call it "Adrenaline Boost" or something
Click to expand...
Click to collapse
Code:
if [ "$opt" -eq 16 ]; then
# see http://www.droidforums.net/forum/liberty-rom-d2/122733-tutorial-sysctl-you-guide-better-preformance-battery-life.html
# credit imoseyon
echo " Your device may get laggy after a day or two.."
echo ""
$sleep
echo " ...if you haven't rebooted."
echo ""
$sleep
echo " It happens when system caches keep growing..."
echo ""
$sleep
echo " ...and free RAM keeps shrinking..."
echo ""
$sleep
echo " ...and apps are starved for memory!"
echo ""
$sleep
echo ""
$sleep
echo " This Engine Flush will give you a Quick Boost!"
echo ""
$sleep
echo " The system will drop all file system caches..."
echo ""
$sleep
echo " ...which means more free RAM and no lag!"
echo ""
$sleep
echo " ...so need to reboot!"
echo ""
$sleep
echo " Credit to imoseyon for making this known!"
echo ""
$sleep
echo " Continue and drop all file system caches?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read flush
echo ""
echo $line
case $flush in
y|Y)sync; echo 3 > /proc/sys/vm/drop_caches
echo " Engine Flush Completed!"
echo ""
$sleep
echo " ...Enjoy Your Quick Boost :)";;
*)echo " File system caches were retained...";;
esac
echo $line
echo ""
$sleep
fi
do u mean this one ?
Code:
Code:
# sync
# echo 3 > /proc/sys/vm/drop_caches
That's it. Not much to see here. The first command writes any cache data that hasn't been written to the disk out to the disk. The second command tells the kernel to drop what's cached. Not much to it. This invalidates the write cache as well as the read cache, which is why we have the sync command first.
Click to expand...
Click to collapse
Source
and from my opinion , it's better to echo 1 back to drop_caches, cause the caches which are still in use may be cleaned whenever u go task manager and clear ram
correct me if i'm wrong
imbawind said:
Code:
if [ "$opt" -eq 16 ]; then
# see http://www.droidforums.net/forum/liberty-rom-d2/122733-tutorial-sysctl-you-guide-better-preformance-battery-life.html
# credit imoseyon
echo " Your device may get laggy after a day or two.."
echo ""
$sleep
echo " ...if you haven't rebooted."
echo ""
$sleep
echo " It happens when system caches keep growing..."
echo ""
$sleep
echo " ...and free RAM keeps shrinking..."
echo ""
$sleep
echo " ...and apps are starved for memory!"
echo ""
$sleep
echo ""
$sleep
echo " This Engine Flush will give you a Quick Boost!"
echo ""
$sleep
echo " The system will drop all file system caches..."
echo ""
$sleep
echo " ...which means more free RAM and no lag!"
echo ""
$sleep
echo " ...so need to reboot!"
echo ""
$sleep
echo " Credit to imoseyon for making this known!"
echo ""
$sleep
echo " Continue and drop all file system caches?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read flush
echo ""
echo $line
case $flush in
y|Y)sync; echo 3 > /proc/sys/vm/drop_caches
echo " Engine Flush Completed!"
echo ""
$sleep
echo " ...Enjoy Your Quick Boost :)";;
*)echo " File system caches were retained...";;
esac
echo $line
echo ""
$sleep
fi
do u mean this one ?
Click to expand...
Click to collapse
Try this one
Code:
echo " Reported \"Free\" RAM = $ramreportedfree MB"
echo ""
busybox sync; echo 3 > /proc/sys/vm/drop_caches
sleep 3
echo 1 > /proc/sys/vm/drop_caches
ramused=$((`free | awk '{ print $3 }' | sed -n 2p`/1024))
ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p`
ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $2}' | sed -n 1p`
ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1024));ramreportedfree=$(($ramfree + $ramcached))
echo $line
echo " ...RAM Stats AFTER Engine Flush"
Plus you ain't sleeping between the echo 3 and echo 1 - so sometimes that won't work.
zeppelinrox said:
Try this one
Code:
echo " Reported \"Free\" RAM = $ramreportedfree MB"
echo ""
busybox sync; echo 3 > /proc/sys/vm/drop_caches
sleep 3
echo 1 > /proc/sys/vm/drop_caches
ramused=$((`free | awk '{ print $3 }' | sed -n 2p`/1024))
ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p`
ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $2}' | sed -n 1p`
ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1024));ramreportedfree=$(($ramfree + $ramcached))
echo $line
echo " ...RAM Stats AFTER Engine Flush"
Plus you ain't sleeping between the echo 3 and echo 1 - so sometimes that won't work.
Click to expand...
Click to collapse
wow i din noticed that u hav new version , still can report ram free , awesome one of the best devs out there
thanks for your guidance
zeppelinrox said:
Try this one
Code:
echo " Reported \"Free\" RAM = $ramreportedfree MB"
echo ""
busybox sync; echo 3 > /proc/sys/vm/drop_caches
sleep 3
echo 1 > /proc/sys/vm/drop_caches
ramused=$((`free | awk '{ print $3 }' | sed -n 2p`/1024))
ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p`
ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $2}' | sed -n 1p`
ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1024));ramreportedfree=$(($ramfree + $ramcached))
echo $line
echo " ...RAM Stats AFTER Engine Flush"
Plus you ain't sleeping between the echo 3 and echo 1 - so sometimes that won't work.
Click to expand...
Click to collapse
the line which shows ram doesnt works
Works in my screen shot, no?
I just posted a snippet LOL
imbawind said:
wow i din noticed that u hav new version , still can report ram free , awesome one of the best devs out there
thanks for your guidance
Click to expand...
Click to collapse
Thanks I appreciate the good words
While I was pushing some files trough adb I thought it would be handy to have a script which automates it, a simple bat file in this case, can become very handy if you need to push some system apps for testing. It will show several reboot options afterwards and additionally it can flash a kernel to your device.
I know it's better to just upgrade my Quick Flasher tool, but this was written in 10 min so why not share and upgrade later
co credits:
- stepie22 (helped me in expanding it)
It requires adb in it's directory and the files you want to push as well.
Kernelflasher.bat:
Code:
@echo off
REM /*
REM * cd to the current directory
REM */
cd /d %~dp0
mode con:lines=30
REM /*
REM * Check if adb is available in the path variable, the default path or the current directory.
REM * Asks user if they want to download it if it is not found.
REM */
set found=
set quotedPath="%PATH:;="; "%"
set prog=adb.exe
for %%i in (%quotedPath%) do if exist %%i\%prog% set found=%%i
:adbdetected
REM /*
REM * Added incase usb isn't properly connected
REM */
title Universal Quick Flasher v1.04 - Waiting for device...
echo Waiting for device...
echo Please plugin android device with usb debugging enabled
adb wait-for-device
cls
adb root
adb remount
title Universal Quick Flasher v1.04
goto main
if not ""==%found% goto adbdetected
if exist adb.exe goto adbdetected
if exist "%programfiles%\Android\android-sdk\platform-tools\adb.exe" goto adbdetected
REM /*
REM * Added Windows 7 Default location for android-sdk
REM */
if exist "%USERPROFILE%\android-sdks\platform-tools\adb.exe" goto adbdetected
if exist "%USERPROFILE%\android-sdk\platform-tools\adb.exe" goto adbdetected
goto noadb
:main
cls
echo.
echo *************************************
echo * Universal Quick Flasher v1.04 *
echo * *
echo * By broodplank1337 *
echo * and *
echo * stepie22 *
echo * *
echo * All Filenames are CaseSensitive! *
echo *************************************
echo.
echo What do you want to flash?
echo.
echo [1] App (system app or regular app)
echo [2] Kernel
echo.
echo Optional
echo.
echo [3] Reboot
echo [4] Visit project page
echo.
echo [79] exit
echo.
echo.
set /p choice=:
if "%choice%"=="1" goto app
if "%choice%"=="2" goto kernel
if "%choice%"=="3" goto rmenu
if "%choice%"=="4" goto ppage
if "%choice%"=="79" goto exit
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%choice%'.
pause
goto main
:kernel
cls
echo.
echo Enter kernel name (zImage or boot.img)
set /p kername= Kernel name:
echo.
echo Enter kernel partition number
echo As in (/dev/block/mmcblk0p*) where * is your number
set /p kernum= Kernel Partition Number:
echo.
cls
:kernelck
REM /*
REM * Display for rewiew
REM */
echo.
echo Kernel name: %kername%
echo FLash to : /dev/block/mmcblk0p%kernum%
echo.
set /p valid=Correct (y or n):
if "%valid%"=="y" goto kernelcont
if "%valid%"=="Y" goto kernelcont
if "%valid%"=="n" goto kernel
if "%valid%"=="N" goto kernel
set msg=Incorrent option
goto kernelck
:kernelcont
if not exist %kername% (
set returnto=kernel
goto nofile
)
echo.
echo Flashing %kername% to /dev/block/mmcblk0p%kernum%
adb push %kername% /sdcard/%kername%
adb -d shell su -c "dd if=/sdcard/%kername% of=/dev/block/mmcblk0p%kernum%"
echo.
echo Done! Rebooting Device...
echo.
adb reboot
pause
goto goagain
:app
set /p name=APK Name:
cls
echo.
echo APK Name: %name%
echo APK Type:
echo.
echo [1] System App (/system/app)
echo [2] Framework App (/system/framework)
echo [3] Regular App (/data/system)
echo.
set /p type=:
if "%type%"=="1" goto sysapp
if "%type%"=="2" goto frameapp
if "%type%"=="3" goto normapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%type%'.
pause
cls
goto app
:sysapp
if not exist %name% (
set returnto=app
goto nofile
)
adb push %name% /system/app/%name%
adb -d shell chmod 644 /system/app/%name%
cls
echo.
echo Do you want to reboot your device (y/n)?
echo.
set /p choice=:
if "%choice%"=="n" goto goagain
if "%choice%"=="N" goto goagain
if "%choice%"=="y" goto rmenu
if "%choice%"=="Y" goto rmenu
echo ERROR, no option found for '%choice%'
pause
goto sysapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%reboot%'.
pause
cls
goto sysapp
:frameapp
if not exist %name% (
set returnto=app
goto nofile
)
adb push %name% /system/framework/%name%
adb -d shell chmod 644 /system/framework/%name%
cls
echo.
echo Do you want to reboot your device (y/n)?
echo.
set /p choice=:
if "%choice%"=="n" goto goagain
if "%choice%"=="N" goto goagain
if "%choice%"=="y" goto rmenu
if "%choice%"=="Y" goto rmenu
echo ERROR, no option found for '%choice%'
pause
goto frameapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%reboot%'.
pause
cls
goto frameapp
:normapp
if not exist %name% (
set returnto=app
goto nofile
)
adb install %name%
goto goagain
:rmenu
cls
echo.
echo [1] Shutdown
echo [2] Reboot Normaly
echo [3] Reboot fast
echo [4] Reboot into Recovery
echo [5] Reboot into Bootloader (Download Mode)
echo [9] Main Menu
echo [79] Exit
echo.
set /p rmenu=:
if "%rmenu%"=="1" goto shutdown
if "%rmenu%"=="2" goto reboot
if "%rmenu%"=="3" goto rebootf
if "%rmenu%"=="4" goto rebootr
if "%rmenu%"=="5" goto rebootdl
if "%rmenu%"=="9" goto main
if "%rmenu%"=="79" goto exit
echo.
echo No option found for '%rmenu%'
pause
goto rmenu
:ppage
start http://broodplank.net/?p=729
goto main
:shutdown
echo.
echo Shutting down device.
adb shell reboot -p
goto goagain
:reboot
echo.
echo Rebooting Device Completely.
adb reboot
echo Done!
goto goagain
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
goto goagain
:rebootr
echo.
echo Rebooting Device into Recovery.
adb reboot recovery
goto goagain
:rebootdl
echo.
echo Rebooting Device into Bootloader (Download Mode)
adb reboot bootloader
goto goagain
:nofile
cls
echo.
echo ********************************
echo * That file could not be found *
echo ********************************
echo.
echo Press enter to try again.
set /p nofile=
goto %returnto%
:noadb
cls
echo.
echo ************************
echo * ADB was not detected *
echo ************************
echo.
echo Download?? (y/n)
set /p choice=:
if "%choice%"=="n" goto exit
if "%choice%"=="N" goto exit
if "%choice%"=="y" goto dl
if "%choice%"=="Y" goto dl
echo ERROR, no option found for '%choice%'
pause
goto noadb
:dl
cls
echo.
echo ************************
echo * ADB was not detected *
echo ************************
echo.
echo Downloading adb.rar from broodplank.net...
echo Extract it in: %~dp0
start http://broodplank.net/files/ADB.rar
pause
goto exit
:goagain
cls
echo.
echo Press m to go to the Main Menu,
echo Press any other key to exit.
echo.
set /p goagain=:
if "%goagain%"=="m" goto main
if "%goagain%"=="M" goto main
:exit
echo.
echo.
echo Exiting...
pause
exit
Really useful one..thank u..
Sent from my GT-I9001 using Tapatalk 2
VERY VERY NICE SCRIPT! Omg you're a monster
Inviato dal mio GT-I9001 che di originale non ha più nulla con la CyanogenMod RC1 usando Tapatalk 2.
lontu said:
Really useful one..thank u..
Sent from my GT-I9001 using Tapatalk 2
Click to expand...
Click to collapse
You're welcome
umb3rts said:
VERY VERY NICE SCRIPT! Omg you're a monster
Inviato dal mio GT-I9001 che di originale non ha più nulla con la CyanogenMod RC1 usando Tapatalk 2.
Click to expand...
Click to collapse
Haha, I develop all the time (like 90% of the time that I spend on my computer) so I have a lot of things like these. I will keep producing more and more without question
Usefull as always..
The tools and roms are growing like trees here. I cant update the index on androidworld so fast :silly:
I wish I had enough free time to spend on developing, i have some ideas sometime... but not enough time to learn/write, altough i'm a native Linux user. brood, you are fantastic as always
Inviato dal mio GT-I9001 che di originale non ha più nulla con la CyanogenMod RC1 usando Tapatalk 2.
if i may give you an idea:
you could write an app which does basically this
Code:
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
exit
untill now i had to kill system_server using terminal emulator.
Hey Brood.
Could you make something like a bat to get quick to my adb.exe? I hate it to cd through all the directorys to get to it.
Example:
I want to go to cmd.exe then type "adb" then for example "adb devices" and adb should start? Is that possible?
P.S: As always i love your work. The script is really nice and wellmade with the logo and etc
mrjraider said:
Usefull as always..
The tools and roms are growing like trees here. I cant update the index on androidworld so fast :silly:
Click to expand...
Click to collapse
Thanks and yes it's growing very fast idd!
umb3rts said:
I wish I had enough free time to spend on developing, i have some ideas sometime... but not enough time to learn/write, altough i'm a native Linux user. brood, you are fantastic as always
Inviato dal mio GT-I9001 che di originale non ha più nulla con la CyanogenMod RC1 usando Tapatalk 2.
Click to expand...
Click to collapse
The key is to not spend your computer time on gaming but on developing hehe (works for me). but if you don't have enough time it will become hard
And you're welcome ^^
dr.wtf said:
if i may give you an idea:
you could write an app which does basically this
Code:
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
exit
untill now i had to kill system_server using terminal emulator.
Click to expand...
Click to collapse
Of course I can make that, I'm in linux right now so when i'm back in windows, I will make the app and send it to you.
XeLLaR* said:
Hey Brood.
Could you make something like a bat to get quick to my adb.exe? I hate it to cd through all the directorys to get to it.
Example:
I want to go to cmd.exe then type "adb" then for example "adb devices" and adb should start? Is that possible?
P.S: As always i love your work. The script is really nice and wellmade with the logo and etc
Click to expand...
Click to collapse
Yes that can be achieved by adding: "cd /d %~dp0" in the batch script, the command will automatically cd to it's directory.
And you need to enter "adb shell" to enter the adb shell , else it will close.
adb shell > normal shell usage
adb -d shell ".." > command here
And you're welcome btw
broodplank1337 said:
Yes that can be achieved by adding: "cd /d %~dp0" in the batch script, the command will automatically cd to it's directory.
And you need to enter "adb shell" to enter the adb shell , else it will close.
adb shell > normal shell usage
adb -d shell ".." > command here
And you're welcome btw
Click to expand...
Click to collapse
Thank you very much!! :good:
Hey Brood do you know a nice howto about building an app wich base is a batch file ? Or is ot not possible to buold an android app with batch commands ?
Sent from my GT-I9001 using xda app-developers app
Diablob555 said:
Hey Brood do you know a nice howto about building an app wich base is a batch file ? Or is ot not possible to buold an android app with batch commands ?
Sent from my GT-I9001 using xda app-developers app
Click to expand...
Click to collapse
i think that its impossible because DOS uses its own functions. means that batch commands are especially for windows.
Sent from my GT-I9001 using xda app-developers app
So I'll need java commands ?
Sent from my GT-I9001 using xda app-developers app
What, you haven't updated it here? I feel offended! Na, just joking.
To people who don't know what I'm talking about: http://broodplank.net/?p=729
Sent from my GT-I9001 using xda app-developers app
stepie22 said:
What, you haven't updated it here? I feel offended! Na, just joking.
To people who don't know what I'm talking about: http://broodplank.net/?p=729
Sent from my GT-I9001 using xda app-developers app
Click to expand...
Click to collapse
True, well it's my site so it's not very strange if it gets priority but it's good that you take a look at my site, it has more hidden stuff
v1.4
Code:
@echo off
REM /*
REM * cd to the current directory
REM */
cd /d %~dp0
mode con:lines=30
REM /*
REM * Check if adb is available in the path variable, the default path or the current directory.
REM * Asks user if they want to download it if it is not found.
REM */
set found=
set quotedPath="%PATH:;="; "%"
set prog=adb.exe
for %%i in (%quotedPath%) do if exist %%i\%prog% set found=%%i
:adbdetected
REM /*
REM * Added incase usb isn't properly connected
REM */
title Universal Quick Flasher v1.04 - Waiting for device...
echo Waiting for device...
echo Please plugin android device with usb debugging enabled
adb wait-for-device
cls
adb root
adb remount
title Universal Quick Flasher v1.04
goto main
if not ""==%found% goto adbdetected
if exist adb.exe goto adbdetected
if exist "%programfiles%\Android\android-sdk\platform-tools\adb.exe" goto adbdetected
REM /*
REM * Added Windows 7 Default location for android-sdk
REM */
if exist "%USERPROFILE%\android-sdks\platform-tools\adb.exe" goto adbdetected
if exist "%USERPROFILE%\android-sdk\platform-tools\adb.exe" goto adbdetected
goto noadb
:main
cls
echo.
echo *************************************
echo * Universal Quick Flasher v1.04 *
echo * *
echo * By broodplank1337 *
echo * and *
echo * stepie22 *
echo * *
echo * All Filenames are CaseSensitive! *
echo *************************************
echo.
echo What do you want to flash?
echo.
echo [1] App (system app or regular app)
echo [2] Kernel
echo.
echo Optional
echo.
echo [3] Reboot
echo [4] Visit project page
echo.
echo [79] exit
echo.
echo.
set /p choice=:
if "%choice%"=="1" goto app
if "%choice%"=="2" goto kernel
if "%choice%"=="3" goto rmenu
if "%choice%"=="4" goto ppage
if "%choice%"=="79" goto exit
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%choice%'.
pause
goto main
:kernel
cls
echo.
echo Enter kernel name (zImage or boot.img)
set /p kername= Kernel name:
echo.
echo Enter kernel partition number
echo As in (/dev/block/mmcblk0p*) where * is your number
set /p kernum= Kernel Partition Number:
echo.
cls
:kernelck
REM /*
REM * Display for rewiew
REM */
echo.
echo Kernel name: %kername%
echo FLash to : /dev/block/mmcblk0p%kernum%
echo.
set /p valid=Correct (y or n):
if "%valid%"=="y" goto kernelcont
if "%valid%"=="Y" goto kernelcont
if "%valid%"=="n" goto kernel
if "%valid%"=="N" goto kernel
set msg=Incorrent option
goto kernelck
:kernelcont
if not exist %kername% (
set returnto=kernel
goto nofile
)
echo.
echo Flashing %kername% to /dev/block/mmcblk0p%kernum%
adb push %kername% /sdcard/%kername%
adb -d shell su -c "dd if=/sdcard/%kername% of=/dev/block/mmcblk0p%kernum%"
echo.
echo Done! Rebooting Device...
echo.
adb reboot
pause
goto goagain
:app
set /p name=APK Name:
cls
echo.
echo APK Name: %name%
echo APK Type:
echo.
echo [1] System App (/system/app)
echo [2] Framework App (/system/framework)
echo [3] Regular App (/data/system)
echo.
set /p type=:
if "%type%"=="1" goto sysapp
if "%type%"=="2" goto frameapp
if "%type%"=="3" goto normapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%type%'.
pause
cls
goto app
:sysapp
if not exist %name% (
set returnto=app
goto nofile
)
adb push %name% /system/app/%name%
adb -d shell chmod 644 /system/app/%name%
cls
echo.
echo Do you want to reboot your device (y/n)?
echo.
set /p choice=:
if "%choice%"=="n" goto goagain
if "%choice%"=="N" goto goagain
if "%choice%"=="y" goto rmenu
if "%choice%"=="Y" goto rmenu
echo ERROR, no option found for '%choice%'
pause
goto sysapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%reboot%'.
pause
cls
goto sysapp
:frameapp
if not exist %name% (
set returnto=app
goto nofile
)
adb push %name% /system/framework/%name%
adb -d shell chmod 644 /system/framework/%name%
cls
echo.
echo Do you want to reboot your device (y/n)?
echo.
set /p choice=:
if "%choice%"=="n" goto goagain
if "%choice%"=="N" goto goagain
if "%choice%"=="y" goto rmenu
if "%choice%"=="Y" goto rmenu
echo ERROR, no option found for '%choice%'
pause
goto frameapp
REM /*
REM * Display error if no valid option was chosen
REM */
echo Error, no option found for '%reboot%'.
pause
cls
goto frameapp
:normapp
if not exist %name% (
set returnto=app
goto nofile
)
adb install %name%
goto goagain
:rmenu
cls
echo.
echo [1] Shutdown
echo [2] Reboot Normaly
echo [3] Reboot fast
echo [4] Reboot into Recovery
echo [5] Reboot into Bootloader (Download Mode)
echo [9] Main Menu
echo [79] Exit
echo.
set /p rmenu=:
if "%rmenu%"=="1" goto shutdown
if "%rmenu%"=="2" goto reboot
if "%rmenu%"=="3" goto rebootf
if "%rmenu%"=="4" goto rebootr
if "%rmenu%"=="5" goto rebootdl
if "%rmenu%"=="9" goto main
if "%rmenu%"=="79" goto exit
echo.
echo No option found for '%rmenu%'
pause
goto rmenu
:ppage
start http://broodplank.net/?p=729
goto main
:shutdown
echo.
echo Shutting down device.
adb shell reboot -p
goto goagain
:reboot
echo.
echo Rebooting Device Completely.
adb reboot
echo Done!
goto goagain
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
goto goagain
:rebootr
echo.
echo Rebooting Device into Recovery.
adb reboot recovery
goto goagain
:rebootdl
echo.
echo Rebooting Device into Bootloader (Download Mode)
adb reboot bootloader
goto goagain
:nofile
cls
echo.
echo ********************************
echo * That file could not be found *
echo ********************************
echo.
echo Press enter to try again.
set /p nofile=
goto %returnto%
:noadb
cls
echo.
echo ************************
echo * ADB was not detected *
echo ************************
echo.
echo Download?? (y/n)
set /p choice=:
if "%choice%"=="n" goto exit
if "%choice%"=="N" goto exit
if "%choice%"=="y" goto dl
if "%choice%"=="Y" goto dl
echo ERROR, no option found for '%choice%'
pause
goto noadb
:dl
cls
echo.
echo ************************
echo * ADB was not detected *
echo ************************
echo.
echo Downloading adb.rar from broodplank.net...
echo Extract it in: %~dp0
start http://broodplank.net/files/ADB.rar
pause
goto exit
:goagain
cls
echo.
echo Press m to go to the Main Menu,
echo Press any other key to exit.
echo.
set /p goagain=:
if "%goagain%"=="m" goto main
if "%goagain%"=="M" goto main
:exit
echo.
echo.
echo Exiting...
pause
exit
I am posting my Windows command script that I use on my Evita for various ADB and FastBoot commands. Its not much, but it sure beats manually entering ADB and FastBoot commands.
Q&A
Q: But... There are already Android/HTC/Evita utilities.
A: I know there are already utilities out there, but guess what? I am an old school command line guy and don't give two $hits if your edit the script to your own liking or share it. :highfive:
Q: How often will you update the script?
A: Say what? That is entirely up to you! The code is below please share your updates here. :angel:
Requirements
Windows XP, 7, 8
Create Command File (Name it what ever you want dot cmd) for example ECs_Evita_Utility.CMD
Create Folder called ADB, and place adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll in the folder.
Create a folder called FB and place fastboot.exe, AdbWinApi.dll, AdbWinUsbApi.dll in the folder.
Run the script! (No admin rights required.)
Version Information
2013.24.8.2
General release.
[size=+2]This script is free to use or edit, and should be used at your own risk![/size]
Now that is out of the way, here is the script :fingers-crossed:
Code:
[user=279333]@ECHO[/user] Off
Set VSN=ECs Evita Utility 2013.24.8.2
Set CLRW=0C
Set CLRS=0A
Set CLRA=0E
Set CLRF=0B
Set CLRE=03
Set LogFile="%~dp0\Logs\Logfile.log"
Title %VSN%
If Not Exist "%~dp0\Logs" MD "%~dp0\Logs"
Cls
:War
Echo %VSN%
Color %CLRW%
Echo %Date% - %Time% : Warning Menu. >> %LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * Warning use at your own risk! *
Echo * *
Echo **************************************
Echo.
Echo Do you want to continue?
Echo.
Set /P WARV=Press [Y] for Yes and [N] for No: || Set WARV=NothingEntered
If "%WARV%"=="NothingEntered" Goto WAR
If /i "%WARV%"=="Y" Goto STR
If /i "%WARV%"=="N" Goto END
Goto WAR
:STR
Color %CLRS%
Echo %Date% - %Time% : Start Menu. >> %LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Start Menu = *
Echo * *
Echo * *
Echo **************************************
Echo.
Echo What do you want to use?
Echo.
Echo Press [A] for ADB
Echo Press [F] for Fastboot
Echo Press [E] to Exit
Echo.
Set /P STRV=Enter Choice: || Set STRV=NothingEntered
If "%STRV%"=="NothingEntered" Goto STR
If /i "%STRV%"=="A" Goto ADBSS
If /i "%STRV%"=="F" Goto FBS
If /i "%STRV%"=="E" Goto End
Goto STR
:ADBSS
Color %CLRW%
Cls
If not exist "%~dp0\ADB\ADB.exe" Goto ADBW
Echo %Date% - %Time% : Started ADB Server. >> %LogFile%
%~dp0\ADB\ADB.exe start-server
:ADBS
Color %CLRA%
Echo %Date% - %Time% : ADB Menu. >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Menu = *
Echo * *
Echo * Make sure your Android device *
Echo * debug mode is turned on! *
Echo * *
Echo **************************************
Echo.
Echo What do you want to do?
Echo.
Echo Press [1] to force reboot to Recovery
Echo Press [2] to force reboot to fastboot
Echo Press [3] to backup applications
Echo Press [4] to backup downloads
Echo Press [5] to backup camera photos
Echo Press [6] to backup pictures
Echo Press [7] to install applications
Echo Press [8] to uninstall applications
Echo Press [9] to install ROM
Echo Press [10] to copy to...
Echo Press [S] to go to the Start Menu
Echo Press [C] to force a device check
Echo Press [F] to go to the Fastboot Menu
Echo Press [E] to Exit
Echo.
Set /P ADBV=Enter Choice: || Set ADBV=NothingEntered
If "%ADBV%"=="NothingEntered" Goto ADBS
If "%ADBV%"=="1" Goto ADB1
If "%ADBV%"=="2" Goto ADB2
If "%ADBV%"=="3" Goto ADB3
If "%ADBV%"=="4" Goto ADB4
If "%ADBV%"=="5" Goto ADB5
If "%ADBV%"=="6" Goto ADB6
If "%ADBV%"=="7" Goto ADB7
If "%ADBV%"=="8" Goto ADB8
If "%ADBV%"=="9" Goto ADB9
If "%ADBV%"=="10" Goto ADB10
If /i "%ADBV%"=="S" Goto STR
If /i "%ADBV%"=="C" Goto ADBC
If /i "%ADBV%"=="F" Goto FBS
If /i "%ADBV%"=="E" Goto End
Goto ADBS
:ADBC
Echo %Date% - %Time% : ADB Checking Device State Menu. >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Check Device State = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking Device State. >> "%LogFile%
"%~dp0\ADB\ADB.exe" devices -l >> %LogFile%
"%~dp0\ADB\ADB.exe" devices -l
Echo.
Pause
Goto ADBS
:ADB1
Echo %Date% - %Time% : ADB Force to Recovery Menu. >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Force to Recovery = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Forcing device to Recovery. >> "%LogFile%
"%~dp0\ADB\ADB.exe" reboot recovery
Goto FBS
:ADB2
Echo %Date% - %Time% : ADB Force to Fastboot Menu. >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Force to Fastboot = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Forcing device to Fastboot. >> "%LogFile%
"%~dp0\ADB\ADB.exe" reboot bootloader
Goto FBS
:ADB3
Echo %Date% - %Time% : ADB Backup Applications. >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Backup Applications = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Applications Folder >> "%LogFile%
If exist "%~dp0\Backup\Applications" Echo %Date% - %Time% : Applications folder does exist. >> "%LogFile%
If not exist "%~dp0\Backup\Applications" Echo Echo %Date% - %Time% : Warning Applications folder does not exist! Creating Applications Folder. >> "%LogFile%
If not exist "%~dp0\Backup\Applications" MD "%~dp0\Backup\Applications"
Echo %Date% - %Time% : Starting Applications Backup. >> "%LogFile%
"%~dp0\ADB\ADB.exe" pull "./system/app" "%~dp0\Backup\Applications"
Echo %Date% - %Time% : Completed Application Backup. >> "%LogFile%
Goto ADBS
:ADB4
Echo %Date% - %Time% : ADB Backup Downloads Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Backup Downloads = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Downloads Folder >> "%LogFile%
If exist "%~dp0\Backup\Downloads" Echo Echo %Date% - %Time% : Downloads folder does exist. >> "%LogFile%
If not exist "%~dp0\Backup\Downloads" Echo Echo %Date% - %Time% : Warning Downloads folder does not exist! Creating Downloads Folder. >> "%LogFile%
If not exist "%~dp0\Backup\Downloads" MD "%~dp0\Backup\Downloads"
Echo %Date% - %Time% : Starting Downloads Backup. >> "%LogFile%
"%~dp0\ADB\ADB.exe" pull "./sdcard/downloads" "%~dp0\Backup\Downloads"
Echo %Date% - %Time% : Completed Downloads Backup. >> "%LogFile%
Goto ADBS
:ADB5
Echo %Date% - %Time% : ADB Backup Camera Photos Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Backup Camera Photos = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Camera Folder. >> "%LogFile%
If exist "%~dp0\Backup\Camera" Echo Echo %Date% - %Time% : Camera folder does exist. >> "%LogFile%
If not exist "%~dp0\Backup\Camera" Echo Echo %Date% - %Time% : Warning Camera folder does not exist! Creating Camera Folder. >> "%LogFile%
If not exist "%~dp0\Backup\Camera" MD "%~dp0\Backup\Camera"
Echo %Date% - %Time% : Starting Camera Photos Backup. >> "%LogFile%
"%~dp0\ADB\ADB.exe" pull "./sdcard/dcim/camera" "%~dp0\Backup\Camera"
Echo %Date% - %Time% : Completed Camera Photos Backup. >> "%LogFile%
Goto ADBS
:ADB6
Echo %Date% - %Time% : ADB Backup Pictures Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = ADB Backup Pictures = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Pictures for Camera Folder. >> "%LogFile%
If exist "%~dp0\Backup\Pictures" Echo Echo %Date% - %Time% : Pictures folder exist. >> "%LogFile%
If not exist "%~dp0\Backup\Pictures" Echo Echo %Date% - %Time% : Warning Pictures folder does not exist! Creating pictures folder. >> "%LogFile%
If not exist "%~dp0\Backup\Pictures" MD "%~dp0\Backup\Pictures"
Echo %Date% - %Time% : Starting Pictures Backup. >> "%LogFile%
"%~dp0\ADB\ADB.exe" pull "./sdcard/pictures" "%~dp0\Backup\Pictures"
Echo %Date% - %Time% : Completed Pictures Backup. >> "%LogFile%
Goto ADBS
:ADBW
Echo %Date% - %Time% : ADB Warning Menu >> "%LogFile%
Color %CLRW%
Cls
Echo.
Echo *****************************************************
Echo * *
Echo * Sorry ADB.exe does not exist in the ADB directory *
Echo * Please fix this issue before using this feature *
Echo * *
Echo *****************************************************
Echo.
If not exist "%~dp0\ADB\ADB.exe" Echo Echo %Date% - %Time% : Error ADB.exe does not exist! Check the ADB Folder. >> "%LogFile%
pause
Goto STR
:FBS
If not exist "%~dp0\FB\Fastboot.exe" Goto FBW
"%~dp0\FB\Fastboot.exe" continue
Color %CLRF%
Echo %Date% - %Time% : Fastboot Menu. >> %LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Menu = *
Echo * *
Echo * Make sure your Android device *
Echo * is in Fastboot mode! *
Echo * *
Echo **************************************
Echo.
Echo What do you want to do?
Echo.
Echo Press [1] to unlock device
Echo Press [2] to flash a new boot image
Echo Press [3] to flash a new recovery image
Echo Press [4] to Reboot device to Bootloader
Echo Press [5] to SuperCID device
Echo Press [6] to Set S-Off
Echo Press [7] to Update TP Firmware
Echo Press [8] to Downgrade TP Firmware
Echo Press [9] to Reboot device to OS
Echo Press [S] to go to the Start Menu
Echo Press [A] to go to the ADB Menu
Echo Press [E] to Exit
Echo.
Set /P FBV=Enter Choice: || Set FBV=NothingEntered
If "%FBV%"=="NothingEntered" Goto FBS
If "%FBV%"=="1" Goto FB1
If "%FBV%"=="2" Goto FB2
If "%FBV%"=="3" Goto FB3
If "%FBV%"=="4" Goto FB4
If "%FBV%"=="5" Goto FB5
If "%FBV%"=="6" Goto FB6
If "%FBV%"=="7" Goto FB7
If "%FBV%"=="8" Goto FB8
If "%FBV%"=="9" Goto FB9
If /i "%FBV%"=="S" Goto STR
If /i "%FBV%"=="A" Goto ADBSS
If /i "%FBV%"=="E" Goto End
Goto FBS
:FB1
Echo %Date% - %Time% : Fastboot Unlock Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Unlock = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Unlock Folder >> "%LogFile%
If exist "%~dp0\Install\Unlock" Echo Echo %Date% - %Time% : Unlock folder does exist. >> "%LogFile%
If not exist "%~dp0\Install\Unlock" Echo Echo %Date% - %Time% : Warning Unlock folder does not exist! Creating Unlock Folder. >> "%LogFile%
If not exist "%~dp0\Install\Unlock" MD "%~dp0\Install\Unlock"
Echo %Date% - %Time% : Checking for Unlock bin file >> "%LogFile%
If exist "%~dp0\Install\Unlock\Unlock_code.bin" Echo Echo %Date% - %Time% : Unlock bin file does exist. >> "%LogFile%
If not exist "%~dp0\Install\Unlock" Echo Echo %Date% - %Time% : Warning Unlock bin file does not exist! >> "%LogFile%
If not exist "%~dp0\Install\Unlock" Goto FBS
Echo %Date% - %Time% : Starting Unlock. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash unlocktoken "%~dp0\Install\Unlock\Unlock_code.bin"
Goto FB3
:FB2
Echo %Date% - %Time% : Fastboot Boot Flash Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Boot Flash = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Boot Folder >> "%LogFile%
If exist "%~dp0\Install\Boot" Echo Echo %Date% - %Time% : Boot folder does exist. >> "%LogFile%
If not exist "%~dp0\Install\Boot" Echo Echo %Date% - %Time% : Warning Boot folder does not exist! Creating Boot Folder. >> "%LogFile%
If not exist "%~dp0\Install\Boot" MD "%~dp0\Install\Boot"
Echo %Date% - %Time% : Checking for Boot image file >> "%LogFile%
If exist "%~dp0\Install\Boot\Boot.img" Echo Echo %Date% - %Time% : Boot image file does exist. >> "%LogFile%
If not exist "%~dp0\Install\Boot\Boot.img" Echo Echo %Date% - %Time% : Warning Boot image file does not exist! >> "%LogFile%
If not exist "%~dp0\Install\Boot\Boot.img" Goto FBS
Echo %Date% - %Time% : Starting Boot Flash. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash boot "%~dp0\Install\Boot\Boot.img"
Echo %Date% - %Time% : Completed Boot Flash. >> "%LogFile%
Pause
Goto FBS
:FB3
Echo %Date% - %Time% : Fastboot Boot Flash Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Recovery Flash = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Recovery Folder >> "%LogFile%
If exist "%~dp0\Install\Recovery" Echo Echo %Date% - %Time% : Recovery folder does exist. >> "%LogFile%
If not exist "%~dp0\Install\Recovery" Echo Echo %Date% - %Time% : Warning Recovery folder does not exist! Creating Recovery Folder. >> "%LogFile%
If not exist "%~dp0\Install\Recovery" MD "%~dp0\Install\Recovery"
Echo %Date% - %Time% : Checking for Recovery image file >> "%LogFile%
If exist "%~dp0\Install\Recovery\openrecovery-twrp-2.5.0.0-evita.img" Echo Echo %Date% - %Time% : Recovery image file does exist. >> "%LogFile%
If not exist "%~dp0\Install\Recovery\openrecovery-twrp-2.5.0.0-evita.img" Echo Echo %Date% - %Time% : Recovery image file does not exist! >> "%LogFile%
If not exist "%~dp0\Install\Recovery\openrecovery-twrp-2.5.0.0-evita.img" Goto FBS
Echo %Date% - %Time% : Starting Recovery Flash. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash recovery "%~dp0\Install\Recovery\openrecovery-twrp-2.5.0.0-evita.img"
Echo %Date% - %Time% : Completed Recovery Flash. >> "%LogFile%
Pause
Goto FBS
:FB4
Echo %Date% - %Time% : Fastboot Bootloader Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Bootloader = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Starting Fastboot boot. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" reboot-bootloader
Echo %Date% - %Time% : Completed Fastboot boot. >> "%LogFile%
Goto FBS
:FB5
Echo %Date% - %Time% : Fastboot SuperCID Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot SuperCID = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Starting SuperCID. >> "%LogFile%
Echo %Date% - %Time% : Writing SuperCID. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" oem writecid 11111111
Echo %Date% - %Time% : Rebooting into Bootloader. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" reboot-bootloader
"%~dp0\FB\Fastboot.exe" continue
Echo %Date% - %Time% : Getting CID Information. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" getvar cid >> "%LogFile%
"%~dp0\FB\Fastboot.exe" getvar cid
Echo.
Echo [It should confirm your CID is 11111111]
Pause
Echo %Date% - %Time% : Rebooting device >> "%LogFile%
"%~dp0\FB\Fastboot.exe" reboot
Echo %Date% - %Time% : Completed SuperCID. >> "%LogFile%
Goto FBS
:FB6
Echo %Date% - %Time% : Fastboot S-Off Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot S-Off = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Checking for Boot Folder >> "%LogFile%
If exist "%~dp0\Install\S-Off" Echo Echo %Date% - %Time% : S-Off folder does exist. >> "%LogFile%
If not exist "%~dp0\Install\S-Off" Echo Echo %Date% - %Time% : Warning S-Off folder does not exist! Creating Boot Folder. >> "%LogFile%
If not exist "%~dp0\Install\S-Off" MD "%~dp0\Install\S-Off"
Echo %Date% - %Time% : Checking for Boot image file >> "%LogFile%
If exist "%~dp0\Install\S-Off\PJ8312000-OneX.zip" Echo Echo %Date% - %Time% : Boot image file does exist. >> "%LogFile%
If not exist "%~dp0\Install\S-Off\PJ8312000-OneX.zip" Echo Echo %Date% - %Time% : Warning Boot image file does not exist! >> "%LogFile%
If not exist "%~dp0\Install\S-Off\PJ8312000-OneX.zip" Goto FBS
Echo %Date% - %Time% : Checking for S-Off file >> "%LogFile%
If exist "%~dp0\Install\S-Off\soffbin3" Echo Echo %Date% - %Time% : Boot image file does exist. >> "%LogFile%
If not exist "%~dp0\Install\S-Off\soffbin3" Echo Echo %Date% - %Time% : Warning Boot image file does not exist! >> "%LogFile%
If not exist "%~dp0\Install\S-Off\soffbin3" Goto FBS
Echo %Date% - %Time% : Starting S-Off. >> "%LogFile%
Echo %Date% - %Time% : Rebooting into RUU. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" oem rebootRUU
Echo.
Echo [Wait for black HTC Screen]
Pause
Echo %Date% - %Time% : Flashing Boot Image. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash zip "%~dp0\Install\S-Off\PJ8312000-OneX.zip"
Echo %Date% - %Time% : Wait for FAILED remote: 92 supercid! error. >> "%LogFile%
Echo.
Echo [Wait for FAILED remote: 92 supercid! error]
Pause
Echo %Date% - %Time% : Booting into boot image. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" oem boot
Echo.
Echo [You may see some errors, just wait for the device to boot into Android]
Echo.
Echo %Date% - %Time% : Starting ADB server. >> "%LogFile%
"%~dp0\ADB\ADB.exe" start-server
Echo %Date% - %Time% : Waiting for device. >> "%LogFile%
"%~dp0\ADB\ADB.exe" wait-for-device
Echo %Date% - %Time% : Checking device state. >> "%LogFile%
"%~dp0\ADB\ADB.exe" devices -l >> %LogFile%
"%~dp0\ADB\ADB.exe" devices -l
Echo.
Echo %Date% - %Time% : Uploading file to device. >> "%LogFile%
"%~dp0\ADB\ADB.exe" push "%~dp0\Install\S-Off\soffbin3" /data/local/tmp/
Echo %Date% - %Time% : Changing permissions of file. >> "%LogFile%
"%~dp0\ADB\ADB.exe" shell chmod 744 /data/local/tmp/soffbin3
Echo %Date% - %Time% : Updating security partition >> "%LogFile%
"%~dp0\ADB\ADB.exe" shell su -c "/data/local/tmp/soffbin3"
Echo %Date% - %Time% : Rebooting to bootloader >> "%LogFile%
"%~dp0\ADB\ADB.exe" reboot bootloader
Echo %Date% - %Time% : Completed S-Off >> "%LogFile%
Goto FBS
:FB7
Echo %Date% - %Time% : Fastboot TP Update Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot TP Update = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Starting TP Firmware Update. >> "%LogFile%
Echo %Date% - %Time% : Rebooting into RUU. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" oem rebootRUU
Echo.
Echo [Wait for black HTC Screen]
Pause
Echo %Date% - %Time% : Flashing TP Update Firmware. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash zip "%~dp0\Install\HBoot\upgrade_tp.zip"
Echo.
Echo [Wait for Finished]
Pause
Goto ADBSS
:FB8
Echo %Date% - %Time% : Fastboot TP Update Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot TP Downgrade = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Starting TP Firmware Downgrade. >> "%LogFile%
Echo %Date% - %Time% : Rebooting into RUU. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" oem rebootRUU
Echo.
Echo [Wait for black HTC Screen]
Pause
Echo %Date% - %Time% : Flashing TP Downgrade Firmware. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" flash zip "%~dp0\Install\HBoot\downgrade_tp.zip"
Echo.
Echo [Wait for Finished]
Pause
Goto ADBSS
:FB9
Echo %Date% - %Time% : Fastboot Reboot Menu >> "%LogFile%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Fastboot Reboot = *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Starting Reboot. >> "%LogFile%
"%~dp0\FB\Fastboot.exe" reboot
Echo %Date% - %Time% : Completed Reboot. >> "%LogFile%
Goto FBS
:FBW
Echo %Date% - %Time% : Fastboot Warning Menu >> "%LogFile%
Color %CLRW%
Cls
Echo.
Echo *********************************************************
Echo * *
Echo * Sorry Fastboot.exe does not exist in the FB directory *
Echo * Please fix this issue before using this feature *
Echo * *
Echo *********************************************************
Echo.
Echo Echo %Date% - %Time% : Error Fastboot.exe does not exist! Check the Fastboot Folder. >> "%LogFile%
pause
Goto STR
:End
Echo %Date% - %Time% : Killing ADB Server. >> %LogFile%
%~dp0\ADB\ADB.exe kill-server
Color %CLRE%
Cls
Echo.
Echo **************************************
Echo * *
Echo * %VSN% *
Echo * *
Echo * = Exit Menu = *
Echo * *
Echo * Sorry to see you go *
Echo * Thanks for using *
Echo * *
Echo **************************************
Echo.
Echo %Date% - %Time% : Exit Menu. >> %LogFile%
Pause
Hold :angel:
I like this, nice little script, I may take and port it to Linux for us Linux geeks. Good work on this.
mclovin926 said:
I like this, nice little script, I may take and port it to Linux for us Linux geeks. Good work on this.
Click to expand...
Click to collapse
Thanks, It originally grew from collecting various commands to do ADB and FastBoot functions in a text file. I persuaded my self to put together this script to make it easy doing it over and over. Over a few months It grew into the script you see now.
It would be nice to see Linux script when you get done with it. Post it up when you are done
Eventually I want to port my script into a PowerShell script. We will see if I get the time to do it.
Started porting over to PowerShell Its not as easy as command line, have to use a whole lot of functions and needs to be ran as an Administrator
Teaser
Code:
RunAdmin
New-EventLog –LogName Application –Source “ECs Evita Utility”
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Starting Script.”
MainMenu
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Exiting Script.”
ExitMenu
Edit
Working on it
Code:
#
#
#
#
#
#
function RunAdmin{
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
if ($myWindowsPrincipal.IsInRole($adminRole)){}Else{
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
$newProcess.Verb = "runas";
[System.Diagnostics.Process]::Start($newProcess);
}
if (!(Get-EventLog -LogName Application -Source "ECs Evita Utility")) {
New-EventLog –LogName Application –Source “ECs Evita Utility”
}
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Starting Script.”
FnFCheck
}
function FnFCheck {
$Folders = @(
".\ADB";
".\Backup";
".\Backup\Applications";
".\Backup\Camera";
".\Backup\Documents";
".\Backup\Downloads";
".\Backup\Pictures";
".\Downloads";
".\Downloads\ADK";
".\Downloads\Drivers";
".\FB";
".\Install";
".\Install\Applications";
".\Install\Boot";
".\Install\Drivers";
".\Install\HBoot";
".\Install\Recovery";
".\Install\ROM";
".\Install\S-Off";
".\Install\Unlock"
)
$Files = @(
".\ADB\adb.exe";
".\ADB\AdbWinApi.dll";
".\ADB\AdbWinUsbApi.dll";
".\FB\AdbWinApi.dll";
".\FB\AdbWinUsbApi.dll";
".\FB\fastboot.exe";
)
foreach ($Folder in $Folders){
if (!(Test-Path $Folder -pathType container)){
Write-Host $Folder -NoNewline; Write-Host " Does Not Exist!" -ForegroundColor Yellow
New-Item $Folder -Type Directory
}
}
foreach ($File in $Files){
if (!(Test-Path $File)){
Write-Host $File -NoNewline; Write-Host " Does Not Exist!" -ForegroundColor Red
Write-Host
}
}
MainMenu
}
function SDKDownload {
$AndroidSDK = "http://dl.google.com/android/adt/adt-bundle-windows-x86_64-20130729.zip"
$ADKDL = ".\Downloads\ADK\adt-bundle-windows-x86_64-20130729.zip"
if (!(Test-Path $ADKDL)){
$WC = New-Object System.Net.WebClient
Write-Host "Downloading Android Development Kit v.20130729" -ForegroundColor Green
Write-Host "Please Wait..."
$WC.DownloadFile($AndroidSDK, $ADKDL)
}
}
function MainMenu {
Clear-Host
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering Main Menu.”
Clear-Variable $MM
Clear-Host
Write-Host "Welcome to ECs Evita Utility"
Write-Host
Write-Host "Main Menu"
Write-Host
Write-Host "Enter [A] to go to ADB"
Write-Host "Enter [F] to go to FastBoot"
Write-Host "Enter [U] to go to Utilities"
Write-Host "Enter [E] to Exit"
$MM=Read-Host "Enter Selection"
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving Main Menu.”
If ($MM -eq "A"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB.”
ADB
}
If ($MM -eq "F"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot.”
FastBoot
}
If ($MM -eq "U"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected Utilities.”
Utilities
}
}
Until ($MM -eq "E")
ExitMenu
}
function ADB {
$ADBE = ".\ADB\adb.exe"
Clear-Host
&$ADBE start-server
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering ADB Menu.”
Clear-Variable $ADBM
Clear-Host
Write-Host "ECs Evita Utility"
Write-Host
&$ADBE devices -l
Write-Host
Write-Host "ADB Menu"
Write-Host
Write-Host "Enter [1] to go to "
Write-Host "Enter [2] to go to "
Write-Host "Enter [3] to go to "
Write-Host "Enter [4] to go to "
Write-Host "Enter [5] to go to "
Write-Host "Enter [6] to go to "
Write-Host "Enter [7] to go to "
Write-Host "Enter [8] to go to "
Write-Host "Enter [9] to go to "
Write-Host "Enter [E] to Exit"
$ADBM=Read-Host "Enter Selection"
If ($ADBM -eq "1"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 1.”
ADB1
}
If ($ADBM -eq "2"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 2.”
ADB2
}
If ($ADBM -eq "3"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 3.”
ADB3
}
If ($ADBM -eq "4"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 4.”
ADB4
}
If ($ADBM -eq "5"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 5.”
ADB5
}
If ($ADBM -eq "6"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 6.”
ADB6
}
If ($ADBM -eq "7"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 7.”
ADB7
}
If ($ADBM -eq "8"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 8.”
ADB8
}
If ($ADBM -eq "9"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 9.”
ADB9
}
}
Until($ADBM -eq "E")
&$ADBE kill-server
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving ADB Menu.”
}
function ADB1 {
Clear-Host
Write-Host ADB1 Selected
sleep 2
}
function ADB2 {
Clear-Host
Write-Host ADB2 Selected
sleep 2
}
function ADB3 {
Clear-Host
Write-Host ADB3 Selected
sleep 2
}
function ADB4 {
Clear-Host
Write-Host ADB4 Selected
sleep 2
}
function ADB5 {
Clear-Host
Write-Host ADB5 Selected
sleep 2
}
function ADB6 {
Clear-Host
Write-Host ADB6 Selected
sleep 2
}
function ADB7 {
Clear-Host
Write-Host ADB7 Selected
sleep 2
}
function ADB8 {
Clear-Host
Write-Host ADB8 Selected
sleep 2
}
function ADB9 {
Clear-Host
Write-Host ADB9 Selected
sleep 2
}
function FastBoot {
Clear-Host
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering FastBoot Menu.”
Clear-Variable $FBM
Clear-Host
Write-Host "ECs Evita Utility"
Clear-Host
Write-Host "FastBoot Menu"
Write-Host
Write-Host "Enter [1] to go to "
Write-Host "Enter [2] to go to "
Write-Host "Enter [3] to go to "
Write-Host "Enter [4] to go to "
Write-Host "Enter [5] to go to "
Write-Host "Enter [6] to go to "
Write-Host "Enter [7] to go to "
Write-Host "Enter [8] to go to "
Write-Host "Enter [9] to go to "
Write-Host "Enter [E] to Exit"
$FBM=Read-Host "Enter Selection"
If ($FBM -eq "1"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 1.”
FB1
}
If ($FBM -eq "2"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 2.”
FB2
}
If ($FBM -eq "3"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 3.”
FB3
}
If ($FBM -eq "4"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 4.”
FB4
}
If ($FBM -eq "5"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 5.”
FB5
}
If ($FBM -eq "6"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 6.”
FB6
}
If ($FBM -eq "7"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 7.”
FB7
}
If ($FBM -eq "8"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 8.”
FB8
}
If ($FBM -eq "9"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 9.”
FB9
}
}
Until($FBM -eq "E")
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving FastBoot Menu.”
}
function FB1 {
Clear-Host
Write-Host FB1 Selected
sleep 2
}
function FB2 {
Clear-Host
Write-Host FB2 Selected
sleep 2
}
function FB3 {
Clear-Host
Write-Host FB3 Selected
sleep 2
}
function FB4 {
Clear-Host
Write-Host FB4 Selected
sleep 2
}
function FB5 {
Clear-Host
Write-Host FB5 Selected
sleep 2
}
function FB6 {
Clear-Host
Write-Host FB6 Selected
sleep 2
}
function FB7 {
Clear-Host
Write-Host FB7 Selected
sleep 2
}
function FB8 {
Clear-Host
Write-Host FB8 Selected
sleep 2
}
function FB9 {
Clear-Host
Write-Host FB9 Selected
sleep 2
}
function Utilities {
Clear-Host
Write-Host "ECs Evita Utility"
Clear-Host
Write-Host "This is Utilities Menu"
Sleep 5
}
function ExitMenu {
Clear-Host
Write-Host "ECs Evita Utility"
Write-Host
Write-Host "Good Bye!"
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Exiting Script.”
Sleep 5
exit
}
RunAdmin
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
This is a tool to get screenshots from Recovery or the Aroma Installer!
It's no big secret in the XDA community that you can use ffmpeg to convert your framebuffer to an image on some devices. I've found the ffmpeg values for the Nexus 7 2013, and made a batch script that lets you save as many screenshots as you would like in recovery or the aroma installer. This should work on all versions of Windows. I have only tested in Windows 7 and running the modified TWRP for multirom, which is based off of TWRP 2.6.3.1. It should work with regular TWRP as well as other recoveries. Please let me know if it works or not and what set up you have!!!
Why would anyone use this or do this?
Most people have actually no use for it whatsoever. It's pretty much useful for tutorials, showing anomalies, and showing off custom recovery themes. I needed to do it one time to show what I thought was an error in my recovery, but hadn't seen anyone post how to do it on the Nexus 7 2013, or any 1200x1920 device for that matter. While searching how to do this I came across this thread by @Whiskey103 :good: I learned a lot of useful information.
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 ffmpeg is the newest 32-bit version from their downloads page. You must have adb.exe, ffmpeg.exe, and the two dll files for adb in the same directory as this batch when you run it. The easiest thing to do is just extract the rar to a new directory, then run the file named RUNrs.bat. The screenshots will be saved in the same folder you unzip everything as 'timestamp'.png.
Download Recovery Screenshot.rar
To see whats in the batch script hit the show more content button below. I don't recommend viewing it if you've ever used the phrase "cat your buffer" before:cyclops:
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 7 2013
ECHO and 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 N7 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 rgb565 -s 1216x1920 -i frmbfr -vf crop=1200:1920:0:0 -vframes 1 -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 rgb565 -s 1216x1920 -i frmbfr -vf crop=1200:1920:0:0 -vframes 1 -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 7 2013, congratulations for successfully pulling
ECHO the framebuffer. To figure out the resolution to use, try adding 4,8,16, or 32 to your native width to
ECHO make room for the extra data, ioctrls?, at the end of each pixel row. Experiment with different pixel
ECHO formats 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
Thanks make my like easy now lol
sorry, wrong thread
Thanks!! :laugh:
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