5,600,919 Members 41,901 Now Online
XDA Developers Android and Mobile Development Forum
View Poll Results: Was this helpful?
Yes 50 94.34%
No 3 5.66%
Voters: 53. You may not vote on this poll

[GUIDE][HOW-TO] Create a windows one click tool with menus, options, etc!

Tip us?
 
eraste
Old
(Last edited by eraste; 11th April 2013 at 09:18 PM.)
#1  
eraste's Avatar
Recognized Contributor - OP
Thanks Meter 546
Posts: 1,039
Join Date: Aug 2011
Location: Griffin, Ga

 
DONATE TO ME
Smile [GUIDE][HOW-TO] Create a windows one click tool with menus, options, etc!

How to make a windows one click tool,

Featured on the XDA Portal! Check it out


Hello all I use these one click tools for just about everything. They make things simple. Today I will demonstrate how to make a simple one click tool to change the boot animation on your phone.

More advanced users and after you have mastered the basics check out post 2 for creating a multi tool with menus etc!

Remember please this is just a tutorial and you will have to edit it and create one specific for your device!
XDA Senior Member mnishamk has expanded upon this tutorial even further and made it automated! Check out his thread HERE.

I will be making this tool compatible with my Samsung galaxy note 2 with custom bootanimation support.

You should also know that some phones need to have custom bootanimation support for this tool to work such as samsung.
Also your phone must be rooted.

Disclaimer you try this at your own risk!

