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 ;)
It requires adb in it's directory and the files you want to push as well.
Kernelflasher.bat:
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 ;)
It requires adb in it's directory and the files you want to push as well.
Kernelflasher.bat:
Code:
@echo off
adb root
adb remount
title Universal Quick Flasher
cls
echo.
echo ************************************
echo * Universal Quick Flasher v1.0 *
echo * By broodplank1337 *
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.
set /p choice=:
if "%choice%"=="1" goto app
if "%choice%"=="2" goto kernel
:kernel
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/mmcblk0px) where x is your number
set /p kernum=Kernel Partition Number:
echo.
cls
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
exit
:app
set /p name=APK Name:
cls
echo.
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
:sysapp
adb push %name% /system/app/%name%
adb -d shell chmod 644 /system/app/%name%
cls
echo.
echo Do you want to reboot your device?
echo.
echo [1] Yes, reboot my device completely
echo [2] Yes, reboot my device fast!
echo [3] No, Don't do anything
echo.
set /p reboot=:
if "%reboot%"=="1" goto reboot
if "%reboot%"=="2" goto rebootf
if "%rebooot%"=="3" goto rebootno
:reboot
echo.
echo Rebooting Device Completely.
adb reboot
echo Done!
exit
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
exit
:rebootno
echo.
echo Exiting..
exit
:frameapp
adb push %name% /system/framework/%name%
adb -d shell chmod 644 /system/framework/%name%
cls
echo.
echo Do you want to reboot your device?
echo.
echo [1] Yes, reboot my device completely
echo [2] Yes, reboot my device fast!
echo [3] No, Don't do anything
echo.
set /p reboot=:
if "%reboot%"=="1" goto reboot
if "%reboot%"=="2" goto rebootf
if "%rebooot%"=="3" goto rebootno
:reboot
echo.
echo Rebooting Device Completely.
adb reboot
echo Done!
exit
:rebootf
echo.
echo Rebooting Device Fast (kill system_server)
adb -d shell su -c "busybox killall system_server"
echo Done!
exit
:rebootno
echo.
echo Exiting..
exit
:normapp
adb install %name%