-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsalt.vars
134 lines (117 loc) · 4.75 KB
/
salt.vars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
##########################################################################
#
# SALT - [S]teadfasterX [A]ll-in-one [L]G [T]ool
#
# Copyright (C): 2017-2023, steadfasterX <steadfastX|boun.cr>
#
# global variables for SALT
#
# include this with:
# source salt.vars
#
# brought to you by: steadfasterX <steadfastX|boun.cr>
##########################################################################
## 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}:STREAM"
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