########################################################################## # # SALT - [S]teadfasterX [A]ll-in-one [L]G [T]ool # # Copyright (C): 2017-2023, steadfasterX # # global variables for SALT # # include this with: # source salt.vars # # brought to you by: steadfasterX ########################################################################## ## binaries needed in SALT export YAD="/usr/bin/yad" export GIT=/usr/bin/git export LAFTERM="/usr/bin/xterm" export CURLB="/usr/bin/env curl" export FBBIN="/usr/bin/fastboot" export DFBIN="/bin/df" export AWKBIN="/bin/awk" export GREPBIN="/bin/grep" export EGREPBIN="/bin/grep -E" export TRBIN="/bin/tr" export TEEBIN="/usr/bin/tee" ## salt basic stuff export LC_ALL=C export VDIG="3.36-1" export TNAME="SALT" export TFULLNAME="$TNAME - [S]teadfasterX's [A]ll-in-one [L]G [T]ool" export PYTHONUNBUFFERED=1 export VERSION="${VDIG}:STABLE" export YTITLE="$TNAME - $VERSION" # comment the following when you get issues: export LAFARGS="--skip-hello" # remove the # char from the following for advanced debugging info: #export LAFARGS="--skip-hello --debug" ## user detection if [ ! -z "$PKEXEC_UID" ];then export REALUSER=$(id -nu $PKEXEC_UID); export REALHOME=/home/$REALUSER echo "DEBUG: user $REALUSER identified by pkexec" else if [ ! -z "$SUDO_USER" ];then export REALHOME=/home/$SUDO_USER; export REALUSER=$SUDO_USER echo "DEBUG: user $REALUSER identified by sudo" elif [ "$USER" != "root" ];then export REALHOME=/home/$USER; export REALUSER=$USER echo "DEBUG: user $REALUSER identified" else echo "WARNING: SALT seems to run as REAL root user!" export REALHOME=$HOME; export REALUSER=root fi fi ## paths export SALTPATH="${0%/*}" export KDZMGR="$SALTPATH/kdzmanager.sh" export FOREIGNPATH="$SALTPATH/foreign" export APASTE="$FOREIGNPATH/usr/bin/anypaste" export LAFPATH=$REALHOME/programs/lglafng export KDZTOOLS=$REALHOME/programs/kdztools export SICONS="$SALTPATH/icons" export SDATPATH=$REALHOME/programs/sdat2img export SDATBIN="$SDATPATH/sdat2img.py" export LOG="$REALHOME/salt.log" export USUTMPDIR=/tmp/UsU export DUMPER="$SALTPATH/payload-dumper-go" ## misc export FYAD="$YAD --center --window-icon=$SICONS/salt_logo.png" export KDZGIT="https://github.com/steadfasterX/kdztools.git" export LAFGIT="https://github.com/steadfasterX/lglaf.git" export SDATGIT="https://github.com/xpirt/sdat2img.git" export LOCKFILE=/tmp/salt.lock export PYTHONBIN="/usr/bin/env python3" export BROTLI=/usr/bin/brotli export STDBUF="/usr/bin/stdbuf -o0" # required to disable buffering for progress bars # default lglaf CR detection (can be interactively set in SALT -> Advanced Menu -> CR) # Auto,yes,no # yes enforces CR, no enforces no CR [ -z "$CRMODE" ] && export CRMODE=Auto # default max partition size in MB (basic backup) export BMAXDEF=260 ### partitions info # unneeded partitions means they contain no or useless data. # e.g. cache or userdata never needed to flash from a KDZ export PUNNEEDED="@(cache|grow|userdata)" # known to be dangerous to flash (in terms of locking/unlocking state and device specific # data like IMEI etc export PDEVICE="@(devinfo|drm|misc|modemst1|modemst2|persist|persistent|sns)" # known to be safe to flash export PSYSTEM="@(apdp|boot|carrier|cust|DDR|dpo|eksst|encrypt|eri|factory|felicia|fota|fsc|fsg|keystore|limits|modem|mpt|msadp|operatorlogging|raw_resources*|rct|recovery|sec|ssd|system)" # known to be part of the bootloader plus LAF as that is required to be compatible with the rest of # the bootloader stack in order to bring up download mode on locked devices! export PBOOTL="@(aboot|abootbak|hyp|hypbak|laf|pmic|pmicbak|rpm|rpmbak|sbl1|sbl1bak|sdi|sdibak|tz|tzbak)" # When extracting a KDZ or using auto mode to extract/flash these are NEVER be flashed (must be separated by a pipe) export AUTONOEXTRACT="GPT|misc|devinfo|modemst*" ## Ignore list for flashing export FLASHIGNORE="GPT|firehose|zeros" ## G4 UsU # same then AUTONOEXTRACT but when UsU has been detected export AUTONOEXTRACTUSU="${AUTONOEXTRACT}|aboot*|raw_resources*" export USUVALIDS="@(LG-G4_UsU|*LS991*|*F500*|*H810*|*H812*|*H811*|*H815*|*H819*|*US991*|*VS986*)" export FLASHIGNOREUSU="aboot|laf|raw_resources|GPT|firehose|zeros" ## LG models export LGG4="@(LG-G4_UsU|*LS991*|*F500*|*H810*|*H812*|*H811*|*H815*|*H818*|*H819*|*US991*|*VS986*)" ## ARB partition(s) # List of known partition names containing the ARB value export PARB="aboot|sbl1|xbl1|xbl" # shown names when switching/updating export SALTMODES="STABLE|STREAM" # git branches: current version export BR_S_SALT=master export BR_S_KDZ=master export BR_S_LAF=stable # git branches: testing version export BR_T_SALT=develop export BR_T_KDZ=develop export BR_T_LAF=develop