Schlagwort-Archive: samsung s7 heimdall

LineageOS at Samsung Galaxy S7

In this blog I want to descripe my experience to flash a Samsung Galaxy S7 with a LineageOS. Why a old S7? Because you can get a lot of Accessories like bumber cases or armored display protections and the costs are reasonable in relation to technical specifications. And the main reason is that you can get fully developed mods like LineageOS. I’ve had more smartphones in the past e.g. the sony experia Z or the sony experia Z3 – all flashed with cyanogenmod you can compare nowadays to LineageOS. Sony supported in former times a innovative „open device“ program and installed a default recovery image. yes, you lost support but you got a possibility to flash Android without tricky preperations. Please read the computer news for this historical stuff.

I can say that all flash operations with former sony were tricky. No one time was flashing withouth problems. For example on experia Z i installed cyanogen – so far so good – and after this i crypted the internal store. finally, through the encryption, the system was not able to decrypt the file(s)  with provider data. I had a smartphone just only for data connections…  i had to make the decission to use a young and buggy „nightly“ version, that was the solution – and so on!

So i decided to use a samsung s7 for the next years. And because i got a lot of errors the last 2 weeks: here is the progress of flashing and a possible solution that worked for my devices.

Please understand this blog as a part or as addition-blog to the official sites of LineageOS. If you are localized in DACH and can not go on with english sites, just take a translational software like google… (Sollten Sie der engl. Sprache nicht mächtig sein, kopieren Sie den Text einfach in einen Online-Übersetzer wie google…)

I will take no warranty to steps you will do basically at this howto. See it like a additional summary of experience.

Requirements -what do you need?

  • Unboxed Samsung Galaxy S7 type G930F
  • The original USB-Cable of your box (so you can exclude test procedures)
  • Load the battery nearly full to 100% (some devices are just flashable with a high battery status)
  • Put in a large SD card with min 16 GB of size
  • 1 day of free time

First Todos

  • Switch on the S7, step through the starting procedure
  • go to Settings an switch the developer mode on with tabbing at lesat 7 times to the build number in the smartphones properties
  • now you can see the developer mode options in the settings
  • go there to the dev options
  • set OEM dislocking ON, USB Debugging ON
  • shut down the device

What does the common LineageOS say?

At first, go to the official site of LineageOS and read the manual steps. As a summary, you can say that there are three steps. Samsung provides the flashing of there devices. And this is the first step: there is a small part on your smartphone like a bootloader with name „Download mode“. This software package does have no really usable functions but you can start it if you press on the switched off device three keys together: VOL-DOWN, HOME-BUTTON and SWITCH-ON-BUTTON. After seconds you will reach the „Download mode“. Accept the warning and you will see a screen it seems to be waiting for a action from outside the smartphone. You can restart the download mode at every time: just hold the three buttons again and you will see that the device is rebooting – hold further on the buttons and you will land in the same screen again. Easy. But as I say, the „Download mode“ can nothing as download something. Here is the second step: you have to change this part of software with a software with more functions. I have used the flash custom recoery of the TWRP (called: Team WIN)  group.  This custom recovery software does have more functions as the default samsung part. LineageOS does descripe this step with Team Win too. And with the software we reach the third step: change the OS.

First problems – the connection with the device.

My first problem startet with step 1: to transfer the custom recovery flash to the waiting device was not doable. The LineageOS manual said: use the haimdall-Suite to install driver and transfer the image. Installing the driver should be possible with another software programm called zadiag.exe which is a part of the heimdall suite. In summary, that was the problem. The manual said: as a driver use the samsung usb composite device and if you will not find this one, try the gadged serial device in zadiag  to install the driver. For my part i took the gadged serial one because there was no stuff like samsung… After installing the driver, you can simple test the connection with the command heimdall device for detecting and then heimdall print-pit   to download the device specificatio (by the way: just use the –verbose parameter to ge a more detailed log). I got this errors and warnings: „ERROR: Failed to access device. libusb error -12“, „WARNING: Control transfer #1 failed -1“, „ERROR: libusb error -7 whilst receiving packet -7“. With the -7 error it came: „ERROR: Failed to receive PIT file size!“ and „ERROR: Failed to download PIT file!“. In my environment worked the libusb0-driver with the „best“ results: the s7 was detectable but print-pit said 6 warnings with control transfer failed. The other 2 drivers stopped working at „initializing“ status. I have tried more days and many hours to go find a solution. I have tried a virtualbox with a old windows xp and a windows 7 32bit and of course a windows 10 64bit, too. I read a lot of internet articles about thes three errors: -7, -1, -12. Many others had same problems but no finally solutions. The advices hang around: Change the cable, try to reboot several times, load up the battery. At the end, i did a really complex-structured trial-and-test day just find a solution. My opinion now go around the operating system. The main problem is: the device is findably with the „device“ parameter but you can get no transfer-connection the it. probably it should work if you have physical windows 7 with 32 bit with unlocked driver signature surveillance.

The solution – change the transfer software

In my case, through reading many sites i find the TWRP group. As i mentioned above, they developed a custom recovery suite to change the default of samsung and replace it with a more functional flash part. TWRP just not only give the image, they developed a transfer software called ODIN (like heimdall), too. I have downloaded the ODIN 3.12.3 and started it and plugged in the AP-Box the TWRP-Tar-Image file (you can find it here – btw: „herolte“ means the S7, like a developement project name)

thomas-zehrer-de_ODIN-Transfer-Herolte-TWRP-Image

As i said, the phone was with the default image in waiting status. Then START and without problems, i transfered the image to the smartphone. SIMPLE. READY. NO PROBLEMS! Why? The connection should be realized through the former installed Samsung Composite Drivers.

First Restart

After this, i restarted the device by holidng VOL-UP, HOME-BUTTON and SWITCH-ON-BUTTON and got to the new Image of TWRP. Here you can see a screenshot from ther HP.thomas-zehrer-de_twrp-software-image

There are a lot of functions to do. At first, you should make a backup with go to Backup-Tab and swipe a backup to the external card. Takes about 2 hours. At second, wipe the complete storage with Wipe and Advanced Wipe.  Choose “Davlik Cache”, “System , Data”, “Cache”, “Android Secure” and swipe the wipe button. Takes about 10 minutes. Now, you can start your phone in default Waiting Mode with VOL-DOWN + POWER + HOME and in the new TWRP recovery Image with VOL-UP + POWER + HOME. From here you can later start some nice features: backup a complete image, go to the encrypted store, copy files… – all possible with adb.

Last step: Transfer the LineageOS to the phone.

Go to Advanced and set the device to listening mode again. Its called sideload. With the sideload mode you can transfer from your pc or laptop a file for installing to the device, similar a waiting status. Now you need on the windows side a Android well knows software called „android debugging bridge“ or adb. Just download this part from google site and start the command line like this: adb sideload LineageOD.zip – you can see the transmission from windows to the S7 on booth sides. After this go to to restart and restart the device. The new Image will be rolled out.

Summary

Finally, it worked for me. You need a sum of software and todos, i try to list it. so i did not use the heimdall suite. (the links are working at Jan, 19, if you need the files: just contact me).

  • At first the Samsung Composite Drivers from here and install this ones at your windows system.
  • Then create a directory and download following files:
    • The herolte Image: the alternative custom image of TWRP as a tar-File
    • The ODIN-Software to transfer the herolte image-tar-File
    • The ADB Suite (called android plattform tools) for transfering the LineageOS to the device and unpack it.
    • The LineageOS package from the website and copy it in the same directory as the adb.

Then set your phone in listen mode, start ODIN, choose in AP-box the tar-file and send it. Then restart phone holding three buttons VOL-UP_POWER_HOME and the TWRP recovery is starting. Do a backup of your current system, format / wipe the storage and set the device in sideload mode. Do in your windows the adb sideload command and transfer the image to the device.

So flashing a device can make a lot of fun because you learn a lot of your device. What could be the next steps after flashing? Crypting the storage, loading apps from f-droid. You have a unbounded fresh Android with no needless apps you never use or need.

Have a nice day.