| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. -z "${ANDROID_HOST_OUT}" ]; then |
| 4 | echoscip-shell system . . echo. 'ANDROID_HOST_OUT not set. Have you run lunch?' |
| 5 | exit 1 |
| 6 | elif [scip-shell system . . `[`. -z "${ANDROID_BUILD_TOP}" ]; then |
| 7 | echoscip-shell system . . echo. 'ANDROID_BUILD_TOP not set. Have you run lunch?' |
| 8 | exit 1 |
| 9 | elif [scip-shell system . . `[`. ! -f "$ANDROID_HOST_OUT/lib64/libselinux.so" ]; then |
| 10 | echoscip-shell system . . echo. "Cannot find $ANDROID_HOST_OUT/lib64/libselinux.so" |
| 11 | echoscip-shell system . . echo. "Need to build project" |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
| 15 | unamestr=`unamescip-shell system . . uname.` |
| 16 | if [scip-shell system . . `[`. "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then |
| 17 | export LD_PRELOAD=$ANDROID_HOST_OUT/lib64/libselinux.so |
| 18 | export PYTHONPATH=$ANDROID_BUILD_TOP/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages |
| 19 | exec python $ANDROID_BUILD_TOP/external/selinux/python/audit2allow/audit2why "$@" |
| 20 | else |
| 21 | echoscip-shell system . . echo. "audit2why is only supported on linux" |
| 22 | exit 1 |
| 23 | fi |