Custom app/wgt backup : Dev work - Samsung Gear 2

CUSTOM APP/WGT BACKUP : DEV WORK
REMEMBER THIS IS A WIP
This thread is for the development , help, contributions and testing of a script to back up the custom apps and wgt's of our tizen powered
gear , gear 2, gear 2 neo
heres what ive got so far to pull
Code:
@ECHO OFF
ECHO THIS GEAR PULL .BAT WAS CREATED BY GAV83COLLINS
ECHO.
ECHO ITS DESIGNED FOR TIZEN POWERED SAMSUNG GEARS
ECHO AND WILL NOT EFFECT YOUR GEAR IN ANYWAY
ECHO.
ECHO TO START, FIRST WE NEED TO CREATE THE DIRECTORIES NEEDED TO PULL TO
ECHO.
PAUSE
md "C:\sdb\optshareapplications"
md "C:\sdb\optusrapps"
md "C:\sdb\optsharepackages"
md "C:\sdb\usrsharepackages"
md "C:\sdb\usr/apps"
ECHO OK THATS DONE!!!!
ECHO.
ECHO NOW TO CONTINUE RIPPING FOLDERS
ECHO.
ECHO /opt/share/applications
ECHO /usr/apps
ECHO /opt/usr/apps
ECHO /opt/share/packages
ECHO /usr/share/applications
ECHO /usr/share/packages
ECHO.
ECHO TO CONTINUE
ECHO.
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb pull /opt/share/applications "C:\sdb\optshareapplications"
sdb pull /usr/apps "C:\sdb\usrapps"
sdb pull /opt/usr/apps "C:\sdb\optusrapps"
sdb pull /opt/share/packages "C:\sdb\optsharepackages"
sdb pull /usr/share/applications "C:\sdb\usrsharepackages"
ECHO.
ECHO OK THATS DONE!!!!
ECHO.
ECHO TO REBOOT WATCH
ECHO.
PAUSE
sdb shell reboot watch
HERES THE SCRIPT
SEE POST TWO FOR PUSHING BACK
XDA:DevDB Information
CUSTOM APP/WGT BACKUP : DEV WORK, Tool/Utility for the Samsung Gear 2
Contributors
gav83collins
Version Information
Status: Testing
Created 2014-10-10
Last Updated 2014-10-09
XDA:DevDB Information
Custom app/wgt backup, Tool/Utility for the Samsung Galaxy Gear
Contributors
gav83collins
Version Information
Status: Testing
Created 2014-10-10
Last Updated 2014-10-10

DO NOT USE
YET
UNLESS YOUR PREPARED TO RE FLASH TIZENMOD
all or some system apps need removing (i think) before pushing back
im still working this out, thats why i need your help and why this isnt deemed as stable and a wip
heres what i have so far
Code:
@ECHO OFF
ECHO THIS GEAR PUSH .BAT WAS CREATED BY GAV83COLLINS
ECHO.
ECHO ITS DESIGNED FOR TIZEN POWERED SAMSUNG GEARS
ECHO.
ECHO SO YOUVE PULLED THE FOLDERS, AND NOW YOU WANT TO PUSH THEM BACK
ECHO.
ECHO !!!! CAUTION !!!! ? !!!! CAUTION !!!! ? !!!! CAUTION !!!!
ECHO THIS CAN CAUSE BOOT FAILURE IF STEPS NOT FOLLOWED CORRECTLY
ECHO BUT DONT WORRY IF IT DOES A REFLASH OF TIZENMOD WILL FIX THIS
ECHO IM STILL WORKING OUT THE KINKS
ECHO.
ECHO TO CONTINUE PUSHING BACK TO DEVICE
ECHO.
ECHO /opt/share/applications
ECHO /usr/apps
ECHO /opt/usr/apps
ECHO /opt/share/packages
ECHO /usr/share/applications
ECHO /usr/share/packages
ECHO.
ECHO TO CONTINUE
PAUSE
cd "C:\sdb"
sdb.exe
sdb root on
sdb shell mount -o remount rw /
sdb push C:\sdb\optshareapplications "/opt/share/applications"
sdb push C:\sdb\optusrapps "/opt/usr/apps"
sdb push C:\sdb\optsharepackages "/opt/share/packages"
sdb push C:\sdb\usrsharepackages "/usr/share/packages"
sdb push C:\sdb\usr/apps "/usr/apps"
ECHO.
ECHO OK THATS DONE!!!!
ECHO.
sdb shell reboot watch
HERES THE SCRIPT

Needs a few tweaks then its all good.

count me for beta tester

Project still alive?

jasonkhoo87 said:
Project still alive?
Click to expand...
Click to collapse
Good Question Here....

Related

[UTIL] getcyan [v2.1 updated 2009-07-29] - Shell script to get a CyanogenMod ROM

