MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / choose_menu_style

Function choose_menu_style

Scripts/Settings.py:2124–2158  ·  view source on GitHub ↗
(stdscr)

Source from the content-addressed store, hash-verified

2122BOOT="$STAGE/bootstrap"
2123PRE="$HOME/.termux_transfer_pre_restore"
2124SOURCE_ARCH={source_arch}
2125SOURCE_PREFIX={source_prefix}
2126SOURCE_SDK={source_sdk}
2127
2128fail() {{ echo "[!] $*" >&2; exit 1; }}
2129[ "$(uname -m)" = "$SOURCE_ARCH" ] || fail "CPU architecture mismatch: transfer=$SOURCE_ARCH, device=$(uname -m)."
2130[ "${{PREFIX:-/data/data/com.termux/files/usr}}" = "$SOURCE_PREFIX" ] || fail "Termux prefix mismatch. Expected $SOURCE_PREFIX."
2131CURRENT_SDK="$(getprop ro.build.version.sdk 2>/dev/null || true)"
2132if [ -n "$SOURCE_SDK" ] && [ -n "$CURRENT_SDK" ] && [ "$SOURCE_SDK" != "$CURRENT_SDK" ]; then
2133 echo "[!] Android SDK differs (old $SOURCE_SDK, new $CURRENT_SDK). Portable data will restore, but native packages may need repair later."
2134fi
2135
2136cd "$TRANSFER_DIR"
2137[ -f "{TERMUX_TRANSFER_CORE_NAME}" ] || fail "{TERMUX_TRANSFER_CORE_NAME} is missing. Transfer it from the old phone."
2138rm -rf "$STAGE"
2139mkdir -p "$BOOT"
2140
2141verify_archive() {{
2142 expected="$1"; file="$2"; expected_size="$3"
2143 [ -f "$file" ] || fail "Missing transfer archive: $file"
2144 actual_size="$(wc -c < "$file" | tr -d ' ')"
2145 [ "$actual_size" = "$expected_size" ] || fail "Size check failed for $file"
2146 actual="$(sha256sum "$file" | awk '{{print $1}}')"
2147 [ "$actual" = "$expected" ] || fail "SHA-256 check failed for $file"
2148}}
2149
2150{verify_lines}
2151echo "[+] All transfer archives passed integrity checks."
2152
2153# Offline unzip bootstrap captured from the old Termux installation.
2154{bootstrap}
2155extract_zip() {{
2156 file="$1"
2157 if command -v unzip >/dev/null 2>&1; then
2158 unzip -oq "$file" -d "$STAGE"
2159 return
2160 fi
2161 if [ -x "$BOOT/bin/unzip" ]; then

Callers

nothing calls this directly

Calls 3

_Function · 0.70
safe_curses_addstrFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected