Android Rooting Galaxy Grand Prime v5.1.1 SM-G530R4

Using Heimdall to Root Android


Compiling Heimdall

Install required packages

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


Appendix B - Installing Heimdall Suite from Source:

    1. First make sure you have installed build-essential, cmake, zlib1g-dev,
       qt5-default, libusb-1.0-0-dev and OpenGL (e.g libgl1-mesa-glx and

       NOTE: Package names may not be absolutely identical to those above.

    2. Open a terminal and navigate to the directory you downloaded,
       or extracted, Heimdall to.

    3. Enter the following commands to compile Heimdall Suite:

            mkdir build
            cd build
            cmake -DCMAKE_BUILD_TYPE=Release ..



$ mkdir build
$ cd build
/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.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/  
-- 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/ (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/silosix/t/git/Heimdall/build
/build$ make
Scanning dependencies of target pit
[  3%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
[  6%] Linking CXX static library libpit.a
[  6%] Built target pit
Scanning dependencies of target heimdall
[ 10%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Arguments.cpp.o
[ 13%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/BridgeManager.cpp.o
In file included from /home/silosix/t/git/Heimdall/heimdall/source/BridgeManager.cpp:50:0:
/home/silosix/t/git/Heimdall/heimdall/source/SendFilePartPacket.h: In constructor ‘Heimdall::SendFilePartPacket::SendFilePartPacket(FILE*, unsigned int)’:
/home/silosix/t/git/Heimdall/heimdall/source/SendFilePartPacket.h:49:5: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     (void)fread(data, 1, bytesToRead, file);
[ 16%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/ClosePcScreenAction.cpp.o
[ 20%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DetectAction.cpp.o
[ 23%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DownloadPitAction.cpp.o
[ 26%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/FlashAction.cpp.o
[ 30%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/HelpAction.cpp.o
[ 33%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/InfoAction.cpp.o
[ 36%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Interface.cpp.o
[ 40%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/main.cpp.o
[ 43%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/PrintPitAction.cpp.o
/home/silosix/t/git/Heimdall/heimdall/source/PrintPitAction.cpp: In function ‘int Heimdall::PrintPitAction::Execute(int, char**)’:
/home/silosix/t/git/Heimdall/heimdall/source/PrintPitAction.cpp:142:3: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
   (void)fread(pitFileBuffer, 1, localPitFileSize, localPitFile);
[ 46%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Utility.cpp.o
[ 50%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/VersionAction.cpp.o
[ 53%] Linking CXX executable ../bin/heimdall
[ 53%] Built target heimdall
Scanning dependencies of target heimdall-frontend_autogen
[ 56%] Automatic MOC for target heimdall-frontend
[ 56%] Built target heimdall-frontend_autogen
[ 60%] Generating qrc_mainwindow.cpp
RCC: Warning: No resources in '/home/silosix/t/git/Heimdall/heimdall-frontend/mainwindow.qrc'.
[ 63%] Generating ui_mainwindow.h
[ 66%] Generating ui_aboutform.h
Scanning dependencies of target heimdall-frontend
[ 70%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/aboutform.cpp.o
[ 73%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Alerts.cpp.o
[ 76%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/FirmwareInfo.cpp.o
[ 80%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/main.cpp.o
[ 83%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/mainwindow.cpp.o
[ 86%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/PackageData.cpp.o
[ 90%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Packaging.cpp.o
/home/silosix/t/git/Heimdall/heimdall-frontend/source/Packaging.cpp: In static member function ‘static bool HeimdallFrontend::Packaging::WriteTarEntry(const QString&, QTemporaryFile*, const QString&)’:
/home/silosix/t/git/Heimdall/heimdall-frontend/source/Packaging.cpp:224:6: warning: ‘%07o’ directive writing between 7 and 11 bytes into a region of size 8 [-Wformat-overflow=]
 bool Packaging::WriteTarEntry(const QString& filePath, QTemporaryFile *tarFile, const QString& entryFilename)
/home/silosix/t/git/Heimdall/heimdall-frontend/source/Packaging.cpp:224:6: note: directive argument in the range [0, 2147483647]
In file included from /usr/include/stdio.h:862:0,
                 from /home/silosix/t/git/Heimdall/heimdall-frontend/source/Packaging.cpp:26:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:34:43: note: ‘__builtin___sprintf_chk’ output between 8 and 12 bytes into a destination of size 8
       __bos (__s), __fmt, __va_arg_pack ());
[ 93%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/qrc_mainwindow.cpp.o
[ 96%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/heimdall-frontend_autogen/mocs_compilation.cpp.o
[100%] Linking CXX executable ../bin/heimdall-frontend
[100%] Built target heimdall-frontend


Download PIT

  • when prompted, press VOLUP
  • goto Heimdall Frontend Utilities Tab
  • Click Detect
  • Click Save As..., give filename, then download


Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

This software is provided free of charge. Copying and redistribution is


If you appreciate this software and you would like to support future

development please consider donating:

Initialising connection...

Detecting device...

Claiming interface...

Setting up interface...

Initialising protocol...

Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.

Please be patient!

Session begun.

Downloading device's PIT file...

ERROR: Failed to send request to end PIT file transfer!

ERROR: Failed to download PIT file!

Ending session...

ERROR: Failed to send end session packet!

Releasing device interface...