How do you backup the stock rom - General Questions and Answers

Hi everyone sorry for this question but haven't been able to find any info on backing up the stock rom of a device.
It is a Samsung so not sure if fastboot would be an option and yet to install any recovery image (TWRP)
Please advise what would be the best way before installing a custom ROM for backing up the stock roms of the device.
I also want to backup the recovery before adding a customer recovery if possible.
Thanks for any help

Only for demonstration purpose:
Here excerpt of a Windows CMD script I times ago wrote to fully backup a phone by means of ADB
Code:
rem THIS DOESN'T WORK ON MTK-CHIPSET BASED DEVICES!
rem
rem for MTD and EMMC devices, the partition layout and the partition names
rem can be retrieved by reading the /proc/mtd and /proc/emmc files.
set file_to_query=
for /F %%a in ('adb shell "[ -f /proc/mtd ]; echo $?"') do (
set "error=%%a"
if "%error%"=="0" (
set "part_layout=mtd"
set "file_to_query=/proc/%part_layout%"
)
)
if not defined file_to_query (
for /F %%a in ('adb shell "[ -f /proc/emmc ]; echo $?"') do (
set "error=%%a"
if "%error%"=="0" (
set "part_layout=emmc"
set "file_to_query=/proc/%part_layout%"
)
)
)
if not defined file_to_query ( goto :failed )
for /F "skip=1" "tokens=1,4 delims= " %%a in ('adb shell "cat %file_to_query%"') do (
rem get dev-name and corresponding part-name
set "dev_name=%%a" & set "part_name=%%b"
if not "?%dev_name%"=="?" (
rem remove colon
set "dev_name=%dev_name::=%"
rem remove double quotes
set "part_name=%part_name:"=%"
rem write out dump to pc
adb exec-out "dd if=/dev/%part_layout%/%dev_name% bs=4096" > "C:\%part_name%.img"
timeout /t 2 /nobreak >nul
)
)
:failed

From what I have read phone needs to be rooted to complete the backup via adb

Related

[TOOL][WINDOWS][RECOVERY][SYSTEM][SNAPS][VIDEO][GUI]android-shot! (version 2.1)

