(TOOL) Haipai X710D MTK6577 Deodex+zipalign Tools + smooth scroll patched framework.j - Android General

MY Haipai x710D CUSTOM ROM is released , Worth check
Go to ROM Download Page
Hi all , I have bought haipai x710d for about a month and I found this phone is quite good , much faster than my one v. I have paid quite a lot of time in digging the potential of this phone. I would like to share my Effort with all guys who bought this phone...here is my first Tool for x710d
" The auto deodex and zipalign Tool "
Using this tool is quite simple... Just copy all files in \system\app\ (.apk + .odex files) and \system\framework\ (.jar + .odex files) under the root folder of the tool
like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
and simply run
start_deodex_zipalign.bat and then wait ....
After that of course you need to copy all the processed files back to your phone... manually...sorry I am kind of lazy man... YOU know what I mean...:laugh:
I have tested the tool so many times and worked perfect However I cant guarantee that it will run perfect on your machine too... depends on your
machine config.
As for the smooth scroll patched framework file , simply copy it into \system\framework and replace the original one ...CAUTION: You must deodex the rom before apply the smooth scroll patched file.
Thanks AndroidON for the good tutorial on patching framework.jar

Thank you for your explanation in the PM. Unfortunately I could not get it to work.
I unzipped your tool to a folder, used root explorer to copy the content of system\app and system\framework into the microSD card, and transferred these files from the microSD card to the tool folder. Then I right-click "start_deodex_zipalign.bat" and chose "run as administrator". Command prompt popped up and the tool seemed to run through.
However, all the files I transferred to the tool folder did not disappear. There were no "deodexed framework" and "deodexed zipaligned apk" folders in the tool folder. However, I found these folders in Windows/system32, but they were empty.
I tried moving the unpacked tool folder to the root of the system drive (C:\\) and even into windows\system32 folder, but the result was the same.
I use the Taiwan101 v.2 ROM (based on 20120713 firmware), and I used root uninstaller to remove some of the system apps. I wonder if this may be the cause of your tool not working?

I think different system environment configuration causing the problem...and it's related to the %cd% variable in the batch file.. So the fix is try open the batch file with notepad then "find and replace %cd% with c:\myfastdeodextool-hoipai like below ..
@echo off
@echo ==================================================
@echo.
@echo Auto deodex + Zipalign Tool by BjDanny @ XDA Forum
@echo.
@echo ==================================================
@mkdir c:\myfastdeodextool-hoipai\deodexed_framework
@mkdir c:\myfastdeodextool-hoipai\deodexed_zipaligned_apk
@set df=c:\myfastdeodextool-hoipai\deodexed_framework\
@set daz=c:\myfastdeodextool-hoipai\deodexed_zipaligned_apk
@set baksmali=c:\myfastdeodextool-hoipai\bin\baksmali-1.3.4.jar
@set smali=c:\myfastdeodextool-hoipai\bin\smali-1.3.4.jar
@set zip=c:\myfastdeodextool-hoipai\bin\zip.exe
@set zipalign=c:\myfastdeodextool-hoipai\bin\zipalign.exe
@set apilevel=15
if exist *res.apk (@move *res.apk %df% >>nul)
:dfw
@echo This error log can be ignored because of the reason "Odex file are not exist">>c:\myfastdeodextool-hoipai\err.txt
@echo. >>c:\myfastdeodextool-hoipai\err.txt
@echo Start deodex Framework >> c:\myfastdeodextool-hoipai\deodex.log
@if exist c:\myfastdeodextool-hoipai\out (rmdir /s /q c:\myfastdeodextool-hoipai\out)
@set filetype=jar
@echo Creating Jar file list ...
@dir c:\myfastdeodextool-hoipai /b | findstr /m .jar >>c:\myfastdeodextool-hoipai\jarfile.txt
@for /F "delims=" %%a in (c:\myfastdeodextool-hoipai\jarfile.txt) do @echo Baksmali %%~na.odex ... && @echo. && java -Xmx512m -jar %baksmali% -a %apilevel% -x %%~na.odex 2>>c:\myfastdeodextool-hoipai\err.txt && @echo Smali ... && @echo. && java -Xmx512m -jar %smali% -a %apilevel% -o classes.dex out && @echo Merge %%~na.%filetype% ... && @echo. && @%zip% -r -q %%~na.%filetype% classes.dex && @echo Delete classes.dex && @echo. && @del /f /q c:\myfastdeodextool-hoipai\classes.dex && @echo Delete out folder ... && @echo. && rmdir /s /q c:\myfastdeodextool-hoipai\out && @echo Deodexed %%~na.%filetype% && @echo. && @echo =========================================================== && @echo ( %%~na.%filetype% ) - was deodexed successfully! >> c:\myfastdeodextool-hoipai\deodex.log
@echo Moving Done framework to deodexed_framework\
@move c:\myfastdeodextool-hoipai\*.%filetype% %df%
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> c:\myfastdeodextool-hoipai\deodex.log
@echo Deodexed Framework >> c:\myfastdeodextool-hoipai\deodex.log
@echo. >> c:\myfastdeodextool-hoipai\deodex.log
@del /f /q c:\myfastdeodextool-hoipai\jarfile.txt
@goto da
:da
@echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> c:\myfastdeodextool-hoipai\deodex.log
@echo Start Deodex and Zipalign APK >> c:\myfastdeodextool-hoipai\deodex.log
@echo. >> c:\myfastdeodextool-hoipai\deodex.log
@set filetype=apk
@echo Creating Apk file list ...
@dir c:\myfastdeodextool-hoipai /b | findstr /m .apk >>c:\myfastdeodextool-hoipai\apkfile.txt
@for /F "delims=" %%a in (c:\myfastdeodextool-hoipai\apkfile.txt) do @echo Baksmali %%~na.odex ... && @echo. && java -Xmx512m -jar %baksmali% -a %apilevel% -x %%~na.odex 2>>c:\myfastdeodextool-hoipai\err.txt && @echo Smali ... && @echo. && java -Xmx512m -jar %smali% -a %apilevel% -o classes.dex out && @echo Merge %%~na.%filetype% ... && @echo. && @%zip% -r -q %%~na.%filetype% classes.dex && @echo Delete classes.dex && @echo. && @del /f /q c:\myfastdeodextool-hoipai\classes.dex && @echo Delete out folder ... && @echo. && rmdir /s /q c:\myfastdeodextool-hoipai\out && @echo Deodexed %%~na.%filetype% && @echo. && @echo ( %%~na.%filetype% ) - was deodexed successfully! >> c:\myfastdeodextool-hoipai\deodex.log && @echo.& @echo.&& @echo Zipalign %%~na.%filetype% ... && @%zipalign% -v 4 c:\myfastdeodextool-hoipai\%%~na.%filetype% c:\myfastdeodextool-hoipai\%%~na.%filetype%.ZIPALIGNED && @echo. && @echo ===========================================================
@echo.
@echo Moving Deodexed APKs into deodexed_zipaligned_apk folder ...
@echo.
@move c:\myfastdeodextool-hoipai\*.apk.ZIPALIGNED c:\myfastdeodextool-hoipai\deodexed_zipaligned_apk\
@echo Renaming files
@for %%a in ("c:\myfastdeodextool-hoipai\deodexed_zipaligned_apk\*") do ren "%%a" "%%~na"
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>> c:\myfastdeodextool-hoipai\deodex.log
@echo Deodexed and Zipaligned APK >> c:\myfastdeodextool-hoipai\deodex.log
@del /f /q c:\myfastdeodextool-hoipai\apkfile.txt
@del /f /q c:\myfastdeodextool-hoipai\*.odex
@del /f /q c:\myfastdeodextool-hoipai\*.%filetype%
@echo All Action Completed ! Thanks for using
@pause
@goto exit
:err
@echo error found
@pause
:end
@exit
and this time i am using fix path (c:\myfastdeodextool-hoipai) rather than (%cd%)
so you need to put the tool under c:\
The folder name myfastdeodextool-hoipai is up to you ...you can name it with your own idea but pls do use the same name in the batch file
I tested this amended code on my win 7 32 bit OS , ran perfect ...without any errors...
Try it out ... Thanks for using...

Thanks for sharing.
Can you show us the code changes for framework.jar so we can use it for other ROM as well?
Thanks.
Tested and it works perfect after changing the %cd% to C:/XX and unzip downloaded files and ALL system/app and system/framework to the C:/XX.
Thank you.
Can you work out a odex batch file?

---- oriignal post deleted -----
Thanks jbctiong - after reading what you said, I finally understand what I need to do.
Changing %cd% to a fixed folder name means that I have to move the content of the unzipped tool and the content of the \system\app and \system\framework folders to the folder of that name, in the root of the system drive.
ie. If I rename %cd% to c:\deodex, I have to make a new folder called "deodex" in the system drive "C", and move everything into this folder, before running the .bat file.
I got it all worked out finally, thanks!

Sorry one more noob question.
What is the best way to replace the old files in the system/app and system/framework folders with the new files?
I deleted all the files in the app folder first, then realize all the functions of the phone freeze. This is certainly the stoopid way to do it.

slim_thumb said:
---- oriignal post deleted -----
Thanks jbctiong - after reading what you said, I finally understand what I need to do.
Changing %cd% to a fixed folder name means that I have to move the content of the unzipped tool and the content of the \system\app and \system\framework folders to the folder of that name, in the root of the system drive.
ie. If I rename %cd% to c:\deodex, I have to make a new folder called "deodex" in the system drive "C", and move everything into this folder, before running the .bat file.
I got it all worked out finally, thanks!
Click to expand...
Click to collapse
I will post the changed code on smooth scroll patched framework later because i am currently working on custom rom for x710d based on latest official rom which is version 0902

slim_thumb said:
Sorry one more noob question.
What is the best way to replace the old files in the system/app and system/framework folders with the new files?
I deleted all the files in the app folder first, then realize all the functions of the phone freeze. This is certainly the stoopid way to do it.
Click to expand...
Click to collapse
make a cwm update zip file is the best...
using adb shell command is second choice

Sorry more problem.
I tried to backup with CWM, but when I check the CWM folder, although it has created the folder with the date of the backup, it is empty.
Does anyone have problem with their CWM backup?
---------- Post added at 04:59 PM ---------- Previous post was at 04:50 PM ----------
Another question:
When I look at the content of my Taiwan101 custom ROM, I notice the "system" folder has the same "app" and "framework" folders. I guess I can replace the content of these two folders with the deodexed / zipaligned files, repack and flash it with CWM?
If this work, I presume I can do the same for future versions of CWM flashable custom ROMs?

slim_thumb said:
Sorry more problem.
I tried to backup with CWM, but when I check the CWM folder, although it has created the folder with the date of the backup, it is empty.
Does anyone have problem with their CWM backup?
---------- Post added at 04:59 PM ---------- Previous post was at 04:50 PM ----------
Another question:
When I look at the content of my Taiwan101 custom ROM, I notice the "system" folder has the same "app" and "framework" folders. I guess I can replace the content of these two folders with the deodexed / zipaligned files, repack and flash it with CWM?
If this work, I presume I can do the same for future versions of CWM flashable custom ROMs?
Click to expand...
Click to collapse
problem 1: Never met
problem 2: yes you can do that ...

---- oriignal post deleted ----
Thanks. Looking forward to the custom version of the latest official FW. In the meantime I am going to mess around and learn how to get this deodex / zipalign process working.

bjdanny said:
I will post the changed code on smooth scroll patched framework later because i am currently working on custom rom for x710d based on latest official rom which is version 0902
Click to expand...
Click to collapse
Can you post a link to the latest firmware 09/02/2012, and what the bug fixes and changes are? ie. Front camera, bluetooth, wifi, external sd, etc..

brotherman38 said:
Can you post a link to the latest firmware 09/02/2012, and what the bug fixes and changes are? ie. Front camera, bluetooth, wifi, external sd, etc..
Click to expand...
Click to collapse
This phone is made in china. so the page you request is written in chinese
This is the description page
http://www.jajatong.com/article/show-86.aspx
This is the download link
http://l11.yunpan.cn/lk/59k5uxavll
AS for what have been updated sorry I can't find change log of the firmware..
So , I was just guesssing .
under the download page you can see follow message
20120713_e1809c_v77_lx529_x710d2.zip
225.1MB, jajat***@jajatong.com 发布于2012-09-03
20120713_e1809c_v77_lx529_x710d2.zip is the file name
225.1MB, jajat***@jajatong.com 发布于2012-09-03 means the manufacturer uploaded may be updated rom on 2012-09-03 the package is 225.1.MB

Related

One Click Apk Signer... Easiest Apk Signing Ever

So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.
You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.
hopefully this one works for me.. java has been in my class path for others, but could never figure out where things went wrong...
I can answer any Java question you have... class path, Mem settings
Sent from my PC36100 using XDA App
thanks, working for me!
Use Zipsigner instead
Sent from my X8
hopefully this one works for me too..
How i do in UNIX??
useless
ASimmons said:
...give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned...
Click to expand...
Click to collapse
Maybe others would work with proper tweaking of environment variables, but One Click Signer is the first solution that worked for me! However, I could not get it to work by providing any name & path such as C:\myapp.apk or even what the prompt literally asks for- myapp.apk C:\. What finally worked through trial & error was to just have the apk in the same directory as one_click_signer.cmd and specify ONLY the apk name (as in myapp.apk). I'm not positive, but spaces in paths or file names are probably best avoided as well.
Thank you so much man I can now test my app skipping google's requirements.
very useful. I had problems signing apks and this did the trick.
Hello.
Very nice tutorial, i just find it easier to do it like this:
1. Download the rar and extract the lib folder somewhere
2. Copy your APK or ZIP to the lib folder
3. Press shift and rightclick in the folder (not on a file) - select "open command prompt here"
4. To sign a file: java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 <APK OR ZIP NAME> <APK OR ZIP NAME> (example java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 myfile.apk myfile.apk
5. To zipalign the file: zipalign -f 4 <APK OR ZIP NAME> <APK OR ZIP NAME> (example: zipalign -f 4 myfile.apk myfile.apk)
Done!
The reason for this approch is that you are 100% sure it will work, because you are working directly in the directory.
monchyrcg said:
How i do in UNIX??
Click to expand...
Click to collapse
Linux:
Code:
[email protected]:~/android/apktool$ cat one_click_signer/one_click_signer.sh
export EnableDelayedExpansion # dunno what that does
if [ -z $1 ]; then
echo "usage: $0 xxx.apk"
exit 2
fi
ROM=$1
cp $ROM x$ROM
cd lib
# sign the rom
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ../$ROM ../x$ROM
# zip align
./zipalign -f 4 ../x$ROM ../signed-$ROM
cd ..
rm x$ROM
copy zipalign from ~/android-sdk-linux_x86/tools/
sh-06d nerv only Docomo launcher Rom oficial
Hello good friends and found the files in the official ROM released for the phone sh-06d nerv only here you will find all the content of the wallpapers Ringtones equipment and just about anything to have hope and someone decides to port it to other teams in this community so great there are people who really like to share their knowledge and would love to work together to carry this Rom for other teams doing well and something that many users have asked seen shouting greetings and look forward to your support here I left the Link http://tieba.baidu.com/p/2012713251
Finally, a program that worked. Good work.
I am new to android i dont know any thing please help
ASimmons said:
So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.
You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.
Click to expand...
Click to collapse
for this post i want say that i have a java installed in my windows xp can any one send me a video tutorial on how to use one click signer.
my email id is [email protected]
---------- Post added at 11:23 AM ---------- Previous post was at 11:19 AM ----------
ASimmons said:
So I see people have trouble using apk manager, apk tool or the signing tool. This solves that simple double click the one_click_signer.cmd and give the name and path of your zip or apk and BAM!!! it gets signed and zipaligned.
You'll need java in your class path for this to work orrr alter the script to point to where java is on your machine.
Click to expand...
Click to collapse
You'll need java in your class path
What does that mean i have a java installed on xp please help or send a video.
easiest way is to just drag apk file into one click dailog box. .and press enter......it will do the rest itself....i wish unity 4+ were also open sourcd...
The script only works if you put apk/zip in script folder. I rewrote the script. Open the cmd file and replace all text with this one:
Code:
@ECHO off
setlocal EnableDelayedExpansion
SET SCRIPT_PATH=%0
SET SCRIPT_PATH=%SCRIPT_PATH:"=%
echo %SCRIPT_PATH% | FIND ":" > nul
IF %ERRORLEVEL%==1 SET SCRIPT_PATH=%CD%\%SCRIPT_PATH%
FOR /F "delims=\ tokens=*" %%G IN ('echo %SCRIPT_PATH%') DO SET SCRIPT_PATH=%%~dpG
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
if NOT "%1"=="" goto seguir
echo Enter full path and filename of the apk/zip to sign or drag&drop file to this window:
SET /P rom=----^>?
call :separar "%ROM%"
goto seguir2
:seguir
call :separar "%1"
:seguir2
echo Copying "%ruta%%archivo%" to "%ruta%temp-%archivo%"
copy "%ruta%%archivo%" "%ruta%temp-%archivo%">nul
set olddir=%cd%
cd /d "%SCRIPT_PATH%\lib"
echo Signing "%ruta%temp-%archivo%"
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 "%ruta%temp-%archivo%" "%ruta%temp-%archivo%"
echo Zip aligning "%ruta%temp-%archivo%" to "%ruta%signed-%archivo%"
zipalign -f 4 "%ruta%temp-%archivo%" "%ruta%signed-%archivo%"
del "%ruta%temp-%archivo%"
cd /d "%olddir%"
goto fin
:separar
set ruta=%~dp1
set archivo=%~nx1
goto :eof
:fin
This works in the folllowing cases:
- Calling script from command line (from any drive/folder)
- Calling it from Windows (Explorer/Run/etc)
And you can pass apk/zip in the following ways:
- Drag&drop file to the console window
- Passing file as an argument
- Manually writing full path and filename to file
Bye and sorry for my english.
PLAY STORE SAYS ::
Upload failed
You uploaded an APK that is signed with a restricted certificate. You need to upload an APK signed with your own certificate.
PLEASE UPDATE THE CERTIFICATE FILES
Right-Click Menu?
I created .reg file to add this "apksign one click" to mouse right click menu (when i click r-click on apk, will give me sign apk).
SEE the BOLD part..i get the menu but it dont work i got error...later ill show you
Code:
@echo off
color 0a
:: relaunch self elevated
ver|find /i "XP">nul||whoami /all|find "S-1-16-12288">nul
IF %ERRORLEVEL% NEQ 0 (
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
)
java -version >nul 2>&1||echo Error: Java is not found&&echo Please install JRE first &&echo.&&echo Existing..&&pause&&exit
:: remove menu handlers installed by other apps
reg add "HKCR\.apk" /f /ve /t REG_SZ /d ""
reg delete "HKCU\Software\Classes\.apk" /f >nul 2>&1
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.apk" /f >nul 2>&1
reg add "HKCR\.apk\DefaultIcon" /f /ve /t REG_SZ /d "%~dp0tools\apk.ico"
reg add "HKCR\.apk\shell\decompile" /f /ve /t REG_SZ /d "Browse Java Code of APK"
reg add "HKCR\.apk\shell\decompile\command" /f /ve /t REG_SZ /d "\"%~dp0tools\decompile.cmd\" \"%%1\""
reg add "HKCR\.apk\shell\disassemble" /f /ve /t REG_SZ /d "Disassemble APK and Decode Resources"
reg add "HKCR\.apk\shell\disassemble\command" /f /ve /t REG_SZ /d "\"%~dp0tools\disassemble.cmd\" \"%%1\""
reg add "HKCR\.apk\shell\install" /f /ve /t REG_SZ /d "Install APK to Phone"
reg add "HKCR\.apk\shell\install\command" /f /ve /t REG_SZ /d "\"%~dp0tools\install.cmd\" \"%%1\""
[U]reg add "HKCR\.apk\shell\signapk" /f /ve /t REG_SZ /d "Sign the Apk"
reg add "HKCR\.apk\shell\signapk" /f /ve /t REG_SZ /d "\"%~dp0tools\oneclickapksigner.cmd\" \"%%1\""[/B][/U]
reg add "HKCR\folder\shell\recompile" /f /ve /t REG_SZ /d "Recompile APK from Disassembly"
reg add "HKCR\folder\shell\recompile\command" /f /ve /t REG_SZ /d "\"%~dp0tools\buildapk.cmd\" \"%%1\""
:: remove entries left from old versions
reg delete "HKCR\jarfile\shell\decompile" /f >nul 2>&1
pause

[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

[GUIDE]To Unpack/Repack livesuit flashable images

While browsing XDA i didn't find anything for unpacking Livesuite images so i created this THREAD.
Things you need
Allwiner kitchen
Stock Firmware
Linux image tool
Ubuntu 64 bit
Click to expand...
Click to collapse
Lets start
Step 1
Extracting and building the stock image (Windows)
Extract a10_flash_kitchen_v1.zip and look inside the directory, you'll see packer_gb and packer_ics. packer_ics is for Android ICS, so that is the one you will be using.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Open packer_ics and you will notice a bunch of directories and a couple of .bat scripts. We will spend a lot of time in these directories.
Extract the stock firmware you downloaded earlier, and copy the .img file into this directory. Rename the file to original.img.
Run the extract_image.bat script, and a command window will pop up while it is extracting.
The command window will output like the following, it will display Press any key to continue . . . when it is complete. Press a key to close the window.
Once the command window is closed, open the _extract directory and all of the extracted files will be there. The three following files are the ones we are interested in: RFSFAT16_BOOT_00000000000.fex (the boot partition), RFSFAT16_RECOVERY_0000000.fex (the recovery partition), RFSFAT16_SYSTEM_000000000.fex (the system partition, ext4 sparse).
NOTE and WARNING Some systems may also have a RFSFAT16_BOOTLOADER_00000.fex, which may also be required for your device to boot properly. There are some vague instructions @ this TechKnow forums post. I (the reader) will attempt to clarify and modify this page with the updated additional instructions for these devices to aid in making these instructions more universal for anyone using LiveSuit.
Click to expand...
Click to collapse
Step 2
Extracting, modifying and building partitions (Linux)
Copy your Extracted files to ubuntu
Rename the files as follows:
RFSFAT16_BOOT_00000000000.fex -> boot.img
RFSFAT16_RECOVERY_0000000.fex -> recovery.img
RFSFAT16_SYSTEM_000000000.fex -> system.fex
Click to expand...
Click to collapse
Copy the tools.tar.gz archive you downloaded earlier into the same directory.
To extract the tools, right click on the file and click Extract here.
This will extract the tools into a tools subdirectory.
Type terminal to show the terminal application. Hit enter and the terminal will appear.
Boot partition
Code:
$ cd "custom image"
$ tools/split_bootimg.pl boot.img
$ ls
Now extract the ramdisk file into a ramdisk subdirectory.
Code:
$ mkdir ramdisk
$ cd ramdisk
$ gunzip -c ../boot.img-ramdisk.gz | cpio -i
$ ls
You are now able to modify the files as needed.
Once you have finished modifying the file, we will rebuild the image. Run the following commands.
Code:
$ cd ..
$ tools/mkbootfs ramdisk | gzip > ramdisk-new.gz
$ tools/mkbootimg --base 0x40000000 --kernel boot.img-kernel --ramdisk ramdisk-new.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new-boot.img
$ ls
Recovery partition
his follows the same process as the boot partition. Execute the following commands to extract the image:
Code:
$ tools/split_bootimg.pl recovery.img
$ rm -rf ramdisk
$ mkdir ramdisk
$ cd ramdisk
$ gunzip -c ../recovery.img-ramdisk.gz | cpio -i
$ ls
rebuild the image with the following commands:
Code:
$ cd ..
$ tools/mkbootfs ramdisk | gzip > ramdisk-new.gz
$ tools/mkbootimg --base 0x40000000 --kernel recovery.img-kernel --ramdisk ramdisk-new.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new-recovery.img
$ ls
System partition
The process for the system partition is different, because it is not bootable and because it is ext4 sparse, so it cannot be mounted straight away. Execute the following commands to convert and mount the image:
Code:
$ tools/simg2img system.fex system.img
$ mkdir system
$ sudo mount -o loop system.img system
$ cd system
$ ls
Once you are done, execute the following commands to rebuild the system image:
Code:
$ cd ../tools
$ sudo ./mkuserimg.sh -s ../system ../new-system.fex ext4 ../tmp 300M
$ cd ..
$ sudo umount system
$ ls
Now switch back to the file browser and you will see many new files in your directory. The three files that you are interested in are new-boot.img, new-recovery.img, new-system.fex
Copy these to your Windows drive to the directory a10_flash_kitchen_v2/packer_ics/_input
Click to expand...
Click to collapse
Step 3
Building the new image (Windows)
Once the files are copied, jump back to Windows and rename the files as following:
new-boot.img -> root.fex
new-recovery.img -> recovery.fex
new-system.fex -> system.fex
Click to expand...
Click to collapse
http://i.imgur.com/klTA5.png/img]
Now we need to make some modifications to the image config file. Navigate to the files directory and you should see image.cfg.
[img]http://i.imgur.com/Wg6Ov.png/img]
Open this file using your text editor that supports Unix line endings. Using Notepad will break this file. Locate the two lines that reference OEM and VOEM as is highlighted below.
[img]http://i.imgur.com/YxczH.png
Comment these lines by adding a semicolon ( to the start of each line. Do not make any other modifications. Save the file once you have made the change.
http://i.imgur.com/urMMN.png/img]
Go back to the packer_ics root directory and find the create_image.bat script. It will open a console while it is creating the new image.
[img]http://i.imgur.com/X2O6l.png
Once the process is complete, you will see Press any key to continue . . . and you will have a new image called output.img.
AND JUST FLASH IT AND YOU ARE DONE
Click to expand...
Click to collapse
Credits
miniandwiki
To ME
To Everyone who helped me creating this one
do i have to use 64bit liux?? i only have a 32 bit computer?? thnx
Permission denied
Hey....
I installed Ubuntu on an external disk. But even logged at su (also tried sudo su) I dont have the permission to perform with the Linux-tool. When I click at the roo-folder, it is already set to rw permission for root.
What am I doing wrong?
Links are broken, can you kindly update them.
Links are broken Pls Upload to another host

[SCRIPT] Make ODIN Flashable tars

Easy peasy. Download the script attached and run as follows to create an Odin flashable tar
Code:
$ odintar image_1 image_2 image_3 ... image_X package.tar
You can also run the script with no arguments to get the usage information.
The output will be a package.tar.md5 which will contain all the image_XXX files you specified, and will also be Odin flashable.
Flash at your own risk, but I have tested this and it works. Just helps to automate tar flashable making
Instructions for use:
Download and remove .txt extension
Move/Copy to somewhere in your path (~/bin, /usr/local/bin, [for cygwin move it to C:/path/to/cygwinDirectory/bin] anywhere in your PATH)
Run to make tars
Profit.
Contents of script file:
Code:
#!/bin/bash
if [ "[email protected]"="" ]
then
echo "Usage: $0 image_1 image_2 ... image_X package.tar"
exit 0
fi
O=${#@}
((NUM = ${#@} - 1))
tar -H ustar -c ${@:1:$NUM} > ${@:$O}
md5sum -t ${@:$O} >> ${@:$O}
mv ${@:$O} ${@:$O}.md5

[TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi, I present you my tool for unpacking/repacking boot and recovery images for Android phones: Carliv Image Kitchen for Android.
2016-06-30 Update to version 1.3 stable
Changelog:
- detect mtk header during unpacking;
- removed grep method;
Instructions can be found in every variant folder.
To start it just double click on carliv.bat script (windows) or carliv script (Linux) then choose "Run in terminal" from dialog box.
Credits:
yuweng for his assistance and help on testing and troubleshooting (you should thank him too guys - it was a great help);
michfood for initial starting ideea;
osm0sis for bootimg-info source and some hints from his kitchen;
Cyanogenmod for mkbootimg source folder;
Omnirom for their clean implementation of MTK header.
Pete Batard for bootimage tools windows fix.
Thomas Polaert ([email protected]) for CECHO DOS coloring tool (windows version).
If you want to share this in other websites, blogs or forums please keep the credits from script files (I wrote those from scratch), and give proper credits for me.
Contributors
carliv, yuweng
Drag & Drop on linux CarlivImageKitchen version! function implemented by yuweng
Alternative linux version with Drag and Drop functionality, modded by my friend yuweng! -* carliv's edit: copied here from my friend's post.
Yes, now you can also Drag&Drop to UnPack/ RePack Android images on linux using CarlivImageKitchen !
Download CarlivImageKitchen-DnD.zip & extract to your linux Desktop, copy out all the five .desktop files to your Desktop & start Dragging & Dropping . . . :laugh: You can also Drag&Drop it to same .desktop files inside CarlivImageKitchen folder & it'll to work too . . . :good:
Tested working perfectly on BBQLinux & also Ubuntu, however, for Ubuntu you need to open the .desktop launcher shortcut with any text editor & manual edit the command as below . . .
Code:
[COLOR="Blue"]gnome-terminal[/COLOR] -e "bash -c \"~/Desktop/CarlivImageKitchen/image_info %f\""
i have also tested it on numerous of linux terminal program & it works perfectly too so you gotta manual edit it if you are using those . . . :good:
Code:
[URL="https://launchpad.net/terminator"]terminator[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="https://konsole.kde.org/"]konsole[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/unpack_MTK_img %f""
[URL="http://mate-desktop.org/#mate-terminal"]mate-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/GNOME_Terminal"]gnome-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/repack_MTK_img %f""
[URL="http://wiki.lxde.org/en/LXTerminal"]lxterminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://roxterm.sourceforge.net/"]roxterm[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="https://www.enlightenment.org/p.php?p=about/terminology"]terminology[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/repack_img %f""
[URL="https://launchpad.net/sakura"]sakura[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/Xterm"]xterm[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/Terminal_(Xfce)"]xfce4-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/unpack_img %f""
No more typing to unpack/ repack, just draaaagggg & drooooopppp it like you use to do that on Windows . . . :laugh:
Full credits to Master Shifu Carliv, i just modded a few lines to support Drag&Drop, that's all . . .
Drag&Drop in Action !
Konsole
roxterm
sakura
gnome-terminal
lxterminal
mate-terminal
xterm
terminator
terminology
xfce4-terminal
If you want to hit the THANKS button for yuweng's version, go here and do it.
Mirror Downloads
2015-04-08 Big Update to version 1.0 stable
Changelog:
- corrected few issues in scripts;
- rebuilt all modules also to correct some issues;
- cleaned up the source;
- added more compression support - see next;
- now the kitchen supports ramdisks compressions as following: gz, bz2, lzma, xz, lzo, lz4;
- converted to a Menu driven interface: now everything can be done from inside kitchen menu with few clicks;
- updated Instructions (can be loaded in kitchen interface for reading).
* for those of you who don't want the menu interface, there is version 0.5 in download list, with the old individual scripts structure but updated with same modules and compression support as version 1.0 (I kept this especially for windows, where it can be used with drag and drop).
2015.02.16 Update version 0.3
rebuilt binaries to correct few issues.
some fixes in scripts.
generate correct sha id.
use minigzip for repacking ramdisk as in recovery building.
compiled standalone bzip2 module.
So, what's this?
It's a utility (tool) for unpacking and repacking boot and recovery images for many kind of android phones. I made two versions, one for windows users and one for linux users. The windows version works by dragging&dropping over the script you want to use, while the linux version will work with terminal commans (very simple commands though).
What's inside?
For windows version the scripts are batch files and for linux bash files, but the names are the same and they do same thing:
clear_all will clear the working folder deleting any unpacked boot/recovery folder, but not the boot or recovery files (original or repacked).
image_info will print on screen all informations about the image you want to check (sizes, offsets, cmdline, etc.) and all these infos will be saved in a text file (which will be deleted when you clear the folder - see point 1). This is handy if you don't want to unpack the image, but only to see its infos. This script works for all kind of images (not specific to a hardware platform).
unpack_img is the script for unpacking images for all kind of phones with different platforms (qcom, exynos,...) but not MTK. It will work I think for AndroidOne project phones.
unpack_MTK_img is the script for unpack any MTK image, including the ones from new platforms (mt6595, mt6752, mt6753, and whatever they are).
repack_img is the repacking script for regular (non-MTK) phones.
repack_MTK_img is the repacking script for all MTK boot/recovery images.
Besides these in Utility folder there is a bin folder (hidden) with all executables needed by the scripts.
How to use it?
As I said, for windows just drag&drop an image (boot or recovery) you want to unpack over the corresponding script, and drag&drop the folder of the unpacked image over the repacking script when you want to repack it. Choose the scripts with MTK in name for MTK images, and the other ones for any other kind.
For linux open a terminal window in CarlivImageKitchen folder and type (or just copy/paste from here) the commands:
Code:
./unpack_img boot.img
or
Code:
./unpack_MTK_img recovery.img
or what name has your image.
To repack type like this:
Code:
./repack_img recovery
or
Code:
./repack_MTK_img boot
and so on.
NOTICE here for repacking just type the name of the folder, without slashes.
Important, my utility doesn't have any request for position on partitions or directories. In testes worked in a third sub-sub-subfolder on an external partition (both in linux and windows), and it proves to work with any kind of name (except special characters that may break the script), including spaces or dots in folders names, but I recommend you to use dashes or underscores instead of spaces, and avoid dots. In repacking procedure, the script will prompt you to introduce a name for the new image, and if it will contain dots or spaces you will see an error. Also the name must include the type of image (boot or recovery) - Eg: "boot-stock-repack" or "recovery_cwm_m7", and without the extension (.img).
Same condition about names applies for images you want to unpack; if they have other names, like "cwm-m7.img", rename it including the type of image in name: eg "recovery-cwm-m7.img". Why this? As many of you used bgcngm's tool you noticed he asked for including an argument in script command ("-boot" or "-recovery") because this is the way his script can apply the right header for ramdisks in repacking. My tool does that from image name and you don't have to add extra arguments in command.
A second note: This tool doesn't support Rockchip Android images.
What's under hood?
All modules used in my tools are compiled by me, both for windows and linux.
Also for windows, because it requires few cygwin libraries to work with compressing/uncompressing executables, I used those libraries and executables from latest cygwin release (gzip, xz, bzip2, cpio and the corresponding dlls).
But my utility doesn't require a cygwin installed. Well, linux version worked very well in cygwin environment, but it's not necessary since I provided a standalone windows version.
The executable modules:
imageinfo - a initial source is shared by osm0sis here, but I used that only for inspiration because I liked the ideea; I used the unpackbootimg from cyanogenmod 12, system/core/mkbootimg and modded to get a similar output as in osm0sis bootimg-info.
mkbootfs - built in cygwin for windows and normal in linux. I used the "stock" source from cyanogenmod 12 /system/core/cpio.
mkbootimg - based cyanogenmod 12 source, but modded, and for windows fixed to work (the standard source it builds in windows but doesn't work). I used for fixing the ideeas from Pete Batard's source. This module repack also dtb-images back to repacked image.
mtkbootimg - same as mkbootimg, but with additions from omnirom code for MTK, to append the MTK header to this kind of images. This one will check first the kernel and then the ramdisk for MTK header, and if it's not there it will append it, but if it's there will skip.
unpackbootimg - from same cyanogenmod 12 source, with few extra additions by me.
unpackmtkimg - same as unpackbootimg but adapted for MTK images, for which will strip the header off before unpacking, to be easy to work with.
For windows I used jeremejevs cmdcolor source to build a module which add colors in cmd console, for a pleasant experience.
All these sources are modified, improved and fixed in some aspects.
Why I did it?
Well, the trigger was the apparition of the new platforms from MTK, which didn't worked with any of the old tools. First who found out what's changed was mrjavum. Starting from his findings I explored more, and then provided the update ideea and binaries for bgcngm's tool. But that is only for linux. I know it can be used in windows with cygwin, but we had a standalone tool, michfood's tool, which now doesn't work with the new platforms.
So I started to think for a new utility for windows to solve that need. After I did it I thought I can do it for linux too even if there exists already bgcngm's tool and works great. And I made it not only for MTK phones.
That's the reason I called it Image Kitchen. It is like a tool that combines michfood's tool with osm0sis Kitchen, and serves for different platforms (I tested MTK, Qualcomm, Exynos, with or without dtb, and all worked great). But it's first release, not fully tested (I don't have all kind of phones for that), and so it is marked beta.[/HIDE]
Cygwin-windows version
Removed since it was only for some specific testing, and anyway the windows version now works and it shows exactly the same with linux, producing same result.
awesome
More goodies for me to test.
Thanks guys
This is great! No need to shuffle programs for unpacking/repacking boot and recovery images of various platforms.
Windows version working (MTK and non-MTK).
Tried to use the Linux version in cygwin and encountered the following errors:
There are already separate package for Windows & Linux so use the appropriate package however for beta-testing sake . . .
Copy all the *.exe from Windows package -> hidden folder bin to Linux .bin folder.
Add the extension exe to all linux binary at the script
Eg.
gzip -> gzip.exe
mkbootfs -> mkbootfs.exe
unpackmtkimg -> unpackmtkimg.exe
mtkbootimg -> mtkbootimg.exe
unpackbootimg -> unpackbootimg.exe
mkbootimg -> mkbootimg.exe
Now the linux script will work on cygwin . . .
Thanks for the suggestion.
Now, unpack (MTK and non-MTK) works but repack does not. The repacked image is much smaller in size than that of the original. It also produces errors when I unpack the repacked image.
iZLeeP said:
Thanks for the suggestion.
Now, unpack (MTK and non-MTK) works but repack does not. The repacked image is much smaller in size than that of the original. It also produces errors when I unpack the repacked image.
Click to expand...
Click to collapse
If you want to test it in cygwin you need to add all binaries from windows bin with exe extension except dlls (those are native) and compressing modules, and to replace those from linux. You can see in linux version all compressing modules are missing - they have to be installed in system. Same for cygwin. It's possible you got a cygwin with some packages missing. That error message you see is because it's missing cpio probably. The linux binaries are much smaller because the compiler works different in linux. In windows the modules are standalone and don't need any dll, except those for archiving from cygwin, but we are not talking about those.
Anyway what you do here is just cross testing, and you don't need to use linux version in windows because windows version works the same.
carliv said:
If you want to test it in cygwin you need to add all binaries from windows bin with exe extension except dlls (those are native) and compressing modules, and to replace those from linux. You can see in linux version all compressing modules are missing - they have to be installed in system. Same for cygwin. It's possible you got a cygwin with some packages missing. That error message you see is because it's missing cpio probably. The linux binaries are much smaller because the compiler works different in linux. In windows the modules are standalone and don't need any dll, except those for archiving from cygwin, but we are not talking about those.
Anyway what you do here is just cross testing, and you don't need to use linux version in windows because windows version works the same.
Click to expand...
Click to collapse
Yes, I was just testing the functionality of the linux version in cygwin. As I don't have linux here (office), I use cygwin instead. I'll re-download full cygwin package and test again. Nonetheless, I have no problems with the windows version (tested in Vista and 7). I'll try it on XP at home.
iZLeeP said:
Yes, I was just testing the functionality of the linux version in cygwin. As I don't have linux here (office), I use cygwin instead. I'll re-download full cygwin package and test again. Nonetheless, I have no problems with the windows version (tested in Vista and 7). I'll try it on XP at home.
Click to expand...
Click to collapse
It's ok, but you have to be carefull to search manually for some packages, because depending from what mirror you install cygwin, they may be there or not. This situation is very well exposed in cygwin forums. When I built mkbootfs in cygwin for windows the compiler complains for few missing packages and I had to add them one by one searching online in cygwin packages. Some of them were on mirrors.kernel.org and some on cygwin.cybermirror.org. In any other mirror site they were missing. Same for compression packages: xz was only in mirrors.kernel.org. When you install cygwin you don't see any message of something not being there.
Or maybe I don't know how to work with cygwin, I don't know...
carliv said:
It's ok, but you have to be carefull to search manually for some packages, because depending from what mirror you install cygwin, they may be there or not. This situation is very well exposed in cygwin forums. When I built mkbootfs in cygwin for windows the compiler complains for few missing packages and I had to add them one by one searching online in cygwin packages. Some of them were on mirrors.kernel.org and some on cygwin.cybermirror.org. In any other mirror site they were missing. Same for compression packages: xz was only in mirrors.kernel.org. When you install cygwin you don't see any message of something not being there.
Or maybe I don't know how to work with cygwin, I don't know...
Click to expand...
Click to collapse
It's working now after updating cygwin. If I recall correctly, I used dsixda's instructions on how to setup cygwin for kitchen. The procedure required to install additional packages including cpio. Maybe, the files were just outdated since I had this last 2011.
Refer to post #2 for details . . .
Fantabulous Work Sir :good: Going To Test it
carliv said:
the name must include the type of image (boot or recovery)
Click to expand...
Click to collapse
Sir if i am Not Mistaken, Michfood's Recovery/Boot UnPacker/Repacker Tool Don't Need This, Right?
EnerJon said:
Fantabulous Work Sir :good: Going To Test it
Sir i Think, Michfood's Recovery/Boot UnPacker/Repacker Tool Don't Need This... Right?
Click to expand...
Click to collapse
Yes, you're right, but his tool uses a different method. It stores the ramdisk and kernel headers on unpack in separate files and add them back for repack. My tool strip off the headers on unpack and will recreate them during repack and it need that info to determine wich header to add for ramdisk (ROOTFS or RECOVERY).
carliv said:
Yes, you're right, but his tool uses a different method. It stores the ramdisk and kernel headers on unpack in separate files and add them back for repack. My tool strip off the headers on unpack and will recreate them during repack and it need that info to determine wich header to add for ramdisk (ROOTFS or RECOVERY).
Click to expand...
Click to collapse
Got it, So Michfood's Tool Just Extracts The Headers Of The IMG File While UnPacking And Adds Them Back As it is, This Way it Don't Need To Take Care Of The IMG Type Because The Type Of Output IMG Automatically Becomes Same as input IMG in The End...
But Your Tool Needs To Know The Type Of IMG Because it Creates Those Headers By itself... Hmm, But Sir, i Don't Understand One Thing, What's Wrong With Extracting And Adding Same Headers As input IMG File?
i Think, You/OmniROM DEVs Did This To Make Boot.img Usable As Recovery.img Or Vice Versa? Thats The Only Reason Comes in My Mind
EnerJon said:
Got it, So Michfood's Tool Just Extracts The Headers Of The IMG File While UnPacking And Adds Them Back As it is, This Way it Don't Need To Take Care Of The IMG Type Because The Type Of Output IMG Automatically Becomes Same as input IMG in The End...
But Your Tool Needs To Know The Type Of IMG Because it Creates Those Headers By itself... Hmm, But Sir, i Don't Understand One Thing, What's Wrong With Extracting And Adding Same Headers As input IMG File?
i Think, You/OmniROM DEVs Did This To Make Boot.img Usable As Recovery.img Or Vice Versa? Thats The Only Reason Comes in My Mind
Click to expand...
Click to collapse
The original MTK module (mkimage) - which source is not published (I never find it anywhere), append the right header during build of a ROM, and that's for boot - ROOTFS and for recovery - RECOVERY (on ramdisk). Omnirom code will add ROOTFS to any ramdisk, and same is the code from dsixda kitchen. This may be fine and may work in some phones, but I wanted to do it the right way, as in bgcngm's tool - because of the new MTK platforms. So I changed the source code to do it as I wanted, and instead of an extra argument I'm using just the name of image. I think it's not that hard to name the new image boot-something or something-boot-something or somethingboot, etc - same for recovery.
And for extracting old headers it's nothing wrong and it's easy to do it, but for adding back it needs an extra module (michfoods use sfk166 - now I think it reached version 173) and I wanted to reduce the number of binaries involved.
And again, really, I think my method with adding the name for newly created image is better.
Thanks For The info Sir, Yes, its Not That Hard To Rename it, Actually i Work With Dozens Of IMGs, But No Worries, its Just a One Time Process... Previously Michfood's Boot/Recovery RePacking Tool Was Not Working if i Try To RePack The IMGs Made With Sir Yuweng's Easy Magic Tool... But Your Tool Has No Such issues... Thank You Very Much For This Great Tool :highfive:
i Just Tested it And its Working Perfectly Fine For My Qmobile-A900 (Gionee Elife E3)
Just a Suggestion:
instead Of Asking User To input Final IMG Name, The Tool Should Automatically Expand The File Name By Adding "_NEW"
For Example:
Original IMG Name ===> MyStockBoot.img
1st Modified IMG Name ===> MyStockBoot_NEW.img
2nd Modified IMG Name ===> MyStockBoot_NEW_NEW.img
3rd Modified IMG Name ===> MyStockBoot_NEW_NEW_NEW.img
The Code Of You Tool Seems To Be Very Clean, And Handles The Errors Very Well :good:
EnerJon said:
.....Thank You Very Much For This Great Tool :highfive:
i Just Tested it And its Working Perfectly Fine For My Qmobile-A900 (Gionee Elife E3)
Just a Suggestion:
instead Of Asking User To input Final IMG Name, The Tool Should Automatically Expand The File Name By Adding "_NEW"
.... The Code Of You Tool Seems To Be Very Clean, And Handles The Errors Very Well :good:
Click to expand...
Click to collapse
Thanks, I worked quite a bit to make it that way because I do like clean and easy to read codes - easy to spot errors :laugh:
First test version was as you suggest without asking for a name and everything done automatic, but when I send it to my friend yuweng to test it, he came out with the ideea to ask user for the name and I think it's a good ideea and I added that prompt; this way you can repack same image with little modifications again and again, for tests purposes or other, and give related names, like boot-1, boot-2, or recovery-1, etc. In automated method for such things it needs to rename the new repacked image or the unpacked folder and at the end it creates more troubles than current method.
Hello Sir, i Wanted To Share My Modding Of Your Tool For Better Compression, i Also Did This Long Time Ago With Michfood's Tool, And it Works Effectively... By Doing This, Final Output IMG Can Be More Than 100KB Smaller Compared To Previous IMG Output... Which is a Releaf For 6MB Recovery/Boot Partition Devices...
For This, We Need 7zip Command Line Tool
By Downloading And Extracting "7za" Executable into The BIN Folder Of Your Tool And Modding Your Tool's RePack Script File, We Can Achieve Better Compression For GZIP'ed RAMDISKs...
Original repack_MTK_img.bat
Code:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::: :::
::: Carliv Image Kitchen for Android :::
::: boot+recovery images copyright-2015 [email protected] :::
::: including support for MTK powered phones images :::
::: :::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
cd %~dp0
IF EXIST "%~dp0\bin" SET PATH=%PATH%;"%~dp0\bin"
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal enabledelayedexpansion
set "red=\033[91m"
set "cyan=\033[96m"
set "yellow=\033[93m"
set "deft=\033[0m"
echo(
echo **********************************************************
echo * *
echo * %cyan%Carliv Image Kitchen for Android %deft%v0.1 * | klr
echo * boot+recovery images copyright-2015 %cyan%[email protected]%deft% * | klr
echo * including support for MTK powered phones images *
echo * WINDOWS version *
echo * The repacking MTK images script *
echo * *
echo **********************************************************
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%~nx1" == "" goto noinput
echo You have selected the%yellow% %~nx1 %deft%folder. | klr
echo(
echo Processing the%yellow% %~nx1 folder%deft%. | klr
echo(
set "folder=%~nx1"
icacls %folder% /grant Everyone:(IO)(CI)
cd %folder%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo(
echo Repacking the image....
echo(
for /f "delims=" %%a in ('dir /b *-kernel') do @set nfile=!nfile!%%~na
set "file=%nfile%"
if not exist "%file%.img-kernel" goto error
set kernel=!kernel!%file%.img-kernel
echo The kernel is:%yellow% %kernel%%deft% | klr
echo(
echo Getting the ramdisk compression....
echo(
if not exist "ramdisk" goto error
for /f "delims=" %%a in (%file%.img-ramdisk-compress) do @set compress=!compress!%%a
echo Ramdisk compression:%yellow% %compress%%deft% | klr
goto %compress%
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:gz
echo(
[COLOR="Red"]mkbootfs ramdisk | gzip > %file%.img-ramdisk.gz[/COLOR]
set ramdisk=!ramdisk!%file%.img-ramdisk.gz
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:lzma
echo(
mkbootfs ramdisk | xz -Flzma > %file%.img-ramdisk.lzma
set ramdisk=!ramdisk!%file%.img-ramdisk.lzma
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:xz
echo(
mkbootfs ramdisk | xz -1 -Ccrc32 > %file%.img-ramdisk.xz
set ramdisk=!ramdisk!%file%.img-ramdisk.xz
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:bz2
echo(
mkbootfs ramdisk | bzip2 > %file%.img-ramdisk.bz2
set ramdisk=!ramdisk!%file%.img-ramdisk.bz2
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:repack
echo(
echo Getting the image repacking arguments....
echo(
if not exist "%file%.img-board" goto noboard
for /f "delims=" %%a in (%file%.img-board) do @set nameb=!nameb!%%a
echo Board:%yellow% '%nameb%'%deft% | klr
echo(
:noboard
if not exist "%file%.img-base" goto nobase
for /f "delims=" %%a in (%file%.img-base) do @set base=!base!%%a
echo Base:%yellow% %base%%deft% | klr
echo(
:nobase
for /f "delims=" %%a in (%file%.img-pagesize) do @set pagesize=!pagesize!%%a
echo Pagesize:%yellow% %pagesize%%deft% | klr
echo(
if not exist "%file%.img-cmdline" goto nocmdline
for /f "delims=" %%a in (%file%.img-cmdline) do @set scmdline=!scmdline!%%a
echo Command line:%yellow% '%scmdline%'%deft% | klr
echo(
:nocmdline
if not exist "%file%.img-kernel_offset" goto nokoff
for /f "delims=" %%a in (%file%.img-kernel_offset) do @set koff=!koff!%%a
echo Kernel offset:%yellow% %koff%%deft% | klr
echo(
:nokoff
if not exist "%file%.img-ramdisk_offset" goto noramoff
for /f "delims=" %%a in (%file%.img-ramdisk_offset) do @set ramoff=!ramoff!%%a
echo Ramdisk offset:%yellow% %ramoff%%deft% | klr
echo(
:noramoff
if not exist "%file%.img-second_offset" goto nosecoff
for /f "delims=" %%a in (%file%.img-second_offset) do @set fsecoff=!fsecoff!%%a
echo Second offset:%yellow% %fsecoff%%deft% | klr
set secoff=--second_offset %fsecoff%
echo(
:nosecoff
if not exist "%file%.img-second" goto nosecd
set fsecd=!fsecd!%file%.img-second
echo Second bootloader:%yellow% %fsecd%%deft% | klr
set "second=--second %fsecd%"
echo(
:nosecd
if not exist "%file%.img-tags_offset" goto notagoff
for /f "delims=" %%a in (%file%.img-tags_offset) do @set tagoff=!tagoff!%%a
echo Tags offset:%yellow% %tagoff%%deft% | klr
echo(
:notagoff
if not exist "%file%.img-dt" goto nodt
set fdt=!fdt!%file%.img-dt
echo Device tree blob:%yellow% %fdt%%deft% | klr
set "dtb=--dt %fdt%"
echo(
:nodt
echo(
:newimage
echo Please enter the desired name for the new repacked image without extension (img). Like this %yellow%boot%deft%-stock-2201 or carliv-%yellow%recovery%deft%-30 or %yellow%boot%deft%-new. | klr
set /P newimage=Insert the name here: || set newimage="0"
if "%newimage%"=="0" goto noimage
if not "%newimage%"=="%newimage:boot=%" goto command
if not "%newimage%"=="%newimage:recovery=%" goto command
goto wrongname
echo(
:command
echo Your new image is%yellow% %newimage%.img%deft%. | klr
echo(
echo Executing the repacking command....
echo(
mtkbootimg --kernel %kernel% --ramdisk %ramdisk% --pagesize %pagesize% --base %base% --board "%nameb%" --kernel_offset %koff% --ramdisk_offset %ramoff% --tags_offset %tagoff% %second% --cmdline "%scmdline%" %secoff% %dtb% -o ..\%newimage%.img
del "%file%.img-ramdisk.%compress%"
cd ..\
echo(
echo(
echo Done. Your new image was repacked as%yellow% %newimage%.img%deft%. | klr
goto end
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:noinput
echo(
echo(
echo %red%No folder selected. Exit script.%deft% | klr
echo(
goto end
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:wrongname
echo(
echo(
echo %red%The name have to include the type of image in it, %yellow%boot%red% or%yellow% recovery%red%.%deft% | klr
echo(
goto newimage
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:noimage
echo(
echo(
echo %red%Please enter a name for the repacked image first.%deft% | klr
echo(
goto newimage
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:error
echo(
echo(
echo %red%There is an error in your folder. The kernel or ramdisk is missing. Exit script.%deft% | klr
echo(
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:end
echo(
pause
Modded repack_MTK_img.bat
Code:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::: :::
::: Carliv Image Kitchen for Android :::
::: boot+recovery images copyright-2015 [email protected] :::
::: including support for MTK powered phones images :::
::: :::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
cd %~dp0
IF EXIST "%~dp0\bin" SET PATH=%PATH%;"%~dp0\bin"
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal enabledelayedexpansion
set "red=\033[91m"
set "cyan=\033[96m"
set "yellow=\033[93m"
set "deft=\033[0m"
echo(
echo **********************************************************
echo * *
echo * %cyan%Carliv Image Kitchen for Android %deft%v0.1 * | klr
echo * boot+recovery images copyright-2015 %cyan%[email protected]%deft% * | klr
echo * including support for MTK powered phones images *
echo * WINDOWS version *
echo * The repacking MTK images script *
echo * *
echo **********************************************************
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%~nx1" == "" goto noinput
echo You have selected the%yellow% %~nx1 %deft%folder. | klr
echo(
echo Processing the%yellow% %~nx1 folder%deft%. | klr
echo(
set "folder=%~nx1"
icacls %folder% /grant Everyone:(IO)(CI)
cd %folder%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo(
echo Repacking the image....
echo(
for /f "delims=" %%a in ('dir /b *-kernel') do @set nfile=!nfile!%%~na
set "file=%nfile%"
if not exist "%file%.img-kernel" goto error
set kernel=!kernel!%file%.img-kernel
echo The kernel is:%yellow% %kernel%%deft% | klr
echo(
echo Getting the ramdisk compression....
echo(
if not exist "ramdisk" goto error
for /f "delims=" %%a in (%file%.img-ramdisk-compress) do @set compress=!compress!%%a
echo Ramdisk compression:%yellow% %compress%%deft% | klr
goto %compress%
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:gz
echo(
[COLOR="Blue"]mkbootfs ramdisk > %file%.img-ramdisk
7za a -tgzip -mx=9 %file%.img-ramdisk.gz %file%.img-ramdisk
del /F /Q %file%.img-ramdisk[/COLOR]
set ramdisk=!ramdisk!%file%.img-ramdisk.gz
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:lzma
echo(
mkbootfs ramdisk | xz -Flzma > %file%.img-ramdisk.lzma
set ramdisk=!ramdisk!%file%.img-ramdisk.lzma
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:xz
echo(
mkbootfs ramdisk | xz -1 -Ccrc32 > %file%.img-ramdisk.xz
set ramdisk=!ramdisk!%file%.img-ramdisk.xz
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:bz2
echo(
mkbootfs ramdisk | bzip2 > %file%.img-ramdisk.bz2
set ramdisk=!ramdisk!%file%.img-ramdisk.bz2
echo The ramdisk is:%yellow% %ramdisk%%deft% | klr
goto repack
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:repack
echo(
echo Getting the image repacking arguments....
echo(
if not exist "%file%.img-board" goto noboard
for /f "delims=" %%a in (%file%.img-board) do @set nameb=!nameb!%%a
echo Board:%yellow% '%nameb%'%deft% | klr
echo(
:noboard
if not exist "%file%.img-base" goto nobase
for /f "delims=" %%a in (%file%.img-base) do @set base=!base!%%a
echo Base:%yellow% %base%%deft% | klr
echo(
:nobase
for /f "delims=" %%a in (%file%.img-pagesize) do @set pagesize=!pagesize!%%a
echo Pagesize:%yellow% %pagesize%%deft% | klr
echo(
if not exist "%file%.img-cmdline" goto nocmdline
for /f "delims=" %%a in (%file%.img-cmdline) do @set scmdline=!scmdline!%%a
echo Command line:%yellow% '%scmdline%'%deft% | klr
echo(
:nocmdline
if not exist "%file%.img-kernel_offset" goto nokoff
for /f "delims=" %%a in (%file%.img-kernel_offset) do @set koff=!koff!%%a
echo Kernel offset:%yellow% %koff%%deft% | klr
echo(
:nokoff
if not exist "%file%.img-ramdisk_offset" goto noramoff
for /f "delims=" %%a in (%file%.img-ramdisk_offset) do @set ramoff=!ramoff!%%a
echo Ramdisk offset:%yellow% %ramoff%%deft% | klr
echo(
:noramoff
if not exist "%file%.img-second_offset" goto nosecoff
for /f "delims=" %%a in (%file%.img-second_offset) do @set fsecoff=!fsecoff!%%a
echo Second offset:%yellow% %fsecoff%%deft% | klr
set secoff=--second_offset %fsecoff%
echo(
:nosecoff
if not exist "%file%.img-second" goto nosecd
set fsecd=!fsecd!%file%.img-second
echo Second bootloader:%yellow% %fsecd%%deft% | klr
set "second=--second %fsecd%"
echo(
:nosecd
if not exist "%file%.img-tags_offset" goto notagoff
for /f "delims=" %%a in (%file%.img-tags_offset) do @set tagoff=!tagoff!%%a
echo Tags offset:%yellow% %tagoff%%deft% | klr
echo(
:notagoff
if not exist "%file%.img-dt" goto nodt
set fdt=!fdt!%file%.img-dt
echo Device tree blob:%yellow% %fdt%%deft% | klr
set "dtb=--dt %fdt%"
echo(
:nodt
echo(
:newimage
echo Please enter the desired name for the new repacked image without extension (img). Like this %yellow%boot%deft%-stock-2201 or carliv-%yellow%recovery%deft%-30 or %yellow%boot%deft%-new. | klr
set /P newimage=Insert the name here: || set newimage="0"
if "%newimage%"=="0" goto noimage
if not "%newimage%"=="%newimage:boot=%" goto command
if not "%newimage%"=="%newimage:recovery=%" goto command
goto wrongname
echo(
:command
echo Your new image is%yellow% %newimage%.img%deft%. | klr
echo(
echo Executing the repacking command....
echo(
mtkbootimg --kernel %kernel% --ramdisk %ramdisk% --pagesize %pagesize% --base %base% --board "%nameb%" --kernel_offset %koff% --ramdisk_offset %ramoff% --tags_offset %tagoff% %second% --cmdline "%scmdline%" %secoff% %dtb% -o ..\%newimage%.img
del "%file%.img-ramdisk.%compress%"
cd ..\
echo(
echo(
echo Done. Your new image was repacked as%yellow% %newimage%.img%deft%. | klr
goto end
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:noinput
echo(
echo(
echo %red%No folder selected. Exit script.%deft% | klr
echo(
goto end
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:wrongname
echo(
echo(
echo %red%The name have to include the type of image in it, %yellow%boot%red% or%yellow% recovery%red%.%deft% | klr
echo(
goto newimage
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:noimage
echo(
echo(
echo %red%Please enter a name for the repacked image first.%deft% | klr
echo(
goto newimage
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:error
echo(
echo(
echo %red%There is an error in your folder. The kernel or ramdisk is missing. Exit script.%deft% | klr
echo(
echo(
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:end
echo(
pause
EnerJon said:
Hello Sir, i Wanted To Share My Modding Of Your Tool For Better Compression, i Also Did This Long Time Ago With Michfood's Tool, And it Works Effectively... By Doing This, Final Output IMG Can Be More Than 100KB Smaller Compared To Previous IMG Output... Which is a Releaf For 6MB Recovery/Boot Partition Devices...
For This, We Need 7zip Command Line Tool
By Downloading And Extracting "7za" Executable into The BIN Folder Of Your Tool And Modding Your Tool's RePack Script File, We Can Achieve Better Compression For GZIP'ed RAMDISKs...
.....
Click to expand...
Click to collapse
I understand your point of view, but I have to tell you few things.
First thing I tested was 7zip because at start I didn't want to use any cygwin dll in my tool, but 7zip isn't "the same" in windows and linux (I use ubuntu and it is provided in official ubuntu packages), and I wanted my tool to be consistent across OSes. Then, 7zip changes the original file attributes (date of creation for example, permissions, etc.) and it takes longer to do the job (execution time), so I moved to gzip built by me from source for windows. Gzip keeps original data for files by default and it is faster. But windows standalone module didn't worked - I mean technically worked, repack unpack but the created image didn't worked in phone. That's how I ended up with cygwin compression modules - they do the job.
So, thank you for your suggestion, but I will stick with gzip as "official" way for both versions, since it proves to work in every situation. Maybe if I didn't provided a linux version too and I didn't care about preserving files original infos, I would use 7zip for the advantage of a slightly better compression.
It's good though that you posted here your modd, because if someone wants to try it or use it, all it needs to do is to check your post! :good:

Categories

Resources