﻿### LICENSE:
#
# Copyright (C) 2011 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### FILE INFO:
#
# AROMA Installer 2.00 - AROMA Installer Test Script Configuration
#       (c) 2011-2012 by Ahmad Amarullah
#           amarullz - xda-developers
#           http://www.amarullz.com/
#
#       Binary Version  : 2.56
#       Binary Codename : Edelweis
#
### INFO:
#
# * AROMA Resource Dir  = META-INF/com/google/android/aroma
#
# * AROMA Temporary Dir = /tmp/aroma/
#
# * About Icon          = @alert - show <AROMA Resource Dir>/icons/alert.png
#                         or if theme used it will find <themedir>/icon.alert.png
#                         you can still access it via "icons/alert"
#
# * dp                  = Device Pixelate. WVGA/QHD = 3, HVGA = 2.
#                         dp calculated with = round(min(width,height) / 160)
#
###

##
# Fix Colorspace Issue
#
# For device which have a problem with color ( not display the correct color )
# try to set "force_colorspace" with ini_set. It may caused by wrong framebuffer
# information that passed by kernel into framebuffer device.
#
# You can use one of following values:
#   "rgba", "abgr", "argb", "bgra"
#
# NOTE: It must be in top most script, or you will got the color flicker
#
# ini_set("force_colorspace","rgba");
#

##
# Set device pixel density
#
ini_set("dp","3");

##
# Initializing Kernel Information
#
ini_set("rom_name",             "arter97 kernel");
ini_set("rom_version",          "1.1");
ini_set("rom_author",           "arter97");
ini_set("rom_device",           "CyanogenMod");
ini_set("rom_date",             "2013");

##
# Show Simple Splash
#
splash(
  #-- Duration 2000ms / 2 seconds
    5000,
  
  #-- <AROMA Resource Dir>/arter97.png
    "arter97"
);

#
# Set Small Font to Support all fonts
#
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansArabic.ttf;ttf/DroidSansFallback.ttf;", "12" ); #-- Use sets of font (Font Family)

###################################################################################################################
#
# LANGUAGE SELECTION
#
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" ); #-- "0" = Small Font ( Look at Fonts & UNICODE Demo Below )
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); #-- "1" = Big Font

###################################################################################################################
#
# THEME SELECTION
#
theme("ics");

###################################################################################################################
#
# LICENSE
#
agreebox(
  #-- Title
    "<~terms.title>",
  
  #-- Subtitle / Description
    "<~terms.desc>",
  
  #-- Icon
    "@license",
  
  #-- Text Content ( Read from <AROMA Resource Dir>/license.txt )
    resread("license.txt"),
  
  #-- Checkbox Text
    "<~terms.check>",
  
  #-- Unchecked Alert Message
    "<~terms.confirm>"
);

###################################################################################################################
#
# DISPLAY CHANGELOG
#
textbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version"),
  
  #-- Subtitle
    "<~changelog.desc>",
  
  #-- Icon
    "@update",
  
  #-- Arg 4
    resread("changelog.txt")
);

###################################################################################################################
#
# Installation Mode
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Installation mode",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "install.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  																																									 #-- selected.0
    "Powersave",	"Better battery life @ 1.2GHz",				0, #-- 1
    "Balanced",		"Balanced @ 1.2GHz",					0, #-- 2
    "Snappy",		"Snappy",						1, #-- 3
    "Performance",	"Maximum performance @ 1.6GHz",				0  #-- 4
);

###################################################################################################################
#
# Reset presets in case we've come back from further down
#

exec("/sbin/rm", "/tmp/aroma/cpugov.prop");
exec("/sbin/rm", "/tmp/aroma/cpufreq.prop");
exec("/sbin/rm", "/tmp/aroma/io.prop");
exec("/sbin/rm", "/tmp/aroma/lmk.prop");
exec("/sbin/rm", "/tmp/aroma/swap.prop");
exec("/sbin/rm", "/tmp/aroma/charge.prop");
exec("/sbin/rm", "/tmp/aroma/delay.prop");
exec("/sbin/rm", "/tmp/aroma/fsync.prop");
exec("/sbin/rm", "/tmp/aroma/boeffla.prop");
exec("/sbin/rm", "/tmp/aroma/LED.prop");
exec("/sbin/rm", "/tmp/aroma/modules.prop");
exec("/sbin/rm", "/tmp/aroma/initd.prop");

