arc: more logic rewrite

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-10 18:15:54 +01:00
parent 78f5455b69
commit 1d04d3f59f
2 changed files with 10 additions and 3 deletions

View File

@ -2210,11 +2210,15 @@ function genHardwareID() {
else else
dialog --backtitle "$(backtitle)" --title "HardwareID" \ dialog --backtitle "$(backtitle)" --title "HardwareID" \
--yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed)." 8 60 --yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed)." 8 60
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
[ $? -ne 0 ] && break [ $? -ne 0 ] && break
fi fi
else else
dialog --backtitle "$(backtitle)" --title "HardwareID" \ dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: Verification failed!" 6 50 --msgbox "HardwareID: Verification failed!" 6 50
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
break break
fi fi
done done
@ -2234,6 +2238,8 @@ function checkHardwareID() {
curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" > "${S_FILE}" curl -skL "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" > "${S_FILE}"
fi fi
else else
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "HardwareID" \ dialog --backtitle "$(backtitle)" --title "HardwareID" \
--infobox "Couldn't verify your HardwareID!\nArc Patch not enabled!" 6 40 --infobox "Couldn't verify your HardwareID!\nArc Patch not enabled!" 6 40
cp -f "${S_FILE}.bak" "${S_FILE}" cp -f "${S_FILE}.bak" "${S_FILE}"

View File

@ -33,6 +33,7 @@ fi
# Get Arc Data from Config # Get Arc Data from Config
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")" ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")" BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
@ -409,7 +410,7 @@ function arcPatch() {
# Check for Custom Build # Check for Custom Build
if [ "${ARCMODE}" == "automated" ]; then if [ "${ARCMODE}" == "automated" ]; then
[ -z "${ARCCONF}" ] && checkHardwareID || true [ -z "${ARCCONF}" ] && checkHardwareID || true
sleep 2 sleep 1
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")" [ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" [ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
@ -425,7 +426,7 @@ function arcPatch() {
[ -z "${resp}" ] && return 1 [ -z "${resp}" ] && return 1
if [ ${resp} -eq 1 ]; then if [ ${resp} -eq 1 ]; then
[ -z "${ARCCONF}" ] && checkHardwareID || true [ -z "${ARCCONF}" ] && checkHardwareID || true
sleep 2 sleep 1
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")" ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")" [ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" [ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
@ -824,7 +825,7 @@ else
[ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1" [ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1"
while true; do while true; do
echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu" echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu"
if [ -z "${ARCCONF}" ] && [ "${ARCOFFLINE}" != "true" ]; then if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu" echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
fi fi
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu" echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"