﻿### 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",             "Yank555.lu Kernel");
ini_set("rom_version",          "v3.0");
ini_set("rom_author",           "Yank555.lu");
ini_set("rom_device",           "Samsung SGS3 JB U6");
ini_set("rom_date",             "07/01/2013");

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

#
# 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

###################################################################################################################
#
# 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")+" <~changelog.title>",
  
  #-- 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
    "Customized",		"Allows to chose each setting individually",									1, #-- 1
    "Yank555.lu",		"My personal settings, so I can flash faster ;)",							0, #-- 2
    "Stocklike",		"As stock, everything disabled, 1.4GHz CPU, 256Kb cfq",				0, #-- 3
    "Power",				"1.6GHz CPU, I/O as CPU load, 512Kb cfq, fsync enabled",			0  #-- 4
);

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

###################################################################################################################
#
# Yank555.lu Settings
#
if file_getprop("/tmp/aroma/install.prop", "selected.0") == "2" then

		writetmpfile(	"cpu.prop",
										"selected.1=7\n"		# 1.6GHz
									+	"selected.2=3\n"		# Governor LulzactiveQ
		);

		writetmpfile(	"io.prop",
										"selected.1=5\n"		# 2048Kb readahead
									+	"selected.2=3\n"		# CFQ scheduler
		);

		writetmpfile(	"lmk.prop",
										"selected.1=4\n"		# Medium
		);

		writetmpfile(	"swap.prop",
										"selected.1=2\n"		# Hardswap
									+	"selected.2=1\n"		# No zram
									+	"selected.3=5\n"		# Swappiness = 100
		);

		writetmpfile(	"charge.prop",
										"selected.1=3\n"		# Fast charge custom current
									+	"selected.2=6\n"		# 1000mA USB charge current
									+	"selected.3=1\n"		# 1000mA AC charge current
		);

		writetmpfile(	"earlysuspend.prop",
										"selected.1=1\n"		# 0ms fs early suspend delay
		);

		writetmpfile(	"boeffla.prop",
										"selected.1=1\n"		# Master switch ON
									+	"selected.2=4\n"		# Speaker output level +3
									+	"selected.3=1\n"		# Headphones output level 0
									+	"selected.4=1\n"		# Equalizer ON with saturation prevention
									+	"selected.5=2\n"		# EargasmEqualizer Settings
									+	"selected.6=1\n"		# Privacy Mode ON
									+	"selected.7=1\n"		# DAC direct ON
									+	"selected.8=1\n"		# DAC 128bit oversampling ON
									+	"selected.9=1\n"		# FLL clock tuning ON
									+	"selected.10=4\n"		# Microphone Sensitivity Stock SGS3
		);

		writetmpfile(	"fsync.prop",
										"selected.1=1\n"		# Dynamic fsync enabled
		);

		writetmpfile(	"modules.prop",
										"selected.1=1\n"		# Load cifs modules on boot
									+	"selected.2=2\n"		# Do not load xpad modules on boot
		);

		writetmpfile(	"initd.prop",
										"selected.1=2\n"		# init.d support
		);

endif;

###################################################################################################################
#
# Stocklike Settings
#

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "3" then

		writetmpfile(	"cpu.prop",
										"selected.1=5\n"		# 1.4GHz
									+	"selected.2=1\n"		# Governor PegasusQ & I/O not as CPU load
		);

		writetmpfile(	"io.prop",
										"selected.1=2\n"		# 256Kb readahead
									+	"selected.2=3\n"		# CFQ scheduler
		);

		writetmpfile(	"lmk.prop",
										"selected.1=7\n"		# Not set
		);

		writetmpfile(	"swap.prop",
										"selected.1=1\n"		# No Hardswap
									+	"selected.2=1\n"		# No zram
									+	"selected.3=6\n"		# Swappiness not set
		);

		writetmpfile(	"charge.prop",
										"selected.1=1\n"		# Fast charge disabled
									+	"selected.2=1\n"		# Stock USB charge current
									+	"selected.3=1\n"		# Stock AC charge current
		);

		writetmpfile(	"earlysuspend.prop",
										"selected.1=2\n"		# 100ms fs early suspend delay
		);

		writetmpfile(	"fsync.prop",
										"selected.1=2\n"		# Dynamic fsync disabled
		);

		writetmpfile(	"modules.prop",
										"selected.1=2\n"		# Do not load cifs modules on boot
									+	"selected.2=2\n"		# Do not load xpad modules on boot
		);

		writetmpfile(	"flash.prop",
										"selected.0=1\n"		# flash kernel & config
		);

endif;

###################################################################################################################
#
# Power Settings
#

