tree: cleanup

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-17 16:22:53 +01:00
parent c4ff1ecf1e
commit b2538b24ef
2 changed files with 11 additions and 51 deletions

View File

@ -2255,28 +2255,19 @@ function getpatfiles() {
function genHardwareID() { function genHardwareID() {
HWID="$(genHWID)" HWID="$(genHWID)"
while true; do while true; do
if [ -n "${HWID}" ]; then USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" if echo "${USERID}" | grep -vq "Hardware ID"; then
if echo "${USERID}" | grep -vq "Hardware ID"; then dialog --backtitle "$(backtitle)" --title "HardwareID" \
dialog --backtitle "$(backtitle)" --title "HardwareID" \ --msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70 writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}" break
break
else
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).\nPress Retry after you registered it." 8 60
[ $? -ne 0 ] && USERID="" && break
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
fi
else else
dialog --backtitle "$(backtitle)" --title "HardwareID" \ dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ID Generation failed!" 6 50 --yes-label "Retry" --no-label "Cancel" --yesno "HardwareID: ${HWID}\nRegister your HardwareID on\nhttps://arc.auxxxilium.tech (Discord Account needed).\nPress Retry after you registered it." 8 60
USERID="" [ $? -ne 0 ] && USERID="" && break
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}" writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
break
fi fi
done done
return return
@ -2285,37 +2276,6 @@ function genHardwareID() {
############################################################################### ###############################################################################
# Check HardwareID # Check HardwareID
function checkHardwareID() { function checkHardwareID() {
HWID="$(genHWID)"
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
if echo "${USERID}" | grep -vq "Hardware ID"; then
[ ! -f "${S_FILE}" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true
if curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}&userid=${USERID}" -o "${S_FILE}" 2>/dev/null; then
writeConfigKey "arc.hwid" "${HWID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
else
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--infobox "HardwareID: Your HardwareID couldn't be verified!" 4 50
sleep 3
USERID=""
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
else
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--infobox "HardwareID: Your HardwareID isn't registered!" 4 50
sleep 3
USERID=""
writeConfigKey "arc.hwid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
mv -f "${S_FILE}.bak" "${S_FILE}" 2>/dev/null
fi
return
}
###############################################################################
# Check HardwareID
function checkHardwareIDsilence() {
HWID="$(genHWID)" HWID="$(genHWID)"
USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)" USERID="$(curl -skL -m 10 "https://arc.auxxxilium.tech?hwid=${HWID}" 2>/dev/null)"
[ ! -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true [ ! -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak" 2>/dev/null || true

View File

@ -92,7 +92,7 @@ function arcModel() {
if [ ! -f "${S_FILE}" ] || [ ! -f "${P_FILE}" ]; then if [ ! -f "${S_FILE}" ] || [ ! -f "${P_FILE}" ]; then
updateConfigs updateConfigs
else else
checkHardwareIDsilence checkHardwareID
fi fi
dialog --backtitle "$(backtitlep)" --title "Model" \ dialog --backtitle "$(backtitlep)" --title "Model" \
--infobox "Reading Models..." 3 25 --infobox "Reading Models..." 3 25
@ -957,7 +957,7 @@ else
b) addonMenu; NEXT="b" ;; b) addonMenu; NEXT="b" ;;
d) modulesMenu; NEXT="d" ;; d) modulesMenu; NEXT="d" ;;
e) ONLYVERSION="true" && arcVersion; NEXT="e" ;; e) ONLYVERSION="true" && arcVersion; NEXT="e" ;;
p) ONLYPATCH="true" && checkHardwareIDsilence && arcPatch; NEXT="p" ;; p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;;
S) storageMenu; NEXT="S" ;; S) storageMenu; NEXT="S" ;;
o) dtsMenu; NEXT="o" ;; o) dtsMenu; NEXT="o" ;;
g) governorMenu; NEXT="g" ;; g) governorMenu; NEXT="g" ;;