*** v2.1 Updated 2009-Jul-29 : Integrated into CyanogenMod ROM v3.9.3 (experimental) ***
WHAT IT DOES:
Gets ROMs: Gets a particular version of the CyanogenMod series of ROMs, verifies the MD5sum of the downloaded ROM file and sticks it on your SD card as update.zip, ready for you to flash. You can even fetch experimental and test versions of CM ROMs with this script.
List ROMs: You can list available ROMs on cyanogen's server. You can choose to list the latest available, the latest 5, or all available ROMs in the STABLE, EXPERIMENTAL and TESTING branches on cyanogen's server.
Automatically Reboot into recovery: It has an option to automatically reboot into recovery mode after a successful ROM download, to ease the flashing process. If you use this option, it counts down 10 seconds to give you a chance to change your mind in case you decide you do not want to reboot. During this countdown, you can ctrl+c out of the script (If you're doing this on the phone, to type "ctrl+c" you press the trackball, then hit the "c" key). I recommend that you install cyanogen's Recovery image
Backward compatibility mode: For those who prefer the way the old 1.0 script behaved, and fetch a ROM with a minimum of fuss without messing with pesky command line parameters
PRE-REQUISITES:
Busybox (for all the script goodness)
Root access (makes life easier)
Apps2SD (not mandatory)(the script goes on your ext2 partition)
HOW TO INSTALL:
In case the script is not already present in your CM ROM (or if you want to upgrade), simply follow the steps below to install/upgrade it.
Unzip the attached zip file
Push the "getcyan" script to your SD card, onto the ext2 partition. This is usually at "/system/sd". You can use adb push as follows:
Code:
adb push <PATH_TO_EXTRACTED_SCRIPT>/getcyan /system/sd
If you want to create a softlink to the getcyan script so you don't have to keep typing the full path to the script, do the following on the phone (or after running "adb shell"):
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm -f /system/bin/getcyan
ln -s /system/sd/getcyan /system/bin/getcyan
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
OR
Note that from adb, instead of typing in the whole mount command as above, you could also do the following
Code:
adb remount
adb shell
rm -f /system/bin/getcyan
ln -s /system/sd/getcyan /system/bin/getcyan
(thanks to Karolis for this tip)
Change the permissions on the script:
Code:
su
chmod 755 /system/sd/getcyan
USAGE:
You really should open up terminal and get a root shell using "su" before running the script. It has the following options:
Code:
OPTIONS :
-g VER - get/fetch CM ROM with version VER.
VER can be (see NOTE below):
latest - The latest available
x.x[.x]* - A particular version number
like 3.4 or 3.6 or 3.6.8.1
-G - get latest version. Shorthand for "-g latest"
-x - Get/list ROM(s) from experimental branch
-t - Get/list ROM(s) from testing branch
-l NUM - list/show NUM number of ROM(s).
NUM can be (see NOTE below):
latest - Show latest available ROM
some - Show the 5 latest ROMs
all - Show all available ROMs
-L - list latest. Shorthand for "-l latest"
-r - reboot into recovery after fetch
-f - override filename
-h - Help/usage (This message)
-v - Show version number of this script
NOTE:
For both the -g and the -l options above:
The ROMs listed/fetched depend on whether -t or -x
were passed in or not.
If -t was specified, then ROMs from the testing
directory will be shown/fetched
If -x was specified, then experimental ROMs will
be shown or fetched
If neither -x or -t was specified, then stable ROMs
are fetched
SHORTCUTS :
-6 - Get latest stable ROM and reboot into recovery
shorthand for "-g latest -r"
-8 - Get latest experimental ROM and reboot into recovery
shorthand for "-g latest -x -r"
EXAMPLES:
To see what the latest stable ROM is
Code:
getcyan -l latest
OR
Code:
getcyan -L
To see the last 5 experimental ROMs
Code:
getcyan -l some -x
To see all testing ROMs
Code:
getcyan -l all -t
To see what the latest experimental ROM is
Code:
getcyan -l latest -x
OR
Code:
getcyan -L -x
To get the latest stable ROM
Code:
getcyan -g latest
OR
Code:
getcyan -G
To get the latest stable ROM and automatically reboot into recovery mode
Code:
getcyan -g latest -r
OR
Code:
getcyan -G -r
OR
Code:
getcyan -6
To get the latest experimental ROM and automatically reboot into recovery mode
Code:
getcyan -g latest -x -r
OR
Code:
getcyan -G -r -x
OR
Code:
getcyan -8
To get a particular version of a ROM - say 3.6
Code:
getcyan -g 3.6
To get a particular version of a ROM - say 3.9 from the experimental branch, then reboot into recovery
Code:
getcyan -g 3.9 -x -r
To get a ROM with a particular filename. In this example, we get the "donuthole-20090725.zip" ROM from the testing branch (Notice the use of the "-f" parameter to force the filename override)
Code:
getcyan -g donuthole-20090725.zip -f -t
Backward Compatibility Mode - For that old-timey feeling. In this example, we get CM ROM version 3.6
Code:
getcyan 3.6
ACKNOWLEDGEMENTS:
ttabbal - For the md5sum idea
spacezorro - For the "latest" idea
Cyanogen - For the ROMs, man, for the ROMs
CHANGELOG:
2.1
Added (actually fixed) backward compatibility mode
Added version number (with option to display it, for scripting)
Cleaned up help message to remove irrelevant faff
This script is present in CyanogenMod Experimental ROM 3.9.3
2.0
List available ROMs - latest, latest 5 or all
Listing/fetching ROMs from stable, experimental and testing branches
Get latest ROM or a particular version
Ability to fetch an unconventionally-named ROM by specifying the filename on the command line
Automatically reboot into recovery mode after a successful fetch
This script is present in CyanogenMod Experimental ROM 3.9.2
Excellent job. Can't wait till Cyanogen just packages it with his mods.
beast.in.black said:
Apps2SD (the script goes on your ext2 partition)
Click to expand...
Click to collapse
Wouldn't it also work to stick this into /data/local/bin, which is already in the PATH variable by default (at least on cyan's ROMs). Of course, that way it would disappear on wipe, but it would be easier to run the script.
I tried adding a 'export PATH="$PATH:/system/sd/bin"' line to my userinit.sh, but it didn't have any effect. It probably runs too early...
@firetech : Yes, you could definitely stick it in your /data/local/bin...but as you pointed out, it will be lost on wipe. In case you don't have (or want) apps2sd, then this is an option for you. I would, however, recommend apps2sd along with the symlink method I outlined in the "How to install" section.
@overpower: Thanks
Used your original one from CM thread. Great that you added the experimental version download option.
When I came to read this post, I thought you were talking about switching between multiple versions of ROMs from cyano.
Do you think this can be extended to other ROMs as well?
Do you think writing peripheral code for really installing/reinstalling a ROM version would be a good idea to add to this script? For example:
1. Backup current /system/sd, along with the nandroid backup of the system and the ROM ZIP.
2. Mark the above with a ROM version and create a folder for it on /sdcard.
3. Provide the reverse to go back and forth between ROM versions. Make the nandroid backup from the selected ROM folder the latest so that recovery can restore it, copy the ZIP file in /sdcard as update.zip in case a wipe is needed.
Right now, this is a painstaking job to toggle between 2 ROMs.
If you are doing these steps in ADB, step #3 can be done much easier. Just type adb remount and that's it!
Also, at least on my phone it does not seem to want to work unless I su first.
Otherwise great script! Makes life much more easier. I like taking risks and downloading experimental ROM 15 minutes before my flight to foreign country, where if my phone is dead, I'm dead. This script will definitely allow me to do crazy stuff with more confidence
Oh, and I wish Cyanogen would add it to the ROM itself. At least until the OTA updater is built.
devsk said:
Do you think writing peripheral code for really installing/reinstalling a ROM version would be a good idea to add to this script?
Click to expand...
Click to collapse
devsk, interesting idea indeed...Let me put some thought into this
Karolis said:
If you are doing these steps in ADB, step #3 can be done much easier. Just type adb remount and that's it!
Also, at least on my phone it does not seem to want to work unless I su first.
Click to expand...
Click to collapse
Karolis, the script needs to run as root since otherwise wget has problems. I'll make this explicit in the instructions. Also, thanks for pointing out the "adb remount" command, I've added it to the instructions
I will try this, sounds like a great idea... thanks
Is there any way to add this to gscript? Since there needs to be interaction from the user, I would guess you would have to edit each time to make it work.
Yeah I will put it in 3.9.1 until we get a proper OTA updated finished.
cyanogen said:
Yeah I will put it in 3.9.1 until we get a proper OTA updated finished.
Click to expand...
Click to collapse
Sweet! Thank you.
Also, I know you must be sick of questions like this, but: is there an ETA for 3.9.1. I've seen you are playing with donut. Hopefully that won't postpone 3.9.1. too much...
You're the best!
beast.in.black, I've just had an idea for the future of this script. How about posting "a call to action" ir development and theme forums asking for all devs to use the same naming convention for their roms and themes + provide checksums. That way you could expand the script beyond CM's ROMs (that is if you want).
Of course not everyone would join this cause as some people don't have server resources to post stuff and it wouldn't work with file sharing services, but hey, it's worth a try.
What do you think?
Gscriptable getcyan
pixel-painter said:
I will try this, sounds like a great idea... thanks
Is there any way to add this to gscript? Since there needs to be interaction from the user, I would guess you would have to edit each time to make it work.
Click to expand...
Click to collapse
I hacked mine to use...
Code:
wget -q -O- http://n0rp.chemlab.org/android/ |grep "${FNAME_PREFIX}.*${FNAME_SUFFIX}\""|sed "s/.*<a href=\"//;s/\".*//"|tail -n1
Then I got the "scripting bug" and I rewrote it a bit so it wasn't hacked up.
Code:
#!/system/bin/sh
FNAME_PREFIX="update-cm-"
FNAME_SUFFIX="-signed.zip"
MD5NAME_SUFFIX="${FNAME_SUFFIX}.md5sum"
SAVEFNAME=/sdcard/update.zip
MD5CMD="md5sum -c"
MOD_FILENAME=""
MOD_MD5NAME=""
MIRROR="http://n0rp.chemlab.org/android/"
usage()
{
echo
echo "Usage : $0 ( [VERSION] [-x] | -h )"
echo " Gets a particular version of the CyanogenMod"
echo " series of ROMs, and sticks it on your SD card"
echo " as update.zip, ready for you to flash."
echo
echo "Args :"
echo " -h - Help (This Message!)"
echo " VERSION - The CM ROM version to fetch."
echo " -x - Specify that the version you want to fetch"
echo " is an EXPERIMENTAL version."
echo
exit
}
cleanup()
{
rm -f ${SAVEFNAME}
rm -f ${MOD_FILENAME}
rm -f ${MOD_MD5NAME}
}
latest()
{
wget -q -O- ${MIRROR}${EXPER} |grep "${FNAME_PREFIX}.*${FNAME_SUFFIX}\""|sed "s/.*<a href=\"//;s/\".*//"|tail -n1
}
if [ "$1" = "-h" ];
then
usage
fi
# check if user wants an experimental build
EXPER=""
if [ "$1" == "-x" ];
then
EXPER="experimental/"
echo "Experimental build specified"
elif [ "$2" == "-x" ];
then
EXPER="experimental/"
echo "Experimental build specified"
fi
if [ -z $1 ];
then
MOD_FILENAME=`latest`
MOD_MD5NAME=${MOD_FILENAME}.md5sum
VER="Latest"
elif [ "$1" == "-x" ];
then
MOD_FILENAME=`latest`
MOD_MD5NAME=${MOD_FILENAME}.md5sum
VER="Latest Experimental"
else
MOD_FILENAME=${FNAME_PREFIX}${1}${FNAME_SUFFIX}
MOD_MD5NAME=${FNAME_PREFIX}${1}${MD5NAME_SUFFIX}
VER="${1}"
fi
cd /sdcard
echo "Deleting any previous update.zip..."
cleanup
# Download update ROM and MD5Sum
echo "Getting CyanogenMod ROM version $VER : ${MOD_FILENAME}"
echo
wget ${MIRROR}${EXPER}${MOD_FILENAME}
RES=$?
if [ ${RES} -ne 0 ];then
echo "Could not download ${MOD_FILENAME}"
echo "If you want to fetch an experimental version,"
echo "specify -x in the call to this script"
echo
echo "Nothing downloaded, exiting"
cleanup
exit
fi
# get the md5sum file
echo "Getting CyanogenMod ROM MD5 version $VER : ${MOD_MD5NAME}"
echo
wget ${MIRROR}${EXPER}${MOD_MD5NAME}
RES=$?
if [ ${RES} -ne 0 ];then
echo "Could not download ${MOD_MD5NAME}, exiting"
cleanup
exit
fi
# Verify downloaded ROM
echo "Checking ${MOD_FILENAME} MD5..."
MD5SUM_RESULT=`${MD5CMD} ${MOD_MD5NAME} | cut -d":" -f2 | grep OK`
echo " md5sum result : $MD5SUM_RESULT"
if [ ! -z $MD5SUM_RESULT ]
then
echo "${MOD_FILENAME} Downloaded Successfully"
mv ${MOD_FILENAME} ${SAVEFNAME}
rm ${MOD_MD5NAME}
echo "You may now reboot and flash"
else
echo "ERROR : ${MOD_FILENAME} Download Unsuccessful"
echo "Deleting bad download and exiting..."
cleanup
fi
So there it is...
I haven't try this yet but so far the only think I woudl ask for besides an GUI is to be able to know what versions are out there. What if i don't know what's the new version. i woudl have to go and check online. but if we have a command on the script to tell us the roms available it woudl be easier and great. I wouldn't even ask for a GUI then.
Rafase282 said:
I haven't try this yet but so far the only think I woudl ask for besides an GUI is to be able to know what versions are out there. What if i don't know what's the new version. i woudl have to go and check online. but if we have a command on the script to tell us the roms available it woudl be easier and great. I wouldn't even ask for a GUI then.
Click to expand...
Click to collapse
Until there is a way to do something like LucidREM has done with his script (such as lucid -u), I think your only options are
Subscribe to his Twitter page
Bookmark his server where his updates are stored.
Subscribe or check back frequently here on XDA.
I personally do all three.
beast.in.black said:
[*]Fetching Experimental builds: to fetch an experimental build from Cyanogen (Applicable from CyanogenMod v3.9 onwards), simply add the "-x" command line option to the script, after specifying the VERSION. Like so:
Code:
getcyan 3.9 -x
Click to expand...
Click to collapse
Recommendation
Add a "-t" for his testing builds as well.
They are not anywhere near as frequently used as experimental... but nonetheless it is still available on his server.
I added this on to the end so that the completed build would be flashed\
Code:
#Flash the Rom
echo "Rebooting and flashing update..."
echo "boot-recovery --update_package=SDCARD:update.zip" > /cache/recovery/command
reboot recovery
Sounds coll that you can do that, but still, I prefer making a backup first
This is amazing, thank you for making cyan updates even easier! Got it set up and running in no time!
Karolis said:
How about posting "a call to action" ir development and theme forums asking for all devs to use the same naming convention for their roms and themes + provide checksums.
Click to expand...
Click to collapse
Karolis, this is a great idea. I'll put the call to action out
spacezorro said:
I hacked mine to use...
So there it is...
Click to expand...
Click to collapse
spacezorro, you have already done what was on my roadmap for this script Thank you very much indeed. I am right now hacking the script up to recognize "latest" as a keyword and testing the changes now, and will update the script and post a fresh download (in the original post) once i've tested it out.
Rafase282 said:
What if i don't know what's the new version. i woudl have to go and check online. but if we have a command on the script to tell us the roms available it woudl be easier and great
Click to expand...
Click to collapse
Rafase282, I've put this on the roadmap as the next thing to work on.
Binary100100 said:
Recommendation
Add a "-t" for his testing builds as well.
They are not anywhere near as frequently used as experimental... but nonetheless it is still available on his server.
Click to expand...
Click to collapse
Excellent recommendation, will add it to the script.
indiekid97 said:
I added this on to the end so that the completed build would be flashed
Click to expand...
Click to collapse
Nice, will make it an option in the script to automatically reboot and flash if the md5sum checks out OK.
Thanks to everyone for all the great ideas
@cyanogen: Since you'll be adding this to your ROM, how do I keep you informed of changes to the script? PM you or something?