###################################################################################################################
#
# Preset installation modes
#

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "1" then
	writetmpfile("cpufreq.prop",	"selected.1=3\n" + "selected.2=2\n"			);
	writetmpfile("io.prop",		"selected.1=1\n" + "selected.2=1\n"			);
endif;

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "2" then
	writetmpfile("cpufreq.prop",	"selected.1=3\n" + "selected.2=2\n"			);
	writetmpfile("io.prop",		"selected.1=2\n" + "selected.2=1\n"			);
endif;

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "3" then
	writetmpfile("lmk.prop",	"selected.1=4\n"					);
endif;

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "4" then
	writetmpfile("cpugov.prop",	"selected.1=2\n"					);
	writetmpfile("cpufreq.prop",	"selected.1=7\n"					);
	writetmpfile("io.prop",		"selected.1=5\n" + "selected.2=1\n"			);
	writetmpfile("lmk.prop",	"selected.1=6\n"					);
endif;

###################################################################################################################
#
# CPU Governor
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "CPU governor settings",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "cpugov.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "CPU Governor",		"",							2, #-- selected.1
    "PegasusQ", 	"Stock SGS3",							0, #-- 1
    "PegasusQ-IO", 	"Consider I/O as CPU load",					0, #-- 2
    "YankasusQ",	"based on PegasusQ, more battery friendly on light use",	1, #-- 3
    "LulzactiveQ", 	"",								0, #-- 4
    "zzmoove", 		"",								0, #-- 5
    "smartassV2", 	"",								0, #-- 6
    "hotplug", 		"",								0, #-- 7
    "ondemand",		"",								0, #-- 8
    "interactive",	"",								0, #-- 9
    "conservative",	"",								0, #-- 10
    "userspace",	"",								0, #-- 11
    "adaptive",		"",								0, #-- 12
    "powersave",	"Always min CPU freq",						0, #-- 13
    "performance",	"Always max CPU freq",						0  #-- 14
);

###################################################################################################################
#
# CPU Frequencies
#
if file_getprop("/tmp/aroma/cpugov.prop", "selected.1") == "3" then
		selectbox(
		  #-- Title
		    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
		  
		  #-- Sub Title
		    "CPU frequency settings",
		  
		  #-- Icon
		    "@customize",
		    
		  #-- Will be saved in /tmp/aroma/
		    "cpufreq.prop",
		    
		  #---------------------------------[ Selectbox Without Group ]----------------------------------#
		  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
		  #----------------------------------------------------------------------------------------------#
		  # TITLE            |  SUBTITLE                                                 | Initial Value #
		  #----------------------------------------------------------------------------------------------#
		
		"CPU maximum frequency for YankasusQ", 		"",				2, #-- selected.1
		"1.0GHz low",	"0.8, 0.9, 1.0, 1.0GHz - Full UC SGS3 (saves more battery)",	0, #-- 1
		"1.0GHz high",	"1.0, 0.9, 1.0, 1.0GHz - Full UC SGS3 (snappier on 1 core)",	0, #-- 2
		"1.2GHz low",	"0.8, 0.9, 1.0, 1.2GHz - Stocklike SGS3 (saves more battery)",	0, #-- 3
		"1.2GHz high",	"1.2, 0.9, 1.0, 1.2GHz - Stocklike SGS3 (snappier on 1 core)",	0, #-- 4
		"1.4GHz low",	"1.0, 1.1, 1.2, 1.4GHz - Light (saves more battery)",		1, #-- 5
		"1.4GHz high",	"1.4, 1.1, 1.2, 1.4GHz - Light (snappier on 1 core)",		0, #-- 6
		"1.6GHz low",	"1.0, 1.2, 1.4, 1.6GHz - Full OC (saves more battery)",		0, #-- 7
		"1.6GHz high",	"1.6, 1.2, 1.4, 1.6GHz - Full OC (snappier on 1 core)",		0, #-- 8
		"Screen off CPU maximum frequency for YankasusQ", 	"",			2, #-- selected.2
		"300MHz",	"Limit maximum CPU frequency in standby to 300MHz",		0, #-- 1
		"400MHz",	"Limit maximum CPU frequency in standby to 400MHz",		1, #-- 2
		"600MHz",	"Limit maximum CPU frequency in standby to 600MHz",		0, #-- 3
		"800MHz",	"Limit maximum CPU frequency in standby to 800MHz",		0, #-- 4
		"1000MHz",	"Limit maximum CPU frequency in standby to 1000MHz",		0, #-- 5
		"1200MHz",	"Limit maximum CPU frequency in standby to 1200MHz",		0, #-- 6
		"1400MHz",	"Limit maximum CPU frequency in standby to 1400MHz",		0, #-- 7
		"1600MHz",	"Limit maximum CPU frequency in standby to 1600MHz",		0  #-- 8
		);
