Guest User

Untitled

a guest
Apr 7th, 2011
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.67 KB | None | 0 0
  1. #!/system/bin/sh
  2. # Patch to fix build.prop mismatch o.O
  3.  
  4. TAG="Liberty Patch - "
  5. LOG_FILE=/data/liberty/liberty.log
  6.  
  7. if busybox test ! -d $( busybox dirname $LOG_FILE ); then
  8.     busybox mkdir -p $( busybox dirname $LOG_FILE )
  9. fi
  10.  
  11. # check if we have a droid2 or droidx:
  12. if busybox test -e /system/lib/hw/lights.droid2.so; then
  13.     DEVICE=DROID2
  14.     echo "${TAG}Detected device: ${DEVICE}" | busybox tee -a $LOG_FILE
  15.     BUILD_PROP_URL=http://jrummy16.com/jrummy/roms/liberty/downloads/droid2.build.prop
  16. elif busybox test -e /system/lib/hw/lights.shadow.so; then
  17.     DEVICE=DROIDX
  18.     echo "${TAG}Detected device: ${DEVICE}" | busybox tee -a $LOG_FILE
  19.     BUILD_PROP_URL=http://jrummy16.com/jrummy/roms/liberty/downloads/droidx.build.prop
  20. else
  21.     echo "${TAG}Unkown device! Exiting patch." | busybox tee -a $LOG_FILE
  22.     exit 1
  23. fi
  24.  
  25. # See if we need to perform the patch:
  26. if busybox test "$( getprop ro.product.model )" == "${DEVICE}"; then
  27.     echo "${TAG}build.prop looks ok, skipping patch." | tee -a $LOG_FILE
  28.     exit 1
  29. fi
  30.  
  31. # Download correcty build.prop:
  32. if ! busybox wget $BUILD_PROP_URL -O $EXTERNAL_STORAGE/patch.build.prop; then
  33.     echo "${TAG}Failed to download build.prop patch!" | busybox tee -a $LOG_FILE
  34.     exit 1
  35. fi
  36.  
  37. # Replace bad build.prop:
  38. echo -n "${TAG}Installing build.prop patch ... " | busybox tee -a $LOG_FILE
  39. busybox mount -o remount,rw -t yaffs2 $( busybox grep " /system " "/proc/mounts" | busybox cut -d ' ' -f1 ) /system > /dev/nul 2>&1
  40. busybox cp -f $EXTERNAL_STORAGE/patch.build.prop /system/build.prop
  41. busybox mount -o remount,ro -t yaffs2 $( busybox grep " /system " "/proc/mounts" | busybox cut -d ' ' -f1 ) /system > /dev/nul 2>&1
  42. echo "done!" | busybox tee -a $LOG_FILE
Advertisement
Add Comment
Please, Sign In to add comment