[Q] [Solved] batch file question(s) for auto adb

okay so im creating a batch file for a little automation just mainly for rebooting the device into bootloader/recovery.. i have gotten most of the way through but at the end i would like for the batch file to stop and allow for further manual input (like i have it set to reboot the device into bootloader and then i would like the window to stop and allow me to MANUALLY input the next command such as flash/reboot/whatever) however i cant seem to find any way of doing that
HERE IS WHAT I HAVE CURRENTLY
it all works perfectly just for the issue i cant seem to work out
ECHO OFF
ECHO ============== CHANING DIRECTORY ==============
CD c:\program files (x86)\android\android-sdk\tools
TIMEOUT 2 /NOBREAK >nul
ECHO ........ Done
ECHO ============== CHECKING ADB DEVICE CONNECTION ==============
TIMEOUT 2 /NOBREAK >nul
adb devices
ECHO ........ Done
PAUSE
:MENU
ECHO.
ECHO ================== ADB MENU ==================
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT.
ECHO.
ECHO 1 - Reboot Device into Bootloader [FASTBOOT]
ECHO 2 - Reboot Device into Recovery [CLOCKWORK MOD]
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO BOOTLOADER
IF %M%==2 GOTO RECOVERY
IF %M%==3 GOTO EOF
:BOOTLOADER
adb reboot bootloader
GOTO FASTBOOT
:RECOVERY
adb reboot recovery
GOTO RECOVERY
:FASTBOOT
ECHO .
ECHO Waiting for device to reconnect
TIMEOUT 15 /NOBREAK >nul
ECHO ........ Done
ECHO ================== FASTBOOT ==================
ECHO manually type fastboot commands
:RECOVERY
ECHO .
ECHO Waiting for device to reconnect
TIMEOUT 15 /NOBREAK >nul
ECHO ........ Done
ECHO ================== RECOVERY ==================
ECHO Manually handle Clockwork Recovery tasks
ECHO .
ECHO .
ECHO Will automatically close in about 5 Seconds =]
TIMEOUT 5 /NOBREAK >nul
ECHO ....... bye!
I am not sur to understand exactly what you want to do, but you can do what you want in you batch file, it is what you did with for exemple :
- "Reboot Device into Bootloader [FASTBOOT]"
- "Reboot Device into Recovery [CLOCKWORK MOD]"
You have just check the choice with a number and after execute your "code".
So, if you know the "adb script" in addiction of the command you want, go to "code" it.
I remake your script and i especially add an exemple.
- "Execution" and "Code" are more clear.
- It is better for checking error.
- Now, this script is able to check if you are in "64bit" or "32bit", and check if the "ADB Tool" is in his correct way.
- Now, this script is able to check if you have connect or not your device.
- You can see the BootAnimation without "Power OFF" and then "Power ON" your phone.
- It is more beautiful, even if it is not very important.
The new "code", with your previous "started code" :
Code:
Even this topic is solved, i remove my code.
cheers for the reply.. but that was not really what i was after... i did some more googling and what i found was (in the last 2 minutes) that i needed a CMD /K at the end of the file.. which leaves the command window open and i can now enter in fastboot commands manually (for flashing etc)... i have attached the file as a.txt for anyone to use themselves if they were so inclined..
1. just make sure the directory of your adb/fastboot.exe is in the same directory as mine (CD c:\program files (x86)\android\android-sdk\tools) and change the 2 lines if necessary with note pad by opening the .txt normally as yours might be in program files or in platform-tools not tools, etc
2. change the extension to .bat and not .txt
3. chuck it in your task bar/start bar etc for quicker acess
and should be good to go =]
edit: i see the checking that the other fellow put it can do the checking for you.. but for me i knew the directory, etc
So, i did not exaclty understand your aim, but you have found it, so it is perfect.
I remake my previous script to do exactly what you want, and i always check every thing during the execution, to know the mistake when we have a problem. Because my version is for everybody, even if i think it is just for us. (Views: 45)
So if you want it, or someone else, just ask me.
ptit developer said:
So, i did not exaclty understand your aim, but you have found it, so it is perfect.
I remake my previous script to do exactly what you want, and i always check every thing during the execution, to know the mistake when we have a problem. Because my version is for everybody, even if i think it is just for us. (Views: 45)
So if you want it, or someone else, just ask me.
Click to expand...
Click to collapse
no worries mate it was my first time writing an entire script so im pretty stoked with the outcome i tried to keep it looking as real as scripts i have seen as possible.. =]
I will continue to develop this idea : "A easy way to use ADB Menu".
When i will have finish, if you want i will post a link here to it.
ptit developer said:
I will continue to develop this idea : "A esay way to use ADB Menu".
When i will have finish, if you want i will post a link here to it.
Click to expand...
Click to collapse
sure mate.. ill edit the op if you like and can sort something out?
i think the simpler nature allows for much to be automated for mundane tasks... as long as you keep the fastboot commands manual so noobs dont do anything incorrect
I will use what you want, and i will add what i post in my first answer here.
In addition of this, i will post the final "A easy way to use ADB Menu" on a new topic on other section.
And i will post news here, because i think you will look it.

