From a4f4c80b7b03cf6808dad5835a83f5fecf68070b Mon Sep 17 00:00:00 2001 From: "Bat.bat" Date: Wed, 30 Oct 2019 21:18:18 +0800 Subject: [PATCH 1/2] Workaround for csr-active-config `E7030000` PS: Add gitignore --- .gitignore | 2 ++ hidpi.sh | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e539de --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +._* \ No newline at end of file diff --git a/hidpi.sh b/hidpi.sh index fccfb69..08f36c6 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -1,6 +1,6 @@ #!/bin/sh -sipChecker=($(csrutil status | awk '{ print $5 }')) +sipInfo=("$(csrutil status)") systemVersion=($(sw_vers -productVersion | cut -d "." -f 2)) systemLanguage=($(locale | grep LANG | sed s/'LANG='// | tr -d '"' | cut -d "." -f 1)) @@ -68,9 +68,11 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/dev" # downloadHost="http://127.0.0.1:8080" -if [ "${sipChecker}" != "disabled." ]; then - echo "${disableSIP}"; - exit 0 +if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]]; then + : +else + echo "${disableSIP}"; + exit 0 fi if [[ "${systemVersion}" -ge "15" ]]; then From 0622ae61b3f136553336e3e817b98a6592898b15 Mon Sep 17 00:00:00 2001 From: "Bat.bat" Date: Thu, 31 Oct 2019 20:28:04 +0800 Subject: [PATCH 2/2] Fix indentation --- hidpi.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index 08f36c6..1402b24 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -69,10 +69,10 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="http://127.0.0.1:8080" if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]]; then - : + : else - echo "${disableSIP}"; - exit 0 + echo "${disableSIP}"; + exit 0 fi if [[ "${systemVersion}" -ge "15" ]]; then