[Android Software/Hacking General [Developers Only]] steadfasterX:
Before reading any further

This thread is best viewed in a

browser

!

Mobile apps may parse the XDA formatting not correctly and may screw things up.

About

View attachment 5191493

s

teadfasterX's

A

ll-in-one

L

G

T

ool (SALT)​

SALT is able to communicate with your device while in download mode and provides these features:

Detects

your:

ARB

device model

firmware version (short)

firmware version (full)

country of firmware

Secure device state

Battery Level

Is able to:

working completely without any LG dll (no more issues with replacing LGUP_xxxx.dll anymore!)

backup your device (predefined modes: full & basic and since v3.20 even a custom mode)

extract KDZ files

display your partitions (including what each partition is like bootloader etc!)

open a shell on the device*

ERASE (HOLY SH*** this is

DANGEROUS

!) one or multiple partitions

verify a taken backup (read all about this here)

self-update

In development

(already working on LP firmware! NOT on MM or N! read the Note):

Flashing a folder (e.g. from a previous backup)

Flashing a KDZ

IMPORTANT NOTE: Do not use the underlying code backend (lglaf /partitions.py) to RESTORE image files (yet)!

Reason:

LG has changed the mechanism in MM and later for writing to a partition! It seems that the reason is that each write must be authenticated differently or at least another one for the fsync.

Explained in detail

Besides the writing this may also be an issue afterwards: filesize

for reference here is a dump of a lgup flashing

Requirements

mAid (fka as FWUL) (recommended)

No requirements as SALT and everything needed is included there!

Highly recommended: booting mAid from USB stick to avoid any connection issues.

Ensure you use the latest mAid release and start SALT by opening the LG folder on the desktop.

Now just click the update button once SALT is started to ensure you have the latest and greatest SALT version!

Linux:

I recommend mAid (fka FWUL) in general but SALT is made to be run on any Linux (if you can set it up).

Requirements to install before beginning:

yad, git, python3, python3-pyusb, python3-crypto, python-zstandard (python3), python-pip (python3) and pkexec/policykit

(instead of pkexec/polkit gksudo will work too but this has been removed from many distributions)

On mAid:

open the Folder "LG" from the desktop and start SALT :)

On Arch:

sudo pacman -Sy polkit git xterm python-pyusb python-crypto python-pip

yay -Sy yad python-zstandard (hint: you may need to install yay first)

sudo pip3 install cryptography

on Manjaro:

sudo pacman -Sy polkit yad git xterm python-pyusb python-crypto trizen python-pip python-zstandard

sudo pip3 install cryptography

on *buntu, Debian, Mint and on all derivates of those:

sudo apt install policykit-1 yad git xterm python3 python3-usb python3-pip

sudo pip3 install zstandard

sudo pip3 install cryptography

you may need to setup your udev rules as well: android-udev-rules thats another reason why I recommend mAid ;) this is all implemented there out of the box..!!

Windows:

Windows users should use SALT in mAid which is highly recommended for many operations with Android devices. Also read & follow the above topic "mAid (fka FWUL) (recommended)".

Installation

(not needed on mAid! Just open the LG folder and start SALT)

open a terminal

type:

git clone https://github.com/steadfasterX/SALT.git
cd SALT
bash install-desktop.sh

read the output and if required copy the SALT.desktop file manually to your Desktop.

double click the SALT icon or while in a terminal start SALT with: sudo ~/SALT/salt

When starting SALT the first time you will be prompted to install necessary backend tools.

Choose YES to install them!

Note:

Even when the downloads tab in this project will contain releases the most up-to-date code can be fetched via the above way only.

Nevertheless you can download the tar file from the Downloads tab but ensure that you're using the latest code by starting an update (Update button in SALT) afterwards.

Usage

Start the device in download mode and connect it to the PC.

Start SALT.

Usually the download mode should be fully ready in 20 - 60 seconds after you see the cycling arrow screen.

But some devices needs up to >= 90 seconds until SALT can detect your device.

If you still get trouble connecting boot the device in download mode and let it connected that way while rebooting mAid (fka FWUL) or your personal Linux.

Known Issues

A current list of all known issues can be found at the bugtracker

Support

Android + SALT Support:

[matrix] || Telegram

mAid Support:

[matrix] || Telegram

CI/CD/Automation:

[matrix] || Telegram

Credits (without them no SALT)

SALT is based on:

YAD (yet another dialog) -> GUI

the awesome LGLAF code and reverse engineering by Peter Wu & friends ;)

-> general communication with the device like: flash, dump, getinfo, erase, list partitions, ...

kdztools by Elliott Mitchell -> extracting KDZ files

MANY enhancements by steadfasterX -> bring all together plus much more :)

SALT's own sources:

SALT

Patched LGLAF

Patched kdztools

Special credits:

@runningnak3d for his incredible reverse engineering skills which makes SALT better and better each day :) it's great to have you in the community !

tuxuser for making LAF communication on Nougat possible and for his great support!

XDA:DevDB Information

SALT - teadfasterX's [A]ll-in-one [L]G [T]ool, Tool/Utility for the LG G4

Contributors

steadfasterX

Source Code: https://github.com/steadfasterX/salt

Version Information

Status: Stable

Created 2017-12-11