[APP] Scheduled Automatic CWM Nandroid Backup - Intika Automatic Backup MoD

Waw Grrrr... a whole day to make it possible
as i never posted... i can not post link... so google is your friend for downloading lol
Here is a little tutorial to make
Scheduled Automatic CWM Nandroid Backup
Intika Automatic Backup MoD ^^
First what you need :
- Rooted device
- CWM Recovery
- Application SL4A (Free google dev. sl4a_r5.apk)
- Apllication "TaskBomb Task Scheduler" (Free on market)
- Application "SL4A Script Launcher" (Free plugin on market)
- A Script to do the stuff
How it work ? :
The idea is simple, it's running an automated task with a script without any interact... the Automated nandroid backup will erase her self for a new one when the task is launched...
the backup is always made at the same place under your clockworkmod backup folder "IntikaAutomaticTask" so it will always take the size of one backup even if the task is scheduled every day ... and naturally you will keep your manually make backup.
You can set up the backup to made different backup of keep 3 last one or else... not explained but easy to do with TaskBomb
The Script For a backup to "sdcard/clockworkmod" :
Code:
cd \ ;
mkdir -p /cache/recovery ;
rm /cache/recovery/mounter? ;
rm /cache/recovery/extendedcommand? ;
rm /cache/recovery/mounter ;
rm /cache/recovery/extendedcommand ;
echo '#!/sbin/ext/busybox sh' > /cache/recovery/mounter ;
echo '/sbin/ext/busybox mount /sdcard' >> /cache/recovery/mounter ;
echo '/sbin/ext/busybox mount /dev/block/mmcblk1p1 /emmc' >> /cache/recovery/mounter ;
echo '/sbin/ext/busybox rm /cache/recovery/mounter' >> /cache/recovery/mounter ;
chmod 777 /cache/recovery/mounter ;
echo 'run_program("/cache/recovery/mounter");' > /cache/recovery/extendedcommand ;
echo 'ui_print("Intika Backup MoD... Processing Backup...");' > /cache/recovery/extendedcommand ;
echo 'backup_rom("/emmc/clockworkmod/backup/IntikaAutomaticTask");' >> /cache/recovery/extendedcommand ;
sync ;
echo 1 > /sdcard/external_sd/clockworkmod/.recoverycheckpoint ;
echo 1 > /sdcard/clockworkmod/.recoverycheckpoint ;
sync ;
reboot recovery ;
The Script For a backup to "sdcard/external_sd/clockworkmod" :
Code:
cd \ ;
mkdir -p /cache/recovery ;
rm /cache/recovery/mounter? ;
rm /cache/recovery/extendedcommand? ;
rm /cache/recovery/mounter ;
rm /cache/recovery/extendedcommand ;
echo '#!/sbin/ext/busybox sh' > /cache/recovery/mounter ;
echo '/sbin/ext/busybox mount /sdcard' >> /cache/recovery/mounter ;
echo '/sbin/ext/busybox mount /dev/block/mmcblk1p1 /emmc' >> /cache/recovery/mounter ;
echo '/sbin/ext/busybox rm /cache/recovery/mounter' >> /cache/recovery/mounter ;
chmod 777 /cache/recovery/mounter ;
echo 'run_program("/cache/recovery/mounter");' > /cache/recovery/extendedcommand ;
echo 'ui_print("Intika Backup MoD... Processing Backup...");' > /cache/recovery/extendedcommand ;
echo 'backup_rom("/sdcard/clockworkmod/backup/IntikaAutomaticTask");' >> /cache/recovery/extendedcommand ;
sync ;
echo 1 > /sdcard/external_sd/clockworkmod/.recoverycheckpoint ;
echo 1 > /sdcard/clockworkmod/.recoverycheckpoint ;
sync ;
reboot recovery ;
Installing needed stuff :
Considering you have a rooted device and CWM installed...
You can use different file and folder name regarding the tutorial
1. Copy the scripts to your device and name it backup.sh and backup.ext.sh
1.1 Copy the script to :
1.1 \sdcard\Intika.Backup.MoD\backup.sh
1.2 \sdcard\Intika.Backup.MoD\backup.ext.sh
1.3 You can test the script with a terminal by writing this
Code:
su -c sh \sdcard\Intika.Backup.MoD\backup.sh
2. Install SL4A (Free google dev. sl4a_r5.apk)
3. Install "TaskBomb Task Scheduler" (Free on market)
4. Install "SL4A Script Launcher" (Free plugin on market)
How to Setup ? :
1. Open SL4A hit menu and then "add" select "Shell" if you are asked to select the application to continue with select SL4A... put backup.sh or backup.ext.sh on the title and put the code below on the script after that hit menu and then "save & exit"
Code:
su -c sh \sdcard\Intika.Backup.MoD\backup.sh
or
Code:
su -c sh \sdcard\Intika.Backup.MoD\backup.ext.sh
2. Open TaskBomb hit "Task" click " + " to add a new one , on action type leave or set VIEW and on data choose "Select script" and choose backup.sh ... on Activity choose background or foreground if you want to see when the script is launched.
3. Here we are, we just need to specify when to run the task ... on TaskBomb hit Alarm and then " + " and then select the wanted script
choose a start time and then the day you want to launch the backup.
Bla Bla :
AAAhhhhhh !!!!!!! finally get it work after many research and after trying Rom Manager (not working with every device and he tray to install an other CWM "very dangerous" )
My way is not the only one
Any way good luck
I don't have the time for the moment but when i got some free time i will make an application to do the stuff
Could you please explain how it works? Does it reboot your phone to make backup?
Hello
Here what it do :
1. Set a backup at a time and day (or every day or every week or what you want regarding time and repetition)
2. On selected time, the phone reboot to recovery without any interact make the backup (every think is displayed) ... once finish it reboot the phone to normal state.
example you set to make a backup every day at 4h o clock... your phone will reboot and make the backup and then restart to normal mode... so when you wake up you just have to enter the Code pin of the phone or just unlock it if it's does not ask for a code pin.
Ok, so user will have to input PIN... not like that really.
best stable backup are backup made from recovery...
generally we would make an automatic backup when we are not using the phone so at night... so it's not really a problem to do not have incoming call after backup until the pin is entered...
any way all other stuff like wake up alarm and other application will be running they don't need the pin to be entered ! ...
you can also remove pin request and put just a code to unlock the screen, it's a solution if you want to be reachable any time...
LA_ said:
Ok, so user will have to input PIN... not like that really.
Click to expand...
Click to collapse
I think intika means that it will reboot once the backup are done.
The pin input is normal if you enabled it in security settings. It happens when you reboot your phone.
---------- Post added at 05:06 PM ---------- Previous post was at 05:01 PM ----------
intika said:
Bla Bla :
AAAhhhhhh !!!!!!! finally get it work after many research and after trying Rom Manager (not working with every device and he tray to install an other CWM "very dangerous" )
My way is not the only one
Any way good luck
Click to expand...
Click to collapse
Any screenshots for this? Seems like the script is too simple to be true.
Is there a command to stop Recovery from rebooting? I have an OTA app that flashes a ROM and I want Recovery to stay in it and not just auto reboot, because the user might want to install gapps before rebooting.
Sorry to bump an old thread, but has anyone gotten this to work? I really miss the automated full backup from my windows mobile device.
Sorry, mistake.
any review on this?
i just spent few bucks on ROM manager only to find out the auto backup only work on internal memory. if i set it to sd card, it will get error and just stuck in recovery. kind of sucks for paid app. and my question to dev just went unanswered. really sucks for a paid app.