To learn more about ADB/Fastboot you can check out the tutorials I learned from:
[TUTORIAL] Everything about ADB - A reference for everyone Great guide by: Droidzone
[GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies This is a newer guide by: iamareebjamal he explains ADB, commands, uses, logcat and a few other goodies.
[GUIDE] ADB Workshop and Guide for everyoneAnother good guide to ADB by: Captainkrtek
Simple guide to ADB/FastbootEasy to follow adb/fastboot guide by: Andy

Files you will need are included in this zip:
Bootaniflasher.zip

It contains:
Adb.exe – file needed for adb to function
Adbwinapi.dll – needed for windows
Adbwinusbapi – needed for windows
Fastboot.exe – needed for some mods
Bootani.bat – the one click file that runs your script

Programs you will need:
Standard windows notepad

What is so great about this, the only thing you will need to create/edit is the bootani.bat file! Also it is so simple that after reading this tutorial a cave man could do it!

Creating the bootani.bat file:

1. open a blank notepad page
2. click file/save as then type in bootani.bat leave the type as a text
document and encoding to ansi.


3. Now to write the script that will actually change the bootanimation

In the open notepad
Type the following information so that it looks like the screenshot:


ECHO is used to put text on the UI screen similar to the ui_print function in an updater script.

Code:
@ECHO OFF
COLOR 9b -  this is the color of the UI -  for a list of these click here
ECHO.
ECHO one click bootanimation flasher – title of the one click tool
ECHO. ends the text
ECHO  By: XDA Eraste – you can put whatever you want here or leave it out..
ECHO. 
ECHO.
ECHO. Adding space between text that appears by typing more ECHO. lines
ECHO  Use this at your own risk! – simple disclaimer
ECHO.
ECHO  By pressing enter you understand the risks – disclaimer
ECHO. 
ECHO.
ECHO make sure your phone has usb debugging mode enabled! - information
ECHO.
ECHO.
ECHO make sure you put your custom bootanimation.zip file in this folder – info 
ECHO.
PAUSE – this means nothing else will happen until user presses enter, any button
ECHO Loading files and preparing to send – simple information that displays
ECHO.
adb wait-for-device   - this tells adb to wait until user has connected the phone
ECHO sending bootanimation  - simple information that is displayed
ECHO.
adb push bootanimation.zip /system/media/bootanimation.zip -  script that installs           
the bootanimation! 
ECHO Almost finished – more info
ECHO. 
ECHO finished rebooting! 
adb reboot – tells the phone to restart this allows you to make sure changes stuck
ECHO thanks for using this script
ECHO.
PAUSE
EXIT -  closes the UI
4. Now click file/save
5. Put this bootani.bat file in your folder containing the above files also
6. Now find a custom bootanimation that you would like use and place the
bootanimation.zip in this folder also.
7. To test your new script plug up your phone make sure usb debugging is
enabled then double click the bootani.bat file and follow your on screen
directions!

If you did everything correct the above settings will create a crisp blue UI like this:


This tutorial and attached files will work on the Samsung galaxy note 2 with custom bootanimation support!

You can edit this bootani.bat to whatever you would like. For instance you can use a one click tool to reinstall all your apps after you flash a new rom!

There really are endless possibilities with one click tools and you can customize the UI, script, etc to your liking.

Those other processes are a little more in depth but virtually the same process in creating them.

You can name the bootani.bat file to whatever you like and customize the UI in whatever way you like by following the template above. The only things that will change in creating other types of one click tools are the scripts that you type into the notepad file.

Common places of bootanimation files:
Samsung: if custom bootanimation is supported by your rom usually in /system/media
HTC: /system/customize/resource

Note: On other devices such as HTC custom bootanimation support is not necessary as they use the standard .zip for the animation you can change them simply by typing the original name of the boot zip in your script. Example The ATT HTC one x stock boot zip file is named ATT_bootanimation.zip. So you can rename your custom one to this name stick it in your folder then change the one click script to reflect this name and voila!

Bootanimations can be changed on rooted phones only!

Hopefully this will help some of your newer people in gaining a bigger interest in creating cool programs that you can use on your own!

Hit thanks if this helped you learn something new!
Create Your own windows multi tool!
Android live wallpapers

Like Us on Facebook
Follow on Twitter
 
Device:
Samsung Galaxy S4 (ATT) SGH-i337
OS: Cleanrom 1.0 ATT
Baseband: MDL
Android: 4.2.2
Recovery: OUDHS CWM-based 1.0.3.4
The Following 31 Users Say Thank You to eraste For This Useful Post: [ Click to Expand ]
 
eraste
Old
(Last edited by eraste; 24th March 2013 at 11:07 PM.)
#2  
eraste's Avatar
Recognized Contributor - OP
Thanks Meter 546
Posts: 1,039
Join Date: Aug 2011
Location: Griffin, Ga

 
DONATE TO ME
Here I will explain some other "common" uses for the one click tool.

Using the same principals above:

The one command that should always be in your script file:
adb wait-for-device – remember this tells the program to wait until the device as been connected and detected.


You can use your one click tool to do many things: *WARNING The following procedures are dangerous and can potentially brick your device. Please experiment with easier things before trying your hand at boot.img’s, etc!

1. Flash a kernel/boot.img for HTC devices or those that use a bootloader. This will not work on Samsung devices or devices that
take “tricks” to get into fastboot or the bootloader. In addition to root, Also this requires your device's bootloader to be unlocked!

You will need to have your kernel/boot.img file in the folder just like the
bootanimation.zip file as before. Anything you want to flash needs to be in this
folder. Not in any subfolders just inside the root folder!

A. While writing the script in your bootani.bat ( or whatever you named it) file from above. You will leave out the bootanimation stuff
and add this:
B. Script the bat file as normal then use these commands instead of the others from above to flash: so the script should look
something like this:

Code:
ECHO.
ECHO Press any key to continue
ECHO.
PAUSE.
adb wait-for-device
adb reboot bootloader  -  this command will get you into fastboot. Make sure by looking at your phones screen it says fastboot usb or   
                                    something similar indicating you are in fastboot.
ECHO Rebooting to fastboot please wait and do not touch device!
ECHO.
fastboot flash boot boot.img  - this is the command that will actually flash the kernel/ boot.img file
ECHO.
ECHO.
ECHO Finished you can now exit this tool and reboot the phone to recovery or the os
ECHO.
ECHO.
EXIT
If a dev has named this kernel/boot.img file to something else ending in .img, .elf, etc make sure you type in the correct name. Such as elekernel.img you would type in the command line the elekernel.img name instead of boot.img so it should look like this:

Code:
fastboot flash boot elekernel.img
your kernel can also be named kernel.elf, etc depending on what type of phone you are using. Just make sure to change boot.img to whatever the name of the file is you want to flash.

Then you can continue scripting your bat file to your liking!

2. This is my favorite! This procedure is harmless if done right but I must say it is still dangerous and you accept the risk if you
decide to do it. This only requires your phone to be rooted!

I have a set of ringtones, alarm sounds, ui, sounds, and notification tones that I use on every phone. So instead of putting them in folders on my sd card or phone storage, I use my one click tool to install them to the system directories so that they show up in the stock ringtone, notification, alarm, etc selection methods.

A. Take your bat file from above name it whatever you like I use: mysounds.bat
B. Take the sounds you would like to flash and put them in your folder containing the adb files, bat file, etc.
C. Script your bat file as normal but leave out the bootanimation stuff. Instead add the following commands: so that it looks something
like this:

Code:
ECHO.
ECHO Press any key to continue
ECHO.
PAUSE
adb wait-for-device
ECHO sending your media files please wait and do not touch the phone!
ECHO.
adb push yoursoundsname.mp3 /system/media/audio/ringtones/yoursoundsname.mp3

Now remember the path to your system ringtones etc, may be different depending on the type of phone you have. The above location will work for samsung note 2 and the HTC one X This path is the most common path but still it depends on your phone. Simply use your file explorer and navigate your system folder until you find the path you need and type it in the command line instead of what I have above. 

Repeat the above command line until you have all the tones you are flashing added into your bat file

adb push yoursoundsname.mp3 /system/media/audio/ringtones/yoursoundsname.mp3
adb push yoursoundsname1.mp3 /system/media/audio/ringtones/yoursoundsname1.mp3

adb push yoursoundsname2.mp3 /system/media/audio/notifications/yoursoundsname2.mp3 
the above one will go into the notification folder for say your favorite SMS tone instead of the ringtone folder

adb push yoursoundsname.ogg /system/media/audio/ui/Lock.ogg <-- AH you see something new! This command will change your screen lock sound to whatever file you want it! This file must be in .ogg format! Make sure its no longer than about 1 second. Or you can get a terrible AudioOut_02 wakelock or similar that will drain your battery!
ECHO finished. Rebooting so changes take effect. After phone reboots you may unplug it
ECHO.
adb reboot
ECHO.
ECHO Thanks
ECHO.
EXIT

As you can see the combinations are endless with the one click tool!

Enjoy



Creating a multi tool with a menu and selectable options!!!!!

Now I will expand the above guides and show you how to make your very on multi tool with a menu and options!
You can download this multitool.zip to use as a guide.

It contains this bat file as well as a bootanimation.zip and an mp3 in the ringtones folder. Simply extract it as before and open it up.

So lets begin.

What are we going to do? We will make a multi tool that will open a few webpages, flash a new bootanimation, or send some ringtones to your sdcard.

First we create a bat file as before. You can name it whatever you like.

Then we use this script to make the new tool: Ill explain the script below

Code:
ECHO OFF
color 9f
CLS
:MENU
CLS
ECHO.
ECHO Before you start make sure your phone has USB Debugging enabled!
ECHO.
ECHO.
ECHO .... One CLick Multi Tool ....
ECHO    Make your selection below
ECHO ..............................
ECHO.
ECHO 1 - Visit XDA
ECHO 2 - Visit Scotts ROMS
ECHO 3 - Visit EMBLWPDesign
ECHO.
ECHO 4 - Flash a new bootanimation: make sure your custom bootanimation
ECHO     is in the bootani folder and named bootanimation.zip!
ECHO 5 - Flash New Ringtones
ECHO 6 - Exit this tool
ECHO.
ECHO 7 - Reboot Device 
ECHO.
ECHo.
SET /P M=Type your choice then press ENTER:
IF %M%==1 GOTO XDA
IF %M%==2 GOTO SROMS
IF %M%==3 GOTO EMB
IF %M%==4 GOTO BA
IF %M%==5 GOTO RT
IF %M%==6 GOTO EOF
IF %M%==7 GOTO RD
:XDA
START "" "http://www.xda-developers.com"
GOTO MENU
:SROMS
START "" "http://www.scottsroms.com"
GOTO MENU
:EMB
START "" "http://www.emblwpdesign.com"
GOTO MENU
:BA
adb wait-for-device
adb push bootani/bootanimation.zip /system/media
GOTO MENU
:RT
adb wait-for-device
adb push ringtones /storage/extSdCard/ringtones
GOTO MENU
:RD
adb wait-for-device
adb reboot
GOTO MENU
This will give us a multi tool with a menu were you can select what to do!

:MENU starts the menu making process as an anchor.

ECHO 1 - Visit XDA this will be option one on the menu simple coding! Followed by options 2 and 3 then a space with ECHO. then option 4 through 6 followed by another space using ECHO. finally option 7.

The next bit of menu code that will be different than the regular batch file is the variables!

SET /P M=Type your choice then press ENTER: - this line is were the user will input their selection
IF %M%==1 GOTO XDA - this line begins your variables, so if 1 is selected the script will jump to anchor :XDA and run from there. You can have as many variables as you would like.

Make sure your GOTO ??? command and the anchor later in the script :??? are the same for each variable as above in the script.

Now execution of the selection:

:XDA this line is an anchor for selection 1.
under your anchor you type what you want the script to do then you type GOTO MENU so that the user is taken back to the menu.
You can have the tool exit after any selection you would like. So for instance if I wanted the script to close after the user selected option 1 I would instead of typing GOTO MENU type EXIT

You would repeat this process using the above script as a guide until you had your multi tool the way you wanted it!

With the multi tool you can have things in folders inside the root folder as long as you add the correct path to the items as in the script above with the bootanimation.zip. You see it is located in /bootani within the root folder.

Your knew tool with a menu should look like this: Without option 8. Thats coming later!



Creating these tools with multiple menus!

Ok now you guys should pretty much have the basics of making these tools down. Creating multiple menu's in these tools is just as easy as anything else.

This tool I created will show you that function:
Download appbackup tool. This tool is complete and will work. You can use it, modify it how you want etc.

The code contained in the batch file from the backup tool is as follows with multiple menus:

Code:
ECHO OFF
color 9f
CLS
:MENU
CLS
ECHO.
ECHO                   ..................................
ECHO                          One click app backup
ECHO                       Make your selection below
ECHO                   ..................................
ECHO                        Developed by: XDA Eraste
ECHO                   ..................................
ECHO                          One click app backup 
ECHO                              and restore
ECHO                   ..................................
ECHO.
ECHO.
ECHO. 
ECHO            Please review the readme file before continuing.
ECHO.
ECHO      This tool is safe however I cannot take responsibility should 
ECHO  anything negative happen to your phone. Use this tool at your own risk.
ECHO.
ECHO 1 - Continue
ECHO 2 - Exit tool
ECHO 3 - Readme File 
ECHO 4 - Credits/Share policy
ECHO.
SET /P M=Type your choice then press ENTER:
IF %M%==1 GOTO MENU1
IF %M%==2 GOTO EOF
IF %M%==3 GOTO RED
IF %M%==4 GOTO MENU2
:RED
ECHO.
START readme.txt
GOTO MENU
:MENU1
color 9f
CLS
ECHO.
ECHO                     ...............................
ECHO                                Main Menu
ECHO                     ...............................
ECHO.
ECHO.
ECHO.
ECHO 1 - Backup apps  - This will only backup the apps not the
ECHO                    data. Use this for a "fresh" app install
ECHO                    after flashing a new rom, etc.
ECHO.
ECHO 2 - Restore apps - Remember no data will be restored these
ECHO                    will be "fresh" apps.
ECHO.
ECHO 3 - Exit tool
ECHO 4 - Reboot Device
ECHO 5 - Return to previous menu
ECHO.
SET /P M=Type your choice then press ENTER:
IF %M%==1 GOTO BUP
IF %M%==2 GOTO RES
IF %M%==3 GOTO EOF
IF %M%==4 GOTO REB
IF %M%==5 GOTO MENU
:BUP
ECHO Backing up apps to backup folder that will be created here.
ECHO.
ECHO This can take a while depending on how many apps you have
ECHO Press enter to continue
ECHO.
PAUSE
adb wait-for-device
adb pull /data/app ./backup
ECHO.
ECHO Backup finished Press Enter
ECHO.
PAUSE
GOTO MENU1
:RES
ECHO.
ECHO  Restoring apps please wait this can take a while!
ECHO  Hit enter to continue.
ECHO.
adb wait-for-device
adb install backup/*.apk
ECHO.
ECHO Finished Restoring apps. You can reboot now and apps should 
ECHO show up in Google Play as installed.
PAUSE
GOTO MENU1
:REB
ECHO.
ECHO  Are you sure you want to reboot device?
PAUSE
adb wait-for-device
adb reboot
ECHO.
ECHO Rebooting press any key to return to the menu.
PAUSE
GOTO MENU1
:MENU2
CLS
COLOR 04
ECHO.
ECHO                 ...........................................
ECHO                 Credits/Share policy please check them out!
ECHO                 ...........................................
ECHO.
ECHO 1 - Visit XDA
ECHO 2 - Visit ScottsROMS
ECHO 3 - Visit EMB LWP Design - My site
ECHO 4 - Return to main menu
ECHO.
ECHO               .......................................
ECHO                             Share Policy
ECHO                  This tool created by eraste @ XDA 
ECHO               For all its users. Feel free to use this
ECHO                tool at will. If you use portions of it 
ECHO                to make your own all I ask is that you 
ECHO                    acknowlege myself a little.
ECHO                               Credits:
ECHO                        Developed by: Eraste
ECHO                   Backup script: Scott @scottsroms
ECHO                       Restore script: Eraste
ECHO                          Knowledge: XDA
ECHO               ........................................
ECHO.
SET /P M=Type your choice then press ENTER:
IF %M%==1 GOTO XDA
IF %M%==2 GOTO SR
IF %M%==3 GOTO EMB
IF %M%==4 GOTO MENU1
:XDA
ECHO.
START "" "http://forum.xda-developers.com/index.php"
GOTO MENU2
:SR
ECHO.
START "" "http://www.scottsroms.com/content.php"
GOTO MENU2
:EMB
START "" "http://www.emblwpdesign.com/"
GOTO MENU2
With this code sample and the knowledge you have gained from the previous two tutorials adding your own menus should be a breeze!

As you can see in the code the starting menu label is :MENU
The second menu or main menu is :MENU1
And the third or "credits" menu is :MENU2

In the code you can see the commands used to return users to whatever menu you choose, insert a option that the user can type to go to another menu, etc.

This command is just as before in the above tutorials.

GOTO ????

replacing the ? marks with whichever menu you want. So in example in this tool once a user backs up their apps they are returned to the same menu which is MENU1 after hitting enter.

Another cool thing you can do is have one menu different colors than the others. For instance in this tool the start menu and main menu are blue with white text. The credits menu is black with red text. You can see this command above in the script under :MENU2 as COLOR 04.

A link to the page with different color combinations is located in the OP.

Now for what it looks like:

Start menu:


Main menu:


Credit menu: Sorry my computer screen and cam didnt play nice with the dark theme of this one! Looks good on the pc though.


As usual good luck and if anyone needs help don't hesitate to ask. Also these codes, tools, etc are for everyone to use as they please simple credit is all I ask if you use a portion when designing your own.
Create Your own windows multi tool!
Android live wallpapers

Like Us on Facebook
Follow on Twitter
 
Device:
Samsung Galaxy S4 (ATT) SGH-i337
OS: Cleanrom 1.0 ATT
Baseband: MDL
Android: 4.2.2
Recovery: OUDHS CWM-based 1.0.3.4
The Following 22 Users Say Thank You to eraste For This Useful Post: [ Click to Expand ]
 
Flashalot
Old
#3  
Flashalot's Avatar
Recognized Contributor
Thanks Meter 1806
Posts: 2,000
Join Date: Jun 2012
Location: Chicago
Thanks for this now testing it with some stuff for my evo3D
 
eraste
Old
#4  
eraste's Avatar
Recognized Contributor - OP
Thanks Meter 546
Posts: 1,039
Join Date: Aug 2011
Location: Griffin, Ga

 
DONATE TO ME
Default Re: [GUIDE][HOW-TO] Create a windows one click tool!

Quote:
Originally Posted by Flashalot View Post
Thanks for this now testing it with some stuff for my evo3D
Easy wasnt it!

Note 2 ftw
Create Your own windows multi tool!
Android live wallpapers

Like Us on Facebook
Follow on Twitter
 
Device:
Samsung Galaxy S4 (ATT) SGH-i337
OS: Cleanrom 1.0 ATT
Baseband: MDL
Android: 4.2.2
Recovery: OUDHS CWM-based 1.0.3.4
The Following User Says Thank You to eraste For This Useful Post: [ Click to Expand ]
 
Rittik
Old
#5  
Rittik's Avatar
Senior Member
Thanks Meter 760
Posts: 1,319
Join Date: Nov 2011
Location: Kolkata

 
DONATE TO ME
Default Re: [GUIDE][HOW-TO] Create a windows one click tool!

Real easy worked like a treat!.
good guide for new users thanks mate

-Rik[Rittik]
For Donations to My Indian Paypal

Paypal Email- rittik.main@gmail.com
1)Send Money
2)I'm paying for goods or services (Please enter amount to Donate.)
 
GEKTHEBOSS
Old
#6  
GEKTHEBOSS's Avatar
Senior Member
Thanks Meter 2975
Posts: 1,989
Join Date: Mar 2012

 
DONATE TO ME
Default R: [GUIDE][HOW-TO] Create a windows one click tool!

Yeah very useful!
Thanks hitted!
 
eraste
Old
#7  
eraste's Avatar
Recognized Contributor - OP
Thanks Meter 546
Posts: 1,039
Join Date: Aug 2011
Location: Griffin, Ga

 
DONATE TO ME
Quote:
Originally Posted by Rittik View Post
Real easy worked like a treat!.
good guide for new users thanks mate

-Rik[Rittik]
Quote:
Originally Posted by GEKTHEBOSS View Post
Yeah very useful!
Thanks hitted!
Anyone who reads and learns from the ADB/fastboot tutorials can implement those commands here to in the one click tool. Like flashing custom recoveries, boot.img's, etc all will work via the one click tool! Anyway guys don't forget to rate the thread and submit it for news worthiness!
Create Your own windows multi tool!
Android live wallpapers

Like Us on Facebook
Follow on Twitter
 
Device:
Samsung Galaxy S4 (ATT) SGH-i337
OS: Cleanrom 1.0 ATT
Baseband: MDL
Android: 4.2.2
Recovery: OUDHS CWM-based 1.0.3.4
 
GEKTHEBOSS
Old
#8  
GEKTHEBOSS's Avatar
Senior Member
Thanks Meter 2975
Posts: 1,989
Join Date: Mar 2012

 
DONATE TO ME
Default R: [GUIDE][HOW-TO] Create a windows one click tool!

You can also put in op some usefull commands like fastboot reboot,fastboot flash boot boot.img or kernel.elf and also like chmod chown adb etc!
 
eraste
Old
#9  
eraste's Avatar
Recognized Contributor - OP
Thanks Meter 546
Posts: 1,039
Join Date: Aug 2011
Location: Griffin, Ga

 
DONATE TO ME
Quote:
Originally Posted by GEKTHEBOSS View Post
You can also put in op some usefull commands like fastboot reboot,fastboot flash boot boot.img or kernel.elf and also like chmod chown adb etc!
I was thinking about that to but then I thought with all the ADB/fastboot tutorials around here would that be necessary? Hmm maybe Add links in the op to those great tutorials were I learned couldn't hurt! Nice suggestion and I think I will add a few of the more common ones as you mentioned!
Create Your own windows multi tool!
Android live wallpapers

Like Us on Facebook
Follow on Twitter
 
Device:
Samsung Galaxy S4 (ATT) SGH-i337
OS: Cleanrom 1.0 ATT
Baseband: MDL
Android: 4.2.2
Recovery: OUDHS CWM-based 1.0.3.4
 
GEKTHEBOSS
Old
#10  
GEKTHEBOSS's Avatar
Senior Member
Thanks Meter 2975
Posts: 1,989
Join Date: Mar 2012

 
DONATE TO ME
Default R: [GUIDE][HOW-TO] Create a windows one click tool!

Quote:
Originally Posted by eraste View Post
I was thinking about that to but then I thought with all the ADB/fastboot tutorials around here would that be necessary? Hmm maybe Add links in the op to those great tutorials were I learned couldn't hurt! Nice suggestion and I think I will add a few of the more common ones as you mentioned!
Ok ,2nd post http://forum.xda-developers.com/show....php?t=1241935

The Following User Says Thank You to GEKTHEBOSS For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes