Related
I just had to unroot my transformer so I could RMA it (it didn't want to charge anymore) and I noticed that a lot of the actions could be scripted so it would be quicker and people couldn't screw the process up since it's automated.
I based my script off of [GUIDE] Official [unroot] guide here
Code:
#!/bin/bash
echo "Script by Brando56894 from XDA Developers"
directory=`pwd`
echo "Checking for necessary files...."
if [[ -e blob && EP101_SDUPDATE.zip ]]
then
echo "The necessary files are present, continuing process"
else
echo "One or more of the necessary files is missing."
echo "Would you like me to get the files for you? (y or n)"
read answer
if [[ $answer == 'y' ]]
then
wget http://dlcdnet.asus.com/pub/ASUS/EeePAD/TF101/UpdateLauncher_US_epad_user_8239.zip
unzip -n UpdateLauncher_US_epad_user_8239.zip
cd ASUS/Update
unzip US_epad-user-8.2.3.9.zip
mv blob $directory
mv US_epad-user-8.2.3.9.zip $directory/EP101_SDUPDATE.zip
else
read -p "Please acquire the needed files. Press enter to exit"
exit
fi
fi
echo
adb devices
echo
read -p "If device is listed, press enter to continue unrooting"
adb push blob /data/local/
adb push EP101_SDUPDATE.zip /Removable/MicroSD/
adb shell dd if=/data/local/blob of=/dev/block/mmcblk0p4
adb reboot recovery
echo "It should now be flashing the stock update, unrooting the TF in the process"
echo
read -p "Press enter to exit"
exit
This is for 3.2 ?
It worked for me on 3.2 but I believe it should work for any version since it wipes everything out by reflashing the blob via nvflash. Make sure you have everything backed up to your sdcard because it wipes everything, including the internal memory.
This would also work if you were, for example, on 3.2 and wanted to go back to 3.1, wouldn't it?
Edit. Do you have the filenames to be downloaded for the WW version?
This tutorial is going to help ROM chiefs on how to add and integrate different languages and csc codes from different regions in their cooked custom ROM
Have you ever wanted to port your language across custom ROMs but you don't know how?
Yes after searching the xda, you knew that you need to integrate your language value folder in each ROM apk in order to have your language ported to the custom ROM; however heh, it will be very long journey of decompiling and compiling, making integrating your language value folder in each ROM apk is like a hell..!!
So from this side, I decided to make a tool that will decompile and extract languages values folders and after extracting all values folders from all apks of the same name (e.g, SystemUI.apk) from all ROMs' different regions, you can integrate all languages in one multi-languages apk; making the whole process a much less painful than the manual way..!!
So in short, this tool will add languages from ROM's apk files to another of the same name..
How to use:
1. Run apk-lang-extractor.bat file; this will create all needed folders.
2. Install your ROM dependencies (Only once) by putting them in "put-dependencies-here" folder and choose option #0.
3. Put all same apks from different region ROM's releases in "put-apk-here" folder; you can give them numbers in order to not get confused; ensure no space in apk name (e.g, SystemUI1.apk, SystemUI2.apk, SystemUI3.apk... etc).
4. Set Current-apk for one of them (option #1), and start extracting job (option #2) and do the same for the rest of apk files.
5. Let the apk file that you will integrate all languages in to be the last apk to extract the languages from; this is important to ensure the least error during compiling.
6. After you extracted all languages from all apk files, and being the last extracted apk is set as Current-apk, start languages integrating process (option #3) that will result in one apk file that contains all extracted languages. :laugh:
{
"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"
}
Credits:
1. Igor Pavlov: for 7za command line.
2. Brut.all & iBotPeaches: for the awesome apktool.jar :good:
3. atomicdryad: for SignApk.jar
4. Google: for android SDK
and to dedicate the contribution of such elite developers, the credits are shown in the utility splash screen..
- apk-languages-Extractor-Integrator_v1.05 @19/July/2013 - [the most recent]
- apk-languages-Extractor-Integrator_v1.00 @ 17/July/2013 - [old]
Change-log:
@ 19/July/2013 (v1.05):
- Fixed error message during language integration "The process cannot access the file because it is being used by another process".
- Fixed compression function. Now the whole final apk file is compressed by level specified, instead of signature only (my bad!!).
- Fixed open "finished-apk" folder delay after language integrating process.
- Deleting existing signed file apk of same name before signing (no more overlapping).
- New option added in the main menu to link the utility with this thread page (you can check update anytime now).
@ 17/July/2013 (v1.00):
- First release.
You just finished integrating languages values folders in each apk file in your custom ROM; however, we haven't finish porting languages yet..!! Continue with the next post
<<In this post, we will concentrate on making the added languages visible and usable in your cooked ROM. Also we will learn how to add different CSC code regions in the cooked ROM>>
How to add languages to language display and language input:
1. Navigate to system\csc\common\system\csc folder and open language.xml file. Here we will concentrate in this section:
Code:
<LanguageSet>
[B][COLOR="Blue"]<Display>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for displayed languages[/COLOR][/B]
en_GB;en_US;fr_FR;
ar_AE;fa_FA;ur_PK;
</Display>
[B][COLOR="Blue"]<Input>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for input languages[/COLOR][/B]
<SupportList>
en_GB;en_US;fr;ar;fa;ur;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>
for each section you can add iso code language for each region. Here is the code again after applying iso code languages:
Code:
<LanguageSet>
<Display>
en_GB;ar_AE;az_AZ;bg_BG;ca_ES;cs_CZ;da_DK;de_AT;de_CH;de_DE;
el_GR;en_AU;en_IE;en_NZ;en_PH;en_US;en_ZA;es_ES;es_US;et_EE;
eu_ES;f_FI;fa_FA;fr_CH;fr_FR;ga_IE;gl_ES;hr_HR;hu_HU;hy_AM;
in_ID;is_IS;it_IT;ka_GE;kk_KZ;ko_KR;lt_LT;lv_LV;mk_MK;ms_MY;
nb_NO;nl_BE;nl_NL;pl_PL;pt_BR;pt_PT;ro_RO;ru_RU;sk_SK;sl_SI;
sr_RS;sv_SE;th_TH;tr_TR;ur_PK;uk_UA;uz_UZ;vi_VN;zh_CN;zh_HK;
zh_TW;
</Display>
<Input>
<SupportList>
en_GB;ar;az;bg;bn;ca;cs;da;de;el;
en_US;es;et;eu;fa;fi;fr;gl;gu;hi;
hr;hu;hy;id;is;it;ka;kk;kn;ko;
lt;lv;ml;ms;mr;nb;nl;pa;pl;pt;
ro;ru;sk;sl;sr;sv;ta;te;th;tr;
uk;ur;vi;zh_CN;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>
of course after extracting a lot of ROMs from specific regions, you can just add their iso code language in your cooked ROM language.xml after having the iso codes from their language.xml files
2. Now copy this modified language.xml and paste it on system\csc directory
3. Now to display language name in your device, you need to decompile ResourceManager.apk and navigate to res\values folder and open strings.xml and add new languages resources strings there in this form:
Code:
<string name="vo_rm_authority">com.visionobjects.resourcemanager</string>
<string name="[B][COLOR="Red"]en_GB[/COLOR][/B]">[B][COLOR="Blue"]English(UK)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]en_US[/COLOR][/B]">[B][COLOR="Blue"]English(US)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]az[/COLOR][/B]">[B][COLOR="Blue"]Azərbaycan[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]ca[/COLOR][/B]">[B][COLOR="Blue"]Català[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]cs[/COLOR][/B]">[B][COLOR="Blue"]Čeština[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]da[/COLOR][/B]">[B][COLOR="Blue"]Dansk[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]de[/COLOR][/B]">[B][COLOR="Blue"]Deutsch[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]et[/COLOR][/B]">[B][COLOR="Blue"]Eesti[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]es[/COLOR][/B]">[B][COLOR="Blue"]Español[/COLOR][/B]</string>
..
..
[B][COLOR="Green"]and so on[/COLOR][/B]
Here the red texts are regional iso codes for the added language, and the blue texts are the displayed language name in your device (you can decompile ResourceManager.apk from different ROMs' regions in order to have the iso codes and the corresponding languages strings).
4. Now you need to add input database for different languages. After extracting different ROMs' regions, copy all the content of system\T9DB and paste it in same directory of the ROM that you will make it support different languages.
N.B: To have all input languages activated, you need to add all values folder in the ROM keyboard app for the specific language you want to activate.
Click to expand...
Click to collapse
5. Now you will need to integrate languages data base; after extracting different ROMs' regions, copy all the content of system\hdic folder and paste it in same directory of the ROM that you will make it support different languages.
How to set default language in initial setup wizard:
Go to system\csc folder and open customer.xml and edit this section:
Code:
<Phone>
<DefLanguage>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguage>
<DefLanguageNoSIM>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguageNoSIM>
<DateTimeFormat>
<DateFormat>ddmmyyyy</DateFormat>
</DateTimeFormat>
<VisiblePassword>off</VisiblePassword>
</Phone>
Just change the blue colored iso code and substitute it with your favorite one from language.xml display section
CSC codes:
How to set default csc code:
Go to system\csc\%yourCSCfolder%\system\csc folder and copy all its content (usually contents.db, customer.xml, others.xml, and sales_code.dat) and paste it on system\csc directory.
Alternatively, you can edit the files in system\csc folder that includes:
customer.xml
Code:
<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>
change it to your csc iso code (that is the csc folder name in system\csc folder).
language.xml:
Code:
<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>
the same as change in customer.xml
sales_code.dat
Code:
[B][COLOR="Blue"]KSA[/COLOR][/B]
the same as change in customer.xml
How to add extra CSC codes:
After extracting all CSC folders from different ROMs region, first copy and paste them in system\csc folder then you need to go to system directory and open SW_Configuration.xml and add all CSC folders you just paste:
Code:
<NbCustomer>[B][COLOR="Blue"]67[/COLOR][/B]</NbCustomer> [B][COLOR="Green"]<!-- Here enter how many csc code folders you have in system\csc[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ABS[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFG[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFR[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |--- Here add CSC folders[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ALO[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ARB[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
..
..
[B][COLOR="Green"]and so on[/COLOR][/B]
And now you are ready to create your multi-languages and multi-csc ROM,,
For developers only..!!
Here is all codes I used to build up this utility, any suggestion for improvement is welcomed.. !!
Real CMD codes language used in the utility (v1.05):
Code:
@echo off
setlocal enabledelayedexpansion
COLOR 0A
title [APK LANGUAGES EXTRACTOR TOOL - majdinj - xda]
if (%1)==(0) goto logo
mode con:cols=64 lines=55
echo.
echo.
echo **************************************************
echo **************************************************
echo ** **
echo ** Checking java version... **
echo ** **
echo **************************************************
echo **************************************************
echo.
java -version
IF errorlevel 1 goto errjava
echo.
echo.
echo Java is installed on your machine...
echo.
echo.
ECHO.
ECHO.
ECHO.
echo **************************************************
echo **************************************************
echo ** **
echo ** USED TOOLS, VERSIONS AND CREDITS **
echo ** **
echo **************************************************
echo **************************************************
ECHO.
cd "%~dp0tools"
type versions.txt
echo.
echo WELCOME TO ANDROID APK LANGUAGES EXTRACTOR AND INTEGRATOR TOOL
ECHO BY: majdinj - XDA-DEVELOPERS.COM
echo.
echo.
echo.
echo.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
PAUSE
cd "%~dp0"
set capp=None
set heap=1024
set comp=9
set /A count=0
FOR %%F IN (put-apk-here/*.apk) DO (
set /A count+=1
set tmpstore=%%~nF%%~xF
)
if %count%==1 (set capp=%tmpstore%)
IF NOT EXIST "%~dp0/put-apk-here" mkdir put-apk-here
IF NOT EXIST "%~dp0/put-dependencies-here" mkdir put-dependencies-here
IF NOT EXIST "%~dp0/extracted-languages" mkdir extracted-languages
IF NOT EXIST "%~dp0/finished-apk" mkdir finished-apk
IF NOT EXIST "%~dp0/temp" mkdir temp
echo. >> log.log
echo. >> log.log
echo ---------------------------------------------------------------------------- >> log.log
echo ^|%date% -- %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%^| >> log.log
echo ---------------------------------------------------------------------------- >> log.log
apk-lang-extractor.bat 0 2>> log.log
:logo
cls
COLOR 0A
echo.
echo .- .:`
echo .//. `/+-
echo -/- .+/.
echo .//` ```..--------..``` `:+:
echo `:/--://++++++++++++++++//:.--.
echo `-://++++++++++++++++++++/:-`
echo `-://///++++++++++++++++++:.`
echo `:///////:://+++++++++++++:` `..``
echo `:///////. ./++++++++++:` -/+++/.
echo -///////// /++++++++/. :/++++-
echo -//////////:.``.:++++++++/` `-:/:-
echo -///////////////+++++++++/`
echo .///////////////+++++++++/
echo ////////////////++++++++.
echo ////////////////+++++++:
echo ////////////////++++++:
echo `::::::::::::::::::::::.
echo.
echo **********************************************************
echo **********************************************************
echo * *
echo * ANDROID APK LANGUAGES EXTRACTOR AND INTEGRATOR *
echo * *
echo * *
echo * BY majdinj - xda *
echo * *
echo **********************************************************
echo **********************************************************
echo.
echo.
echo How to use:
echo -----------
echo 1- Install your ROM dependencies (Only once).
echo 2- Put all same apks from different region ROM's releases in
echo "put-apk-here" folder; you can give them numbers in order
echo to not get confused; ensure no space in apk name.
echo 3- Set Current-apk for one of them, and start extracting job
echo and do the same for the rest of apk files.
echo 4- Let the apk file that you will integrate all languages in
echo to be the last apk to extract the languages from; this is
echo important to ensure the least error during compiling.
echo 5- After you extracted all languages from all apk files, and
echo being the last extracted apk is set as Current-apk, start
echo languages integrating process that will result in one apk
echo file that contains all extracted languages.
echo.
echo Note:
echo -----
echo There is an option to sign your finished apk file, this is
echo an extra step for non system apk ONLY, so you will be able
echo to install the apk on your device.
echo.
PAUSE
:restart
COLOR 0E
cls
cd "%~dp0"
echo Date: %date%
echo Time: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo.
echo Java Heap Memory Size: %heap% MB
echo 7za Compression Level: %comp%
echo.
echo Current-apk: %capp%
echo.
echo --------------------------------------------------------------
echo.
echo ANDROID APK LANGUAGES EXTRACTOR AND INTEGRATOR v1.05
echo.
echo --------------------------------------------------------------
echo.
echo 0 - Install Dependencies From "put-dependencies-here"
echo 1 - Set Current-apk From "put-apk-here"
echo.
echo 2 - Extract Language Folders From Current-apk File
echo 3 - Integrate Extracted Languages With Current-apk File
echo 4 - Sign Finished apk (Don't do this if it's a system apk)
echo.
echo 5 - Set Maximum Java Heap Memory Size
echo 6 - Set 7za Archiver Compression Level
echo.
echo 7 - Read Log File
echo 8 - Clean Folders
echo U - Open XDA Utility Thread Page To Check For Update
echo X - Exit
echo.
echo --------------------------------------------------------------
echo.
SET /P menu=Please make your decision: %=%
IF %menu%==0 (goto Install)
IF %menu%==1 (goto SetCapk)
IF %menu%==2 (goto Extract)
IF %menu%==3 (goto Inegrate)
IF %menu%==4 (goto Sign)
IF %menu%==5 (goto heapsize)
IF %menu%==6 (goto compression)
IF %menu%==7 (goto log)
IF %menu%==8 (goto clean)
IF %menu%==U (goto update)
IF %menu%==u (goto update)
IF %menu%==X (goto exit)
IF %menu%==x (goto exit)
::If you got here, it wasn't valid key
echo.
echo ************************************************
echo * Are you crazy.. choose something exist *
echo ************************************************
echo.
pause
goto restart
:Install
cls
cd "%~dp0"
echo Date: %date%
echo Time: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo.
echo Java Heap Memory Size: %heap% MB
echo App Compression Level: %comp%
echo.
echo Current-apk: %capp%
echo.
echo --------------------------------------------------------------
echo.
echo WHICH FILE DEPENDENCY DO YOU WANT TO INSTALL
echo.
echo --------------------------------------------------------------
echo.
ECHO 1 - Install framework-res.apk
ECHO 2 - Install twframework-res.apk
ECHO 3 - Install com.htc.resources.apk
ECHO 4 - Install SystemUI.apk
ECHO 5 - Install SemcGenericUxpRes.apk
ECHO 6 - Install lidroid-res.apk
ECHO.
ECHO 7 - Install Other Dependency
ECHO.
ECHO M - Go Back to the MAIN MENU
echo.
echo --------------------------------------------------------------
ECHO.
SET /P menud=Please make your decision: %=%
IF %menud%==1 (goto d1)
IF %menud%==2 (goto d2)
IF %menud%==3 (goto d3)
IF %menud%==4 (goto d4)
IF %menud%==5 (goto d5)
IF %menud%==6 (goto d6)
IF %menud%==7 (goto d7)
IF %menud%==M (goto restart)
IF %menud%==m (goto restart)
::If you got here, it wasn't valid key
echo.
echo ************************************************
echo * *
echo * Are you crazy.. choose something exist *
echo * *
echo ************************************************
echo.
pause
goto Install
:d1
IF NOT EXIST "%~dp0put-dependencies-here/framework-res.apk" (goto Pd1)
IF EXIST "%~dp0put-dependencies-here/framework-res.apk" (goto Yd1)
:Pd1
ECHO.
echo framework-res.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP1=Any key for YES or n, no for NO: %=%
IF %INPUTP1%==n (goto Install)
IF %INPUTP1%==no (goto Install)
IF %INPUTP1%==nO (goto Install)
IF %INPUTP1%==N (goto Install)
IF %INPUTP1%==No (goto Install)
IF %INPUTP1%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling framework-res.apk from device,,
adb pull system/framework/framework-res.apk "../put-dependencies-here/framework-res.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying framework-res.apk installation
goto d1
:Yd1
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/framework-res.apk
echo.
echo framework-res.apk was installed successfully..
timeout 3 > nul
goto Install
:d2
IF NOT EXIST "%~dp0put-dependencies-here/twframework-res.apk" (goto Pd2)
IF EXIST "%~dp0put-dependencies-here/twframework-res.apk" (goto Yd2)
:Pd2
ECHO.
echo twframework-res.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP2=Any key for YES or n, no for NO: %=%
IF %INPUTP2%==n (goto Install)
IF %INPUTP2%==no (goto Install)
IF %INPUTP2%==nO (goto Install)
IF %INPUTP2%==N (goto Install)
IF %INPUTP2%==No (goto Install)
IF %INPUTP2%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling twframework-res.apk from device,,
adb pull system/framework/twframework-res.apk "../put-dependencies-here/twframework-res.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying twframework-res.apk installation
goto d2
:Yd2
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/twframework-res.apk
echo.
echo twframework-res.apk was installed successfully..
timeout 3 > nul
goto Install
:d3
IF NOT EXIST "%~dp0put-dependencies-here/com.htc.resources.apk" (goto Pd3)
IF EXIST "%~dp0put-dependencies-here/com.htc.resources.apk" (goto Yd3)
:Pd3
ECHO.
echo com.htc.resources.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP3=Any key for YES or n, no for NO: %=%
IF %INPUTP3%==n (goto Install)
IF %INPUTP3%==no (goto Install)
IF %INPUTP3%==nO (goto Install)
IF %INPUTP3%==N (goto Install)
IF %INPUTP3%==No (goto Install)
IF %INPUTP3%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling com.htc.resources.apk from device,,
adb pull system/framework/com.htc.resources.apk "../put-dependencies-here/com.htc.resources.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying com.htc.resources.apk installation
goto d3
:Yd3
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/com.htc.resources.apk
echo.
echo com.htc.resources.apk was installed successfully..
timeout 3 > nul
goto Install
:d4
IF NOT EXIST "%~dp0put-dependencies-here/SystemUI.apk" (goto Pd4)
IF EXIST "%~dp0put-dependencies-here/SystemUI.apk" (goto Yd4)
:Pd4
ECHO.
echo SystemUI.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP4=Any key for YES or n, no for NO: %=%
IF %INPUTP4%==n (goto Install)
IF %INPUTP4%==no (goto Install)
IF %INPUTP4%==nO (goto Install)
IF %INPUTP4%==N (goto Install)
IF %INPUTP4%==No (goto Install)
IF %INPUTP4%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling SystemUI.apk from device,,
adb pull system/app/SystemUI.apk "../put-dependencies-here/SystemUI.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying SystemUI.apk installation
goto d4
:Yd4
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/SystemUI.apk
echo.
echo SystemUI.apk was installed successfully..
timeout 3 > nul
goto Install
:d5
IF NOT EXIST "%~dp0put-dependencies-here/SemcGenericUxpRes.apk" (goto Pd5)
IF EXIST "%~dp0put-dependencies-here/SemcGenericUxpRes.apk" (goto Yd5)
:Pd5
ECHO.
echo SemcGenericUxpRes.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP5=Any key for YES or n, no for NO: %=%
IF %INPUTP5%==n (goto Install)
IF %INPUTP5%==no (goto Install)
IF %INPUTP5%==nO (goto Install)
IF %INPUTP5%==N (goto Install)
IF %INPUTP5%==No (goto Install)
IF %INPUTP5%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling SemcGenericUxpRes.apk from device,,
adb pull system/framework/SemcGenericUxpRes.apk "../put-dependencies-here/SemcGenericUxpRes.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying SemcGenericUxpRes.apk installation
goto d5
:Yd5
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/SemcGenericUxpRes.apk
echo.
echo SemcGenericUxpRes.apk was installed successfully..
timeout 3 > nul
goto Install
:d6
IF NOT EXIST "%~dp0put-dependencies-here/lidroid-res.apk" (goto Pd6)
IF EXIST "%~dp0put-dependencies-here/lidroid-res.apk" (goto Yd6)
:Pd6
ECHO.
echo lidroid-res.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP6=Any key for YES or n, no for NO: %=%
IF %INPUTP6%==n (goto Install)
IF %INPUTP6%==no (goto Install)
IF %INPUTP6%==nO (goto Install)
IF %INPUTP6%==N (goto Install)
IF %INPUTP6%==No (goto Install)
IF %INPUTP6%==NO (goto Install)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling lidroid-res.apk from device,,
adb pull system/framework/lidroid-res.apk "../put-dependencies-here/lidroid-res.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying lidroid-res.apk installation
goto d6
:Yd6
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/lidroid-res.apk
echo.
echo lidroid-res.apk was installed successfully..
timeout 3 > nul
goto Install
:d7
echo.
echo Type the dependency file name without apk extension.
set /P OTHER=Type Entery: %=%
IF NOT EXIST "%~dp0put-dependencies-here/%OTHER%.apk" (goto Pd7)
IF EXIST "%~dp0put-dependencies-here/%OTHER%.apk" (goto Yd7)
:Pd7
ECHO.
echo %OTHER%.apk was not found in "put-dependencies-here"
echo folder. Do you want to pull it from your device?
set /P INPUTP7=Any key for YES or n, no for NO: %=%
IF %INPUTP7%==n (goto Install)
IF %INPUTP7%==no (goto Install)
IF %INPUTP7%==nO (goto Install)
IF %INPUTP7%==N (goto Install)
IF %INPUTP7%==No (goto Install)
IF %INPUTP7%==NO (goto Install)
echo.
echo From which system folder you want to pull it from?
set /P INPUTP8=Type any key for FRAMEWORK, or type (a) for APP folder: %=%
IF %INPUTP8%==a (goto Pd7a)
IF %INPUTP8%==A (goto Pd7a)
IF %INPUTP8%==(a) (goto Pd7a)
IF %INPUTP8%==(A) (goto Pd7a)
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling %OTHER%.apk from device,,
adb pull system/framework/%OTHER%.apk "../put-dependencies-here/%OTHER%.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying %OTHER%.apk installation
goto Yd7
:Pd7a
echo.
cd "%~dp0tools"
ECHO Waiting for device USB connection...
adb kill-server
adb wait-for-device
ECHO.
ECHO Pulling %OTHER%.apk from device,,
adb pull system/app/%OTHER%.apk "../put-dependencies-here/%OTHER%.apk"
if errorlevel 1 (goto err_adb)
ECHO.
echo System pull complete.. Killing ADB..
adb kill-server
ECHO.
echo ADB killed.. Retrying %OTHER%.apk installation
goto Yd7
:Yd7
echo.
cd "%~dp0tools"
echo Installing dependencies,,
java -Xmx%heap%M -jar apktool.jar if %~dp0put-dependencies-here/%OTHER%.apk
echo.
echo %OTHER%.apk was installed successfully..
timeout 3 > nul
goto Install
:Extract
if %capp%==None goto noproject1
::to ensure having empty temp folder
cd "%~dp0"
rmdir /S /Q temp
mkdir temp
echo.
echo ************************************************
echo * *
echo * Extracting Languages Process,, *
echo * *
echo ************************************************
echo.
cd "%~dp0tools"
echo A. Decompiling %capp%,,
java -Xmx%heap%M -jar apktool.jar d "../put-apk-here/%capp%" "../temp/%capp%"
IF errorlevel 1 (goto error)
timeout 2 > nul
echo.
echo B. Extracting languages values from %capp%,,
::Extracting all folders that start with value name
cd "%~dp0"
FOR /d %%a in (temp\%capp%\res\value*) Do XCOPY %%a "extracted-languages\%%a" /S /Y /I /Q > nul
xcopy "%~dp0extracted-languages\temp\%capp%\res\*" "%~dp0extracted-languages\" /S /Y /I /Q > nul
rmdir /S /Q %~dp0extracted-languages\temp > nul
timeout 2 > nul
rmdir /S /Q temp
mkdir temp
echo.
goto OpenExtract
:eek:penExtract
echo.
echo Finished %capp% languages extracting...
echo All extracted values-folder from the apk file are saved in:
echo "extracted-languages" folder.
echo.
echo Do you want to open the "extracted-languages" folder?
set /P INPUT4=Any key for YES or n, no for NO: %=%
IF %INPUT4%==n (goto :restart)
IF %INPUT4%==no (goto :restart)
IF %INPUT4%==nO (goto :restart)
IF %INPUT4%==N (goto :restart)
IF %INPUT4%==No (goto :restart)
IF %INPUT4%==NO (goto :restart)
start "" "%~dp0/extracted-languages/"
goto restart
:Inegrate
if %capp%==None goto noproject1
IF EXIST "%~dp0/finished-apk/system_%capp%" (del /Q "%~dp0\finished-apk\system_%capp%")
::to ensure having empty temp folder
cd "%~dp0"
rmdir /S /Q temp
mkdir temp
echo.
echo ************************************************
echo * *
echo * Integrating Languages Into apk Process,, *
echo * *
echo ************************************************
echo.
cd "%~dp0tools"
echo A. Decompiling %capp%,,
java -Xmx%heap%M -jar apktool.jar d "../put-apk-here/%capp%" "../temp/%capp%"
IF errorlevel 1 (goto error)
timeout 2 > nul
echo.
echo B. Integrating extracted languages into %capp%,,,
xcopy "..\extracted-languages" "..\temp\%capp%\res" /S /Y /I /Q > nul
timeout 2 > nul
echo.
echo C. Compiling the new %capp%,,
java -Xmx%heap%M -jar apktool.jar b "../temp/%capp%" "..\temp\New_%capp%"
if errorlevel 1 (goto error)
timeout 2 > nul
echo.
echo D. Copying original signature and compressing the final apk,,,
:::::Extracting signature from original apk file:::::
7za x -o"../temp/tempOr" "../put-apk-here/%capp%" META-INF -r > nul
7za x -o"../temp/tempOr" "../put-apk-here/%capp%" AndroidManifest.xml -r > nul
:::::Extracting the new apk file for original signature integration and compression:::::
:::::1.Extracting the new apk...
7za x -o"../temp/tempAPK" "../temp/New_%capp%" -r > nul
:::::2.Copying original signature from tempOr to tempAPK...
xcopy "..\temp\tempOr" "..\temp\tempAPK" /S /Y /I /Q > nul
:::::3.Compressing the whole tempAPK folder into new2 compressed apk file...
7za a -tzip "../temp/New2_%capp%" "../temp/tempAPK/*" -mx%comp% -r > nul
if errorlevel 1 (goto error)
timeout 2 > nul
echo.
ECHO E. Zipaligning the final %capp%,,
zipalign -f 4 "%~dp0temp\New2_%capp%" "%~dp0finished-apk\system_%capp%" > nul
if errorlevel 1 (goto error)
cd "%~dp0"
rmdir /S /Q temp
mkdir temp
echo.
echo DONE.. Your file is saved in "finished-apk" Folder as:
echo system_%capp%
goto OpenFinish
:eek:penFinish
echo.
echo Do you want to open the "finished-apk" folder?
set /P INPUT2=Any key for YES or n, no for NO: %=%
IF %INPUT2%==n (goto :restart)
IF %INPUT2%==no (goto :restart)
IF %INPUT2%==nO (goto :restart)
IF %INPUT2%==N (goto :restart)
IF %INPUT2%==No (goto :restart)
IF %INPUT2%==NO (goto :restart)
start "" "%~dp0/finished-apk/"
goto restart
:Sign
if %capp%==None goto noproject1
IF NOT EXIST "%~dp0/finished-apk/system_%capp%" (goto :SignError)
IF EXIST "%~dp0/finished-apk/signed_%capp%" (del /Q "%~dp0\finished-apk\signed_%capp%")
echo.
echo ************************************************
echo * *
echo * Signing Finished apk With New Signature. *
echo * *
echo ************************************************
echo.
cd "%~dp0tools"
echo Signing system_%capp%,,
java -Xmx%heap%M -jar signapk.jar -w testkey.x509.pem testkey.pk8 "../finished-apk/system_%capp%" "../finished-apk/signed_%capp%"
if errorlevel 1 (goto error)
echo.
echo DONE.. Your file is saved in "finished-apk" Folder as:
echo signed_%capp%
goto OpenFinish
:SetCapk
cls
echo.
echo --------------------------------------------------------------
echo Please select a file from the list bellow to
echo be set as Current-apk in "put-apk-here" folder
echo --------------------------------------------------------------
echo.
set /A count=0
FOR %%F IN (put-apk-here/*.apk) DO (
set /A count+=1
set a!count!=%%F
if /I !count! LEQ 9 (echo ^- !count! - %%F )
if /I !count! GTR 9 (echo ^- !count! - %%F )
)
echo.
echo.
echo --------------------------------------------------------------
echo (Any letter or other number to return back to MAIN MENU)
echo --------------------------------------------------------------
ECHO.
set /P INPUT3=Please Enter The File Number: %=%
if /I %INPUT3% GTR !count! (goto non1)
if /I %INPUT3% LSS 1 (goto non1)
set capp=!a%INPUT3%!
set jar=0
set ext=jar
IF "!capp:%ext%=!" NEQ "%capp%" set jar=1
goto restart
:non1
set capp=None
goto restart
:clean
cls
cd "%~dp0"
echo Date: %date%
echo Time: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo.
echo Java Heap Memory Size: %heap% MB
echo App Compression Level: %comp%
echo.
echo Current-apk: %capp%
echo.
echo --------------------------------------------------------------
echo.
echo CLEANING MENU
echo.
echo --------------------------------------------------------------
echo.
echo 1 - Clean "put-apk-here" Folder
echo 2 - Clean "put-dependencies-here" Folder
echo 3 - Clean "extracted-languages" Folder
echo 4 - Clean "finished-apk" Folder
echo 5 - Clean "temp" Folder
echo.
echo 6 - Clean All Working Folders
echo.
echo M - Go Back To The MAIN MENU
echo.
echo.
echo --------------------------------------------------------------
echo.
SET /P menuc=Please make your decision: %=%
IF %menuc%==1 (goto pfhf)
IF %menuc%==2 (goto fd)
IF %menuc%==3 (goto el)
IF %menuc%==4 (goto ff)
IF %menuc%==5 (goto tf)
IF %menuc%==6 (goto allf)
IF %menuc%==M (goto restart)
IF %menuc%==m (goto restart)
[user=228282]@Rem[/user] If you got here, it wasn't valid key
echo.
echo ************************************************
echo * *
echo * Are you crazy.. choose something exist *
echo * *
echo ************************************************
echo.
pause
goto clean
:pfhf
rmdir /S /Q put-apk-here
mkdir put-apk-here
echo.
echo "put-apk-here" folder is cleaned.
echo.
pause
set capp=None
goto clean
:fd
rmdir /S /Q put-dependencies-here
mkdir put-dependencies-here
echo.
echo "put-dependencies-here" folder is cleaned.
echo.
pause
goto clean
:el
rmdir /S /Q extracted-languages
mkdir extracted-languages
echo.
echo "extracted-languages" folder is cleaned.
echo.
pause
goto clean
:ff
rmdir /S /Q finished-apk
mkdir finished-apk
echo.
echo "finished-apk" folder is cleaned.
echo.
pause
goto clean
:tf
rmdir /S /Q temp
mkdir temp
echo.
echo "temp" folder is cleaned.
echo.
pause
goto clean
:allf
rmdir /S /Q put-apk-here
rmdir /S /Q put-dependencies-here
rmdir /S /Q extracted-languages
rmdir /S /Q finished-apk
rmdir /S /Q temp
mkdir put-apk-here
mkdir put-dependencies-here
mkdir extracted-languages
mkdir finished-apk
mkdir temp
echo.
echo All working folders are cleaned.
echo.
pause
set capp=None
goto clean
:heapsize
echo.
echo Enter maximum java heap size in megabytes (16-1400)
set /P INPUTH=(default 1024): %=%
set heap=%INPUTH%
if "%INPUTH%"=="" (set heap=1024)
if /I %INPUTH% GTR 1400 (set heap=1400)
if /I %INPUTH% LSS 16 (set heap=16)
goto restart
:compression
echo.
echo Enter Compression Level For 7za Archiver (0-9)
set /P INPUTCO=(default 9): %=%
set comp=%INPUTCO%
if "%INPUTCO%"=="" (set comp=9)
if /I %INPUTCO% GTR 9 (set comp=9)
if /I %INPUTCO% LSS 0 (set comp=0)
goto restart
:noproject1
echo.
echo *************
echo * ERROR *
echo *************
echo.
echo Please Set Current-apk. (Option 1)
echo.
echo.
PAUSE
goto restart
:SignError
echo.
echo *************
echo * ERROR *
echo *************
echo.
echo There is no system_%capp% file in "finished-apk" folder
echo.
echo.
PAUSE
goto restart
:error
echo.
echo "An Error Occured, Check The log File (option 7)"
cd "%~dp0"
rmdir /S /Q temp
mkdir temp
echo.
PAUSE
goto restart
:err_adb
echo.
adb kill-server
adb kill-server
ECHO "An Error Occured, Please Check The Log (option 7)"
echo.
cd "%~dp0"
rmdir /S /Q temp
mkdir temp
PAUSE
goto restart
:errjava
COLOR 0C
CLS
echo.
echo.
echo.
echo **************************************************
echo **************************************************
echo ** **
ECHO ** Java was not found,,,, **
echo ** You will not be able to use this tool, **
echo ** until you install Java environment **
echo ** **
echo **************************************************
echo **************************************************
echo.
echo.
echo.
PAUSE
goto logo
:log
cd "%~dp0/tools"
Start "[APK LANGUAGES EXTRACTOR TOOL - majdinj - xda] READING LOG FILE FROM" logscript 1
goto restart
:update
echo.
echo Opening XDA Utility Thread Page,,, Please Wait,,,
timeout 2 > nul
start http://forum.xda-developers.com/showthread.php?p=43669667#post43669667
goto restart
:exit
echo.
echo.
echo.
echo.
echo Bye Bye, see ya later :)
echo.
echo.
echo.
timeout 3
EXIT
Nice tool, I'll test it for a next release. ^_^
It seems there is error code in the script that throw some error messages in the utility,,
I will look at it very soon,,
At work on the moment,,, but within hours hopefully, the fix will be online
New update added:
@ 19/July/2013 (v1.05) change-log:
- Fixed error message during language integration "The process cannot access the file because it is being used by another process".
- Fixed compression function. Now the whole final apk file is compressed by level specified, instead of signature only (my bad!!).
- Fixed open "finished-apk" folder delay after language integrating process.
- Deleting existing signed file apk of same name before signing (no more overlapping).
- New option added in the main menu to link the utility with this thread page (you can check update anytime now).
so so so..thank you so much, i need this tool at a long time..
sir, in my rom nothing language.xml file.
how to fixed that?
my device SGY Duos.
Thanks.
wawan999 said:
sir, in my rom nothing language.xml file.
how to fixed that?
my device SGY Duos.
Thanks.
Click to expand...
Click to collapse
You need to search the corresponding xml that contains all languages in system\csc folder.. It could be named with different name..!!
Can this use for MIUI V5 to add multi-language support?
thanks
Ruling said:
Can this use for MIUI V5 to add multi-language support?
thanks
Click to expand...
Click to collapse
Why not..!!! All what this tool did, is just combine all languages values of the specific same apk files into one multi-languages apk file of that specific type.
Very Helpful .Thanks mate for this :thumbup: .
A lil' suggestion ..please Include post #3 in Hide tags ...its soo big
majdinj said:
Why not..!!! All what this tool did, is just combine all languages values of the specific same apk files into one multi-languages apk file of that specific type.
Click to expand...
Click to collapse
Thank you
thank you so much, i need this tool at a long time.
thank pro. how to edit or sing files sec_csc.zip.
:good: great tool
kermage said:
:good: great tool
Click to expand...
Click to collapse
Can this tool sign sec_csc.zip to flash through the stock 3e? Thanks Pro
Hi, how can i export language.xml from S5 (international) add import to USA S5 ?
because Samsung removed my languages support on the new updates, the US variants used to languages-less.
http://forum.xda-developers.com/galaxy-s5/help/languages-missing-s5-t2833249
majdinj said:
<<In this post, we will concentrate on making the added languages visible and usable in your cooked ROM. Also we will learn how to add different CSC code regions in the cooked ROM>>
How to add languages to language display and language input:
1. Navigate to system\csc\common\system\csc folder and open language.xml file. Here we will concentrate in this section:
Code:
<LanguageSet>
[B][COLOR="Blue"]<Display>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for displayed languages[/COLOR][/B]
en_GB;en_US;fr_FR;
ar_AE;fa_FA;ur_PK;
</Display>
[B][COLOR="Blue"]<Input>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for input languages[/COLOR][/B]
<SupportList>
en_GB;en_US;fr;ar;fa;ur;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>
for each section you can add iso code language for each region. Here is the code again after applying iso code languages:
Code:
<LanguageSet>
<Display>
en_GB;ar_AE;az_AZ;bg_BG;ca_ES;cs_CZ;da_DK;de_AT;de_CH;de_DE;
el_GR;en_AU;en_IE;en_NZ;en_PH;en_US;en_ZA;es_ES;es_US;et_EE;
eu_ES;f_FI;fa_FA;fr_CH;fr_FR;ga_IE;gl_ES;hr_HR;hu_HU;hy_AM;
in_ID;is_IS;it_IT;ka_GE;kk_KZ;ko_KR;lt_LT;lv_LV;mk_MK;ms_MY;
nb_NO;nl_BE;nl_NL;pl_PL;pt_BR;pt_PT;ro_RO;ru_RU;sk_SK;sl_SI;
sr_RS;sv_SE;th_TH;tr_TR;ur_PK;uk_UA;uz_UZ;vi_VN;zh_CN;zh_HK;
zh_TW;
</Display>
<Input>
<SupportList>
en_GB;ar;az;bg;bn;ca;cs;da;de;el;
en_US;es;et;eu;fa;fi;fr;gl;gu;hi;
hr;hu;hy;id;is;it;ka;kk;kn;ko;
lt;lv;ml;ms;mr;nb;nl;pa;pl;pt;
ro;ru;sk;sl;sr;sv;ta;te;th;tr;
uk;ur;vi;zh_CN;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>
of course after extracting a lot of ROMs from specific regions, you can just add their iso code language in your cooked ROM language.xml after having the iso codes from their language.xml files
2. Now copy this modified language.xml and paste it on system\csc directory
3. Now to display language name in your device, you need to decompile ResourceManager.apk and navigate to res\values folder and open strings.xml and add new languages resources strings there in this form:
Code:
<string name="vo_rm_authority">com.visionobjects.resourcemanager</string>
<string name="[B][COLOR="Red"]en_GB[/COLOR][/B]">[B][COLOR="Blue"]English(UK)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]en_US[/COLOR][/B]">[B][COLOR="Blue"]English(US)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]az[/COLOR][/B]">[B][COLOR="Blue"]Azərbaycan[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]ca[/COLOR][/B]">[B][COLOR="Blue"]Català[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]cs[/COLOR][/B]">[B][COLOR="Blue"]Čeština[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]da[/COLOR][/B]">[B][COLOR="Blue"]Dansk[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]de[/COLOR][/B]">[B][COLOR="Blue"]Deutsch[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]et[/COLOR][/B]">[B][COLOR="Blue"]Eesti[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]es[/COLOR][/B]">[B][COLOR="Blue"]Español[/COLOR][/B]</string>
..
..
[B][COLOR="Green"]and so on[/COLOR][/B]
Here the red texts are regional iso codes for the added language, and the blue texts are the displayed language name in your device (you can decompile ResourceManager.apk from different ROMs' regions in order to have the iso codes and the corresponding languages strings).
4. Now you need to add input database for different languages. After extracting different ROMs' regions, copy all the content of system\T9DB and paste it in same directory of the ROM that you will make it support different languages.
5. Now you will need to integrate languages data base; after extracting different ROMs' regions, copy all the content of system\hdic folder and paste it in same directory of the ROM that you will make it support different languages.
How to set default language in initial setup wizard:
Go to system\csc folder and open customer.xml and edit this section:
Code:
<Phone>
<DefLanguage>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguage>
<DefLanguageNoSIM>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguageNoSIM>
<DateTimeFormat>
<DateFormat>ddmmyyyy</DateFormat>
</DateTimeFormat>
<VisiblePassword>off</VisiblePassword>
</Phone>
Just change the blue colored iso code and substitute it with your favorite one from language.xml display section
CSC codes:
How to set default csc code:
Go to system\csc\%yourCSCfolder%\system\csc folder and copy all its content (usually contents.db, customer.xml, others.xml, and sales_code.dat) and paste it on system\csc directory.
Alternatively, you can edit the files in system\csc folder that includes:
customer.xml
Code:
<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>
change it to your csc iso code (that is the csc folder name in system\csc folder).
language.xml:
Code:
<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>
the same as change in customer.xml
sales_code.dat
Code:
[B][COLOR="Blue"]KSA[/COLOR][/B]
the same as change in customer.xml
How to add extra CSC codes:
After extracting all CSC folders from different ROMs region, first copy and paste them in system\csc folder then you need to go to system directory and open SW_Configuration.xml and add all CSC folders you just paste:
Code:
<NbCustomer>[B][COLOR="Blue"]67[/COLOR][/B]</NbCustomer> [B][COLOR="Green"]<!-- Here enter how many csc code folders you have in system\csc[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ABS[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFG[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFR[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |--- Here add CSC folders[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ALO[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ARB[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
..
..
[B][COLOR="Green"]and so on[/COLOR][/B]
And now you are ready to create your multi-languages and multi-csc ROM,,
Click to expand...
Click to collapse
salam alaikom
but lanuage.xml not found in my phone
even i show hiden files
hi @majdinj can you put new apktool for this tool or tell my how to update? i put apktool 2.2.2 in tool dir but get error when decompiling?
Hey guys, I've just decided to get inside of the Android development world. Anyways, I'm mostly a fan of Linux, so I've made my first Linux script, I know it's simple, but I've never interacted with the user before, or picked an output. When I knew that Android made use of Linux in its core, my interest on working inside it grew up faster than ever.
In my script, firstly, you type the filename. For compatibility reasons, it'll everytime save to /sdcard/filename. Then, it will ask you how many times you want the script to log everything, and lately, every how many seconds should it save everything to the file.
The script will save, before every entry at the log, the screen status (if it's on or off), that can help to, for example, if your device has been lagging as a result of a bad screen driver or UI error.
Last thnig: it also works on recovery (maybe it give some error, and if no dumpsys is present on your recovery's ramdisk, it'll save everything as OFF).
Remember to send it anywhere excepting from /storage and any sbudir, it won't work as the Android permissions system blocks script execution on those dirs.
Code:
clear
# Wipe $logfile content in /sdcard (if any existing)
echo "Please type the filename where you want to save the log: "
read -r logfile
echo "" > /sdcard/$logfile
echo "Deleted previous log."
echo "SCREEN | CPU" >> /sdcard/$logfile
#cont=60
cont=1
#SHOWLOG=X
echo "Please type how many times the cycle must repeat: "
read -r maxcont
echo "Please type how many seconds will the interval take: "
read -r maxmin
clear
# Here it counts how many times the logging script has been ran
while [ $cont -lt $((maxcont + 1)) ];
do
# That nested while takes control of how many seconds have passed in the current cycle
while [ "$contmin" -lt "$maxmin" ];
do
contmin=$((contmin + 1))
sleep 1
clear
echo "C: $cont/$maxcont - T: $contmin/$maxmin"
done
# echo "$maxmin seconds passed."
# Logs the fist line of "busybox top" to a var
LOGVAR=$(busybox top -d 1 -n 1 | grep "idle")
# Logs the screen state (on or off) to another var
SCREENSTATE=$(dumpsys input_method | grep mScreenOn | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
# Saves a string that tells what it should expect if the screen is on
SCREENSTATEON="msystemreadytruemscreenontrue"
if [ "$SCREENSTATE" == "$SCREENSTATEON" ]
then
echo "ON: $LOGVAR" >> /sdcard/$logfile
else
echo "OFF: $LOGVAR" >> /sdcard/$logfile
fi
cont=$((cont + 1))
contmin=0
done
echo "Show logged values? [Y/N]"
read -r SHOWLOG
case $SHOWLOG in
[yY] | [yY][Ee][Ss] )
cat /sdcard/$logfile
;;
[nN] | [n|N][O|o] )
echo "Ok, goodbye. You'll see a what you've asked me to log in /sdcard/$logfile";
exit 1
;;
*) echo "You must write Y or N to continue."
;;
esac
exit 0
For example, save it as script.sh (remember to save it using Unix codifcation, if you're running Windows, else, it'll tell you that it's unable to find many binaries, as long as Linux isn't ok with CR+LF and requires LF as newline). Then, send it to the sdcard (over USB or adb push script.sh /sdcard/) , now, run ADB shell. Type the following commands:
Code:
su -c "cp -f /sdcard/script.sh /data/local/;chmod 777 /data/local/script.sh"
Then, if you want to run it:
Code:
su
sh /data/local/script.sh
That's all, I hope you enjoy it and not so many people kills me for explaining and feeling so grateful for that simple script.
Hello everyone. We found a way to unlock and root a BLU R1 HD in ota version 6.6.
Files http://forum.xda-developers.com/showpost.php?p=69387472&postcount=5
Here are the instrucction:
mrmazak said:
I wrote (or plagiarized a little) Five batch scripts and put them into a .tar archive.
It is attached.
***** NOTICE DURING THIS YOUR PHONE SCREEN MAY SHOW A FROZEN BOOT ANIMATION, THIS IS EXPECTED, THE ADB SHELL SHOULD STILL BE ACTIVE AND WORKING*****
** THE FREEZING IS FROM THE "/system/bin/app_process32" BEING TEMPORARILY OVER WRITTEN, ON THE NEXT REBOOT IT IS RESTORED****
WARNING UNLOCKING YOUR BOOTLOADER WILL WIPE DATA AND FACTORY RESET THE DEVICE
So backup anything you want to keep
Decompress the files and start with "1-First", and continue until "5-Fifth". (in order 1,2,3,4,5)
The separate scripts could be combined into a one click option to unlock boot loader and then install the recovery. But there is issues with the shell in a shell in a cmd passing the commands through. So in an effort to make sure nobody misses the needed manual steps i kept them separate.
PLEASE PAY ATTENTION TO THE COMMENTS IN ADB WINDOW. CAREFULLY CHECK WHAT YOU TYPE BEFORE YOU HIT ENTER. A TYPO HERE MAY BE SERIOUS.
So you will need to run the script and follow the on screen notes , There are two times you will need to manually open a second command window and enter adb shell, type commands. One time in the First batch and again in the Third. Copy and paste also doesn't work in this situation
If you are on Linux you will have to re write the commands into a sh file or do it all by hand.
If anybody wants to make improvements and can get the manual entry part to be coded, please do.
1-First.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step one
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] adjust window size to the dashed lines above (press any button to continue)
pause > nul
adb push dirtycow /data/local/tmp/dirtycow
adb push cow-app64-mod /data/local/tmp/cow-app64-mod
adb push frp.bin /data/local/tmp/unlock
adb shell chmod 0777 /data/local/tmp/*
echo.--------------------------------------------------------------------------------------------
echo [*] done pushing next is dirtycow swapping (press any button twice)
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
adb shell /data/local/tmp/dirtycow /system/bin/app_process32 /data/local/tmp/cow-app64-mod
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] once it finishes
echo [*] open new command window and type
echo [*] "adb shell"
echo [*] then "toybox nc localhost 11112"
echo [*] and u will be in root shell... u wont see any # or ... but u type commands at it shows
echo [*] once you are in the shell type
echo [*] "mkdir /data/local/test"
echo [*] "chmod 7777 /data/local/test"
echo [*] "cp /dev/block/mmcblk0p17 /data/local/test/frp"
echo [*] "chmod 7777 /data/local/test/frp"
echo [*] Leave that New window There and go onto start 2-Second.bat
echo [*] (press any button twice)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
2-Second.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Two
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] adjust window size to the dashed lines above (press any button to continue)
pause > nul
echo [*] YOU SHOULD NOT BE HERE UNLESS YOU DID THE STEP BELOW
echo [*] **************************************
echo [*] open new command window and type
echo [*] "adb shell"
echo [*] then "toybox nc localhost 11112"
echo [*] and u will be in root shell... u wont see any # or ... but u type commands at it shows
echo [*] once you are in the shell type
echo [*] "mkdir /data/local/test"
echo [*] "chmod 7777 /data/local/test"
echo [*] "cp /dev/block/mmcblk0p17"
echo [*] "chmod 7777 /data/local/test/frp"
echo [*] *****************************************
echo [*] (press any button)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
echo [*] this step may take long time (up to one hour) to fully allow it to complete
echo [*] I continued before it finished and was fine though
echo [*] once the second "madvice=" line shows up should be ok to continue
echo [*] ..
echo [*] press any key twice to Start
echo [*] ......To continue after second "madvice" line hit "ctrl+c" then Y then run 3-Third.bat
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
adb shell /data/local/tmp/dirtycow /data/local/test/frp /data/local/tmp/unlock
echo [*] done dirtycow swapping next is run 3-Third.bat (press any button twice)
pause > nul
pause > nul
3-Third.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Three
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] adjust window size to the dashed lines above (press any button to continue)
pause > nul
echo [*] YOU SHOULD NOT BE HERE UNLESS YOU DID THE STEP BELOW
echo [*] **************************************
echo [*] wait for minumum the second "madvice=" line shows up while running 2-Second.bat
echo [*] this batch does nothing more that give you instructions to open seperate shell
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] ******
echo [*] ******
echo [*] ******
echo [*] ******
echo [*] Go Back to open shell window from step 1
echo [*] enter this command
echo [*] dd if=/data/local/test/frp of=/dev/block/mmcblk0p17
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] done writing unlock image next is run 4-Fourth.bat (press any button twice)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
4-Forth.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Four
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] adjust window size to the dashed lines above (press any button twice continue)
pause > nul
@echo on
pause > nul
adb reboot bootloader
timeout 10 > nul
cls
@echo off
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] now that the device is in fastboot mode we are going to unlock the
echo [*] bootloader. on the next screen on your phone you will see
echo [*] PRESS THE VOLUME UP/DOWN BUTTONS TO SELECT YES OR NO
echo [*] just press volume up to start the unlock process.
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] press any key to start the unlock
pause > nul
fastboot oem unlock
echo [*] once the bootloader is unlocked press any key to wipe data
pause > nul
fastboot format userdata
echo [*] Press any key to reboot the device
pause > nul
fastboot reboot
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] your bootloader is now unlocked on your BLU R1 HD Amazon device
echo [*] first boot up will take around 5 to 10 minutes then you can set it up
echo [*] Next is the 5-Fifth.bat to install recovery echo echo [*]
echo [*] You will need to enble developers option, then enable adb to continue next script
echo [*] ******************
echo [*] IF PHONE DOES NOT REBOOT HOLD POWER UNTILL IT POWERS OFF THEN AGAIN TO POWER ON
echo [*] ******************
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] Press any key to finish this script.
pause > nul
exit
5-Fifth.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Five
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] adjust window size to the dashed lines above (press any button twice continue)
pause > nul
@echo on
pause > nul
adb reboot bootloader
timeout 10 > nul
cls
@echo off
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*]
echo [*]
echo [*]
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] press any key to Flash recovery
pause > nul
fastboot flash recovery recovery.img
echo [*] once the file transfer is complete hold volume up and press any key on pc
echo [*] IF PHONE DOES NOT REBOOT THEN HOLD VOLUME UP AND POWER UNTILL IT DOES
pause > nul
fastboot reboot
echo [*] on phone select recovery with volume key then select with power
pause > nul
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] now you booted to recovery continue and make a backup if you want
echo [*] you can just continue as is from here or flash the old preloader file with
echo [*] recovery. There are more steps not included here if you want to do that.
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] Press any key to finish this script.
pause > nul
exit
Follow up with bootloader roll-back if desired.
http://forum.xda-developers.com/r1-hd/how-to/r1hd-update-6-6-bootloader-roll-t3491096
Click to expand...
Click to collapse
none important note: my english sucks! Que viva Puerto Rico
thanks to:
@jcadduono - wrote recowvery-app_proccess64
@mrmazak - main tester, bat script writer & fastboot steps
@Scorpius666 - mod recowvery-app_proccess64 and lsh into cow-app64-mod
@christianrodher - compiled dirtycow , cow-app64-mod & found the steps to unlock/root
@rootjunky - for files
@lopestom - twrp recovery
@brenns10 - wrote lsh
nicely done guy.
wait you guys have a 64bit enabled r1HD? how?
KazuDante said:
nicely done guy.
wait you guys have a 64bit enabled r1HD? how?
Click to expand...
Click to collapse
thats just the name of the files... they are compiled as 32bits
Oh ok...man i had my hopes up.....because we need to enable the r1 in a 64bit mode
Sent from my BLU R1 HD using Tapatalk
UPDATED
OLD batch script is now made into interactive "tool"
REMOVED LINK FILE HAD PROBLEM SCRIPT TYPO MADE IT UNSTABLE
fixing and will update soon
fixed version here
sorry about the confusion. Will make new thread for tool i think
New thread https://forum.xda-developers.com/r1-hd/how-to/unlock-tool-t3561333
old post is hidden
I keep telling myself I am finished with the srcipt, but then improve it again. I finally decided to put it on github.
https://github.com/mrmazakblu/DirtyCow-R1_HD
most recent version of script and files are now kept on github.
Last post before github host is here
Download tar file and unpack into folder of your choice. Connect phone to pc with ADB enabled. Open folder where you unzipped files to and click on the "one-click-root.bat". Dirtycow has been modified to run much quicker. The new compiled dirtycow.c file is included in the archive. It is the optimized dirtyc0w from this github. https://github.com/bkerler/CVE-2016-5195/tree/master
The included recowvery-app_process32.c is included it comes from @vampirefo 's github project. I changed one line near the end. I changed the 120 second timeout to 10 seconds. https://github.com/vampirefo/limited_shell_root/tree/vampirefo-limited_shell_root
The included busybox executable also comes from vampirefo, it was not necessary to use the busybox, because this devise has toybox included, but I wanted something that could possibly help be used on more devices, so I included it in the scripts.
WARNING UNLOCKING YOUR BOOTLOADER WILL WIPE DATA AND FACTORY RESET THE DEVICE
So backup anything you want to keep
One-Click-root.bat
Code:
::Set our Window Title
@title R1 HD AMAZON BOOTLOADER UNLOCK
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] BEFORE WE BEGIN THE SCRIPT WILL RUN "ADB DEVICES" AND SEE IF YOU HAVE DRIVERS INSTLLED
echo [*] THE NEEDED RESPONSE IS SIMILAR TO BELOW
echo [*]
echo [*] List of devices attached
echo [*] **************** device
echo [*]
echo [*] INSTEAD OF STARS IT WILL BE YOUR SERIAL NUMBER
echo [*] IF NO DEVICE LISTED YOU ARE NOT READY TO RUN THIS SCRIPT. CLOSE THIS WINDOW NOW IF NOT READY
echo [*]
echo [*] IF DEVICE IS LISTED PRESS ANY KEY ON COMPUTER TO START
echo [*]
adb devices
pause > nul
adb wait-for-device
cls
echo [*] copying dirtycow to /data/local/tmp/dirtycow
adb push dirtycow /data/local/tmp/dirtycow
timeout 2 > nul
echo [*] copying recowvery-app_process32 to /data/local/tmp/recowvery-app_process32
adb push recowvery-app_process32 /data/local/tmp/recowvery-app_process32
timeout 2 > nul
echo [*] copying frp.bin to /data/local/tmp/unlock
adb push frp.bin /data/local/tmp/unlock
timeout 2 > nul
echo [*] copying busybox to /data/local/tmp/busybox
adb push busybox /data/local/tmp/busybox
timeout 2 > nul
echo [*] copying cp_comands.txt to /data/local/tmp/cp_comands.txt
adb push cp_comands.txt /data/local/tmp/cp_comands.txt
timeout 2 > nul
echo [*] copying dd_comands.txt to /data/local/tmp/dd_comands.txt
adb push dd_comands.txt /data/local/tmp/dd_comands.txt
timeout 2 > nul
echo [*] changing permissions on copied files
adb shell chmod 0777 /data/local/tmp/*
timeout 2 > nul
cls
echo.--------------------------------------------------------------------------------------------
echo [*] DONE PUSHING FILES TO PHONE. NOW WE ARE GOING TO TEMP WRITE OVER THE APP_PROCESS
echo [*] WITH A MODIFIED VERSION THAT HAS lsh IN IT USING A SYSTEM-SERVER AS ROOT SHELL
echo [*] THIS STEP WILL CAUSE PHONE TO DO A SOFT REBOOT AND WILL NOT RESPOND TO BUTTON PUSHES
echo [*]
adb shell /data/local/tmp/dirtycow /system/bin/app_process32 /data/local/tmp/recowvery-app_process32
echo.--------------------------------------------------------------------------------------------
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*]WAITING 60 SECONDS FOR ROOT SHELL TO SPAWN
timeout 60 > nul
echo.--------------------------------------------------------------------------------------------
echo [*] OPENING A ROOT SHELL ON THE NEWLY CREATED SYSTEM_SERVER
echo [*] MAKING A DIRECTORY ON PHONE TO COPY FRP PARTION TO
echo [*] CHANGING PERMISSIONS ON NEW DIRECTORY
echo [*] COPYING FPR PARTION TO NEW DIRECTORY AS ROOT
echo [*] CHANGING PERMISSIONS ON COPIED FRP
adb shell "/data/local/tmp/busybox nc localhost 11112 < /data/local/tmp/cp_comands.txt"
cls
echo [*] COPY UNLOCK.IMG OVER TOP OF COPIED FRP IN /data/local/test NOT AS ROOT WITH DIRTYCOW
echo [*]
adb shell /data/local/tmp/dirtycow /data/local/test/frp /data/local/tmp/unlock
timeout 5 > nul
cls
echo [*] WAITING 5 SECONDS BEFORE WRITING FRP TO EMMC
timeout 5 > nul
echo [*] DD COPY THE NEW (UNLOCK.IMG) FROM /data/local/test/frp TO PARTITION mmcblk0p17
adb shell "/data/local/tmp/busybox nc localhost 11112 < /data/local/tmp/dd_comands.txt"
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo.-----------REBOOTING_INTO_BOOTLOADER--------------------------------------------------------
adb reboot bootloader
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] YOUR PHONE SCREEN SHOULD BE BLACK WITH THE WORD "=>FASTBOOT mode..." IN LOWER CORNER
echo [*] JUST LIKE IN THE BEGINING WE NEED TO VERIFY YOU HAVE DRIVERS ON PC FOR THE NEXT STEP
echo [*] THE RESPONSE SHOULD BE
echo [*]
echo [*] *************** fastboot
echo [*]
echo [*] THE STARS WILL BE YOUR SERIAL NUMBER
echo [*] IF THE RESPONSE IS THIS THEN HIT ANY BUTTON ON PC TO CONTINUE
echo [*]
echo [*] IF RESPONSE IS A BLANK LINE YOU DO NOT HAVE DRIVER NEEDED TO CONTINUE. CLOSE THIS WINDOW
echo [*] AND GET FASTBOOT DRIVERS THEN EITHER RUN "fastboot oem unlock" IN TERMINAL
fastboot devices
pause > nul
cls
echo [*] NOW THAT THE DEVICE IS IN FASTBOOT MODE WE ARE GOING TO UNLOCK THE
echo [*] BOOTLOADER. ON THE NEXT SCREEN ON YOUR PHONE YOU WILL SEE
echo [*] PRESS THE VOLUME UP/DOWN BUTTONS TO SELECT YES OR NO
echo [*] JUST PRESS VOLUME UP TO START THE UNLOCK PROCESS.
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] PRESS ANY KEY ON COMPUTER TO START THE UNLOCK
pause > nul
fastboot oem unlock
cls
echo [*] ONCE THE BOOTLOADER IS UNLOCKED PRESS ANY KEY TO WIPE DATA
pause > nul
fastboot format userdata
cls
echo [*] PRESS ANY KEY TO REBOOT THE DEVICE
pause > nul
fastboot reboot
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] YOUR BOOTLOADER IS NOW UNLOCKED ON YOUR BLU R1 HD AMAZON DEVICE
echo [*] FIRST BOOT UP WILL TAKE AROUND 5 TO 10 MINUTES THEN YOU CAN SET IT UP
echo [*] NEXT IS TO INSTALL RECOVERY TWRP
echo [*]
echo [*]
echo [*] YOU WILL NEED TO ENBLE DEVELOPERS OPTION, THEN ENABLE ADB TO CONTINUE NEXT SCRIPT
echo [*] ******************
echo [*] IF PHONE DID NOT REBOOT HOLD POWER UNTILL IT POWERS OFF THEN AGAIN TO POWER ON
echo [*] ******************
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] PRESS ANY KEY TO INSTALL TWRP AFTER YOU ENABLE DEVELOPER OPTIONS ON PHONE
echo [*] OR CTRL+C TO STOP HERE
pause > nul
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo.-----------REBOOTING_INTO_BOOTLOADER--------------------------------------------------------
adb reboot bootloader
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] NOW YOUR IN FASTBOOT MODE AND READY TO FLASH TWRP RECOVERY
echo [*]
echo [*]
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] PRESS ANY KEY TO FLASH RECOVERY
pause > nul
fastboot flash recovery recovery.img
echo [*] ONCE THE FILE TRANSFER IS COMPLETE HOLD VOLUME UP AND PRESS ANY KEY ON PC
ECHO [*]
echo [*] IF PHONE DOES NOT REBOOT THEN HOLD VOLUME UP AND POWER UNTILL IT DOES
pause > nul
fastboot reboot
echo [*] ON PHONE SELECT RECOVERY FROM BOOT MENU WITH VOLUME KEY THEN SELECT WITH POWER
echo [*] PRESS ANY KEY ON PC FOR MORE NOTES
pause > nul
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] NOW YOU BOOTED TO RECOVERY CONTINUE AND MAKE A BACKUP IF YOU WANT
echo [*] YOU CAN JUST CONTINUE AS IS FROM HERE OR FLASH THE OLD PRELOADER FILE WITH
echo [*] RECOVERY. THERE ARE MORE STEPS NOT INCLUDED HERE IF YOU WANT TO DO THAT.
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] PRESS ANY KEY TO FINISH THIS SCRIPT.
pause > nul
exit
original post is below hidden
I wrote (or plagiarized a little) Five batch scripts and put them into a .tar archive.
It is attached.
***** NOTICE DURING THIS YOUR PHONE SCREEN WILL SHOW A FROZEN BOOT ANIMATION, THIS IS EXPECTED, THE ADB SHELL SHOULD STILL BE ACTIVE AND WORKING*****
** THE FREEZING IS FROM THE "/system/bin/app_process32" BEING TEMPORARILY OVER WRITTEN, ON THE NEXT REBOOT IT IS RESTORED****
WARNING UNLOCKING YOUR BOOTLOADER WILL WIPE DATA AND FACTORY RESET THE DEVICE
So backup anything you want to keep
Decompress the files and start with "1-First", and continue until "5-Fifth". (in order 1,2,3,4,5)
The separate scripts could be combined into a one click option to unlock boot loader and then install the recovery. But there is issues with the shell in a shell in a cmd passing the commands through. So in an effort to make sure nobody misses the needed manual steps i kept them separate.
PLEASE PAY ATTENTION TO THE COMMENTS IN ADB WINDOW. CAREFULLY CHECK WHAT YOU TYPE BEFORE YOU HIT ENTER. A TYPO HERE MAY BE SERIOUS.
So you will need to run the script and follow the on screen notes , There are two times you will need to manually open a second command window and enter adb shell, type commands. One time in the First batch and again in the Third. Copy and paste also doesn't work in this situation
If you are on Linux you will have to re write the commands into a sh file or do it all by hand.
If anybody wants to make improvements and can get the manual entry part to be coded, please do.
1-lsh_Root_mkdir_test.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step one
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
adb push dirtycow /data/local/tmp/dirtycow
adb push cow-app64-mod /data/local/tmp/cow-app64-mod
adb push frp.bin /data/local/tmp/unlock
adb push busybox /data/local/tmp/busybox
adb shell chmod 0777 /data/local/tmp/*
echo.--------------------------------------------------------------------------------------------
echo [*] DONE PUSHING FILES TO PHONE. NOW WE ARE GOING TO TEMP WRITE OVER THE APP_PROCESS
echo [*] WITH A MODIFIED VERSION THAT HAS LSH IN IT FOR A SYSTEM-SERVER AS ROOT SHELL
echo [*] NOW TO CONTINUE PRESS ANY BUTTON 2 TIMES
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
adb shell /data/local/tmp/dirtycow /system/bin/app_process32 /data/local/tmp/cow-app64-mod
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] ONCE IT FINISHES
echo [*] OPEN A NEW COMMAND WINDOW AND TYPE THE FOLLOWING COMMANDS WITHOUT THE ""
echo [*] "adb shell"
echo [*] "toybox nc localhost 11112" or "/data/local/tmp/busybox nc localhost 11112"
echo [*] YOU WILL NOW SEE "ciao" BUT THERE WILL NOT BE ANY PROMT OR CURSOR, JUST TYPE IT SHOW UP
echo [*] NOW ENTER THESE COMMANDS AT THE ROOT ciao
echo [*] "mkdir /data/local/test"
echo [*] "chmod 7777 /data/local/test"
echo [*] "cp /dev/block/mmcblk0p17 /data/local/test/frp"
echo [*] "chmod 7777 /data/local/test/frp"
echo [*] LEAVE THE NEW COMMAND WINDOW WHERE IT IS AND CONTINUES TO BATCH FILE 2
echo [*] (PRESS ANY BUTTON TWICE TO EXIT)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
2-Dirtycow_unlock_to_tmp.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Two Move Unlock to root owned location
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] YOU SHOULD NOT BE HERE UNLESS YOU DID THE STEP BELOW FROM FIRST BATCH
echo [*] **************************************
echo [*] ONCE IT FINISHES
echo [*] OPEN A NEW COMMAND WINDOW AND TYPE THE FOLLOWING COMMANDS WITHOUT THE ""
echo [*] "adb shell"
echo [*] "toybox nc localhost 11112" or "/data/local/tmp/busybox nc localhost 11112"
echo [*] YOU WILL NOW SEE "ciao" BUT THERE WILL NOT BE ANY PROMT OR CURSOR, JUST TYPE IT SHOW UP
echo [*] NOW ENTER THESE COMMANDS AT THE ROOT ciao
echo [*] "mkdir /data/local/test"
echo [*] "chmod 7777 /data/local/test"
echo [*] "cp /dev/block/mmcblk0p17 /data/local/test/frp"
echo [*] "chmod 7777 /data/local/test/frp"
echo [*] LEAVE THE NEW COMMAND WINDOW WHERE IT IS AND CONTINUES TO BATCH FILE 2
echo [*] *****************************************
echo [*] (PRESS ANT BUTTON TO CONTINUE)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
echo [*] this step may take long time (up to one hour) to fully allow it to complete
echo [*] I continued before it finished and was fine though
echo [*] once the second "madvice=" line shows up should be ok to continue
echo [*] ..
echo [*] press any key twice to Start
echo [*] ......To continue after second "madvice" line hit "ctrl+c" then Y then run 3-Third.bat
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
adb shell /data/local/tmp/dirtycow /data/local/test/frp /data/local/tmp/unlock
echo [*] done dirtycow swapping next is run 3-Third.bat (press any button twice)
pause > nul
pause > nul
3-Write_unlockIMG.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Three DD unlock to FRP partition
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] YOU SHOULD NOT BE HERE UNLESS YOU DID THE STEP BELOW
echo [*] **************************************
echo [*] wait for minumum the second "madvice=" line shows up while running 2-Second.bat
echo [*] this batch does nothing more that give you instructions to open seperate shell
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] ******
echo [*] ******
echo [*] ******
echo [*] ******
echo [*] Go Back to open shell window from step 1
echo [*] enter this command
echo [*] dd if=/data/local/test/frp of=/dev/block/mmcblk0p17
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] done writing unlock image next is run 4-Fourth.bat (press any button twice)
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
pause > nul
pause > nul
4-oem_unlock.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Four fastboot oem unlock
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo.-----------REBOOTING_INTO_BOOTLOADER--------------------------------------------------------
adb reboot bootloader
timeout 15 > nul
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] now that the device is in fastboot mode we are going to unlock the
echo [*] bootloader. on the next screen on your phone you will see
echo [*] PRESS THE VOLUME UP/DOWN BUTTONS TO SELECT YES OR NO
echo [*] just press volume up to start the unlock process.
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] press any key to start the unlock
pause > nul
fastboot oem unlock
echo [*] once the bootloader is unlocked press any key to wipe data
pause > nul
fastboot format userdata
echo [*] Press any key to reboot the device
pause > nul
fastboot reboot
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] your bootloader is now unlocked on your BLU R1 HD Amazon device
echo [*] first boot up will take around 5 to 10 minutes then you can set it up
echo [*] Next is the 5-Fifth.bat to install recovery echo echo [*]
echo [*] You will need to enble developers option, then enable adb to continue next script
echo [*] ******************
echo [*] IF PHONE DOES NOT REBOOT HOLD POWER UNTILL IT POWERS OFF THEN AGAIN TO POWER ON
echo [*] ******************
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] Press any key to finish this script.
pause > nul
exit
5-TWRP.bat
Code:
::Set our Window Title
@title R1 HD Amazon Bootloader Unlock Step Five Install TWRP
mode 100,30
::Set our default parameters
@echo off
color 0b
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo.-----------REBOOTING_INTO_BOOTLOADER--------------------------------------------------------
adb reboot bootloader
timeout 15 > nul
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] NOW YOUR IN FASTBOOT MODE AND READY TO FLASH TWRP RECOVERY
echo [*]
echo [*]
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] press any key to Flash recovery
pause > nul
fastboot flash recovery recovery.img
echo [*] once the file transfer is complete hold volume up and press any key on pc
echo [*] IF PHONE DOES NOT REBOOT THEN HOLD VOLUME UP AND POWER UNTILL IT DOES
pause > nul
fastboot reboot
echo [*] on phone select recovery with volume key then select with power
pause > nul
cls
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] now you booted to recovery continue and make a backup if you want
echo [*] you can just continue as is from here or flash the old preloader file with
echo [*] recovery. There are more steps not included here if you want to do that.
echo [*]
echo.--------------------------------------------------------------------------------------------
echo.--------------------------------------------------------------------------------------------
echo [*] Press any key to finish this script.
pause > nul
exit
Follow up with bootloader roll-back if desired.
http://forum.xda-developers.com/r1-hd/how-to/r1hd-update-6-6-bootloader-roll-t3491096
thanks to @vampirefo for the busybox
(switched to busybox for a more universal approach) ** switched back to toybox with one-click. Busybox did not have a timeout command [(-q 1) for one second]
Follow up with install SperSu if desired.
Stable superSU link. http://forum.xda-developers.com/showthread.php?t=1538053
From supersu site download recovery install version. Version at time of first root was v2.76 no it is v2.78 both should work. Put .zip file onto phone internal memory. Either by adb push, or by mtp connection. And boot to recovery and install.
Follow up with bootloader roll-back if desired.
http://forum.xda-developers.com/r1-hd/how-to/r1hd-update-6-6-bootloader-roll-t3491096
congrats!
lol... give them root and they want 64bit.
Excelente viejo! lo voy a probar saludos desde honduras
Release the source code for these files, they are based on open source files.
Too refuse to release the source is selfish and hurtful to the spirit of open source, in which these files are based off of.
Sent from my R1HD(ZenUI) via Tapatalk
vampirefo said:
Release the source code for these files, they are based on open source files.
Too refuse to release the source is selfish and hurtful to the spirit of open source, in which these files are based off of.
Sent from my R1HD(ZenUI) via Tapatalk
Click to expand...
Click to collapse
The binaries are in the download. Is that what your looking for.
Or the .c files ?
I don't have the un-compiled xxx.c files.
But they are same as from this GitHub.
https://github.com/jcadduono/android_external_dirtycow
Just with minor changes to the referenced /dev/block to match whatever device it's for.
mrmazak said:
The binaries are in the download. Is that what your looking for.
Or the .c files ?
I don't have the un-compiled xxx.c files.
But they are same as from this GitHub.
https://github.com/jcadduono/android_external_dirtycow
Just with minor changes to the referenced /dev/block to match whatever device it's for.
Click to expand...
Click to collapse
Yes I am requesting c file for cow-app64-mod and no it's not in the github you linked to.
If Christian told you it was just a minor change to reference /dev/block then he is being dishonest and needs to be truthful and release the c file.
Sent from my R1HD(ZenUI) via Tapatalk
cant seem to get files to download correctly on Mac. has this been tested using adb and fastboot via macbook pro?
willdoyle22 said:
cant seem to get files to download correctly on Mac. has this been tested using adb and fastboot via macbook pro?
Click to expand...
Click to collapse
I know I'm on Windows. And o e other user who did it on arch. So that's two os's. I don't know why it would be different on a mac. You should be able to download it from the website.
But the batch (.bat) is a Windows thing isn't it.
I assume the adb commands will be the same , but might have to type each one out. That's what someone else did who was doing it on an arch Linux
Also remember there is an adb.exe and windows drivers .DLL in the downloaded zip. So you mifht have to remove them so your Mac used your adb and drivers
i removed the windows files/exe's. when i type in the first command " adb push drtycow /data/local/tmp/dirtycow" i keep getting the same response... "cannot stat 'dirtycow' : no such file or directory"
is this an error on my part?
* not necessarily new to rooting, but definitely new to doing it manually and dealing with locked bootloaders so i apologize if i am asking obvious questions*
willdoyle22 said:
i removed the windows files/exe's. when i type in the first command " adb push drtycow /data/local/tmp/dirtycow" i keep getting the same response... "cannot stat 'dirtycow' : no such file or directory"
is this an error on my part?
* not necessarily new to rooting, but definitely new to doing it manually and dealing with locked bootloaders so i apologize if i am asking obvious questions*
Click to expand...
Click to collapse
Try giving it the full path. For example if the file dirtycow is in /home/willDoyle/download. Then do "adb push /home/willDoyle/download/dirtycow /data/local/to/dirtycow"
mrmazak said:
Try giving it the full path. For example if the file dirtycow is in /home/willDoyle/download. Then do "adb push /home/willDoyle/download/dirtycow /data/local/to/dirtycow"
Click to expand...
Click to collapse
still no luck. it is at least recognizing it as a directory, but now anytime i try to push it, it just blasts me with all the different possible commands within adb... cant find anything that points out a specific problem. Thanks for your help btw.
willdoyle22 said:
still no luck. it is at least recognizing it as a directory, but now anytime i try to push it, it just blasts me with all the different possible commands within adb... cant find anything that points out a specific problem. Thanks for your help btw.
Click to expand...
Click to collapse
How about going back to the basic command to see if your Mac is conected to the phone. What do you get with "adb devices" ?
mrmazak said:
Try giving it the full path. For example if the file dirtycow is in /home/willDoyle/download. Then do "adb push /home/willDoyle/download/dirtycow /data/local/to/dirtycow"
Click to expand...
Click to collapse
mrmazak said:
How about going back to the basic command to see if your Mac is conected to the phone. What do you get with "adb devices" ?
Click to expand...
Click to collapse
works fine, shows my device serial number and then brings up a new command line
willdoyle22 said:
works fine, shows my device serial number and then brings up a new command line
Click to expand...
Click to collapse
attached screenshot of terminal
willdoyle22 said:
attached screenshot of terminal
Click to expand...
Click to collapse
oh I see. maybe
you need two (2) arguements for adb push
"adb push (sourse file location)(1 space)(destination file location)
ex ; willy_$ adb push willy/desktop/dirtycow /data/local/tmp/dirtycow
mrmazak said:
oh I see. maybe
you need two (2) arguements for adb push
"adb push (sourse file location)(1 space)(destination file location)
ex ; willy_$ adb push willy/desktop/dirtycow /data/local/tmp/dirtycow
Click to expand...
Click to collapse
just wanted to say thanks! got everything done, decided to not roll back to the previous bootloader version, but i blocked ota updates and amazon ads/apps so I think i should be fine. rooted and running xposed, finally got what i wanted out of this phone!!!
Hi!
This was not my idea! It belongs to @jenneh, i only had done trough batch files.
You need to create this batchs files bellow:
But first you need to do this:
* Need Notepad++ to be easy to read files.
* Use MediaCreationToolW11.exe and download ISO image or create a Pendrive with system.
* Extract from ISO or Pendrive all in to a work folder on descktop
* Batchs will request administrator permissions.
* At end delete/cut what ever, the batch files and any other extra file, that you see inside the work folder.
* Done!
This are the batchs files:
1- First one it show the images inside install.esd file and the option the select and work on one. ( Copy to inside the work folder)
Spoiler: 1-Preparing_and_extracting_img.bat
Code:
@echo off & @echo.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [43m[31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
mkdir %~dp0ISO
powershell.exe Dism /Get-WimInfo /WimFile:"%~dp0sources\install.esd"
@echo. & set /p index=" Type Image Index number to extract image: "
powershell.exe Dism /export-image /SourceImageFile:"%~dp0sources\install.esd" /SourceIndex:%index% /DestinationImageFile:"%~dp0ISO\install.esd" /Compress:max /CheckIntegrity
pause
2- Second one will mount the image and ask if you want to add a windows key to image.( Copy to inside the work folder)
Spoiler: 2-Mount_Windows_image.bat
Code:
@echo off & @echo.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [43m[31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
@echo. & @echo Doing backup from stock install.esd windows image to desktop.
@echo To rollbackp delete install.esd file from sources folder and paste stock install.esd file. & @echo.
mkdir %userprofile%\Desktop\install.esd_backup
move /y "%~dp0sources\install.esd" "%userprofile%\Desktop\install.esd_backup\install.esd"
move /y "%~dp0ISO\install.esd" "%~dp0sources\install.esd"
mkdir "%~dp0PATH"
dism.exe /mount-wim /wimfile:"%~dp0sources\install.esd" /mountdir:"%~dp0PATH" /index:1 /CheckIntegrity
@echo. & @echo.
:repeat
set /p ask= " type 1 to add a key, type 0 to exite: "
if /i %ask% EQU 0 (goto exit)
if /i %ask% EQU 1 (goto key) else (goto repeat)
:key
set /p key=" Insert Windows Key here if you have it: "
dism.exe /Image:%~dp0PATH /Set-ProductKey:%key%
:exit
@echo. & @echo Press any key to exit
pause >nul
exit
3-In this one you can check the Optional Features windows state then use batch to enable or disable them, but some of them aren't possible to change state, it gives error.( Copy to inside the work folder)
Spoiler: 3-Enable_Disable_options.bat
Code:
@echo off & @echo.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [43m[31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
:start
cls
@echo. & @echo Open WindowsOptionalFeature.txt to check Optional Feature state & @echo.
Timeout /t 3 >nul
powershell.exe Get-WindowsOptionalFeature -Path "%~dp0PATH" > WindowsOptionalFeature.txt
type WindowsOptionalFeature.txt
@echo.
set /p Feature=" Optional Feature name:-"
set /p state=" Enable or disable ? -"
powershell.exe %state%-WindowsOptionalFeature -Path "%~dp0PATH" -FeatureName "%Feature%"
@echo. & @echo Press any key to continue. & pause >nul
goto start
3.1- This one Will Install or remove apps from Windows image, you can install apps from windows app Store in Windows Offline image.( Copy to inside the work folder)
Spoiler: 3.1-Add_or_remove_Apps_to_Offline_Windows_Image.bat
Code:
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [43m[31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
@echo. & @echo [43m[31mAdd apps to offline Windows image. [4m[1mImage must be mounted![0m
@echo. & @echo [41mOpenning Windows App Store...[0m & @echo Press any key to coninue... & pause >nul
start "windows_app_store" https://www.microsoft.com/pt-pt/store/apps/windows
@echo. & @echo [1mFind your app and copy link.[0m
@echo. & @echo [41mOppening https://store.rg-adguard.net/ to [1m[4mget app link to download without install it.[0m & @echo Press any key to coninue... & pause >nul
start "store_rg-adguard.net/" https://store.rg-adguard.net/
@echo. & @echo [1m[31 PPaste the link you copy from App Store in store.rg-adguard.net link bar, select Retail and search links.[0m
@echo. & @echo [1mDownload to desktop [1m[4m[31mthe right [103mappx or appxbundle[0m [31mversion that match your windows version[0m, example for Windows 64 bits download x64 [31m[103mappx or appxbundle[0m version.
@echo [33m Note: * If download doesn t show the extencion just paste the name, to check extencion do right click and check app propertys.
@echo * Some apps have more than 1 package, The app package and its dependencies like Frameworks or VClibs as example.[0m
rem Lets start...
@echo.
dism.exe /Image:%~dp0PATH /Get-ProvisionedAppxPackages >ProvisionedAppxPackages.txt
@echo. & @echo Installed packages:
type %~dp0ProvisionedAppxPackages.txt
:repeat
@echo.
Set /p option=" Type 1 to remove Appx Packages, type 2 to add Appx Packages: "
if /i %option% EQU 1 (goto remove)
if /i %option% EQU 2 (goto add) else (goto repeat)
:remove
@echo. [31m
set /p remove=" Type/paste Appx Package name here: "
Dism /Image:%~dp0PATH /Remove-ProvisionedAppxPackage /PackageName:%remove%
@echo. [0m & @echo Press any key to remove more apps!
pause >nul
goto repeat
:add
@echo.
@echo [44mAdding the Apps...[0m
@echo. [33m
set /p app=" Type/Paste the downloaded app name and extension here and press ENTER: "
@echo.
Dism /Image:%~dp0PATH /Add-ProvisionedAppxPackage /PackagePath:%userprofile%\Desktop\%app% /SkipLicense /Region:"all"
@echo. [0m & @echo Press any key to add more apps!
pause >nul
goto repeat
4-This one dismount image.( Copy to inside the work folder)
Spoiler: 4-Dismount_Windows_Image.bat
Code:
@echo off & @echo.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [43m[31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
powershell Dismount-WindowsImage -CheckIntegrity -Path "%~dp0PATH" -Save
RD /S /Q ISO >NUL
RD /S /Q PATH >NUL
move WindowsOptionalFeature.txt %userprofile%\Desktop
move ProvisionedAppxPackages.txt %userprofile%\Desktop
pause
5- This one and the last one create a ISO image from Your Windows modded image but first you need to Install Windows_Kits10ADK.
Download this tool, extract and execute: adksetup.zip
After you execute it, in selection window of tools, only select Deployment Tools like image bellow and install:
Spoiler: Selection Window from Windows Assessement and Deployment Kit
View attachment 5543165
After installation is easy, After cleanning your Windows Work folder execute this bat bellow in YOUR DESKTOP, reade what is writted in there to execute it right!!!
Spoiler: 5-Build_ISO.bat
Code:
@echo off
setlocal
CD /d "%~dp0"
cls
@echo. & @echo Building ISO image... & @echo.
Set /p dir=" Type here the Work dir name: " & @echo.
echo oscdimg.exe -m -oc -u2 -udfver102 -bootdata:2#p0,e,bC:\Users\perso\Desktop\%dir%\boot\etfsboot.com#pEF,e,bC:\Users\perso\Desktop\%dir%\efi\microsoft\boot\efisys.bin "C:\Users\perso\Desktop\%dir%" "C:\Users\perso\Desktop\%dir%.iso"|"%systemroot%\system32\cmd.exe" /k "%systemdrive%\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
@echo. & @echo DONE!!!
pause
exit /b
Is Done!!! Your Image is ready!
But if you want to copy to Pendrive you will need to do one more step, need to spllit image or copy will fail because image will be bigger than 4GB and can´t be copy to fat32 format!
So copy this batch bellow to desktop and execute it, the you will able to copy to Pendrive.
Spoiler: Spliting install.esd to be able to copy to Pendrive
Code:
@echo off & @echo.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
@echo. & @echo [31mRequesting administrative privileges...[0m
goto UACPrompt
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
rem :To CD to the location of the batch script file (%0)
CD /d "%~dp0"
@echo. & @echo Splitting install.esd bigger than 4GB
@echo Windows Setup recognizes the two split files with the .SWM file name extensions and uses them to create the new installation.
@echo.
set /p win=" write/paste the root to modded install.win folder here: "
Dism /Split-Image /ImageFile:%win%\install.esd /SWMFile:%win%\install.swm /FileSize:2400 /CheckIntegrity
mkdir %userprofile%\Desktop\backup-install.esd >nul
@echo. & @echo Making backup from old install.esd to descktop backup-install.esd folder
move %win%\install.esd %userprofile%\Desktop\backup-install.esd >nul
@echo. & @echo Done! Press any key to exit
pause >nul
I let you here a video tutorial:
THE END!
Tell me if worked for you to!
Updated 26-02-2022
You can isntall or remove packages from windows.
@Oswald Boelcke Hello Sir, Is it possible on XDA to include a copy all code shortcut in our threads somehow?
I'm testing your stuffs now I just got sidetracked wondering if there was an easier way to copy pasta~!
Cause I feel like if this forum doesnt already have it, we're gonna need it
@persona78
Spoiler: A+++ S Tier
First off, Can I say How Impressed I am with your Dedication and Work!! Also YAY~! A new system for us to learn, Windows Assessment and Deployment Kit!~ I haven't used this one before, how fun!!
You wrote out the instructions very clear and the code in a way that, someone who has never wrote their own Extensive scripts, can read and start to understand what is going on behind the scenes. You also solved our problem of creating the iso there at the end, entirely from Hand Scripting, which is Super Impressive~! I have finished extracting Your batch code and converting it, Hopefully I did everything right here....
How Neat, Windows Assesment and Deployment kit, contains the SDK that I was convinced I could only get through Visual Studio, cause Microsoft Docs kept pushing it~!
I have finally tested the batches, this is tooo dang cool seriously. I had some sort of error at the end I think? I will let you review the footage because this one went slightly over my comprehension. I'm sure this is my fault [User Error] Have any ideas?
I
jenneh said:
@persona78
Spoiler: A+++ S Tier
First off, Can I say How Impressed I am with your Dedication and Work!! Also YAY~! A new system for us to learn, Windows Assessment and Deployment Kit!~ I haven't used this one before, how fun!!
You wrote out the instructions very clear and the code in a way that, someone who has never wrote their own Extensive scripts, can read and start to understand what is going on behind the scenes. You also solved our problem of creating the iso there at the end, entirely from Hand Scripting, which is Super Impressive~! I have finished extracting Your batch code and converting it, Hopefully I did everything right here....
How Neat, Windows Assesment and Deployment kit, contains the SDK that I was convinced I could only get through Visual Studio, cause Microsoft Docs kept pushing it~!
I have finally tested the batches, this is tooo dang cool seriously. I had some sort of error at the end I think? I will let you review the footage because this one went slightly over my comprehension. I'm sure this is my fault [User Error] Have any ideas?
I
Click to expand...
Click to collapse
Hmmm...
I check the video, don't understand for sure what is the bug, maybe copy paste failed, maybe is better to upload de batch files and paste links!
But tomorrow, I'm going to bed, work early tomorrow.
persona78 said:
Hmmm...
I check the video, don't understand for sure what is the bug, maybe copy paste failed, maybe is better to upload de batch files and paste links!
But tomorrow, I'm going to bed, work early tomorrow.
Click to expand...
Click to collapse
Yes I think that would be a great idea.. I'm sure I did something wrong and I'll try again later as well!
jenneh said:
Yes I think that would be a great idea.. I'm sure I did something wrong and I'll try again later as well!
Click to expand...
Click to collapse
Hi!
@jenneh I copy the batchs 1 more time before upload the batch himselfe.
Try now.
jenneh said:
@Oswald Boelcke Hello Sir, Is it possible on XDA to include a copy all code shortcut in our threads somehow?
Click to expand...
Click to collapse
Hello, thanks for pinging me. However, I don't understand what you mean. Are you talking about BB Codes (but I assume most likely not):
BB codes
The list of BB codes you can use to spice up the look of your messages. This page shows a list of all BB codes that are available.
forum.xda-developers.com
If you like contact me by PM although I'm not convinced I'd be able to help. But we wouldn't clutter this thread with off-topic posts.
Regards
Oswald Boelcke
Oswald Boelcke said:
Hello, thanks for pinging me. However, I don't understand what you mean. Are you talking about BB Codes (but I assume most likely not):
BB codes
The list of BB codes you can use to spice up the look of your messages. This page shows a list of all BB codes that are available.
forum.xda-developers.com
If you like contact me by PM although I'm not convinced I'd be able to help. But we wouldn't clutter this thread with off-topic posts.
Regards
Oswald Boelcke
Click to expand...
Click to collapse
Hi!
I think he means to add a copy all icon in code window, like that it will be easier to copy all code without the need of selecting all.
I'm going to pm, I'm sorry for cluttering the thread and Thanks to XDA for always being kind with us sillys that diidn't read or comprehend the rules here~!
Updated!
I had a video tutorial on main post.
Spoiler: SUCCESS
It was user error on my part, I was finally able to get everything programmed using just your batch scripts~! Thank You so much for taking the time to do this. This is such a great learning resource~!