else
		selectbox(
		  #-- Title
		    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
		  
		  #-- Sub Title
		    "CPU frequency settings",
		  
		  #-- Icon
		    "@customize",
		    
		  #-- Will be saved in /tmp/aroma/
		    "cpufreq.prop",
		    
		  #---------------------------------[ Selectbox Without Group ]----------------------------------#
		  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
		  #----------------------------------------------------------------------------------------------#
		  # TITLE            |  SUBTITLE                                                 | Initial Value #
		  #----------------------------------------------------------------------------------------------#
		
		"CPU maximum frequency", 		"",		2, #-- selected.1
		"1.0GHz",				"",		0, #-- 1
		"1.1GHz",				"",		0, #-- 2
		"1.2GHz",				"",		0, #-- 3
		"1.3GHz",				"",		0, #-- 4
		"1.4GHz",				"Stock",	1, #-- 5
		"1.5GHz",				"",		0, #-- 6
		"1.6GHz",				"",		0, #-- 7
		"1.704GHz",				"",		0  #-- 8
		);

endif;

###################################################################################################################
#
# I/O settings
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "MMC I/O Settings",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "io.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "MMC ReadAhead buffer size\n(more is not always better !)", 	"",	2, #-- selected.1
    "128kB", 		"Stock",					0, #-- 1
    "256kB", 		"",						0, #-- 2
    "512kB", 		"Recommended",					1, #-- 3
    "1024kB", 		"",						0, #-- 4
    "2048kB", 		"",						0, #-- 5
    "3072kB", 		"",						0, #-- 6
    "4096kB", 		"",						0, #-- 7
  "MMC I/O scheduler", 	"",						2, #-- selected.2
    "fifo", 		"#1 recommended",				1, #-- 1
    "row", 		"#2 recommended",				0, #-- 2
    "deadline", 	"#3 recommended",				0, #-- 3
    "noop", 		"",						0, #-- 4
    "sio", 		"",						0, #-- 5
    "zen", 		"",						0, #-- 6
    "cfq", 		"Stock",					0, #-- 7
    "bfq", 		"",						0, #-- 8
    "v(r)", 		"",						0  #-- 9
);

###################################################################################################################
#
# Android Low Memory Killer settings
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Android Low Memory Killer settings",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "lmk.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "Low Memory Killer Presets", "",			2, #-- selected.1
    "Stock SGS3", 	" 32/ 40/ 48/ 56/ 64/ 72 Mb",	0, #-- 1
    "Stock SGS3 +10Mb",	" 42/ 50/ 58/ 66/ 74/ 82 Mb",	0, #-- 2
    "Stock SGS3 +15Mb",	" 47/ 55/ 63/ 71/ 79/ 87 Mb",	0, #-- 3
    "Stock SGS3 +20Mb",	" 52/ 60/ 68/ 76/ 84/ 92 Mb",	0, #-- 4
    "Stock SGS3 +30Mb",	" 62/ 70/ 78/ 86/ 94/102 Mb",	0, #-- 5
    "Stock SGS3 +40Mb",	" 72/ 80/ 88/ 96/104/112 Mb",	0, #-- 6
    "Don't set here", 	"Leave LMK settings untouched",	1  #-- 7
);

###################################################################################################################
#
# Virtual memory
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Virtual memory",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "swap.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "Hardswap by Yank555.lu\n(swap partition on SD card needed !)", "",	2, #-- selected.1
    "no", 		"Stock, recommended",				1, #-- 1
    "yes",		"",						0, #-- 2
  "zRam support", 	"",						2, #-- selected.2
    "no", 		"Stock, recommended",				1, #-- 1
    "100Mb",		"",						0, #-- 2
    "150Mb",		"",						0, #-- 3
    "200Mb",		"",						0, #-- 4
    "250Mb",		"",						0, #-- 5
  "Swappiness", 	"",						2, #-- selected.3
    "60",		"Standard",					0, #-- 1
    "70",	 	"",						0, #-- 2
    "80",	 	"",						0, #-- 3
    "90",	 	"",						0, #-- 4
    "100",	 	"hardswap",					0, #-- 5
    "Don't set here",	"Leave swappiness untouched",			1  #-- 6
);

