﻿#Don't edit anything if you don't know aout it
calibrate("0.95","12","0.95","12");

ini_set("rom_name", "Multi Root Installer");
ini_set("rom_version", "1.a");
ini_set("rom_author", "iamareebjamal");
ini_set("rom_device", "GT-S5830i");


splash(
  #-- Duration 2000ms / 2 seconds
    3000,
  
  #-- <AROMA Resource Dir>/sample.png
    "manoranjan"
);


anisplash(
  #-- Number of Loop
    4,
  
  #-- Frame 1 [ Image, duration in millisecond ]. <AROMA Resource Dir>/splash/a[1..6].png
    "splash/a1", 500,
    "splash/a2", 30,
    "splash/a3", 30,
    "splash/a4", 30,
    "splash/a5", 30,
    "splash/a6", 30
);



loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf ", "24" );
fontresload( "1", "ttf/Roboto-Regular.ttf ", "24" );
theme("holo");


viewbox(
    "Welcome",
    "Root & Unroot\n"+
    ini_get("rom_name") + " by " + ini_get("rom_author") +  
    "\n\n"+
    "  VERSION\t\t:  <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+
    "  CODENAME\t\t: <b><#selectbg_g>MultiRoot Installer</#></b>\n"+
    "  RELEASED\t\t: <b><#selectbg_g>30 April 2013</#></b>\n"+
    "Press Next to continue the installation...",
    "icons/info"
);


# AGREEMENT
#
agreebox(
  #-- Title
    "Agreement",
  
  #-- Subtitle / Description
    "Please read carefully The "+ini_get("rom_name")+ " Agreement.",
  
  #-- Icon
    "@license",
  
  #-- Text Content ( Read from <AROMA Resource Dir>/license.txt )
    resread("agreement.txt"),
  
  #-- Checkbox Text
    "I Agree with this Agreement...",
  
  #-- Unchecked Alert Message
    "Please check the agreement..."
);


# CHANGELOG
textbox(
  "Changelog",
  "Root Installer changelog",
  "icons/info",
  readfile_aroma("changelog.txt")
);


#Credit List


textbox(
  "Special Thanks",
  "Root Installer Credit",
  "icons/info",
  readfile_aroma("thanks.txt")
);


#Install Select box


appendvar("installmsg","\n\nPlease Select Installation Type Below:");

selectbox(
  "Choose Root App To Install",
  "Please select the one you want",
  "icons/apps",
  "root.prop",
  
  "SuperSU 1.25","Install SuperSU App+SU",1,
  "SuperUser 3.1.3","Install SuperUser App+SU",0,
  "Unroot","Unroot Ur Device",0
);

checkviewbox(
   "Ready To Install",
   ""+
   "All information has been collected for installation.\n\n"+
   "Click Next to start installation",
   "icons/confirm",
   "Reboot the device after installation?",
   "0",
   "reboot_it"
);

install(
  "Installing",
  "Installing Root App"+ 
  "...\n\nPlease wait until it finished.",
  "icons/install"
);

# Set Next Text To Finish
ini_set("text_next", "Finish");
if getvar("reboot_it")=="1" then
	ini_set("text_next", "Reboot");
endif;

viewbox(
   "Installation Finished",
   "<#080>Congratulation!</#>\n\n"+
   "<#080>Ur Device Rooted</#>\n\n"+
   "Root App has been installed successfully.\n\n"+
   "Enjoy!",
   "icons/info"
);

# Check if reboot checkbox was checked
if getvar("reboot_it")=="1" then
	reboot("onfinish");
endif;