Install multipple applications from PC using ADB in single command!!!

Maybe most of us already knowing this, I am making a note of this technique so that it will be helpful for others.
It's a windows batch file script which will install all the applications to phone in single shot. Phone is not necessarily rooted. Only if you are pushing system app then root is required.
You need apk files on your computer, kept together in a folder.
Connect your phone to system using USB cable.
Make sure adb.exe is in the system 'path' environmental variable. (If not replace adb with fill adb path of adb.exe in below script)
Create a batch file with following contents in the same folder where apk files are kept -
Code:
adb wait-for-device
@echo off
adb remount
for /f %%a IN ('dir /b *.apk') do call adb install "%%a"
echo now phone will reboot.
pause
adb reboot
Save and run the batch file. It will install each app one by one.
If you want to speed up the installation, you can install apps using push method. Below is script for that.
Code:
adb wait-for-device
@echo off
adb remount
for /f %%a IN ('dir /b *.apk') do call adb push "%%a" /data/app/
echo now phone will reboot.
pause
adb reboot
Also if you want to install system application, replace /data/app/ with /system/app/ in above script.
Was about to make a post to look for this. Gonna test this next time I format the Device.
Thanks Mate!
Thanks for your quick guide, This is ready helpful to me.
Thanx
thanx for Guide
i am testing via adb command and OK

