3 PATH=/system/bin:/system/xbin
6 dest_dir=/system/lib$1/arm$1
7 binfmt_misc_dir=/proc/sys/fs/binfmt_misc
11 if [ ! -s libhoudini.so ]; then
12 if touch .dl_houdini; then
15 cd .. && cp -a arm$1 /data/local/tmp
16 mount -t tmpfs tmpfs arm$1 && cd arm$1 &&
17 cp -a /data/local/tmp/arm$1/* . && rm -rf /data/local/tmp/arm$1
22 while [ ! -s $dest_dir/libhoudini.so ]; do
23 while [ "$(getprop net.dns1)" = "" ]; do
27 [ "`uname -m`" = "x86_64" ] && url=http://goo.gl/Knnmyl || url=http://goo.gl/JsoX2C
29 url=http://goo.gl/n6KtQa
31 wget $url -cO houdini.tgz &&
32 bzcat houdini.tgz | tar xvf - -C $dest_dir && rm -f houdini.tgz && break
38 # if you don't see the files 'register' and 'status' in /proc/sys/fs/binfmt_misc
39 # then run the following command:
40 # mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
42 # this is to add the supported binary formats via binfmt_misc
44 if [ ! -e $binfmt_misc_dir/register ]; then
45 mount -t binfmt_misc none $binfmt_misc_dir
49 if [ -e register ]; then
50 # register Houdini for arm binaries
52 echo ':arm_exe:M::\\x7f\\x45\\x4c\\x46\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28::'"$dest_dir/houdini:P" > register
53 echo ':arm_dyn:M::\\x7f\\x45\\x4c\\x46\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x28::'"$dest_dir/houdini:P" > register
55 echo ':arm64_exe:M::\\x7f\\x45\\x4c\\x46\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7::'"$dest_dir/houdini64:P" > register
56 echo ':arm64_dyn:M::\\x7f\\x45\\x4c\\x46\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\xb7::'"$dest_dir/houdini64:P" > register
58 if [ -e arm${1}_exe ]; then
62 log -pe -thoudini "No binfmt_misc support"
65 if [ $houdini_bin -eq 0 ]; then
66 log -pe -thoudini "houdini$1 enabling failed!"
68 log -pi -thoudini "houdini$1 enabled"
71 [ "$(getprop ro.zygote)" = "zygote64_32" -a -z "$1" ] && exec $0 64