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");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
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/adjtimex", "/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/taskset", "/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/libjackpal-androidterm3.so", "ecaeb903c230d76e6becedc058fc61b518e9d60b", "/system/lib/modules/bcm4329.ko", "7d976e95dadf3b84d4fa5b5133053ef35871b7b8", "/system/lib/modules/vibrator.ko", "81137f46a1dc431d06f79056052d3d78cd38a834", "/system/lib/modules/cmc7xx_sdio.ko", "86bd74703439ec765f1844f487770de418ce4a20", "/system/lib/hw/sensors.s5pc110.so", "0b3f71ddda6044406525f6b1cc3a38ff01a6552e", "/system/lib/hw/copybit.s5pc110.so", "07782df150f87700e9eef1f3fd51718fefd10d47", "/system/lib/hw/gps.s5pc110.so", "aee0e0af77a2353d438ed27e22ae338e7ce8992b", "/system/lib/hw/lights.s5pc110.so", "4da64f99a75b29329a66a345b07f46d514c135dc", "/system/lib/hw/audio.primary.default.so", "7580d6296b2e13f9d664b99a4901c45338bfbd01", "/system/lib/hw/gralloc.default.so", "10ad7f4f4ad52ec4b2221bcbd8d9344bc2b954d6", "/system/lib/hw/lights.goldfish.so", "1f33f22e5a9f06b07f4feff392401194ff50f8d9", "/system/lib/hw/sensors.goldfish.so", "c2beb017ada76e4d3f40e82549b28e109ef16bff", "/system/lib/hw/audio.a2dp.default.so", "3228b188e1d88530d2838e705c1969d8e5829d35", "/system/lib/hw/gps.goldfish.so", "e8f7144672782c2ba99116761ebc6185d9387573", "/system/lib/hw/audio.primary.s5pc110.so", "79630e4e0257b26ecc57d2ee9416ff0685213c0d", "/system/lib/hw/hwcomposer.s5pc110.so", "ef26fde389bd487450823ae512f90957b40b46e8", "/system/lib/hw/camera.s5pc110.so", "81af9d59df39178d1cec4e8e97616be1e4bccaef", "/system/lib/hw/audio.primary.goldfish.so", "a9c1d6c63a5a57de6564e995043b2c9c4569ed50", "/system/lib/hw/audio_policy.default.so", "07819be3dc9b1e8399051ce58d9a89c0140f334d", "/system/lib/hw/audio_policy.s5pc110.so", "90f1c32ac99c44d41f5e6d6738cdf46dd4bc8d17", "/system/lib/hw/camera.goldfish.so", "7d4de7991f745f47e3f73a16881dcf1d242106b7", "/system/lib/libsensor_yamaha_test.so", "93e75639a645db9c2974260088cbb3de80f13144", "/system/lib/libsecril-client.so", "85a383c73796b555386f35cb075cdedb204ba4b7", "/system/lib/libsec-ril40.so", "d7657e214def5b2bc26e7fe55f08f1b29fc1d7bd", "/system/lib/libWiMAXNative.so", "7b29823c6c8cebacd6c0d37aa77be8c112943d72", "/system/lib/libQmageDecoder.so", "f6d1c64f7879f840dabfaaae5b28eeffc0c2757d", "/system/lib/egl/egl.cfg", "4e15b5998fb2f237bb2d4cadf3efff147d50c9b3", "/system/lib/egl/libGLES_android.so", "36c64e1bf8348e5efb13ef95960a4ab439bedbff", "/system/lib/libz.so", "56965ae0278d1257ae5c4321ad2882df17aa0685", "/system/lib/libexpat.so", "6417eba0c7c85733c61cf0ce43c714cff6c79433", "/system/lib/libdl.so", "4103a0d7be914161aac5a574840f8c48a43973e0", "/system/lib/libstlport.so", "5a143cbba8981b25b6f137c3d87cd7d665ba280b", "/system/lib/libcrypto.so", "41ac0b469b7f00b15f0217deb8691dc6b8b0ac96", "/system/lib/libjni_latinime.so", "af8a9df6a2e44a09c3f9f60731dccbe1b5d425e1", "/system/lib/libc.so", "ac5285fad26426afc709c988188dc4b55d2da52e", "/system/lib/libssl.so", "a40baadef5a3764501be31d24faeaef7115adde5", "/system/lib/libiprouteutil.so", "2e7edf098320a9154f3109cb9a5067de66daacf7", "/system/lib/libnetlink.so", "a2653845b59978be5e0efdb17c7b9622e641c8e1", "/system/lib/libc_malloc_debug_leak.so", "adaf1821dec7c3cefea1268f8767b4d695512c3f", "/system/lib/libc_malloc_debug_qemu.so", "73fe00ce13d71e055e4a8cb2fcc556fdee400155", "/system/lib/libstdc++.so", "fd0f05a5643848cd6f54a33685b99a044aefe797", "/system/lib/libm.so", "ddad9cfb7db2d6f4ae99e1744bdf1ff7e0c5fda9", "/system/lib/libgabi++.so", "d9eb2c63a7fb5059e7114790036b82427d72e8d1", "/system/lib/libthread_db.so", "80b774d52935fa89da7a06ee7963c5760c8b05dc", "/system/lib/libext2_com_err.so", "e079d115be6f3405381be1d756bec226133917ba", "/system/lib/libext2_uuid.so", "d07e1244909291252b0c5471786f54eb9af71008", "/system/lib/libext2_e2p.so", "21d0a9c5ee71452ef6caf669e19d80ddf0fa3c85", "/system/lib/libvorbisidec.so", "15a2280d118950f8571d6060349d8f3812ef8bc0", "/system/lib/libstagefright_amrnb_common.so", "43ff956ac6d3f0e74af82e878d14d7679d69e40a", "/system/lib/libstagefright_enc_common.so", "e5009329508ddc2859b590d6d1ac0e2ed8669c46", "/system/lib/libstagefright_avc_common.so", "2b19421cd7a56200cec241e0ef056f62bed9bb62", "/system/lib/libext2_profile.so", "31b50122e9077f76743285b087753446e296dd57", "/system/lib/libETC1.so", "767fab629c7be3d8facc8269cdbfdcf27de2db6c", "/system/lib/libglib.so", "5c43b0b81273b96261abbc24b18f5148eea7dee7", "/system/lib/libspeexresampler.so", "6d32c83852118cc1b037a48d6bceb6b87c03a6c5", "/system/lib/libctest.so", "8a348b887d39de12c6333e272f74f81bc9b420f4", "/system/lib/libpng.so", "484fe2c64b4ad2c37a30ba86ec8f9f9a7c76a39e", "/system/lib/libpagemap.so", "1d53cd3803ff071169a1d4424b15090f5c37f94f", "/system/lib/libclcore.bc", "a1e2610fdc0c2ef151248092fa32be807d1b983d", "/system/lib/libsurfaceflinger_client.so", "12ba180d276b44d96e23f91c3d328f6ffdeed0eb", "/system/lib/libncurses.so", "06745a4bcdff3a06bb64e92dbafe49995b2b9a3e", "/system/lib/libext4_utils.so", "adaece1ee5f982659065beb74b1966e063170c5f", "/system/lib/libext2_blkid.so", "da7c1ff4b57871118614a81a4b7fa196031bd7cf", "/system/lib/liblog.so", "c61752080af6763ecf69271b503de4631df0948e", "/system/lib/libicuuc.so", "952c842b8ebb598cab1c8c99e5e306f68f0f399e", "/system/lib/libs3cjpeg.so", "93dcda499198613cb52ee06cca4c40a4e716e28f", "/system/lib/libcutils.so", "ea8fa6506973971917f9f0464c8dae80393e0c41", "/system/lib/libext2fs.so", "2871fd5002632c9cffdfae01f6355eaae601526e", "/system/lib/libicui18n.so", "fcc5e962057b10aa58f73a96f835933efba36eb7", "/system/lib/libusbhost.so", "47e7fd29f2f24a876c9c174b4387e2d034fcca2b", "/system/lib/libutils.so", "d0543a7f244e0af18eb1ca4af6646336dbc2a0de", "/system/lib/libnetutils.so", "0b9167d3c558092891de89456a6b16c2814335ef", "/system/lib/libwpa_client.so", "b6bf56784098f394ed6ae0a2db64efc95b78c063", "/system/lib/libhardware.so", "b5828b2f2a8011696e80b695af347668d18bf60f", "/system/lib/libjpeg.so", "f4442cc0d2155103a2f21e94810dc8a6ba483757", "/system/lib/libstagefright_yuv.so", "ce792af47c4a700dba096068016289f85ddf171e", "/system/lib/libnfc_ndef.so", "af4ab060e939ce974cae7b7652566f3322d2a23d", "/system/lib/libbluedroid.so", "8ae5a9583697065986756639d29865e2529bb9b5", "/system/lib/libdbus.so", "04b1da46087ac340e054bdc87e39c379d9caf4d6", "/system/lib/libbluetooth.so", "55d42bf5204a84babf965bd82b62d8f83b823247", "/system/lib/libeffects.so", "57b228df2f52388116c979d530d506f5bec899a8", "/system/lib/libsysutils.so", "cfb358b4425c84ff1b33e730d8d3d8164342c181", "/system/lib/libdiskconfig.so", "d4a333ee3db0f8825dc856b8df6e400d590405ab", "/system/lib/libpower.so", "be0793f4398b118ad1e85bb046c59728576b8b8b", "/system/lib/libaudioutils.so", "e9596db1ab23770edc79c798acc0b1adc049a049", "/system/lib/libbcinfo.so", "30e96a325e74fd1ca6c01aca22cd7ed8e6a54ac0", "/system/lib/libwebrtc_audio_preprocessing.so", "2e866aa53f01c786ada9fe4eebc437a408b8bbea", "/system/lib/soundfx/libbundlewrapper.so", "7f6bc84f091638fed074a0b569dbe1e882cfd6a6", "/system/lib/soundfx/libcyanogen-dsp.so", "b452ea88ac4d3ebc3785be4fd2a186b4a940c14a", "/system/lib/soundfx/libreverbwrapper.so", "ff7c021273f6d3d49c2dd23f2069070e76bb7770", "/system/lib/soundfx/libvisualizer.so", "9c19db37cf6681ebefea500800a2d1fa51a1c4ee", "/system/lib/soundfx/libaudiopreprocessing.so", "3dbdcc116c65487e023da17e9645c920910bb409", "/system/lib/libnativehelper.so", "49cbecec0f310e06d2d26c3bfc00cc9479ff06d5", "/system/lib/libGLESv2_dbg.so", "e5f78931b92bd6c1e0cb3e2bd9e7688984335b82", "/system/lib/libhardware_legacy.so", "2b6edbb1c9630995ecc06351c1180b4b01230f97", "/system/lib/libemoji.so", "1820f66eb493fbeb40c810b90e380deea0038de8", "/system/lib/libbinder.so", "a349e5bd1f0573051489e30eab9a7f89a5a43850", "/system/lib/libsonivox.so", "39c5d6f0895a1aff536ca11340e10de31fe72145", "/system/lib/libsqlite.so", "1dee4171d05cb7957403a44389c5b82de7833b3a", "/system/lib/libharfbuzz.so", "12c6d1aabf56570d5d581a3f951d349de73ee9f7", "/system/lib/libttspico.so", "6c1827a438e229ffd82dba1c558b70a83fa80153", "/system/lib/libbtio.so", "f4c8e4f8482d4d91af28844bbdc427d631a70c95", "/system/lib/libtinyalsa.so", "d2e29a3de791ef76f97e1da783b4a542c383a629", "/system/lib/libSEC_OMX_Core.s5pc110.so", "836001fef5e47592554b40886406a8f71ffe2d5d", "/system/lib/libdrm1.so", "7bba036145851e701172b83591f15448a4aba9f0", "/system/lib/libexif.so", "5c03a891868e0dd7a84c25792d7500049120a9dd", "/system/lib/libdefcontainer_jni.so", "eabf3064f4dcfae95905db29ec714e106fadd2bd", "/system/lib/libdvm.so", "10abe7f7c673f0781fb8d013d88ee9bdb16adf63", "/system/lib/libskia.so", "d1e11378fe2b2f9ce828912b803b83c1eea1fa55", "/system/lib/libstagefright_foundation.so", "df869d3a6162e3450bb5b8bc21a0e03899a29e95", "/system/lib/libdrmframework.so", "751b0f5692a5eb121568c76cfd9d9dde476ba4cd", "/system/lib/libchromium_net.so", "acbf80da5c05d65a9bc49c954d69775756920058", "/system/lib/libpowermanager.so", "ce33d0b4fa24c52dc7085c5c47241ebce7577e25", "/system/lib/libmtp.so", "288e1c31cbbaf3a10076d475049ab0e6be3f0f11", "/system/lib/libsqlite_jni.so", "b0cb83774365ae6e1ada006c2f840c7d89bdb343", "/system/lib/libbluetoothd.so", "87fd68b94122a24652969b477e7fd40bbdd816ce", "/system/lib/libril.so", "352672d807d24953326e97416f312ce7f4093de4", "/system/lib/libdrm1_jni.so", "000f9009d4c5fc2afcb9f164f6b7fbf8ac9657e5", "/system/lib/libEGL.so", "47d6de4e52a9fefee736afe8fda70b6c21fe8f42", "/system/lib/libpixelflinger.so", "9d0bbd1f5c5efe3e618f4cb73bcf0cd20b88b3a0", "/system/lib/bluez-plugin/audio.so", "b4ed81b81650c3a3dbd962c84d42ddeedec03def", "/system/lib/bluez-plugin/bluetooth-health.so", "0d3c7d31223f89708d5ab7eb499e896f8ac9f6e9", "/system/lib/bluez-plugin/network.so", "baaca0af54447ecb020abd00cc7aafbec344f4ce", "/system/lib/bluez-plugin/input.so", "94e4bcb4b6281c40f23490028fe0f20523660167", "/system/lib/libreference-ril.so", "498350724b349b3161bef45630af5b822a12e303", "/system/lib/libui.so", "a66cdfe8b0c27999262629ad874eb2a88c6be3c2", "/system/lib/libGLESv1_CM.so", "07cc4665dcabcdfc469bce864249ffe6e56d159e", "/system/lib/libGLESv2.so", "701a53e74e89a409e435e17367c96634eec7ad59", "/system/lib/libjni_mosaic.so", "a904a7ca57e0bfc65a535a097cfb31f0d5492c55", "/system/lib/libhwui.so", "8a89e93f247db57f970a380c1a23e512d8ece66c", "/system/lib/libOMX.SEC.AVC.Decoder.s5pc110.so", "6a4a90e1063c956b982985390d309dca4dc1181f", "/system/lib/libOMX.SEC.AVC.Encoder.s5pc110.so", "f610badf44f8d27ac3004117864b85de8e4f1bba", "/system/lib/libOMX.SEC.M4V.Decoder.s5pc110.so", "d0e0186fcc72861c5c7583137b3c87786a22a996", "/system/lib/libOMX.SEC.M4V.Encoder.s5pc110.so", "6c3731856d6fff9d80284c168c2e34354e737b5d", "/system/lib/libstagefrighthw.so", "921ce4c22bc145426ff0f868c4b07885a6e4a72d", "/system/lib/libgui.so", "b6355c58de0b550524cb30af357b0b6097acd07a", "/system/lib/libbcc.so.sha1", "3db43251d71399d66dba239fbbc76c1244e566a9", "/system/lib/libbcc.so", "e593f77d83319d6e0fb7edd8eeda88f28469cdd4", "/system/lib/libsensorservice.so", "fdb8890082796c73a5f8c7baa8fca6626b4f5106", "/system/lib/libinput.so", "64e3de1cbe73df3fb70ce9ca1ed7dd16b206193b", "/system/lib/libRS.so", "c00c8d7ffb46c753f1657c0d8d69dca2492888c2", "/system/lib/libcamera_client.so", "945a95b9fafb48e01ee22789601f1fcd86aa55d3", "/system/lib/libmedia.so", "cd98afd0a9b687a92f8dea2c7584f0633232e03b", "/system/lib/libaudioflinger.so", "7704ef8663c78485dd1e7b9400e5655d663c81d8", "/system/lib/libcameraservice.so", "aa67de405d2fd68ac3e38b1ed80f5744b2354f42", "/system/lib/libSR_AudioIn.so", "65f83ab62ee844a18ee7e654602297abf2b15ba8", "/system/lib/librtp_jni.so", "2cd32957eb71daeccad4ea1c9a10436123ee25aa", "/system/lib/libsrec_jni.so", "57e83ed9ac3724252b7a9d1e7509d6ed4d824264", "/system/lib/libstagefright.so", "e5192a35a8b41cb3a27cc3a2f9e2b48b0001ca62", "/system/lib/libandroid_runtime.so", "88f6850a4d8c9b5b8cf24c1b4cb8329f105cf265", "/system/lib/libstagefright_omx.so", "037a9bf301dd9b9a3d380f3d7a37f945e57fa065", "/system/lib/libmediaplayerservice.so", "cc21b109f611569cfd8e6de3c2ac039d4bd94abd", "/system/lib/libsurfaceflinger.so", "e93021f3cbd96e3f1bef7717b1448734e2d467a2", "/system/lib/drm/libfwdlockengine.so", "23ac67894e99f9b850d5401d96d551b681497fbb", "/system/lib/libFFTEm.so", "d539496489689946d08e912f53bc87d30149041d", "/system/lib/libandroid.so", "c35ee8043b54624e477b4d3fad7b4c2264244bec", "/system/lib/libaudioeffect_jni.so", "0adc0dc464ae5785d3faef7d47ce5314ce7b2026", "/system/lib/libdrmframework_jni.so", "5247ec8fb9ebe7f06c183a0c422753b5e742e00a", "/system/lib/libjnigraphics.so", "5272272b1a7c601a250ee4e84767e3dbc125797a", "/system/lib/libmedia_jni.so", "280a1b102bf8116036afec380a916c43fe613efa", "/system/lib/librs_jni.so", "50c0b6f857a6ccdda41bf0b342824061f53d8282", "/system/lib/libsoundpool.so", "cbb8da23dc18b290815804cfe0fa050dee734244", "/system/lib/libstagefright_soft_aacdec.so", "31953dff9e0cb5ac906be05e9252fcae567ae85d", "/system/lib/libstagefright_soft_amrdec.so", "c177a177dcddeb14a61b05496d2a48fb19d22cc1", "/system/lib/libstagefright_soft_g711dec.so", "d17e20864ef2e6749a7e832f9e11e872dff1fedb", "/system/lib/libstagefright_soft_mp3dec.so", "9b1fac3245f231ce17e0ddccb2d86b77ddbd7f49", "/system/lib/libstagefright_soft_mpeg4dec.so", "32512d68379d7bec308e6f5389c643ba33437de8", "/system/lib/libstagefright_soft_vorbisdec.so", "19484429d11be11eecf8dd4b41e732772252a11f", "/system/lib/libstagefright_soft_vpxdec.so", "a762a73a699ae9087aaa792fadac7d833e7b93c6", "/system/lib/libvideoeditorplayer.so", "94bb20c619684e55e9597d0ea20e8e5285f38d8f", "/system/lib/libwilhelm.so", "13ac96b0e7b8574d4dfdb11d8a0f0b8604b96971", "/system/lib/libttscompat.so", "c2c0e1108ba7073cb69517bbdc19cbc79ee72889", "/system/lib/libstagefright_soft_h264dec.so", "116efcf0de2ce7c96c38d8f517aaa0cd9aa96ae7", "/system/lib/libsystem_server.so", "8a1e2263a1e300d11e6d657b1ff5470bf08f5f4e", "/system/lib/libOpenMAXAL.so", "1ca5d1547d59245066404c62262524f6d509ed28", "/system/lib/libfilterfw.so", "9a11ba26711b7446c16049a9e0f4bb530f223a83", "/system/lib/libvideoeditor_jni.so", "14356d5ad1fcf37f2165af328640a36dbef27ef7", "/system/lib/libOpenSLES.so", "db4b1ec79cc389a6924ac2369850a0be29daa11c", "/system/lib/libandroid_servers.so", "9158649681696d75cbe08386104008d9fbcf1f48", "/system/lib/libfilterpack_imageproc.so", "fb3e7ce994622bb5ce3ed4d2817140db7432a4f9", "/system/lib/libvariablespeed.so", "1e2b0338bf1bf7e476dcf91b7078f045534dc8ac", "/system/lib/libwebcore.so", "54425b4692b7564d3a1f153e991e356d71a5d852");
show_progress(0.150000, 5);
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
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");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "restore");
delete("/system/bin/backuptool.sh");
delete("/system/bin/backuptool.functions");
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");