The Linux shell for beginners.

I just wanted to share some links to help out some of the users who may already use Linux from time to time. Linux can be a very intimidating sometimes.
I finaly left Windows for good and was having trouble remembering shell commands. Thought I would post some refrences to maybe help some of you guys out who are new to the Linux shell as well. Good luck!
http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
http://bash.cyberciti.biz/guide/Main_Page
http://linuxcommand.org/learning_the_shell.php
http://www.fortystones.com/40-linux-shell-commands-beginners/
http://community.linuxmint.com/tutorial/view/100
Another one... Thank you Jim!
http://sunsite.utk.edu/UNIX-help/quickref.html
Maribou said:
I just wanted to share some links to help out some of the users who may already use Linux from time to time. Linux can be a very intimidating sometimes.
I finaly left Windows for good and was having trouble remembering shell commands. Thought I would post some refrences to maybe help some of you guys out who are new to the Linux shell as well. Good luck!
http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
http://bash.cyberciti.biz/guide/Main_Page
http://linuxcommand.org/learning_the_shell.php
http://www.fortystones.com/40-linux-shell-commands-beginners/
http://community.linuxmint.com/tutorial/view/100
Click to expand...
Click to collapse
This is another one, and it is a great reference:
http://sunsite.utk.edu/UNIX-help/quickref.html
I like this idea and think this should be a sticky! Great idea!
jimbridgman said:
This is another one, and it is a great reference:
http://sunsite.utk.edu/UNIX-help/quickref.html
I like this idea and think this should be a sticky! Great idea!
Click to expand...
Click to collapse
Thank you for the link Jim! I added it to the original post.:good:
+1 Been going to this guide for quite a while now has most everything you need to get started.....
The shell is really cool. Once you get the commands down you can start learning shell scripting. It automates processes and make some things easier. Like for example I am really rusty when it comes to Linux and I was getting tired of having to Cd into my sdk tools directory every time I wanted to mess around with Adb. So I created a little shell script that automates the process for me. Like I said, I am new to all of this and I am sure there is a much easier way, but it was fun learning how to do it. This is just a really really simple shell script to change in to my /android-sdk-linux/platform-tools directory, then start the Adb server and list my device. Here is my script...
Code:
#!/bin/bash
#Intro
echo "::::::::::::::::::::::::::"
echo ":: Maribou's Adb Script ::"
echo "::::::::::::::::::::::::::"
sleep 3
#Changing directory
echo "::::::::::::::::::"
echo ":: Locating Adb ::"
echo "::::::::::::::::::"
cd /usr/bin/android-sdk-linux/platform-tools
sleep 3
echo ""
echo ""
#Starting adb
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
echo ":: Starting Adb services and connecting device::"
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
sleep 2
./adb start-server
echo ""
echo ""
sleep 2
./adb devices
sleep 3
#Connection Message
echo ":::::::::::::::::::::::"
echo ":: Atrix 2 connected ::"
echo ":::::::::::::::::::::::"
sleep 3
echo ""
echo ""
#Goodbye
echo ":::::::::::::::::::::::::"
echo ":: Have a nice day! :D ::"
echo ":::::::::::::::::::::::::"
Maribou said:
The shell is really cool. Once you get the commands down you can start learning shell scripting. It automates processes and make some things easier. Like for example I am really rusty when it comes to Linux and I was getting tired of having to Cd into my sdk tools directory every time I wanted to mess around with Adb. So I created a little shell script that automates the process for me. Like I said, I am new to all of this and I am sure there is a much easier way, but it was fun learning how to do it. This is just a really really simple shell script to change in to my /android-sdk-linux/platform-tools directory, then start the Adb server and list my device. Here is my script...
Code:
#!/bin/bash
#Intro
echo "::::::::::::::::::::::::::"
echo ":: Maribou's Adb Script ::"
echo "::::::::::::::::::::::::::"
sleep 3
#Changing directory
echo "::::::::::::::::::"
echo ":: Locating Adb ::"
echo "::::::::::::::::::"
cd /usr/bin/android-sdk-linux/platform-tools
sleep 3
echo ""
echo ""
#Starting adb
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
echo ":: Starting Adb services and connecting device::"
echo "::::::::::::::::::::::::::::::::::::::::::::::::"
sleep 2
./adb start-server
echo ""
echo ""
sleep 2
./adb devices
sleep 3
#Connection Message
echo ":::::::::::::::::::::::"
echo ":: Atrix 2 connected ::"
echo ":::::::::::::::::::::::"
sleep 3
echo ""
echo ""
#Goodbye
echo ":::::::::::::::::::::::::"
echo ":: Have a nice day! :D ::"
echo ":::::::::::::::::::::::::"
Click to expand...
Click to collapse
Better yet, you could
Code:
sudo gedit .bashrc
, scroll to the bottom, and add that directory to your path (google how, you need to know!), and use it anywhere you want.
then add some aliases to make things shorter. some I use are:
ins= sudo apt-get install
swp= whatever the heck mounts my swap file I use.
Also I would recommend ditching the stock terminal of ubuntu for something better like the life-hacker acclaimed terminator.
lkrasner said:
Better yet, you could
Code:
sudo gedit .bashrc
, scroll to the bottom, and add that directory to your path (google how, you need to know!), and use it anywhere you want.
then add some aliases to make things shorter. some I use are:
ins= sudo apt-get install
swp= whatever the heck mounts my swap file I use.
Also I would recommend ditching the stock terminal of ubuntu for something better like the life-hacker acclaimed terminator.
Click to expand...
Click to collapse
Awesome! thank you for the sugesstions! I thought there was an easier way of doing things I just couldn't remember at the time.
Installing Terminator now... :good:
lkrasner.... YOU ROCK MAN! Totally saved me from all of the typing. And I had no idea about the alises. Thank you!

Categories

Resources