ui_print("T-mobile Galaxy S3 Modem Installer By Clark44 v3.0.0");
ui_print("");
ui_print("");
ui_print("");
  
show_progress(0.100000, 0);
show_progress(0.100000, 20);
# show_progress(0.2, 2);
	
	# UVALEM Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "1"
      then
      ui_print("@  Flashing UVALEM Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVALEM/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVALEM Modem SUCCESSFUL")
	endif;
  
	# UVLG1 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "2"
      then
      ui_print("@  Flashing UVLG1 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLG1/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLG1 Modem SUCCESSFUL")
	endif;
  
	# UVLH2 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "3"
      then
      ui_print("@  Flashing UVLH2 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLH2/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLH2 Modem SUCCESSFUL");
	endif;
	
	# UVDLH3 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "4"
      then
      ui_print("@  Flashing UVDLH3 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVDLH3/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVDLH3 Modem SUCCESSFUL");
	endif;

	# UVLI1 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "5"
      then
      ui_print("@  Flashing UVLI1 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLI1/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLI1 Modem SUCCESSFUL");
	endif;
	
	# UVLI2 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "6"
      then
      ui_print("@  Flashing UVLI2 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLI2/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLI2 Modem SUCCESSFUL");
	endif;

	# UVLI3 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "7"
      then
      ui_print("@  Flashing UVLI3 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLI3/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLI3 Modem SUCCESSFUL");
	endif;
	
	# UVLI4 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "8"
      then
      ui_print("@  Flashing UVLI4 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLI4/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLI4 Modem SUCCESSFUL");
	endif;

	# UVLI5 Modem
	  if file_getprop("/tmp/aroma/modem.prop","selected.1") == "9"
      then
      ui_print("@  Flashing UVLI5 Modem");
	  package_extract_file("FreeGS3/Modems/flash_image", "/tmp/flash_image");
	  set_perm(0, 0, 0777, "/tmp/flash_image");
	  assert(package_extract_file("FreeGS3/Modems/UVLI5/modem.bin", "/tmp/modem.bin"),
      run_program("/tmp/flash_image", "/dev/block/mmcblk0p1", "/tmp/modem.bin"),
      delete("/tmp/modem.bin"));
	  delete("/tmp/flash_image");
	  ui_print("@  Flashing UVLI5 Modem SUCCESSFUL");
	endif;	
	
ui_print("Installation Complete");  
unmount("/system");
unmount("/cache");
unmount("/data");
ui_print("Congratulations on Installing Your Modem ");
ui_print("You may not use or distribute this");
ui_print("Without the permission of Clark44");
ui_print("Please Press Next Button...");