Heimdall

Heimdall ist eine Open-Source cross-Platform Suite zum flashen der Firmware (aka ROMs) auf Samsung mobile Geräten. Zum Flashen werden PC (auf dem Heimdall installiert wird) und mobile Gerät via USB verbunden.

Die Android Geräte verwenden zum Flashen via USB i.d.R. das Fastboot Protokoll. Samsung verwendet in seinen Geräten jedoch ein proprietäres von Samsung entwickeltes Protokoll, das auch als Odin Protokoll bekannt ist. Odin selbst ist ein Programm zum Flashen der Samsung Geräte. Odin gibt es allerdings nur für Windows, es soll (laut Heimdall) wohl sehr langsam und unzuverlässig laufen, außerdem ist es kein offizielles Programm von Samsung und wird nicht von Samsung suported. Heimdall spricht das gleiche Protokoll hat aber den Vorteil, dass es für macOS, Win und Linux verfügbar ist.

GitHub: https://github.com/Benjamin-Dobell/Heimdall

$ sudo apt install heimdall-flash

Man kann die fertig gebaute Heimdall Software auch runterladen oder wie oben gezeigt mit dem Paketmanager installieren was für ältere Samsung Geräte ausreichend sein sollte. Für brandneue Geräte macht u.U. Sinn sich die Software selber zu übersetzen. Zumindest auf Linux ist das recht einfach möglich (s.a Appendix B - Installing Heimdall Suite from Source). Als erstes muss man sich die Pakete installieren, die für den Build erforderlich sind:

sudo -H apt-get install build-essential cmake zlib1g-dev \
             qt5-default libusb-1.0-0-dev libgl1-mesa-glx \
             libgl1-mesa-dev git

Dann kann man sich das Reposetory klonen:

$ cd ~/Downloads
$ git clone https://github.com/Benjamin-Dobell/Heimdall.git
Klone nach 'Heimdall' ...
...
$ cd Heimdall/

Danach kann der Build konfiguriert werden:

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Configuring done
-- Generating done
-- Build files have been written to: /share/Heimdall/build

Die Ausgaben des cmake solten in etwa wie oben aussehen, wenn da Fehler gemeldet werden, hat man vermutlich eine Bibliothek (eines der oben zuvor installierten Pakete) noch nicht installiert.

Mit ‚make‘ wird dann der Build erstellt:

$ make

Sofern das ‚make‘ ohne Fehler durchläuft sollte man nun einen ./bin Ordner haben in dem die ausführbaren Binaries liegen:

$ ls bin
heimdall  heimdall-frontend

$ ./bin/heimdall version
v1.4.2

Um mit Heimdall auf das Android Gerät zugreifen zu können, muss man das Gerät im Download Mode (s.a. Samsung Download- & Recovery-Mode) booten und dann noch das USB Kabel anschließen.

Abfrage des Partition Information Table (kurz PIT):

$ sudo -H ./bin/heimdall print-pit --no-reboot > my_samsung_device_PIT.txt

Die Option --no-reboot verhindert, dass das Gerät neu gebootet wird. Will man, dass das Gerät neu gebootet wird, lässt man die Option einfach weg.

Ausgabebeispiel siehe SM-T580 PIT