Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/system/bin/sh
- # Patch to fix build.prop mismatch o.O
- TAG="Liberty Patch - "
- LOG_FILE=/data/liberty/liberty.log
- if busybox test ! -d $( busybox dirname $LOG_FILE ); then
- busybox mkdir -p $( busybox dirname $LOG_FILE )
- fi
- # check if we have a droid2 or droidx:
- if busybox test -e /system/lib/hw/lights.droid2.so; then
- DEVICE=DROID2
- echo "${TAG}Detected device: ${DEVICE}" | busybox tee -a $LOG_FILE
- BUILD_PROP_URL=http://jrummy16.com/jrummy/roms/liberty/downloads/droid2.build.prop
- elif busybox test -e /system/lib/hw/lights.shadow.so; then
- DEVICE=DROIDX
- echo "${TAG}Detected device: ${DEVICE}" | busybox tee -a $LOG_FILE
- BUILD_PROP_URL=http://jrummy16.com/jrummy/roms/liberty/downloads/droidx.build.prop
- else
- echo "${TAG}Unkown device! Exiting patch." | busybox tee -a $LOG_FILE
- exit 1
- fi
- # See if we need to perform the patch:
- if busybox test "$( getprop ro.product.model )" == "${DEVICE}"; then
- echo "${TAG}build.prop looks ok, skipping patch." | tee -a $LOG_FILE
- exit 1
- fi
- # Download correcty build.prop:
- if ! busybox wget $BUILD_PROP_URL -O $EXTERNAL_STORAGE/patch.build.prop; then
- echo "${TAG}Failed to download build.prop patch!" | busybox tee -a $LOG_FILE
- exit 1
- fi
- # Replace bad build.prop:
- echo -n "${TAG}Installing build.prop patch ... " | busybox tee -a $LOG_FILE
- busybox mount -o remount,rw -t yaffs2 $( busybox grep " /system " "/proc/mounts" | busybox cut -d ' ' -f1 ) /system > /dev/nul 2>&1
- busybox cp -f $EXTERNAL_STORAGE/patch.build.prop /system/build.prop
- busybox mount -o remount,ro -t yaffs2 $( busybox grep " /system " "/proc/mounts" | busybox cut -d ' ' -f1 ) /system > /dev/nul 2>&1
- echo "done!" | busybox tee -a $LOG_FILE
Advertisement
Add Comment
Please, Sign In to add comment