#android-shot
#your one stop screenshot solution!
#screenshot recovery for windows!
#screenshot system for windows!
#video_record recovery for windows!
#video_record system for windows!
Looking for a Linux Version???
Go Here: http://forum.xda-developers.com/showthread.php?t=2260704
This solely uses the SD Card, which, by default is always kept mounted by
a partition. So, you wouldn't run into any trouble except when you try to
partition or format the SD Card.
I repeat, no need to mount any partition... By default, the SD Card is always mounted, so, I thought using it will be way better than using the /data partition
To take a screenshot:
Code:
Run "shot.bat"
Your screenshot will be saved in a folder named screenshots automatically.
To capture video:
Code:
Run "record.bat"
Press "Ctrl+C" when you have finished recording.
This will basically start recording your screen frame by frame, and automatically
save it in your SD card. Note that recording the video alone is not enough.
Do the following to pull those frames from the SD card, and make a video out of them.
Code:
Run "mkvideo.bat"
Enter the Name that you want to name your video. DON'T ADD AN EXTENSION!
The files will be collected from the SD Card, and a video will be made out
of them. Then, the temporary files will be cleaned automatically, from both
your SD card, and your system.
Downloads:
Version 2.1 (GUI) (Android-Andi): http://forum.xda-developers.com/showpost.php?p=45891403&postcount=59
Version 2.1.3 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44447366&postcount=40
Version 2.1.2 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44288806&postcount=36
Version 2.0.1 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44011267&postcount=17
Version 2.0 (Thanks to Android-Andi): http://forum.xda-developers.com/showpost.php?p=43982996&postcount=12
Version 1.0: http://www.mediafire.com/download/26gi88xdd5c6rly/android-shot_windows.zip
Note: A GUI version can be found here: http://forum.xda-developers.com/showpost.php?p=45891403&postcount=59
Not personally tested by me, as I don't have the appropriate tools (i.e. windows) no more...
Credits:
Kyan He (https://plus.google.com/116857119889961125943) and his wonderful tool "fb2png" (https://code.google.com/p/android-fb2png/)
Whiskey103 (http://forum.xda-developers.com/member.php?u=2632943) and his guide (http://forum.xda-developers.com/showthread.php?p=40260716) on taking screenshot in windows.
Android-Andi (http://forum.xda-developers.com/member.php?u=5153662) for version 2.0 and some cool ideas
Sample:
Recovery!
Recovery & System Video Sample! [With instructions ]
not working and said
"ECHO off 'and' is not recognized as an internal or external command, operable program or batch file.
'C:\Doccuments' is not recognized as an internal or external command, operable program or batch file.
will try your linux version, when get home
Strange....
antutu said:
not working and said
"ECHO off 'and' is not recognized as an internal or external command, operable program or batch file.
'C:\Doccuments' is not recognized as an internal or external command, operable program or batch file.
will try your linux version, when get home
Click to expand...
Click to collapse
Anyways, thanks for your report
I will look into it, as soon as possible
P.S. Only problem is... I don't have Windows :silly: So, it would be a beta :angel:
vineethraj49 said:
Anyways, thanks for your report
I will look into it, as soon as possible
P.S. Only problem is... I don't have Windows :silly: So, it would be a beta :angel:
Click to expand...
Click to collapse
Take your time mate:thumbup:
Sorry bro i just found out how this can work out
I've to put it in root folder
It's working great now:thumbup::thumbup:
Thanks al lot! That´s what i was looking for.
I tried to get better Video-Quality (libx264 as *.mp4).
I modified the .bat
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Someone knows how to make the quality better then with my modified bat?
Me again:
To use your shot.bat i had to download 2 *.dll´s to get "date.exe" working (libiconv2.dll and libintl3.dll). Without these .dll screenshot not possible.
Maybe you can add these two *.dll into your tool directory (don´t know if it´s allowed, check it here).
Download (GnuWin) Libintl.exe(?) from here and install it.
You´ll find the 2 needed *.dll at "C:\Program Files (x86)\GnuWin32\bin".
I´m, running Windows 8 Pro.
Maybe you can add (after changeing directory path) my modified "record.bat" for taking screenshots from running androidsystem
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /extSdCard/screen.png
%~dp0tools\adb pull /extSdCard/screen.png %~dp0new
%~dp0tools\adb shell rm /extSdCard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
I´m using extSdCard as directory, because my Micro-SD-Card is mounted there.
Maybe change it like this:
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Whoa! Someone actually cares
Android-Andi said:
Thanks al lot! That´s what i was looking for.
I tried to get better Video-Quality (libx264 as *.mp4).
I modified the .bat
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Someone knows how to make the quality better then with my modified bat?
Click to expand...
Click to collapse
Remember that the *quality* is always the same. It pulls the images (frames) in the same resolution as of your phone. If you are talking about the FPS, you should modify this line...
Code:
ffmpeg -r 4
The -r switch controls the FPS.
Again, the FPS depends upon how many screens are actually captured by your device. If you have a fast SD-Card, and a fast processor, it is indeed likely that the frames captured would be more. You can try increasing the -r 4 by 2/3 frames and see if the video is suitable to your needs. (eg. -r 5/ -r 6, etc...)
Android-Andi said:
Me again:
To use your shot.bat i had to download 2 *.dll´s to get "date.exe" working (libiconv2.dll and libintl3.dll). Without these .dll screenshot not possible.
Maybe you can add these two *.dll into your tool directory (don´t know if it´s allowed, check it here).
Download (GnuWin) Libintl.exe(?) from here and install it.
You´ll find the 2 needed *.dll at "C:\Program Files (x86)\GnuWin32\bin".
I´m, running Windows 8 Pro.
Click to expand...
Click to collapse
Didn't know about that... It worked for me without those two DLLs. Anyways, I will just add it for safety.
Android-Andi said:
Maybe you can add (after changeing directory path) my modified "record.bat" for taking screenshots from running androidsystem
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /extSdCard/screen.png
%~dp0tools\adb pull /extSdCard/screen.png %~dp0new
%~dp0tools\adb shell rm /extSdCard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
I´m using extSdCard as directory, because my Micro-SD-Card is mounted there.
Maybe change it like this:
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Click to expand...
Click to collapse
You could change it yourself... Reason why I wouldn't change it? Because different devices have different mount points. If it is extSDcard, you can change accordingly. (If that wasn't the point, please clarify the last post. I understood it as: my mountpoint for sdcard is different :silly
p.s. thanks.. i was thinking no one cared
vineethraj49 said:
Remember that the *quality* is always the same. It pulls the images (frames) in the same resolution as of your phone. If you are talking about the FPS, you should modify this line...
Code:
ffmpeg -r 4
The -r switch controls the FPS.
Again, the FPS depends upon how many screens are actually captured by your device. If you have a fast SD-Card, and a fast processor, it is indeed likely that the frames captured would be more. You can try increasing the -r 4 by 2/3 frames and see if the video is suitable to your needs. (eg. -r 5/ -r 6, etc...)
Click to expand...
Click to collapse
This will change how long the picture stays (i set it down to 2, beacause in my case it was to fast).
MP4 and libx264 codec will give you better quality. I tested it yesterday the whole evening Trust me. Screenshot added (mp4 more clearly).
Try that one (video looks better):
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
vineethraj49 said:
Didn't know about that... It worked for me without those two DLLs. Anyways, I will just add it for safety.
Click to expand...
Click to collapse
Adding will take you on the safe side Thanks I think they are under GPLv2, but i´m not shure.
You can also download libiconv-1.9.2-1-bin.zip and libintl-0.14.4-bin.zip. DLL´s are in the "bin" directory after extracting.
vineethraj49 said:
You could change it yourself... Reason why I wouldn't change it? Because different devices have different mount points. If it is extSDcard, you can change accordingly. (If that wasn't the point, please clarify the last post. I understood it as: my mountpoint for sdcard is different :silly
Click to expand...
Click to collapse
Code:
[user=279333]@ECHO[/user] off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Internal SD? Same path you use in your batch-scripts. Should work for everyone.
[The Script i posted before was for use on micro-sd (working for my device) - i have changed it later ( ) to use on internal-sd for everyone]
Only one problem: the name of the files... can´t use the mkvideo.bat to make a video... i had to rename them after captureing using Ant Renamer2.
But you can add the 2 .bat from me as a "Bonus" into your zip if you want.
Sure!
Android-Andi said:
This will change how long the picture stays (i set it down to 2, beacause in my case it was to fast).
MP4 and libx264 codec will give you better quality. I tested it yesterday the whole evening Trust me. Screenshot added (mp4 more clearly).
Try that one (video looks better):
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Adding will take you on the safe side Thanks I think they are under GPLv2, but i´m not shure.
You can also download libiconv-1.9.2-1-bin.zip and libintl-0.14.4-bin.zip. DLL´s are in the "bin" directory after extracting.
Code:
[user=279333]@ECHO[/user] off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Internal SD? Same path you use in your batch-scripts. Should work for everyone.
[The Script i posted before was for use on micro-sd (working for my device) - i have changed it later ( ) to use on internal-sd for everyone]
Only one problem: the name of the files... can´t use the mkvideo.bat to make a video... i had to rename them after captureing using Ant Renamer2.
But you can add the 2 .bat from me as a "Bonus" into your zip if you want.
Click to expand...
Click to collapse
cool! i have no objection. as of mp4 encoding too, you could add it as a feature, but do release it in this thread only. I sure would give you credits for a version 2.0 :angel: i don't want xda to be weeded by one more thread. there are already many (by a gazillion n00bs )
I did some cool batch-scripts (modified scripts from yours). You can download from here. Extract and copy the *.bat into the android-shot folder.
What have i done?
E.g. you can set a different path for storing the *.png on your device untill they get pulled. You can also change the destination-folder (on your local computer).
(All codes only from line 7 to ~ line 15 in batch-script)
1. batch: screenshot_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard.
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set pngpath=screenshots[/COLOR]
REM (default-path:screenshots)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: you have to change it in the converting-video batch-script too.
2. batch: record_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
3. batch: record_running_android-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard
REM (default-path: /sdcard for internal storage)
REM
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set destpath=tmpandroid[/COLOR]
REM (default-path: tmpandroid)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: You have to change it in the converting-video batch-script too.
4. batch: mkvideo_mp4_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_recovery-universal.bat)
[COLOR="Red"]set pngpath=tmp[/COLOR]
REM (default-path:tmp - if you have modified the path do the same here)
Mountpoint of micro SD is different on any devices, you can change it to your´s. If you have changed it in the record_recover-batch-script - you have to do it too.
You can change also the destination folder - but leave it as it is If you have changed it in the record_recovery-batch-script - you have to do it too.
5. batch: mkvideo_mp4_running_android-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_runnning_android-universal.bat)
[COLOR="Red"]set pngpath=tmpandroid[/COLOR]
REM (default-path:tmpandroid - if you have modified the path do the same here)
You can change also the png folder - but leave it as it is If you have changed it in the record_running_android-batch-script - you have to do it too.
Please use Notepad++ if you want to change something in the batch-script.
For watching the .mp4 you can use Media Player Home Cinema.
Cool, but, one small change that I would like to say...
Android-Andi said:
I did some cool batch-scripts (modified scripts from yours). You can download from here. Extract and copy the *.bat into the android-shot folder.
What have i done?
E.g. you can set a different path for storing the *.png on your device untill they get pulled. You can also change the destination-folder (on your local computer).
(All codes only from line 7 to ~ line 15 in batch-script)
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard.
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set pngpath=screenshots[/COLOR]
REM (default-path:screenshots)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: you have to change it in the converting-video batch-script too.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard
REM (default-path: /sdcard for internal storage)
REM
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set destpath=tmpandroid[/COLOR]
REM (default-path: tmpandroid)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: You have to change it in the converting-video batch-script too.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_recovery-universal.bat)
[COLOR="Red"]set pngpath=tmp[/COLOR]
REM (default-path:tmp - if you have modified the path do the same here)
Mountpoint of micro SD is different on any devices, you can change it to your´s. If you have changed it in the record_recover-batch-script - you have to do it too.
You can change also the destination folder - but leave it as it is If you have changed it in the record_recovery-batch-script - you have to do it too.
Code:
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_runnning_android-universal.bat)
[COLOR="Red"]set pngpath=tmpandroid[/COLOR]
REM (default-path:tmpandroid - if you have modified the path do the same here)
You can change also the png folder - but leave it as it is If you have changed it in the record_running_android-batch-script - you have to do it too.
Please use Notepad++ if you want to change something in the batch-script.
For watching the .mp4 you can use Media Player Home Cinema.
Click to expand...
Click to collapse
drawbacks of your method :fingers-crossed: :
not all devices are fast enough to process the "capture>pull>remove" loop which you have implemented.
except that, awesomeness quotient is great. you have added support for capturing the screen while android is running in normal mode :victory:
It can be just downloaded and extracted into the folder where you already have the files... releasing it as version 2.0
p.s. Guess its time for me to update the linux version
vineethraj49 said:
drawbacks of your method :fingers-crossed: :
not all devices are fast enough to process the "capture>pull>remove" loop which you have implemented.
Click to expand...
Click to collapse
Maybe i can make 2 batch files (pulling as a second step). Maybe add the pull line into the "mkvideo_mp4_running_android-universal.bat".
I can test it after sleeping :silly:
And you´re right: its not so fast like in recovery (on my Galaxy Tab 2 7.0 P3110)
vineethraj49 said:
except that, awesomeness quotient is great. you have added support for capturing the screen while android is running in normal mode :victory:
Click to expand...
Click to collapse
Thank you Thanks for your great work before my modification - my modification wouldn´t be possible without you :good:
vineethraj49 said:
It can be just downloaded and extracted into the folder where you already have the files... releasing it as version 2.0
p.s. Guess its time for me to update the linux version
Click to expand...
Click to collapse
Do it
Because i´m not running a linux i couldn´t make it (and i´m not that good at linux).
Maybe i can make 2 batch files (pulling as a second step). Maybe add the pull line into the "mkvideo_mp4_running_android-universal.bat".
I can test it after sleeping :silly:
And you´re right: its not so fast like in recovery (on my Galaxy Tab 2 7.0 P3110)
Click to expand...
Click to collapse
Yeah, recovery... too slow
Thank you Thanks for your great work before my modification - my modification wouldn´t be possible without you :good:
Click to expand...
Click to collapse
Thank Kyan He and Whiskey103 too
Do it
Because i´m not running a linux i couldn´t make it (and i´m not that good at linux).
Click to expand...
Click to collapse
https://github.com/vineethraj49/android-shot
If you are interested, you can send in pull requests to https://github.com/vineethraj49/android-shot/tree/windows. PM me if interested to maintain the git,I will add you as a collaborator.
vineethraj49 said:
Yeah, recovery... too slow
Thank Kyan He and Whiskey103 too
https://github.com/vineethraj49/android-shot
If you are interested, you can send in pull requests to https://github.com/vineethraj49/android-shot/tree/windows. PM me if interested to maintain the git,I will add you as a collaborator.
Click to expand...
Click to collapse
sure, big thank @ Kyan He and Whiskey103 too!
i'll release update 2.0.1 later. i'm working on it. PM to you later.
pull won't work on windows. i tryed over vbs but didn't got it work.
Version 2.0.1 (extra batch-files)​
Download 2.0.1 from here
Installation:
Download and extract V 1.0 from op.
Extract "universal-bat2.0.1.zip" and copy all *.bat to "android-shot" directory.
Changes:
Code:
[LIST][*]not pulling data from your device (slowed down the recording process) @ record_running_android-universal.bat
[*]pulling before converting (better for recording process) @ mkvideo_mp4_running_android-universal.bat[/LIST]
How-To make a video in recovery:
1. start "record_recovery-universal.bat" (press CTRL + C if you are finished)
2. start "mkvideo_mp4_recovery-universal.bat" and follow the instructions.
How-To make a video in running android:
1. start "record_running_android-universal.bat" (press CTRL + C if you are finished)
2. start "mkvideo_mp4_running_android-universal.bat" and follow the instructions.
You can change the path from sdcard (default) to your micro-SD like before (different devices = different mountpoints) (instructions)
Thanks
@vineethraj49
Kyan He (https://plus.google.com/116857119889961125943) and his wonderful tool "fb2png" (https://code.google.com/p/android-fb2png/)
Whiskey103 (http://forum.xda-developers.com/member.php?u=2632943) and his guide (http://forum.xda-developers.com/showthread.php?p=40260716) on taking screenshot in windows.
Edit 30.07.2013:
Changed Download-Link, still 2.0.1 (some UI changes of the running batch)
time to update thread title I guess!
@Android-Andi, could you post a video for android_running_system for video recording as a sample?
vineethraj49 said:
@Android-Andi, could you post a video for android_running_system for video recording as a sample?
Click to expand...
Click to collapse
Shure,can do it next days,maybe today.
for rooted devices
is there anyby some gesture

[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

Question Is it possible to do a factory reset without data loss?

Is it possible to do a factory reset without data loss?
To uninstall all apps installed for Android's actual user ( default user 0 ) in one go and also backup actual user's data you can run a Windows CMD script what looks like this draft:
Code:
@echo off & setlocal
set "pc_bkup_fldr=C:\ANDROID-USER-DATA-BKUP"
rem add timestamp in ISO 8601 format to backup folder
for /F "tokens=2 delims==" %%a in ('wmic os get localdatetime /VALUE 2^>NUL') do ( set "datetime=%%a" )
if not "?%datetime%"=="?" (
for /F "tokens=1 delims=." %%a in ("%datetime%") do ( set "retval=%%a" )
if not "?%retval%"=="?" (
set yyyy=%retval:~0,4%
set mm=%retval:~4,2%
set dd=%retval:~6,2%
set "pc_bkup_fldr=%pc_bkup_fldr%-%yyyy%-%mm%-%dd%"
)
)
for /F "skip=1" "tokens=*" %%a in ('adb devices 2^>nul') do ( set "retval=%%a" )
if "?%retval%"=="?" ( goto :end )
mkdir "%pc_bkup_fldr%" 2>nul >nul
rem retrieve user id
for /F %%a in ('adb shell "am get-current-user"') do ( set "uid=%%a" )
rem Below command will return all the android user-app packages installed
rem on the connected Android device.
for /F "tokens=2 delims=:" %%a in ('adb shell "pm list packages --user %uid% -3"') do (
set "pkg_name=%%a"
if not "?%pkg_name%"=="?"
rem clear all application data (including application cache)
adb shell "pm clear --user %uid% %pkg_name%"
rem uninstall app by app package name
adb shell "pm uninstall --user %uid% %pkg_name%"
timeout /t 2 /nobreak >nul
)
)
rem Next command will return all the android user-data stored in /sdcard
rem partition of the connected Android device.
set "int_sdcard=/storage/emulated"
for /F "skip=1" "tokens=1,9 delims= " %%a in ('adb shell "ls -l %int_sdcard%/%uid%"') do (
set "dir_flag=%%a" & set "dir_name=%%b"
if not "?%dir_flag%"=="?"" (
echo %dir_flag% | findstr /C:"d" >nul
if %errorlevel% equ 0 (
set "data_fldr=%int_sdcard%/%uid%/%dir_name%"
rem backup the folder to pc
adb exec-out "tar -c %data_fldr%" > "%pc_bkup_fldr%\%dir_name%.tar"
rem delete contents of Android folder
adb shell "rm -f %data_fldr%/*"
timeout /t 2 /nobreak >nul
)
)
)
rem Next command reboots Android thus changes made take effect
adb reboot
:end
endlocal & @echo on
exit
DL: https://www.mediafire.com/file/b2qkflgiqhcni8i/my-factory-reset.bat/file
monica lewinsky said:
Is it possible to do a factory reset without data loss?
Click to expand...
Click to collapse
No
mah dude is confused factory reset is basically wiping your data partition
ineedroot69 said:
mah dude is confused factory reset is basically wiping your data partition
Click to expand...
Click to collapse
ROFL
jwoegerbauer said:
To uninstall all apps installed for Android's actual user ( default user 0 ) in one go and also backup actual user's data you can run a Windows CMD script what looks like this draft:
Code:
@echo off & setlocal
set "pc_bkup_fldr=C:\ANDROID-USER-DATA-BKUP"
rem add timestamp in ISO 8601 format to backup folder
for /F "tokens=2 delims==" %%a in ('wmic os get localdatetime /VALUE 2^>NUL') do ( set "datetime=%%a" )
if not "?%datetime%"=="?" (
for /F "tokens=1 delims=." %%a in ("%datetime%") do ( set "retval=%%a" )
if not "?%retval%"=="?" (
set yyyy=%retval:~0,4%
set mm=%retval:~4,2%
set dd=%retval:~6,2%
set "pc_bkup_fldr=%pc_bkup_fldr%-%yyyy%-%mm%-%dd%"
)
)
for /F "skip=1" "tokens=*" %%a in ('adb devices 2^>nul') do ( set "retval=%%a" )
if "?%retval%"=="?" ( goto :end )
mkdir "%pc_bkup_fldr%" 2>nul >nul
rem retrieve user id
for /F %%a in ('adb shell "am get-current-user"') do ( set "uid=%%a" )
rem Below command will return all the android user-app packages installed
rem on the connected Android device.
for /F "tokens=2 delims=:" %%a in ('adb shell "pm list packages --user %uid% -3"') do (
set "pkg_name=%%a"
if not "?%pkg_name%"=="?"
rem clear all application data (including application cache)
adb shell "pm clear --user %uid% %pkg_name%"
rem uninstall app by app package name
adb shell "pm uninstall --user %uid% %pkg_name%"
timeout /t 2 /nobreak >nul
)
)
rem Next command will return all the android user-data stored in /sdcard
rem partition of the connected Android device.
set "int_sdcard=/storage/emulated"
for /F "skip=1" "tokens=1,9 delims= " %%a in ('adb shell "ls -l %int_sdcard%/%uid%"') do (
set "dir_flag=%%a" & set "dir_name=%%b"
if not "?%dir_flag%"=="?"" (
echo %dir_flag% | findstr /C:"d" >nul
if %errorlevel% equ 0 (
set "data_fldr=%int_sdcard%/%uid%/%dir_name%"
rem backup the folder to pc
adb exec-out "tar -c %data_fldr%" > "%pc_bkup_fldr%\%dir_name%.tar"
rem delete contents of Android folder
adb shell "rm -f %data_fldr%/*"
timeout /t 2 /nobreak >nul
)
)
)
rem Next command reboots Android thus changes made take effect
adb reboot
:end
endlocal & @echo on
exit
DL: https://www.mediafire.com/file/b2qkflgiqhcni8i/my-factory-reset.bat/file
Click to expand...
Click to collapse
thanks for this. it's exactly i was looking for.

