[SCRIPT] Common ADB/FASTBOOT Functions - Android General

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

Related

[Script]Universal Quick Flasher

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

[TOOL][WIN] Take screenshots of Recovery and Aroma

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:

dev work for aio tizen mod script

ok, so ive spent all day making this script
now most of it works except installing the bluetooth stack, and busybox
they do however work when this text is copied directly into sdb.exe
sdb shell
mount -o remount rw /
cd /home
rpm -ivh busybox-1.17.1-2.3.armv7l.rpm --nodeps --force busybox-1.17.1-2.3.armv7l.rpm
mount -o remount rw /
cd /home
rpm -ivh wrt-plugins-tizen.rpm --nodeps --force wrt-plugins-tizen.rpm
but, when i copy that same text into my script, it sticks at sdb shell, ive tried alsorts, for hours and its really doing my head in,
this is the script as a .bat
this is the code of my script in text
Code:
@ECHO OFF
ECHO WELCOME THE AIO FOR FLASHING ON TIZEN MOD
ECHO.
ECHO CREATED BY Gav83Collins
ECHO.
ECHO BEFORE WE START WE NEED TO CREATE SOME FOLDERS ONTO YOUR GEAR
ECHO.
PAUSE
ECHO IL NOW SET UP THOSE FOLDERS
PAUSE
cd "C:sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell setup-folder.sh
ECHO.
ECHO OK, DONE !!!
ECHO.
ECHO TO CLEAR THE SCREEN AND CONTINUE
PAUSE
CLS
:START
ECHO NOW TO CONTINUE FLASHING FONTS, THEMES, SOUNDS, MODS AND EXTENDED CAMERA
ECHO.
ECHO JUST
PAUSE
ECHO option 1 will flash sounds, theme, fonts only
ECHO option 2 will flash sounds, theme, fonts and mods. and camera
ECHO option 3 will flash mods only
ECHO option 4 will flash camera only
CHOICE /N /C:1234 /M "PICK A NUMBER (1, 2, 3 or 4)"%1
IF ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
:FOUR
ECHO YOU HAVE PRESSED FOUR
PAUSE
cd "C:sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb install "Camera1hour.wgt
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:THREE
ECHO YOU HAVE PRESSED THREE
PAUSE
cd "C:sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb push busybox-1.17.1-2.3.armv7l.rpm /home
sdb push wrt-plugins-tizen.rpm /home [user=279333]@ECHO[/user] OFF
CLS
ECHO PUSHED NOW INSTALL
PAUSE
GOTO INSTALL
:INSTALL
sdb shell
mount -o remount rw /
cd /home
rpm -ivh busybox-1.17.1-2.3.armv7l.rpm --nodeps --force busybox-1.17.1-2.3.armv7l.rpm
mount -o remount rw /
cd /home
rpm -ivh wrt-plugins-tizen.rpm --nodeps --force wrt-plugins-tizen.rpm
PAUSE
mount -o remount ro /
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:TWO
ECHO YOU HAVE PRESSED TWO
PAUSE
cd "C:sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell install-theme.sh
sdb push Alarm_Ticktac.ogg /opt/share/settings/Alarms/Ticktac.ogg
sdb shell install-alarms.sh
sdb push MyTone.ogg /opt/share/settings/Ringtones/
sdb push "MyAlert" /opt/share/settings/Alerts/
sdb push "C:UsersGavDownloadstizensdbbt_disconnect.ogg" /usr/share/feedback/sound/operation/bt_disconnect.ogg
sdb push "C:UsersGavDownloadstizensdbbt_connect.ogg" /usr/share/feedback/sound/operation/bt_connect.ogg
sdb install "Camera1hour.wgt
sdb shell mount -o remount rw /
sdb push busybox-1.17.1-2.3.armv7l.rpm /home
sdb push wrt-plugins-tizen.rpm /home
CLS
ECHO PUSHED NOW INSTALL
PAUSE
GOTO INSTALL
:INSTALL
sdb shell
mount -o remount rw /
cd /home
rpm -ivh busybox-1.17.1-2.3.armv7l.rpm --nodeps --force busybox-1.17.1-2.3.armv7l.rpm
mount -o remount rw /
cd /home
rpm -ivh wrt-plugins-tizen.rpm --nodeps --force wrt-plugins-tizen.rpm
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:eek:NE
ECHO YOU HAVE PRESSED ONE
PAUSE
cd "C:sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell install-theme.sh
sdb push Alarm_Ticktac.ogg /opt/share/settings/Alarms/Ticktac.ogg
sdb shell install-alarms.sh
sdb push MyTone.ogg /opt/share/settings/Ringtones/
sdb push "MyAlert" /opt/share/settings/Alerts/
sdb push "C:UsersGavDownloadstizensdbbt_disconnect.ogg" /usr/share/feedback/sound/operation/bt_disconnect.ogg
sdb push "C:UsersGavDownloadstizensdbbt_connect.ogg" /usr/share/feedback/sound/operation/bt_connect.ogg
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:END
PAUSE
ECHO.
ECHO Thanks for using, and enjoy
ECHO.
ECHO To reboot Watch
PAUSE
sdb shell reboot watch
exit
XDA:DevDB Information
aio tizen mod script, Tool/Utility for the Samsung Gear 2
Contributors
gav83collins
Version Information
Status: Testing
Created 2014-10-06
Last Updated 2014-10-06
ive figured it out
i create a .txt file contaning this
Code:
sdb root on
sdb shell mount -o remount rw /
sdb shell
cd /home
rpm -ivh wrt-plugins-tizen.rpm --nodeps --force wrt-plugins-tizen.rpm
mount -o remount rw /
cd /home
rpm -ivh busybox-1.17.1-2.3.armv7l.rpm --nodeps --force busybox-1.17.1-2.3.armv7l.rpm
exit
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
and place it in the sdb folder, and then in my script i tell it to open cammands from that txt file, and problem is solved
heres the finished code
Code:
@ECHO OFF
ECHO WELCOME TO THE AIO FOR FLASHING ON TIZEN MOD
ECHO.
ECHO CREATED BY Gav83Collins
ECHO.
ECHO BEFORE WE START WE NEED TO CREATE SOME FOLDERS ONTO YOUR GEAR
ECHO.
PAUSE
ECHO IL NOW SET UP THOSE FOLDERS
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell setup-folder.sh
ECHO.
ECHO OK, DONE !!!
ECHO.
ECHO TO CLEAR THE SCREEN AND CONTINUE
PAUSE
CLS
:START
ECHO NOW TO CONTINUE FLASHING FONTS, THEMES, SOUNDS, MODS AND EXTENDED CAMERA
ECHO.
ECHO JUST
PAUSE
ECHO option 1 will flash sounds, theme, fonts only
ECHO option 2 will flash sounds, theme, fonts and mods. and camera
ECHO option 3 will flash mods only
ECHO option 4 will flash camera only
CHOICE /N /C:1234 /M "PICK A NUMBER (1, 2, 3 or 4)"%1
IF ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
:FOUR
ECHO YOU HAVE PRESSED FOUR
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb install "Camera1hour.wgt
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:THREE
ECHO YOU HAVE PRESSED THREE
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb push busybox-1.17.1-2.3.armv7l.rpm /home
sdb push wrt-plugins-tizen.rpm /home
@ECHO OFF
CLS
ECHO PUSHED NOW INSTALL
PAUSE
GOTO INSTALL
:INSTALL
cd "C:\sdb"
sdb shell < commands.txt
PAUSE
mount -o remount ro /
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:TWO
ECHO YOU HAVE PRESSED TWO
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell install-theme.sh
sdb push Alarm_Ticktac.ogg /opt/share/settings/Alarms/Ticktac.ogg
sdb shell install-alarms.sh
sdb push MyTone.ogg /opt/share/settings/Ringtones/
sdb push "MyAlert" /opt/share/settings/Alerts/
sdb push "C:\Users\Gav\Downloads\tizen\sdb\bt_disconnect.ogg" /usr/share/feedback/sound/operation/bt_disconnect.ogg
sdb push "C:\Users\Gav\Downloads\tizen\sdb\bt_connect.ogg" /usr/share/feedback/sound/operation/bt_connect.ogg
sdb install "Camera1hour.wgt
cd "C:\sdb"
sdb shell < commands.txt
@ECHO OFF
CLS
ECHO PUSHED NOW INSTALL
PAUSE
GOTO INSTALL
:INSTALL
cd "C:\sdb"
sdb shell < commands.txt
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:eek:NE
ECHO YOU HAVE PRESSED ONE
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb shell install-theme.sh
sdb push Alarm_Ticktac.ogg /opt/share/settings/Alarms/Ticktac.ogg
sdb shell install-alarms.sh
sdb push MyTone.ogg /opt/share/settings/Ringtones/
sdb push "MyAlert" /opt/share/settings/Alerts/
sdb push "C:\Users\Gav\Downloads\tizen\sdb\bt_disconnect.ogg" /usr/share/feedback/sound/operation/bt_disconnect.ogg
sdb push "C:\Users\Gav\Downloads\tizen\sdb\bt_connect.ogg" /usr/share/feedback/sound/operation/bt_connect.ogg
ECHO.
ECHO OK, DONE !!!
ECHO.
CLS
ECHO option 1 GO BACK TO THE BEGINNING
ECHO option 2 REBOOT WATCH
CHOICE /N /C:12 /M "PICK A NUMBER (1 or 2)"%1
IF ERRORLEVEL ==2 GOTO END
IF ERRORLEVEL ==1 GOTO START
:END
PAUSE
ECHO.
ECHO Thanks for using, and enjoy
ECHO.
ECHO To reboot Watch
PAUSE
sdb shell reboot watch
exit
heres the batch file
and heres the .txt remember to place this in C:/sdb
then run the batch file