###################################################################################################################
#
# Fast charge
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Fast charge",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "charge.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "USB forced fast charge", "",						2, #-- selected.1
    "disabled", "Don't use USB fast charge",				0, #-- 1
    "enabled", 	"Use AC current when USB charger detected",		0, #-- 2
    "custom",	"Use custom current for AC and USB, choose below",	1, #-- 3
  "USB current", "",							2, #-- selected.2
    "475mA", 	"Stock / standard USB 2.0",				0, #-- 1
    "600mA", 	"",							0, #-- 2
    "700mA", 	"",							0, #-- 3
    "800mA", 	"",							0, #-- 4
    "900mA", 	"Standard USB 3.0",					0, #-- 5
    "1000mA", 	"Standard wall charger",				1, #-- 6
  "AC current", "",							2, #-- selected.3
    "1000mA", 	"Stock SGS3 / Standard wall charger",			1, #-- 1
    "1100mA", 	"",							0, #-- 2
    "1200mA", 	"",							0, #-- 3
    "1300mA", 	"",							0, #-- 4
    "1400mA", 	"",							0, #-- 5
    "1500mA", 	"",							0  #-- 6
);

###################################################################################################################
#
# Dynamic fsync
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Dynamic fsync settings",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "fsync.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "Dynamic fsync by faux123", "",							2, #-- selected.1
    "enabled",	"screen on = fsync deferred, screen off = flush outstanding writes",	1, #-- 1
    "disabled", "fsync synchronises writes normally (slower, but safer) - Stock SGS3",	0  #-- 2
);

###################################################################################################################
#
# Boeffla Sound Engine by AndiP71
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Boeffla Sound Engine by AndiP71",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "boeffla.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "Master switch",															"",																2, #-- selected.1
    "enabled", 				"Turn on the Boeffla Sound Engine",					0, #-- 1
    "disabled", 			"Stock",								0, #-- 2
    "don't set", 			"Nothing here, allow Boeffla Sound App or init.d script",		1, #-- 3
  "Speaker - Output level", 		"",									2, #-- selected.2
    "standard", 			"Stock",								1, #-- 1
    "+1", 				"",									0, #-- 2
    "+2", 				"",									0, #-- 3
    "+3", 				"Recommended",								0, #-- 4
    "+4", 				"Careful !",								0, #-- 5
    "+5", 				"Careful !",								0, #-- 6
    "+6", 				"Careful !",								0, #-- 7
  "Headphones - Output level",		"",									2, #-- selected.3
    "standard", 			"Stock",								1, #-- 1
    "+1", 				"",									0, #-- 2
    "+2", 				"",									0, #-- 3
    "+3", 				"",									0, #-- 4
    "+4", 				"Careful !",								0, #-- 5
    "+5", 				"Careful !",								0, #-- 6
    "+6", 				"Careful !",								0, #-- 7
  "Headphones - Equalizer Mode",	"",									2, #-- selected.4
    "sat.prev.", 			"Enabled with saturation prevention",					0, #-- 1
    "enabled", 				"Enabled without saturation prevention",				0, #-- 2
    "disabled", 			"Stock",								1, #-- 3
  "Headphones - Equalizer Setting",	"",									2, #-- selected.5
    "standard", 			"No change to equalizer",						1, #-- 1
    "eargasm", 				"",									0, #-- 2
    "pleasant4ears",			"",									0, #-- 3
    "bass-extreme",			"",									0, #-- 4
    "Yankgasm", 			"Eargasm revisited by Yank",						0, #-- 5
  "Headphones - Privacy Mode",		"",									2, #-- selected.6
    "enabled", 				"No notification on speaker when headphones connected",			0, #-- 1
    "disabled", 			"Stock",								1, #-- 2
  "Headphones - DAC direct",		"",									2, #-- selected.7
    "enabled", 				"Bypass output mixer & connect DAC to headphone amplifier",		0, #-- 1
    "disabled", 			"Stock",								1, #-- 2
  "Headphones - DAC 128bit oversampling","",									2, #-- selected.8
    "enabled", 				"Changes the oversampling rate from 64 to 128 bit",			0, #-- 1
    "disabled", 			"Stock",								1, #-- 2
  "Headphones - FLL clock tuning",	"",									2, #-- selected.9
    "enabled", 				"Changes FLL configuration of Wolfson WM1811 audio hub",		0, #-- 1
    "disabled", 			"Stock",								1, #-- 2
  "Speaker - Tuning",			"",									2, #-- selected.10
    "enabled", 				"Enabled speaker tuning",						0, #-- 1
    "disabled", 			"Stock",								1  #-- 2
);