if file_getprop("/tmp/aroma/install.prop", "selected.0") == "4" then

		writetmpfile(	"cpu.prop",
										"selected.1=7\n"		# 1.6GHz
									+	"selected.2=2\n"		# Governor PegasusQ & I/O as CPU load
		);

		writetmpfile(	"io.prop",
										"selected.1=3\n"		# 512Kb readahead
									+	"selected.2=3\n"		# CFQ scheduler
		);

		writetmpfile(	"lmk.prop",
										"selected.1=7\n"		# Not set
		);

		writetmpfile(	"swap.prop",
										"selected.1=1\n"		# No Hardswap
									+	"selected.2=1\n"		# No zram
									+	"selected.3=6\n"		# Swappiness not set
		);

		writetmpfile(	"charge.prop",
										"selected.1=1\n"		# Fast charge disabled
									+	"selected.2=1\n"		# Stock USB charge current
									+	"selected.3=1\n"		# Stock AC charge current
		);

		writetmpfile(	"earlysuspend.prop",
										"selected.1=2\n"		# 100ms fs early suspend delay
		);

		writetmpfile(	"fsync.prop",
										"selected.1=1\n"		# Dynamic fsync enabled
		);

		writetmpfile(	"modules.prop",
										"selected.1=2\n"		# Do not load cifs modules on boot
									+	"selected.2=2\n"		# Do not load xpad modules on boot
		);

		writetmpfile(	"flash.prop",
										"selected.0=1\n"		# flash kernel & config
		);

endif;

###################################################################################################################
#
# CPU Frequencies
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "CPU frequency settings",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "cpu.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 SGS3",																									1, #-- 5
    "1.5GHz",				"",																														0, #-- 6
    "1.6GHz",				"",																														0, #-- 7
  "CPU Governor",		"",																														2, #-- selected.2
    "PegasusQ", 		"Stock SGS3",																									0, #-- 1
    "PegasusQ-IO", 	"Consider I/O as CPU load",																		1, #-- 2
    "LulzactiveQ", 	"",																														0  #-- 3
);

###################################################################################################################
#
# 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", 					"",																													0, #-- 1
    "256kB", 					"",																													1, #-- 2
    "512kB", 					"",																													0, #-- 3
    "1024kB", 				"",																													0, #-- 4
    "2048kB", 				"",																													0, #-- 5
    "3072kB", 				"",																													0, #-- 6
    "4096kB", 				"",																													0, #-- 7
  "MMC I/O scheduler", 													"",																2, #-- selected.2
    "noop", 					"",																													0, #-- 1
    "deadline", 			"",																													0, #-- 2
    "cfq", 						"",																													1, #-- 3
    "sio", 						"",																													0, #-- 4
    "row", 						"",																													0  #-- 5
);

###################################################################################################################
#
# 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
    "Very light", 			"2/4/5/8/12/16 Mb (least free RAM)",											0, #-- 2
    "Light", 						"4/8/10/16/24/32 Mb (less free RAM)",											0, #-- 3
    "Medium", 					"4/8/16/32/48/64 Mb (medium free RAM)",										0, #-- 4
    "Aggressive", 			"8/16/32/64/96/128 Mb (more free RAM)",										0, #-- 5
    "Very aggressive", 	"16/32/64/128/192/256 Mb (most free RAM)",								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 SGS3",																								1, #-- 1
    "yes",					 	"",																													0, #-- 2
  "zRam support", 															"",																2, #-- selected.2
    "no", 						"Stock SGS3",																								1, #-- 1
    "100Mb",				 	"",																													0, #-- 2
    "150Mb",				 	"",																													0, #-- 3
    "200Mb",				 	"",																													0, #-- 4
    "250Mb",				 	"",																													0, #-- 5
  "Swappiness", 																"",																2, #-- selected.3
    "60", 						"Standard Linux",																						0, #-- 1
    "70",						 	"",																													0, #-- 2
    "80",						 	"",																													0, #-- 3
    "90",						 	"",																													0, #-- 4
    "100",					 	"Stock 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 (Stock SGS3)",										1, #-- 1
    "substitute", 		"Use AC current when USB charger detected",									0, #-- 2
    "custom current",	"Use custom current for AC and USB, choose below",					0, #-- 3
  "USB current", 																"",																2, #-- selected.2
    "475mA", 					"Stock SGS3 / standard USB 2.0",														1, #-- 1
    "600mA", 					"",																													0, #-- 2
    "700mA", 					"",																													0, #-- 3
    "800mA", 					"",																													0, #-- 4
    "900mA", 					"Standard USB 3.0",																					0, #-- 5
    "1000mA", 				"",																													0, #-- 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
);

