assert(getprop("ro.product.device") == "epic" || getprop("ro.build.product") == "epic" || 
       getprop("ro.product.device") == "epicmtd" || getprop("ro.build.product") == "epicmtd" || 
       getprop("ro.product.device") == "SPH-D700" || getprop("ro.build.product") == "SPH-D700");
ui_print("Checking state of BML/MTD...");
show_progress(0.15, 5);
package_extract_file("updater.sh", "/tmp/updater.sh");
set_perm(0, 0, 0777, "/tmp/updater.sh");
package_extract_file("make_ext4fs", "/tmp/make_ext4fs");
set_perm(0, 0, 0777, "/tmp/make_ext4fs");
package_extract_file("busybox", "/tmp/busybox");
set_perm(0, 0, 0777, "/tmp/busybox");
package_extract_file("flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
package_extract_file("erase_image", "/tmp/erase_image");
set_perm(0, 0, 0777, "/tmp/erase_image");
package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd");
package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");
package_extract_file("boot.img", "/tmp/boot.img");
assert(run_program("/tmp/updater.sh", "cdma") == 0);
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
run_program("/tmp/backuptool.sh", "backup");
show_progress(0.500000, 0);
format("yaffs2", "MTD", "system", "0");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
        "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
        "/system/xbin/base64", "/system/xbin/basename", "/system/xbin/bbconfig",
        "/system/xbin/blockdev", "/system/xbin/brctl", "/system/xbin/bunzip2",
        "/system/xbin/bzcat", "/system/xbin/bzip2", "/system/xbin/cal",
        "/system/xbin/cat", "/system/xbin/catv", "/system/xbin/chattr",
        "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown",
        "/system/xbin/chroot", "/system/xbin/clear", "/system/xbin/cmp",
        "/system/xbin/comm", "/system/xbin/cp", "/system/xbin/cpio",
        "/system/xbin/crond", "/system/xbin/crontab", "/system/xbin/cut",
        "/system/xbin/date", "/system/xbin/dc", "/system/xbin/dd",
        "/system/xbin/depmod", "/system/xbin/devmem", "/system/xbin/df",
        "/system/xbin/diff", "/system/xbin/dirname", "/system/xbin/dmesg",
        "/system/xbin/dnsd", "/system/xbin/dos2unix", "/system/xbin/du",
        "/system/xbin/echo", "/system/xbin/ed", "/system/xbin/egrep",
        "/system/xbin/env", "/system/xbin/expand", "/system/xbin/expr",
        "/system/xbin/false", "/system/xbin/fdisk", "/system/xbin/fgrep",
        "/system/xbin/find", "/system/xbin/flash_lock",
        "/system/xbin/flash_unlock", "/system/xbin/flashcp",
        "/system/xbin/flock", "/system/xbin/fold", "/system/xbin/free",
        "/system/xbin/freeramdisk", "/system/xbin/fsync", "/system/xbin/ftpget",
        "/system/xbin/ftpput", "/system/xbin/fuser", "/system/xbin/getopt",
        "/system/xbin/grep", "/system/xbin/groups", "/system/xbin/gunzip",
        "/system/xbin/gzip", "/system/xbin/halt", "/system/xbin/head",
        "/system/xbin/hexdump", "/system/xbin/id", "/system/xbin/ifconfig",
        "/system/xbin/insmod", "/system/xbin/install", "/system/xbin/iostat",
        "/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
        "/system/xbin/killall5", "/system/xbin/length", "/system/xbin/less",
        "/system/xbin/ln", "/system/xbin/losetup", "/system/xbin/ls",
        "/system/xbin/lsattr", "/system/xbin/lsmod", "/system/xbin/lsusb",
        "/system/xbin/lzcat", "/system/xbin/lzma", "/system/xbin/lzop",
        "/system/xbin/lzopcat", "/system/xbin/man", "/system/xbin/md5sum",
        "/system/xbin/mesg", "/system/xbin/mkdir", "/system/xbin/mke2fs",
        "/system/xbin/mkfifo", "/system/xbin/mkfs.ext2",
        "/system/xbin/mkfs.vfat", "/system/xbin/mknod", "/system/xbin/mkswap",
        "/system/xbin/mktemp", "/system/xbin/modinfo", "/system/xbin/modprobe",
        "/system/xbin/more", "/system/xbin/mount", "/system/xbin/mountpoint",
        "/system/xbin/mpstat", "/system/xbin/mv", "/system/xbin/nanddump",
        "/system/xbin/nandwrite", "/system/xbin/netstat", "/system/xbin/nice",
        "/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd",
        "/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep",
        "/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/pkill",
        "/system/xbin/pmap", "/system/xbin/poweroff", "/system/xbin/printenv",
        "/system/xbin/printf", "/system/xbin/ps", "/system/xbin/pstree",
        "/system/xbin/pwd", "/system/xbin/pwdx", "/system/xbin/rdev",
        "/system/xbin/readlink", "/system/xbin/realpath", "/system/xbin/renice",
        "/system/xbin/reset", "/system/xbin/resize", "/system/xbin/rev",
        "/system/xbin/rm", "/system/xbin/rmdir", "/system/xbin/rmmod",
        "/system/xbin/route", "/system/xbin/run-parts", "/system/xbin/rx",
        "/system/xbin/sed", "/system/xbin/seq", "/system/xbin/setconsole",
        "/system/xbin/setserial", "/system/xbin/setsid", "/system/xbin/sh",
        "/system/xbin/sha1sum", "/system/xbin/sha256sum",
        "/system/xbin/sha512sum", "/system/xbin/sleep", "/system/xbin/sort",
        "/system/xbin/split", "/system/xbin/stat", "/system/xbin/strings",
        "/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff",
        "/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl",
        "/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar",
        "/system/xbin/tee", "/system/xbin/telnet", "/system/xbin/telnetd",
        "/system/xbin/test", "/system/xbin/tftp", "/system/xbin/tftpd",
        "/system/xbin/time", "/system/xbin/timeout", "/system/xbin/top",
        "/system/xbin/touch", "/system/xbin/tr", "/system/xbin/traceroute",
        "/system/xbin/true", "/system/xbin/ttysize", "/system/xbin/tune2fs",
        "/system/xbin/umount", "/system/xbin/uname", "/system/xbin/uncompress",
        "/system/xbin/unexpand", "/system/xbin/uniq", "/system/xbin/unix2dos",
        "/system/xbin/unlzma", "/system/xbin/unlzop", "/system/xbin/unxz",
        "/system/xbin/unzip", "/system/xbin/uptime", "/system/xbin/usleep",
        "/system/xbin/uudecode", "/system/xbin/uuencode", "/system/xbin/vi",
        "/system/xbin/watch", "/system/xbin/wc", "/system/xbin/wget",
        "/system/xbin/which", "/system/xbin/whoami", "/system/xbin/xargs",
        "/system/xbin/xz", "/system/xbin/xzcat", "/system/xbin/yes",
        "/system/xbin/zcat");
