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/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/libjackpal-androidterm3.so", "ecaeb903c230d76e6becedc058fc61b518e9d60b", "/system/lib/modules/vibrator.ko", "81137f46a1dc431d06f79056052d3d78cd38a834", "/system/lib/modules/cmc7xx_sdio.ko", "86bd74703439ec765f1844f487770de418ce4a20", "/system/lib/modules/bcm4329.ko", "7d976e95dadf3b84d4fa5b5133053ef35871b7b8", "/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", "10d931e134358ef6f7cb6c3f2565f7f24a2fbbd6", "/system/lib/hw/lights.goldfish.so", "1f33f22e5a9f06b07f4feff392401194ff50f8d9", "/system/lib/hw/sensors.goldfish.so", "c2beb017ada76e4d3f40e82549b28e109ef16bff", "/system/lib/hw/audio.a2dp.default.so", "e072be99173b9cc49f3d4839ddb6653af9d60f25", "/system/lib/hw/gps.goldfish.so", "e8f7144672782c2ba99116761ebc6185d9387573", "/system/lib/hw/audio.primary.s5pc110.so", "13a7a5e7f3fd2b7d6ac52014af8edff7a73ced72", "/system/lib/hw/hwcomposer.s5pc110.so", "0d0feb244754eea3b3ec7883c06605b375d6b702", "/system/lib/hw/camera.s5pc110.so", "a01cb1e223eba2ff2723a8378d418de9475b732e", "/system/lib/hw/audio.primary.goldfish.so", "e17ec857d55a38bbbd00421e7ba87c68b8f6cde7", "/system/lib/hw/audio_policy.default.so", "8ed95fa6a2ffedd56340a28609808038e598ddd9", "/system/lib/hw/audio_policy.s5pc110.so", "14aba66be5707a0f54a1382835b456a0c6143c1c", "/system/lib/hw/camera.goldfish.so", "fff171fa6689530874880c51f1920bdf22301c75", "/system/lib/libsensor_yamaha_test.so", "93e75639a645db9c2974260088cbb3de80f13144", "/system/lib/libsec-ril40.so", "d7657e214def5b2bc26e7fe55f08f1b29fc1d7bd", "/system/lib/libsecril-client.so", "85a383c73796b555386f35cb075cdedb204ba4b7", "/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", "3ec23ca0492c379ca8f4f42ff98234ac2d7cf190", "/system/lib/libexpat.so", "6417eba0c7c85733c61cf0ce43c714cff6c79433", "/system/lib/libdl.so", "4103a0d7be914161aac5a574840f8c48a43973e0", "/system/lib/libstlport.so", "5a143cbba8981b25b6f137c3d87cd7d665ba280b", "/system/lib/libcrypto.so", "a8c6233f349f8a2761d3a7b328599924044f5c0c", "/system/lib/libjni_latinime.so", "9422e1f2eae121804e8f1f0ef1774eaff51e1438", "/system/lib/libc.so", "0fa26f9a264b1defd8ef9e2bc0c8cfb8c505c974", "/system/lib/libssl.so", "a40baadef5a3764501be31d24faeaef7115adde5", "/system/lib/libiprouteutil.so", "2e7edf098320a9154f3109cb9a5067de66daacf7", "/system/lib/libnetlink.so", "a2653845b59978be5e0efdb17c7b9622e641c8e1", "/system/lib/libstdc++.so", "fd0f05a5643848cd6f54a33685b99a044aefe797", "/system/lib/libm.so", "ddad9cfb7db2d6f4ae99e1744bdf1ff7e0c5fda9", "/system/lib/libc_malloc_debug_leak.so", "03235bb80fcf0cc68d083b2cb58221440b822f68", "/system/lib/libc_malloc_debug_qemu.so", "5fef6c4054769fea051283b615e103364d139444", "/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/libgabi++.so", "d9eb2c63a7fb5059e7114790036b82427d72e8d1", "/system/lib/libvorbisidec.so", "15a2280d118950f8571d6060349d8f3812ef8bc0", "/system/lib/libstagefright_amrnb_common.so", "43ff956ac6d3f0e74af82e878d14d7679d69e40a", "/system/lib/libstagefright_enc_common.so", "e5009329508ddc2859b590d6d1ac0e2ed8669c46", "/system/lib/libclcore.bc", "a1e2610fdc0c2ef151248092fa32be807d1b983d", "/system/lib/libext2_profile.so", "31b50122e9077f76743285b087753446e296dd57", "/system/lib/liblog.so", "c61752080af6763ecf69271b503de4631df0948e", "/system/lib/libstagefright_avc_common.so", "2b19421cd7a56200cec241e0ef056f62bed9bb62", "/system/lib/libETC1.so", "767fab629c7be3d8facc8269cdbfdcf27de2db6c", "/system/lib/libglib.so", "5c43b0b81273b96261abbc24b18f5148eea7dee7", "/system/lib/libspeexresampler.so", "6d32c83852118cc1b037a48d6bceb6b87c03a6c5", "/system/lib/libctest.so", "8a348b887d39de12c6333e272f74f81bc9b420f4", "/system/lib/libpagemap.so", "1d53cd3803ff071169a1d4424b15090f5c37f94f", "/system/lib/libpng.so", "26feb5245a1bdd4ad7ea00fea0251e7d9d71a90a", "/system/lib/libsurfaceflinger_client.so", "12ba180d276b44d96e23f91c3d328f6ffdeed0eb", "/system/lib/libncurses.so", "06745a4bcdff3a06bb64e92dbafe49995b2b9a3e", "/system/lib/libext4_utils.so", "0dbcd008546bf088713ee3ceede5359d1cdce864", "/system/lib/libext2_blkid.so", "da7c1ff4b57871118614a81a4b7fa196031bd7cf", "/system/lib/libicuuc.so", "952c842b8ebb598cab1c8c99e5e306f68f0f399e", "/system/lib/libs3cjpeg.so", "93dcda499198613cb52ee06cca4c40a4e716e28f", "/system/lib/libcutils.so", "ea8fa6506973971917f9f0464c8dae80393e0c41", "/system/lib/libext2fs.so", "2871fd5002632c9cffdfae01f6355eaae601526e", "/system/lib/libutils.so", "635e608abded83512bd882fb242f2836d2793bef", "/system/lib/libwpa_client.so", "b6bf56784098f394ed6ae0a2db64efc95b78c063", "/system/lib/libnetutils.so", "0b9167d3c558092891de89456a6b16c2814335ef", "/system/lib/libhardware.so", "b5828b2f2a8011696e80b695af347668d18bf60f", "/system/lib/libjpeg.so", "f4442cc0d2155103a2f21e94810dc8a6ba483757", "/system/lib/libicui18n.so", "fcc5e962057b10aa58f73a96f835933efba36eb7", "/system/lib/libnfc_ndef.so", "af4ab060e939ce974cae7b7652566f3322d2a23d", "/system/lib/libusbhost.so", "47e7fd29f2f24a876c9c174b4387e2d034fcca2b", "/system/lib/libbluedroid.so", "a37e8477f742c2a1a00cdbaace99d95c6ac0c1a9", "/system/lib/libeffects.so", "57b228df2f52388116c979d530d506f5bec899a8", "/system/lib/libsysutils.so", "cfb358b4425c84ff1b33e730d8d3d8164342c181", "/system/lib/libdiskconfig.so", "d4a333ee3db0f8825dc856b8df6e400d590405ab", "/system/lib/libpower.so", "58d97bd7582629c28b1354f254e844eb2e5e17b1", "/system/lib/libaudioutils.so", "e9596db1ab23770edc79c798acc0b1adc049a049", "/system/lib/libbcinfo.so", "30e96a325e74fd1ca6c01aca22cd7ed8e6a54ac0", "/system/lib/libwebrtc_audio_preprocessing.so", "e3896209e1bf72e6759844b4404de93a6c6da3bc", "/system/lib/soundfx/libbundlewrapper.so", "7f6bc84f091638fed074a0b569dbe1e882cfd6a6", "/system/lib/soundfx/libcyanogen-dsp.so", "d1852361ec4982379dc4b4d2f972fa04dd9e65c0", "/system/lib/soundfx/libreverbwrapper.so", "ff7c021273f6d3d49c2dd23f2069070e76bb7770", "/system/lib/soundfx/libvisualizer.so", "9c19db37cf6681ebefea500800a2d1fa51a1c4ee", "/system/lib/soundfx/libaudiopreprocessing.so", "3dbdcc116c65487e023da17e9645c920910bb409", "/system/lib/libstagefright_yuv.so", "ce792af47c4a700dba096068016289f85ddf171e", "/system/lib/libdbus.so", "04b1da46087ac340e054bdc87e39c379d9caf4d6", "/system/lib/libbluetooth.so", "55d42bf5204a84babf965bd82b62d8f83b823247", "/system/lib/libGLESv2_dbg.so", "e5f78931b92bd6c1e0cb3e2bd9e7688984335b82", "/system/lib/libhardware_legacy.so", "cea3d639b9b30d79ea45886cf009df80b3defbdf", "/system/lib/libemoji.so", "1820f66eb493fbeb40c810b90e380deea0038de8", "/system/lib/libbinder.so", "07addcd8cff68c15b5616fbecd3fad08a7c7fe7c", "/system/lib/libsonivox.so", "39c5d6f0895a1aff536ca11340e10de31fe72145", "/system/lib/libnativehelper.so", "338fd0f5b0303b9fd076fd3fbfe1cb9955f22c87", "/system/lib/libsqlite.so", "1dee4171d05cb7957403a44389c5b82de7833b3a", "/system/lib/libharfbuzz.so", "12c6d1aabf56570d5d581a3f951d349de73ee9f7", "/system/lib/libttspico.so", "6c1827a438e229ffd82dba1c558b70a83fa80153", "/system/lib/libtinyalsa.so", "c84ad68e46149b1d7e2cb19b53e985c6a802c404", "/system/lib/libSEC_OMX_Core.s5pc110.so", "836001fef5e47592554b40886406a8f71ffe2d5d", "/system/lib/libdrm1.so", "7bba036145851e701172b83591f15448a4aba9f0", "/system/lib/libdrmframework.so", "a667d2bd232d376fa6d9b6bccd90058922316892", "/system/lib/libbtio.so", "f4c8e4f8482d4d91af28844bbdc427d631a70c95", "/system/lib/libskia.so", "3c07f19442651d1be8b4a86c8887bef9ba1f5d14", "/system/lib/libstagefright_foundation.so", "4694d45130c642d12212f9fbcdb03cc94c6611fd", "/system/lib/libdefcontainer_jni.so", "eabf3064f4dcfae95905db29ec714e106fadd2bd", "/system/lib/libdvm.so", "dbeb4efbec4d3db3e190e221d5588c3830c1833c", "/system/lib/libpowermanager.so", "942e1fbb185e8a5c8f77db325dbc9c6e530fb091", "/system/lib/libexif.so", "5c03a891868e0dd7a84c25792d7500049120a9dd", "/system/lib/libmtp.so", "288e1c31cbbaf3a10076d475049ab0e6be3f0f11", "/system/lib/libsqlite_jni.so", "b0cb83774365ae6e1ada006c2f840c7d89bdb343", "/system/lib/libEGL.so", "467d1cc392d0940657cb7245093d3885bff00c9f", "/system/lib/libpixelflinger.so", "9d0bbd1f5c5efe3e618f4cb73bcf0cd20b88b3a0", "/system/lib/libchromium_net.so", "5e6eaea398cdb700c3cf21b2943e9b48951f618f", "/system/lib/libril.so", "352672d807d24953326e97416f312ce7f4093de4", "/system/lib/libdrm1_jni.so", "000f9009d4c5fc2afcb9f164f6b7fbf8ac9657e5", "/system/lib/libbluetoothd.so", "87fd68b94122a24652969b477e7fd40bbdd816ce", "/system/lib/libreference-ril.so", "498350724b349b3161bef45630af5b822a12e303", "/system/lib/libGLESv2.so", "701a53e74e89a409e435e17367c96634eec7ad59", "/system/lib/libGLESv1_CM.so", "07cc4665dcabcdfc469bce864249ffe6e56d159e", "/system/lib/bluez-plugin/audio.so", "eebbddd43488ad65b86c5c69d56ad59729472056", "/system/lib/bluez-plugin/bluetooth-health.so", "0d3c7d31223f89708d5ab7eb499e896f8ac9f6e9", "/system/lib/bluez-plugin/input.so", "94e4bcb4b6281c40f23490028fe0f20523660167", "/system/lib/bluez-plugin/network.so", "baaca0af54447ecb020abd00cc7aafbec344f4ce", "/system/lib/libui.so", "a5b4d82fbfb79dbeb57808f8bae204a06fe39f63", "/system/lib/libjni_mosaic.so", "a904a7ca57e0bfc65a535a097cfb31f0d5492c55", "/system/lib/libhwui.so", "4e26d619172caa991af9564bfacf9fd4cc9516b6", "/system/lib/libOMX.SEC.AVC.Decoder.s5pc110.so", "4f3890128564b9b6f014ab8caaeb83ef47a40113", "/system/lib/libOMX.SEC.AVC.Encoder.s5pc110.so", "0ee50b5fb106a3719bbb85397c4da32475343c2a", "/system/lib/libOMX.SEC.M4V.Decoder.s5pc110.so", "e1652bb05b233141766b6088b27794a41b7df065", "/system/lib/libOMX.SEC.M4V.Encoder.s5pc110.so", "bf00206de0f0a8c80ed08e6105219e1bb191b9b4", "/system/lib/libstagefrighthw.so", "0e7156c59153d1ee50678030ec2199a0bbaeb6f6", "/system/lib/libgui.so", "b84fc849c5fd2cbc0ce041c91c8bb573653a07d7", "/system/lib/libbcc.so.sha1", "20cba6bfcc05760bd52b9945cbacf556af22b958", "/system/lib/libbcc.so", "16cfebcdd07484c61ff3d528676ee70f9b308ca5", "/system/lib/libsensorservice.so", "3eaeb51d43af7412268ef9c92a50d25dc8c88f86", "/system/lib/libinput.so", "d58886d37481878fd02315a74435b1a67dfeec81", "/system/lib/libcamera_client.so", "de2182da9675fb9d76c9bac33dea54dd619f071f", "/system/lib/libRS.so", "4df6c822dd5a7cea4580be7ccca1706be18a7cec", "/system/lib/libmedia.so", "f683c0692dcd352e5fc3e3627d701bc3f07473df", "/system/lib/libaudioflinger.so", "33751b2938a537558d1ab1b79a3e4ebfbfe66d0f", "/system/lib/libcameraservice.so", "518ab335f09118ca2fa1b7fe727af023661172f0", "/system/lib/libstagefright.so", "9e55740a1ba82803175d5578d1d2d9909f79351d", "/system/lib/libandroid_runtime.so", "b1f586255d1fae6d5cab89255f01937224611d8f", "/system/lib/libstagefright_omx.so", "9ef3811702775276b9711e4d66bba0141e330002", "/system/lib/libSR_AudioIn.so", "65f83ab62ee844a18ee7e654602297abf2b15ba8", "/system/lib/librtp_jni.so", "e01d95b65081b3231d3d109fe3e3ba904fcd9dec", "/system/lib/libsrec_jni.so", "7c71a5685751f777b8a18d2d764698ae03ac1cb8", "/system/lib/libmediaplayerservice.so", "553dedff53d62d997b589f83a0f928cf629eef9c", "/system/lib/libsurfaceflinger.so", "798f7012dbf3cfe8fdfd03cb7381998fe8fbdc21", "/system/lib/drm/libfwdlockengine.so", "857b0c9118feb5a4e3d4e853b8e0137f71b79e38", "/system/lib/libFFTEm.so", "d539496489689946d08e912f53bc87d30149041d", "/system/lib/libandroid.so", "f2d037de976b529d055398cb96b38b51669f4a32", "/system/lib/libaudioeffect_jni.so", "277ab502a410d040a5e9d04d91feb8143385a938", "/system/lib/libdrmframework_jni.so", "6bb48df2e3c378803635af4495c5d002bd1ad609", "/system/lib/libjnigraphics.so", "5272272b1a7c601a250ee4e84767e3dbc125797a", "/system/lib/libmedia_jni.so", "c78b1c5d105d9ee253ad9843f5c544da0c4a0371", "/system/lib/librs_jni.so", "561a7b1c68a3b1fe51a0968ec638fede605b1fa4", "/system/lib/libsoundpool.so", "e2217745cebb76cf98842cc056143c5ac27fb1c1", "/system/lib/libstagefright_soft_aacdec.so", "64fa72796ee66dbff3bc7fff67ed04a14b368929", "/system/lib/libstagefright_soft_amrdec.so", "0b8f88e9e2926581ef99266a90802d68070b1e9a", "/system/lib/libstagefright_soft_g711dec.so", "fa0c7c39342b7fd7fe82cf5aea38aa6e45382e96", "/system/lib/libstagefright_soft_mp3dec.so", "771bf0c8441caf29fa0f5e7b2f4ed7285f742a49", "/system/lib/libstagefright_soft_mpeg4dec.so", "fcd290d8393c64294e62a35ba8c28b168c0216ef", "/system/lib/libstagefright_soft_vorbisdec.so", "7fc442628fb1a1e64369ffd99ad73b992a47c0fc", "/system/lib/libstagefright_soft_vpxdec.so", "3501d3fb5734a5e8f9d19f91f5b4f541f57e44d7", "/system/lib/libvideoeditorplayer.so", "9595f7aa72e726fc2d029578dbffe8abe90e08d5", "/system/lib/libwilhelm.so", "aac3f0fe3cbd21c0d02d24b8dade76c345c9af27", "/system/lib/libttscompat.so", "3205d5d9b966a9842e2aa052072dab32cf8e3e93", "/system/lib/libstagefright_soft_h264dec.so", "4bf9a04fff635cf2a9c3e17e6fa43cb048e06959", "/system/lib/libsystem_server.so", "103d5507250cd89b108e3b0decde79d6973e4df4", "/system/lib/libOpenMAXAL.so", "1ca5d1547d59245066404c62262524f6d509ed28", "/system/lib/libfilterfw.so", "369430dd678cc7e0f9932a82e55b332c0761e655", "/system/lib/libvideoeditor_jni.so", "3bdeac6d0ec45186529e8c09a623b95fa1d9d74b", "/system/lib/libOpenSLES.so", "db4b1ec79cc389a6924ac2369850a0be29daa11c", "/system/lib/libandroid_servers.so", "4863fed5a5bee986f9b071b8a100e927e7bf9c23", "/system/lib/libfilterpack_imageproc.so", "fb3e7ce994622bb5ce3ed4d2817140db7432a4f9", "/system/lib/libvariablespeed.so", "1e2b0338bf1bf7e476dcf91b7078f045534dc8ac", "/system/lib/libwebcore.so", "53fdef261a70c1d6300d3c68eb7a62045c2e86ff");
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");