program to move apps and data

Is there a computer program that removes apps and data from one phone and reinstalls them onto another phone easier than trying to do it all "by hand", one app at a time?
You can achieve this by writing a Windows batch script that makes use of ADB commands adb backup and adb restore.
jwoegerbauer said:
You can achieve this by writing a Windows batch script that makes use of ADB commands adb backup and adb restore.
Click to expand...
Click to collapse
I appreciate the suggestion but is there any other way? I know not what a Windows batch script is or how to go about making one.
Fot the readers who know what a Windows batch script is, here an example that does the job
Code:
@echo off & setlocal
echo Unplug USB-connection between Android to get backed up and PC
echo When done press any key to continue ...
pause >nul
echo Connect Android with PC via USB
echo When done press any key to continue ...
pause >nul
adb devices
set /A cnt_pkg=0
for /F "tokens=2 delims=:" %%a in ('adb shell "pm list packages -3"') do (
set "pkg=%%a"
if NOT "?%pkg%"=="?" (
for /F "tokens=*" %%f in ('adb shell "pm dump %pkg% | grep 'ALLOW_BACKUP'"') do ( set "flags=%%f" )
if NOT "?%flags%"=="?" (
set /A cnt_pkg+=1
adb backup -f %USER%\%pkg%.backup -apk %pkg%
)
)
)
echo %cnt_pkg% user apps backed up
if %cnt_pkg% equ 0 ( goto :done )
echo Unplug USB-connection
echo When done press any key continue ...
pause >nul
echo Connect Android where apps should get restored to with PC via USB
echo When done press any key to continue ...
pause >nul
adb devices
set /A cnt_pkg=0
for /F "tokens=*" %%a in ('dir %USER%\*.backup /B') do (
set "bkup=%%a"
if NOT "?%bkup%"=="?" (
set /A cnt_pkg+=1
adb restore %USER%\%bkup%
)
)
echo %cnt_pkg% user apps restored
echo Press any key to continue ...
pause >nul
:done
endlocal & @echo on & exit

Process cannot access the file as it is used by another process

I am trying to create windows batch script to check the size of file after it is downloaded but it fails with this message. The Process cannot access the file as it is used by another process 2048 was unexpected at this time. Thanks in advance for any help.
Code -
@Echo off
d:\wget.exe ...
Rem this wget process downloads tst_file.xml
set file="tst_file.xml"
set maxbytesize=2048
for /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% LSS %maxbytesize% (echo file is less than 2KB)
If download gets interrupted for whatever reason then file isn't get properly closed by WGET.
BTW:
1. Location of downloaded file isn't correctly determined: file's path is missing.
2. Use FORFILES to determine file size
Code:
rem List the size of downloaded file:
for /F "tokens=*" %%a in ('FORFILES /M %downloaded_file% /C "cmd /c echo @fsize"') do ( set /A downloaded_bytes=%%a )

Categories

Resources