chris41g

Untitled

Aug 11th, 2011
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.21 KB | None | 0 0
  1. #!/system/bin/sh
  2. # Remount filesystems RW
  3. busybox mount -o remount,rw /
  4. busybox mount -o remount,rw /system
  5. busybox --install -s /system/bin
  6. busybox --install -s /system/xbin
  7. busybox ln -s /sbin/recovery /system/bin/busybox
  8. /system/bin/busybox rm /sbin/busybox
  9. busybox cp -f /sbin/su /system/bin/su
  10. chmod 6755 /system/bin/su
  11. busybox rm /sbin/su
  12. busybox ln -s /system/bin/su /system/xbin/su
  13. if [ ! -f "/system/app/Superuser.apk" ] && [ ! -f "/data/app/Superuser.apk" ] && [[ ! -f "/data/app/com.noshufou.android.su"* ]]; then
  14.     if [ -f "/system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk" ]; then
  15.         busybox rm /system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk
  16.     fi
  17.     if [ -f "/system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk" ]; then
  18.         busybox rm /system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk
  19.     fi
  20.     if [ -f "/system/app/FreeHDGameDemos.apk" ]; then
  21.         busybox rm /system/app/FreeHDGameDemos.apk
  22.     fi
  23.     busybox cp /sbin/Superuser.apk /system/app/Superuser.apk
  24.  fi
  25. sync
  26. # Enable init.d support
  27. if [ -d /system/etc/init.d ]
  28. then
  29.     logwrapper busybox run-parts /system/etc/init.d
  30. fi
  31. sync
  32. # Fix screwy ownerships
  33.  
  34. for blip in conf default.prop fota.rc init init.goldfish.rc init.rc init.smdkc110.rc lib lpm.rc modules recovery.rc res sbin bin
  35. do
  36.     chown root.shell /$blip
  37.     chown root.shell /$blip/*
  38. done
  39.  
  40. chown root.shell /lib/modules/*
  41. chown root.shell /res/images/*
  42. #setup proper passwd and group files for 3rd party root access
  43. # Thanks DevinXtreme
  44.  
  45. if [ ! -f "/system/etc/passwd" ]; then
  46.     echo "root::0:0:root:/data/local:/system/bin/sh" > /system/etc/passwd
  47.     chmod 0666 /system/etc/passwd
  48. fi
  49. if [ ! -f "/system/etc/group" ]; then
  50.     echo "root::0:" > /system/etc/group
  51.     chmod 0666 /system/etc/group
  52. fi
  53. # fix busybox DNS while system is read-write
  54. if [ ! -f "/system/etc/resolv.conf" ]; then
  55.     echo "nameserver 8.8.8.8" >> /system/etc/resolv.conf
  56.     echo "nameserver 8.8.4.4" >> /system/etc/resolv.conf
  57. fi
  58. sync
  59. # patch to prevent certain malware apps
  60. if [ -f "/system/bin/profile" ]; then
  61.     busybox rm /system/bin/profile
  62. fi
  63. touch /system/bin/profile
  64. chmod 644 /system/bin/profile
  65. # remount read only and continue
  66. busybox  mount -o remount,ro /
  67. busybox  mount -o remount,ro /system
Advertisement
Add Comment
Please, Sign In to add comment