###################################################################################################################
#
# CRT off display delay
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "CRT off display delay",
  
  #-- Icon
    "@customize",
    
  #-- Will be saved in /tmp/aroma/
    "earlysuspend.prop",

  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  "fb early suspend delay", 										"",																2, #-- selected.1
    "0 ms", 					"Stock N8020 (Galaxy Note Tab 10.1)",												1, #-- 1
    "100 ms", 				"",																													0, #-- 2
    "200 ms", 				"",																													0, #-- 3
    "300 ms", 				"",																													0, #-- 4
    "400 ms", 				"",																													0, #-- 5
    "500 ms", 				"",																													0, #-- 6
    "600 ms", 				"",																													0, #-- 7
    "700 ms", 				"",																													0  #-- 8
);

###################################################################################################################
#
# 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",													1, #-- 1
    "disabled", 			"Stock SGS3",																								0, #-- 2
  "Speaker - Output level", 										"",																2, #-- selected.2
    "standard", 			"Stock SGS3",																								1, #-- 1
    "+1", 						"",																													0, #-- 2
    "+2", 						"",																													0, #-- 3
    "+3", 						"",																													0, #-- 4
    "+4", 						"Careful !",																								0, #-- 5
    "+5", 						"Careful !",																								0, #-- 6
    "+6", 						"Careful !",																								0, #-- 7
  "Headphones - Output level",									"",																2, #-- selected.3
    "standard", 			"Stock SGS3",																								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",												1, #-- 1
    "enabled", 				"Enabled without saturation prevention",										0, #-- 2
    "disabled", 			"Stock SGS3",																								0, #-- 3
  "Headphones - Equalizer Setting",							"",																2, #-- selected.5
    "standard", 			"No change to equalizer",																		0, #-- 1
    "eargasm", 				"",																													1, #-- 2
    "pleasant4ears", 	"",																													0, #-- 3
    "bass-extreme", 	"",																													0, #-- 4
  "Headphones - Privacy Mode",									"",																2, #-- selected.6
    "enabled", 				"No notification on speaker when headphones connected",			1, #-- 1
    "disabled", 			"Stock SGS3",																								0, #-- 2
  "Headphones - DAC direct",										"",																2, #-- selected.7
    "enabled", 				"Bypass output mixer & connect DAC to headphone amplifier",	1, #-- 1
    "disabled", 			"Stock SGS3",																								0, #-- 2
  "Headphones - DAC 128bit oversampling",				"",																2, #-- selected.8
    "enabled", 				"Changes the oversampling rate from 64 to 128 bit",					1, #-- 1
    "disabled", 			"Stock SGS3",																								0, #-- 2
  "Headphones - FLL clock tuning",							"",																2, #-- selected.9
    "enabled", 				"Changes FLL configuration of Wolfson WM1811 audio hub",		1, #-- 1
    "disabled", 			"Stock SGS3",																								0, #-- 2
  "Microphone - Sensitivity mode",							"",																2, #-- selected.10
    "concert", 				"Highest reduction, for extremely loud environments",				0, #-- 1
    "noisy", 					"Hhigh reduction, for very loud environments",							0, #-- 2
    "light",	 				"medium reduction, for loud environments",									0, #-- 3
    "stock",		 			"Stock SGS3",																								1  #-- 4
);

###################################################################################################################
#
# 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",	"Load dns_resolver, md4 and cifs kernel modules on boot",								0, #-- 1
    "disabled", "Don't load cifs supporting modules on boot - Stock SGS3",							1, #-- 2
  "XBOX 360 gamepad support", 									"",																			2, #-- selected.2
    "enabled",	"Load xpad kernel mdule on boot",																				0, #-- 1
    "disabled", "Don't load XBOX 360 gamepad supporting modules on boot - Stock SGS3",	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 needs to take care of this",														1, #-- 1
    "yes", 						"only use this if you know what you're doing !!",						0  #-- 2
);

###################################################################################################################
#
# 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")
);

###################################################################################################################
#
# What to do now ?
#
selectbox(
  #-- Title
    ini_get("rom_name")+" "+ini_get("rom_version")+" Installer",
  
  #-- Sub Title
    "What do you want to do now ?",
  
  #-- Icon
    "@confirm",
    
  #-- Will be saved in /tmp/aroma/
    "flash.prop",
    
  #---------------------------------[ Selectbox Without Group ]----------------------------------#
  #--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
  #----------------------------------------------------------------------------------------------#
  # TITLE            |  SUBTITLE                                                 | Initial Value #
  #----------------------------------------------------------------------------------------------#

  																																									 #-- selected.0
    "Kernel & Config","Flash the kernel & generate config scripts",								1, #-- 1
    "Config only", 		"Regenerate config scripts only (don't reflash the kernel)",0  #-- 2
);

###################################################################################################################
#
# 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