[SCRIPT] Bootanimation.zip Flasher

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

General Permission Denier Tool

Hey! This is like my first genuine post anywhere on XDA besides my introduction, but I got really fed up today with typing out ADB commands manually and created myself a little menu to deny permissions using APPOPS, and I decided to share it. This is a .BAT file or a Windows batch file. Make sure that if you want to use this script, you put it in the same folder as adb.exe. This should generally work for any Android device, not just the Galaxy A32 5G.
Code:
@echo off
:menu
set currentlocation=menu
echo Package Permission Denier by Platless.
goto appops
:appops
set currentlocation=appops
echo What is the name of the package?
set /p "packname=>"
adb shell pm list packages ^| grep -x package:%packname%
if %errorlevel% == 1 goto notapackage
adb shell appops get %packname% ^| grep -v deny > temp.txt
for %%I in (temp.txt) do echo %%~zI > output.txt
set /p size=<output.txt
del output.txt
if %size% == 0 goto noperms
setlocal ENABLEDELAYEDEXPANSION
set COUNT=0
for /F %%i in ( temp.txt ) do (
set /A COUNT=!COUNT! + 1
echo !COUNT!: %%i
set perm[!COUNT!]=%%i
set choice=!choice!!COUNT!
)
if %COUNT% LSS 10 (
choice /C %choice% /M "Type the number of the permission you want to deny."
set permnumber=!ERRORLEVEL!
) else set /P permnumber="Type the number of the permission you want to deny.: "
set permthing=!perm[%permnumber%]::= !
adb shell appops set %packname% %permthing% deny
del temp.txt
pause
goto %currentlocation%
:noperms
echo This app either doesn't have any permissions or they are all denied. Well done.
pause
goto menu
:notapackage
echo Package not found.
adb shell pm list packages ^| grep -w %packname% > didyoumean.txt
set /p didyoumean= <didyoumean.txt
for %%I in (didyoumean.txt) do echo %%~zI > size.txt
set /p size=<size.txt
del size.txt
del didyoumean.txt
if %size% == 0 goto %currentlocation%
echo Did you mean%didyoumean:package:= %?
goto %currentlocation%

Categories

Resources