###################################################################################################################
#
# Kernel modules
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Kernel modules",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "modules.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "CIFS network filesystem support", "",			2, #-- selected.1
    "enabled",	"",						0, #-- 1
    "disabled", "",						1, #-- 2
  "NFS network filesystem support", "",				2, #-- selected.2
    "enabled",	"",						0, #-- 1
    "disabled", "",						1, #-- 2
  "NTFS filesystem support", "",				2, #-- selected.3
    "enabled",	"",						0, #-- 1
    "disabled", "",						1, #-- 2
  "ISO 9660 (& Joliet) filesystem support (CD/DVD)", "",	2, #-- selected.4
    "enabled",	"",						0, #-- 1
    "disabled", "",						1, #-- 2
  "UDF filesystem support", "",					2, #-- selected.5
    "enabled",	"",						0, #-- 1
    "disabled", "",						1  #-- 2
);

###################################################################################################################
#
# init.d script support out of ramdisk
#
# NB: Except if Yank555.lu settings
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "init.d script support",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "initd.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "init.d script execution support from ramdisk", "",				2, #-- selected.1
    "no",	"ROM takes care of this (including CyanogenMod)",		1, #-- 1
    "yes",	"ramfs takes care of this (careful not to run them twice)",	0  #-- 2
);

###################################################################################################################
#
# device installation
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "Select device",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "device.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "Select your device", "",					2, #-- selected.1
    "GT-I9300",		"International model",			1, #-- 1
    "SHW-M440S",	"Korean 3G model",			0, #-- 2
    "SHV-E210S",	"Korean SK-LTE model",			0, #-- 3
    "SHV-E210K",	"Korean KT-LTE model",			0, #-- 4
    "SHV-E210L",	"Korean LG-LTE model",			0  #-- 5
);

###################################################################################################################
#
# DISPLAY WARNING
#
# NB: Except if Yank555.lu settings
#
textbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version"),
  
  #-- Subtitle
    "Warning !!",
  
  #-- Icon
    "@alert",
  
  #-- Arg 4
    resread("warning.txt")
);


###################################################################################################################
#
# Kernel flashing
#
setvar("retstatus",
  install(
	#-- Title
      ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
	
	#-- Installation Process message
	  "Please wait while flashing <b>"+ini_get("rom_name")+
	  "</b>. This should be done quickly.",
	
	#-- Installation Icon
      "@install",
	
	#-- Installation Finish Message
    "The installation wizard has successfully installed <b>"+ini_get("rom_name")+
	  "</b>. Press Next to continue."
  )
);

##
#
# Next Button is "Finish"
#
ini_set("text_next", "Finish");

###################################################################################################################
#
# FINISH MESSAGE, Add Checkbox to Reboot or No. Save in "reboot_it" variable
#
# You can use return value or "reboot_it" variable to retrive checkbox value
# Example:
# if (checkviewbox(....)=="1" then
#    ... checked ...
# endif;
#
checkviewbox(
  #-- Title
    "Installation Completed",
  
  #-- Text
    "<#selectbg_g><b>Congratulation...</b></#>\n\n"+
    "<b>"+ini_get("rom_name")+"</b> has been flashed onto your device.\n\n"+
    "Installer Status: "+getvar("retstatus")+"\n\n",
	
  #-- Icon
    "@welcome",

  #-- Checkbox Text
    "Reboot your device now.",

  #-- Initial Checkbox value ( 0=unchecked, 1=checked ) -  (Optional, default:0)
    "0",

  #-- Save checked value in variable "reboot_it" (Optional)
    "reboot_it"
);

###
#
# Check if reboot checkbox was checked
if
  getvar("reboot_it")=="1"
then
  #
  # reboot("onfinish");   - Reboot if anything finished
  # reboot("now");        - Reboot Directly
  # reboot("disable");    - If you set reboot("onfinish") before, use this command to revert it.
  #
  reboot("onfinish");
endif;

#---- FINISH
