## maderschramm's 2.3.15 and up .340 fresh install update.zip 1/2/2011 ##
ui_print("");
ui_print("----------------------------");
ui_print("- -");
ui_print("- maderstcok - v1.1 -");
ui_print("- Froyo (ver 2.3.340) -");
ui_print("- by: -");
ui_print("- maderschramm -");
ui_print("- you're about to be stock -");
ui_print("- do NOT turn off phone -");
ui_print("- or it WILL brick. -");
ui_print("- -");
ui_print("- This will take some time -");
ui_print("- DON'T PANIC -");
ui_print("- -");
ui_print("- Special Thanks To -");
ui_print("- Team Black Hat, -");
ui_print("- most of this stuff is -");
ui_print("- theirs so please -");
ui_print("- donate to them. -");
ui_print("- -");
ui_print("----------------------------");
ui_print("");
show_progress(1.000000, 0);
ui_print("Formatting System and Data Partitions...");
format("MTD", "system");
format("MTD", "data");
ui_print("Complete!");
set_progress(0.100000);
ui_print("Mounting System Partition...");
mount("MTD", "system", "/system");
ui_print("Done!");
ui_print("Reinitializing System...");
package_extract_dir("system", "/system");
ui_print("Complete!");
set_progress(0.200000);
ui_print("Setting Permissions...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0644, "/preinstall");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 1001, 04770, "/system/bin/pppd-ril");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/bin/su");
set_perm(0, 0, 06755, "/system/xbin/tcpdump");
ui_print("Complete!");
set_progress(0.300000);
ui_print("Updating CDT...");
assert(package_extract_file("cdt.bin", "/tmp/cdt.bin.img"),
write_raw_image("/tmp/cdt.bin.img", "cdt.bin"),
delete("/tmp/cdt.bin.img"));
ui_print("Complete!");
set_progress(0.400000);
ui_print("Updating CDROM...");
assert(package_extract_file("cdrom.bin", "/tmp/cdrom.img"),
write_raw_image("/tmp/cdrom.img", "cdrom"),
delete("/tmp/cdrom.img"));
ui_print("Complete!");
set_progress(0.500000);
ui_print("Updating Device Tree...");
assert(package_extract_file("device_tree.bin", "/tmp/devtree.img"),
write_raw_image("/tmp/devtree.img", "devtree"),
delete("/tmp/devtree.img"));
ui_print("Complete!");
set_progress(0.600000);
ui_print("Updating LBL Bootloader...");
assert(package_extract_file("lbl", "/tmp/lbl.img"),
write_raw_image("/tmp/lbl.img", "lbl"),
delete("/tmp/lbl.img"));
ui_print("Complete!");
set_progress(0.700000);
ui_print("Updating MBM Bootloader...");
assert(package_extract_file("mbm.bin", "/tmp/mbm.img"),
write_raw_image("/tmp/mbm.img", "mbm"),
delete("/tmp/mbm.img"));
ui_print("Complete!");
set_progress(0.800000);
ui_print("Updating Boot Kernel...");
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
ui_print("Complete!");
set_progress(0.900000);
ui_print("Updating Radio...");
assert(package_extract_file("bp.img", "/tmp/bp.img"));
assert(package_extract_file("rdl.bin", "/tmp/rdl.bin"));
assert(motorola.update_cdma_bp("/tmp/rdl.bin", "/tmp/bp.img"),
delete("/tmp/bp.img", "/tmp/rdl.bin"));
ui_print("Complete!");
set_progress(0.950000);
ui_print("Updating System to 2.3.340...");
unmount("/system");
assert(package_extract_file("system.img", "/tmp/system.img"),
write_raw_image("/tmp/system.img", "system"),
delete("/tmp/system.img"));
ui_print("Complete!");
set_progress(0.990000);
ui_print("Replacing Boot Image...");
assert(package_extract_file("logo.bin", "/tmp/logo.bin.img"),
write_raw_image("/tmp/logo.bin.img", "logo.bin"),
delete("/tmp/logo.bin.img"));
ui_print("Complete!");
set_progress(1.000000);
ui_print("Installation Complete!");
ui_print("see www.droidforums.net for support");