[Android Software Development] majdinj:
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):

@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)

[MENTION=228282]Rem[/MENTION] 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://xdaforums.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