symlink("iwmulticall", "/system/xbin/iwconfig", "/system/xbin/iwgetid",
        "/system/xbin/iwlist", "/system/xbin/iwpriv",
        "/system/xbin/iwspy");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",
        "/system/bin/chown", "/system/bin/cmp", "/system/bin/date",
        "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
        "/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",
        "/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
        "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
        "/system/bin/kill", "/system/bin/ln", "/system/bin/log",
        "/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",
        "/system/bin/mkdir", "/system/bin/mount", "/system/bin/mv",
        "/system/bin/nandread", "/system/bin/netstat",
        "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
        "/system/bin/ps", "/system/bin/r", "/system/bin/reboot",
        "/system/bin/renice", "/system/bin/rm", "/system/bin/rmdir",
        "/system/bin/rmmod", "/system/bin/route", "/system/bin/schedtop",
        "/system/bin/sendevent", "/system/bin/setconsole",
        "/system/bin/setprop", "/system/bin/sleep", "/system/bin/smd",
        "/system/bin/start", "/system/bin/stop", "/system/bin/sync",
        "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
        "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
        "/system/bin/wipe");
retouch_binaries("/system/lib/libnetutils.so", "71ce19b30f513210571f3026e8b69d4f350be5f6", "/system/lib/libsurfaceflinger.so", "aa4779d61bafae01adc4668e81a8a217e473b68b", "/system/lib/libpixelflinger.so", "fe8f98ccc3c212fb2bff6287770f019df42dc79f", "/system/lib/modules/vibrator.ko", "396d999d7b07988ff7206e87d9090bb6a4600d3d", "/system/lib/modules/cmc7xx_sdio.ko", "763435e6b1bf58d0b5d3f5ed418b5db69cd782f4", "/system/lib/modules/bcm4329.ko", "7932f2196a56dd8899b2ec5e9d1554dac63f01a9", "/system/lib/libreference-ril.so", "45edfd54b0199847255e28d11b95b6e9ef5714da", "/system/lib/libhwui.so", "eab34b301ddda873e94c74042a7f876e1671f6b5", "/system/lib/libexif.so", "f7651406556c0997163d4819eb01112c780a17b8", "/system/lib/libext2_blkid.so", "9406a67c59960d1169aba420023b1d391cedd505", "/system/lib/libSEC_OMX_Core.s5pc110.so", "6f91328e3122f85221936035515c8e1931dcb4b7", "/system/lib/libGLESv1_CM.so", "5810bf3b9fbc2f4156edb4c3e764e56493cb826b", "/system/lib/libstdc++.so", "1331b4c1dce2acc3bbd44a1b8623526418c31b29", "/system/lib/libril.so", "352672d807d24953326e97416f312ce7f4093de4", "/system/lib/libvideoeditor_jni.so", "3928a6e6e24197b65d661f3364ab86114ff1dbad", "/system/lib/libsqlite_jni.so", "8a622a7caa46725b130506466dff86ccf9ae154a", "/system/lib/libaudioutils.so", "cf275d333d150cea2e430484be2c6aa87e62b84e", "/system/lib/libncurses.so", "fc71d798956e5577a6070e8c40078ff4a1bcbcff", "/system/lib/libc.so", "fe2ff6a1b2369642033009782fbeac65e3efd866", "/system/lib/libdiskconfig.so", "a501ee656da996a25f83c6b6525bfc89f80b1982", "/system/lib/libemoji.so", "44e1ffd75b91501fe3b8db48e1f451fb72f6ab21", "/system/lib/libusbhost.so", "018de4eeeb0a8ab464c21c3f992fa58ea7a86619", "/system/lib/libspeexresampler.so", "0bcdef9cf45eaebde6ca383086f0ec4b90958e68", "/system/lib/libmedia_jni.so", "ad5f2d25cc6b0fa3cac7211eab990318e46af13d", "/system/lib/libinput.so", "60c0909c69fee5bedc189e4f0587be2d8d6cb177", "/system/lib/librtp_jni.so", "bdbeed081491a1f6b6f9e321c7adddf57349bef2", "/system/lib/libwilhelm.so", "e84dac515a2c41b21639af0e00680fa70afe3c98", "/system/lib/libbcc.so", "e96bbbfb21d36f765c88f8537f9ab2c78659f3e5", "/system/lib/libsoundpool.so", "f15b1577c5e662116d883dd87a0d4a0ed306c94d", "/system/lib/libttscompat.so", "2fd64fdb67cd5ac6319a4b159d3564edc2046855", "/system/lib/libstagefright_soft_amrdec.so", "ca5d8fe3aca34d12d99c8c9bf1744a1754ee873e", "/system/lib/libsqlite.so", "93114a3ac1e92a8b07168103ca0a7b736a787569", "/system/lib/libdrm1_jni.so", "8deddb5ec512cb5cdb4bb6515c28723ae48748d5", "/system/lib/libandroid_servers.so", "7adb52007fd3eb5cdad16537b5027f7b25852ff9", "/system/lib/libglib.so", "6d6b1d41d18a6a10fd6c599f61fc8f5b40d781fc", "/system/lib/libfilterfw.so", "3f1ec9fea0d99fab030dd8aa59c920a19cd02cac", "/system/lib/libGLESv2_dbg.so", "d41b48b7e91d9b309247b11f3a41195b6b50e3f6", "/system/lib/libdefcontainer_jni.so", "537d7de109de1c4ba4ce613a9e581fccd3cae68c", "/system/lib/libstagefright_soft_mp3dec.so", "380b179f41afa3da1d181f1295007297ebc50076", "/system/lib/drm/libfwdlockengine.so", "9da0bdf38ac67b078eccb086b782767b1143f398", "/system/lib/libpng.so", "0aac365f136d6a9d1d5b919889d8839ac261aa74", "/system/lib/libdrmframework_jni.so", "28c45a14c9ede7f9141a9a3875ace3511bc9bdc7", "/system/lib/libsrec_jni.so", "f20de40b9db90c269bac662748d0b4f919262fc5", "/system/lib/libcamera_client.so", "fa5fe647c2812fff06cfd9d7ba68746f04e17b99", "/system/lib/libctest.so", "835b2147604946759c6f876a92adf98b8cc69a81", "/system/lib/libbtio.so", "8839888fd342c8646c41fa969af4c9f2562c7cca", "/system/lib/libpagemap.so", "eb774c4b9ceba3d86081619281abd3583d101654", "/system/lib/libjpeg.so", "001d5ea3d20474c7157be4245c4368d799329fed", "/system/lib/libharfbuzz.so", "227376f7ed4475a4842cdd71807f9db4925b891c", "/system/lib/libthread_db.so", "87b670dc9eee26198b9c939e4a3075a02498ddd2", "/system/lib/libpower.so", "558929363eb4701e117b03ecde5a06347af6c5b1", "/system/lib/libext2fs.so", "73672e0153322748e5fb94a76c0c1046c9819ed3", "/system/lib/libEGL.so", "0f647e66706e0dc941a64132dfe80d5882e28cc3", "/system/lib/libstagefright_avc_common.so", "e9f056cb1213020921147c9b6dc8ac6517c557fd", "/system/lib/libs3cjpeg.so", "ff447a8f210ef71d9c3a6ec0e5d137168447547f", "/system/lib/libstagefright_soft_vorbisdec.so", "208a938d311736cf57521b2100b0e2f15011d68d", "/system/lib/libFFTEm.so", "e3b8041dd15d549e8e2e3c567d8821052164ad35", "/system/lib/libcrypto.so", "f39221dff36b766e1cc2932467bd1dced028e4e4", "/system/lib/libsurfaceflinger_client.so", "12ba180d276b44d96e23f91c3d328f6ffdeed0eb", "/system/lib/libjnigraphics.so", "5d5241cf95a4fab5762818ff636ada80b6aa2493", "/system/lib/libgui.so", "33bcf3c9bf49ce065a69b64a58e7b9fd89a3e974", "/system/lib/libstagefright_omx.so", "a5e3878d05b0c0b407abcb18feedaba0caffa601", "/system/lib/libcameraservice.so", "766b65a153abb8e82576c60c8e0792ee69516674", "/system/lib/libdbus.so", "8a5684d8e8896060d16124988693fc44cd005ae1", "/system/lib/libbluedroid.so", "5f96c012f64e0821ea6c927fa98a5341e4e62bc0", "/system/lib/libttspico.so", "052e03f8a7c759a64818b9e942711be7a6ce51ba", "/system/lib/libstagefright_soft_mpeg4dec.so", "9461eb80fb440f7b20e1b489a6718ee69d0805af", "/system/lib/libext2_e2p.so", "f8ba98e3acacdd5afefff26b9b97de4ebeebdb22", "/system/lib/libsystem_server.so", "7ea0bad9e822877ddc02ffefe7948db296f7a492", "/system/lib/libclcore.bc", "a1e2610fdc0c2ef151248092fa32be807d1b983d", "/system/lib/libssl.so", "4027cad4979145c80195cba14e8b2909c3b1e84c", "/system/lib/libdrm1.so", "19a5e7a69c2c460a3df3376308c1cac611592c47", "/system/lib/liblog.so", "94608f9c59e1e78a89899679ce4ac2ee776da37c", "/system/lib/libOMX.SEC.AVC.Encoder.s5pc110.so", "34349ab7fc8da722fca3ce892ac0a89275f0348e", "/system/lib/libwebcore.so", "69656c1b1948e297f882c3ba5b0ee0cc2052f8e7", "/system/lib/libjni_latinime.so", "a8986e16d04defbb38bd52473bc38810259ab112", "/system/lib/libjackpal-androidterm3.so", "ecaeb903c230d76e6becedc058fc61b518e9d60b", "/system/lib/libnetlink.so", "37e261224d411e9cc576cc592a3296553fb1c5fb", "/system/lib/libext4_utils.so", "545d155754fc59dbd69dffd85b3f33a0fa1696fd", "/system/lib/libeffects.so", "4a6c23853f22bc1dc34bc8e2fd1a7e01b438e87b", "/system/lib/libGLESv2.so", "e73011fa9ccb1f75dfc5271a460d9f8646c92722", "/system/lib/libc_malloc_debug_qemu.so", "fc116766969e4c95a4dfcb2d556407c0844a0175", "/system/lib/libandroid.so", "b073efc8dea07a9fc647e230b08fcee94b3b7a74", "/system/lib/libstlport.so", "dc931515217467fa5a26f4104e496f368c163834", "/system/lib/libicui18n.so", "d10e217c69577472118f34f26839d407e727d752", "/system/lib/libstagefright_enc_common.so", "cf4a031a930c849ff8831d1f0493097c2377216d", "/system/lib/libOMX.SEC.M4V.Decoder.s5pc110.so", "e374fc4b95574312f971b5dfb9507ef751a53816", "/system/lib/libstagefright_foundation.so", "9f2291d28b9c5ef841da8b7df2505519d68942bb", "/system/lib/libtinyalsa.so", "c4e9dd1044c195ad86e320edf9bb853f94fbb9bc", "/system/lib/libQmageDecoder.so", "f6d1c64f7879f840dabfaaae5b28eeffc0c2757d", "/system/lib/libskia.so", "8dbed9bd5a83e4d7759bb280039df09be5d9169e", "/system/lib/libvariablespeed.so", "92898be560d3e94da49731e17f93e693f9d0d771", "/system/lib/libexpat.so", "e5ff1600fb5ab13805c94fbf7d295f74525eb488", "/system/lib/libwpa_client.so", "44e1d9ee6c03986e89434ad8395112a882bb257b", "/system/lib/libsonivox.so", "02f63371fb8e90de529ee7422c0be7da7ed8a598", "/system/lib/libsec-ril40.so", "d7657e214def5b2bc26e7fe55f08f1b29fc1d7bd", "/system/lib/libandroid_runtime.so", "ffef85800e80f3fc2c933625ab08b3fe3c1b616d", "/system/lib/libsensor_yamaha_test.so", "93e75639a645db9c2974260088cbb3de80f13144", "/system/lib/libSR_AudioIn.so", "960982ed89ed01a11d6890bc3fbd20ef12ccca0a", "/system/lib/libbluetooth.so", "400b274c4a99400b4a75adf9b8ccf65923dba743", "/system/lib/libicuuc.so", "40f1af00a40ac73cf858b4c209d4a5519c7a097d", "/system/lib/libc_malloc_debug_leak.so", "985b63b91857be7f7b1a512c15817a12823528be", "/system/lib/libhardware_legacy.so", "ced3a5cafeae21daf8552f489b69d40cc2e514ae", "/system/lib/libbluetoothd.so", "ef230f2d96adbb953113c6c7360877509ef0c385", "/system/lib/libsensorservice.so", "b6f56e8a5d571645df141f76658ad0e052ba453e", "/system/lib/libstagefright_soft_g711dec.so", "d0cb065523e73077d1811df98dea310e21d04e9b", "/system/lib/libRS.so", "4fbec44dc43b220d602514bc430e8f38dc589844", "/system/lib/libchromium_net.so", "8d2b14d2f070dfc2154421f8df1515e4bf823b23", "/system/lib/libbcc.so.sha1", "84c0212e80dd90a5f8dd911742fbbcd461613870", "/system/lib/libjni_mosaic.so", "e43a2cae8323b18f266c33faa9570b5487b568c3", "/system/lib/libext2_com_err.so", "4f488a05bef541b31be79aa6af5f9d97ca17827f", "/system/lib/libsysutils.so", "14a6fa5bfefbd347d93ba7e39e1e699edfb5ee7e", "/system/lib/libbcinfo.so", "fc7972f98cfbc636cd39cdb9286cdd9861a94db0", "/system/lib/libsecril-client.so", "85a383c73796b555386f35cb075cdedb204ba4b7", "/system/lib/libext2_uuid.so", "78464d086a31389f71b3a45db678abb04602d517", "/system/lib/libgabi++.so", "bdeb1e7745642fd2819c304536a7c5e8705fa63a", "/system/lib/libui.so", "cae2f5beae14db2b1d4c5d0a55ba14954905db74", "/system/lib/libaudioflinger.so", "053d578ef176f4bfad4720f93dcc2d266150331a", "/system/lib/libOpenMAXAL.so", "b8345301c4162b5f40c5e5d205a5118758e2f8b1", "/system/lib/libstagefright_soft_aacdec.so", "3f1e03f8dac059783013a92c084181fc6b228fa9", "/system/lib/libstagefright_amrnb_common.so", "ce17715c229aa6840239b92f42fd1e7587ead27d", "/system/lib/libhardware.so", "595ae619919fe95236e5eac7dab3ce0a18a51c52", "/system/lib/libmediaplayerservice.so", "fe6a9f57f075e18e20fa3631ed841b4cf49e285f", "/system/lib/hw/audio.primary.goldfish.so", "4dcabc694463caf5f5ef30036ddb5d9165c96fa3", "/system/lib/hw/camera.goldfish.so", "f60431968495888dc077303a125a3cb253b2d0d9", "/system/lib/hw/audio_policy.s5pc110.so", "5fab788dd6bafaf7ad3f76bca88fd356e929125e", "/system/lib/hw/audio_policy.default.so", "4dc273dd31d1a4f876759f73d656568708633d2f", "/system/lib/hw/lights.goldfish.so", "9782512df72594aae245e65af40292d6a132c849", "/system/lib/hw/audio.primary.default.so", "9a482b71c976980bd57fd85b255cf81d9d677bb9", "/system/lib/hw/sensors.s5pc110.so", "0b3f71ddda6044406525f6b1cc3a38ff01a6552e", "/system/lib/hw/sensors.goldfish.so", "37fb143fe9109b75567903e09c8d6d836bbde1cf", "/system/lib/hw/audio.a2dp.default.so", "026fc47715e4af62c1a72c6c3c842aeebb5f023f", "/system/lib/hw/copybit.s5pc110.so", "07782df150f87700e9eef1f3fd51718fefd10d47", "/system/lib/hw/camera.s5pc110.so", "67a737e208633d1e3e82cec40aae73a24c8f9eaa", "/system/lib/hw/gps.goldfish.so", "4381b0858d0228ce50dc9623a00d7f5149705b83", "/system/lib/hw/lights.s5pc110.so", "c9b04388948bb1d2abffbf2e2cd7027d3819905c", "/system/lib/hw/gralloc.default.so", "188cad6431eab82b558312665cea190d326b69f6", "/system/lib/hw/audio.primary.s5pc110.so", "4aabd697b079df004694e7d95ee60bea4231e6cd", "/system/lib/hw/hwcomposer.s5pc110.so", "becf24713efd7e21355ca14a070f70ef71f2905b", "/system/lib/hw/gps.s5pc110.so", "aee0e0af77a2353d438ed27e22ae338e7ce8992b", "/system/lib/libutils.so", "ef75f22781cfbeac0aac568cf794997f20350af5", "/system/lib/librs_jni.so", "31b974408f2140072c825d97b265e2e476e36bfa", "/system/lib/libstagefright.so", "e1d969e281c048217e1a6862b02662158b6ac907", "/system/lib/libmedia.so", "1f7869d86cdf438b778e1eee49b1d35ae7910aae", "/system/lib/libdl.so", "c562bec17736fe876dbe2d09ab3984704fb4c619", "/system/lib/libm.so", "ac3f2e546ab8299b6eed6a2c29b8892ce2278d27", "/system/lib/libstagefright_soft_h264dec.so", "de3aca01ab52f023f8c0303c1cdc48fe1aa0ee0c", "/system/lib/libnfc_ndef.so", "93f0f4a3bf6e30f8e217f98e28b7b2ce729bce8c", "/system/lib/libOMX.SEC.M4V.Encoder.s5pc110.so", "fc1fcfa153d53b72d19fcdca3694d2a8e527811a", "/system/lib/libbinder.so", "c49517a2b6b1e26874036f3a86ab0f45e1380f18", "/system/lib/libvorbisidec.so", "921da6d01c7ff23b58b851050521ed51b548f0ac", "/system/lib/egl/libGLES_android.so", "36c64e1bf8348e5efb13ef95960a4ab439bedbff", "/system/lib/egl/egl.cfg", "4e15b5998fb2f237bb2d4cadf3efff147d50c9b3", "/system/lib/libpowermanager.so", "d46fa7d2a4f6e426ff3a42f002839f8251ebaa3e", "/system/lib/libstagefrighthw.so", "c7e9a29a3f74cf4d52b9dc6c409a20ca889d63da", "/system/lib/libwebrtc_audio_preprocessing.so", "e1935899a0eed9aacc0944631048ee2f6cd43110", "/system/lib/libvideoeditorplayer.so", "77451d0757811239d23d55643d8e58d1ce0e7f7d", "/system/lib/bluez-plugin/input.so", "6e5804f3f47894a3c16a74cbe65d42258eab5ae5", "/system/lib/bluez-plugin/network.so", "eb33abe4d636c28a276ef5251820fc8568242c9d", "/system/lib/bluez-plugin/audio.so", "08b46146d889bd096775f09e4f3dad95ba85b9cb", "/system/lib/bluez-plugin/bluetooth-health.so", "70ccfa90cb22ef5240dcb645d6fa73f8c80ae8f7", "/system/lib/libaudioeffect_jni.so", "084979f783f8c366c0263a149954c82103e11a24", "/system/lib/libstagefright_soft_vpxdec.so", "30fb9b16cbd223fddf9de7741de5d937964cb386", "/system/lib/libOMX.SEC.AVC.Decoder.s5pc110.so", "e4dca0a4d7be6b1fdeab960ca7977be074b74337", "/system/lib/libWiMAXNative.so", "7b29823c6c8cebacd6c0d37aa77be8c112943d72", "/system/lib/libstagefright_yuv.so", "5589abd96b7d4b28246614e36d3ec7473022a9e0", "/system/lib/soundfx/libvisualizer.so", "27b64e26d699cc0f4683d43f8c08f4578202ffda", "/system/lib/soundfx/libbundlewrapper.so", "05a9e309c0953abdb7cc3ee7880825bc22c0f159", "/system/lib/soundfx/libcyanogen-dsp.so", "fdc7ccbb81eed759dce62611b52747283279f764", "/system/lib/soundfx/libreverbwrapper.so", "8adaad14decd30a944282425fd0fe16fc5091ea8", "/system/lib/soundfx/libaudiopreprocessing.so", "e11fb7c9a59c228f35cc7d2327169bf4cc3d4332", "/system/lib/libnativehelper.so", "a2d47ab922c4d833ddb174af5d6775518c43cf0f", "/system/lib/libdrmframework.so", "3ecf80025e543e5b7560bc10ca27c277a9a6b9d7", "/system/lib/libext2_profile.so", "264fa7dac9194e3c18f84391b975d5527c6bc382", "/system/lib/libdvm.so", "d92c2b827536042ee6478b3e07321bc1e253ab23", "/system/lib/libfilterpack_imageproc.so", "5960188e396e17cebe70689fd3b3d73c0e937b7b", "/system/lib/libz.so", "5aa0e97f8aa6d4360aa3d3ce906ecc594b208009", "/system/lib/libOpenSLES.so", "a1e8f0bf799f2107e0c7ca7f5040e4f37bbc7188", "/system/lib/libcutils.so", "3c245b0f2cbd815c56316dcea9b15bf0db75ba5c", "/system/lib/libiprouteutil.so", "38959892657ca64643188dd250fddbef0a3f85f9", "/system/lib/libmtp.so", "c50fa3211b8dc6f852b6ff11ce510ca0d9853dd2", "/system/lib/libETC1.so", "7692f8515be02beb95840e0e934d807039812afe");
show_progress(0.150000, 5);
set_perm_recursive(0, 0, 0755, 0644, "/system");
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, 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_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0755, "/system/vendor/bin");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/etc");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm(0, 2000, 0755, "/system/vendor/lib/egl");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib/hw");
set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.s5pc110.so");
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/xbin/su");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
run_program("/tmp/backuptool.sh", "restore");
show_progress(0.200000, 10);
assert(run_program("/tmp/erase_image", "boot"));
assert(package_extract_file("boot.img", "/tmp/boot.img"),
       run_program("/tmp/bml_over_mtd.sh", "boot", "72", "reservoir", "4012", "/tmp/boot.img"),
       delete("/tmp/boot.img"));
assert(run_program("/tmp/erase_image", "recovery"));
assert(package_extract_file("recovery.bin", "/tmp/recovery.img"),
       run_program("/tmp/bml_over_mtd.sh", "recovery", "102", "reservoir", "4012", "/tmp/recovery.img"),
       delete("/tmp/recovery.img"));
show_progress(0.100000, 0);
unmount("/system");
