Zvikomborero VIncent Zvikaramba | cef4b70 | 2016-07-26 06:06:49 -0400 | [diff] [blame] | 1 | #!/system/xbin/bash |
| 2 | |
| 3 | MODE=$1 |
| 4 | |
| 5 | RS_PATH=/system/rilswitch/ |
| 6 | |
| 7 | ROPT_PATH=bin/radiooptions |
| 8 | RILD_PATH=bin/rild |
| 9 | REF_RIL_PATH=lib/libreference-ril.so |
| 10 | LIBRIL_PATH=lib/libril.so |
| 11 | LIBRILUTIL_PATH=lib/librilutils.so |
Zvikomborero VIncent Zvikaramba | cef4b70 | 2016-07-26 06:06:49 -0400 | [diff] [blame] | 12 | |
| 13 | #remount the system |
| 14 | mount -o remount,rw /system |
| 15 | |
Zvikomborero VIncent Zvikaramba | cef4b70 | 2016-07-26 06:06:49 -0400 | [diff] [blame] | 16 | if [ -n $MODE ]; then |
| 17 | #kill rild |
| 18 | kill `pidof rild` |
| 19 | mv /system/$RILD_PATH /system/$RILD_PATH.old |
Zvikomborero VIncent Zvikaramba | b894984 | 2016-07-26 06:54:34 -0400 | [diff] [blame] | 20 | cp $RS_PATH/$MODE/$ROPT_PATH /system/$ROPT_PATH 2>/dev/null |
Zvikomborero VIncent Zvikaramba | cef4b70 | 2016-07-26 06:06:49 -0400 | [diff] [blame] | 21 | cp $RS_PATH/$MODE/$RILD_PATH /system/$RILD_PATH |
| 22 | cp $RS_PATH/$MODE/$REF_RIL_PATH /system/$REF_RIL_PATH |
| 23 | cp $RS_PATH/$MODE/$LIBRIL_PATH /system/$LIBRIL_PATH |
| 24 | cp $RS_PATH/$MODE/$LIBRILUTIL_PATH /system/$LIBRILUTIL_PATH |
Zvikomborero VIncent Zvikaramba | cef4b70 | 2016-07-26 06:06:49 -0400 | [diff] [blame] | 25 | rm /system/$RILD_PATH.old |
| 26 | #check if we copied successfully |
| 27 | if [ $? != 0 ]; then |
| 28 | #kill rild again for good measure |
| 29 | kill `pidof rild` |
| 30 | #copy again |
| 31 | mv /system/$RILD_PATH /system/$RILD_PATH.old |
| 32 | cp $RS_PATH/$MODE/$RILD_PATH /system/$RILD_PATH |
| 33 | rm /system/$RILD_PATH.old |
| 34 | fi |
| 35 | fi |
| 36 | |
| 37 | #set permissions |
| 38 | chmod 0655 /system/$RILD_PATH |
| 39 | chmod 0655 /system/$ROPT_PATH |
| 40 | chmod 0644 /system/$REF_RIL_PATH |
| 41 | chmod 0644 /system/$LIBRIL_PATH |
| 42 | chmod 0644 /system/$LIBRILUTIL_PATH |
| 43 | chmod 0644 /system/$SECRIL_C_PATH |
| 44 | |
| 45 | #remount the system |
| 46 | mount -o remount,ro /system |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |