 Hi, and welcome to another video on flashing a free operating system on your mobile phone. In this video we are going to flash a Samsung Galaxy S4 with Linux OS. Linux OS is an Android distribution that supports a large number of devices and is one of the most popular custom operating systems for Android devices out there. To find out more about the motivation behind this video and about our campaign, you can go on the campaign website OpscyclingAndroid.com. So the first thing we have to do is click on Get Linux OS. We have brought to the devices overview page. And then go to our device model, in our case we have Samsung Galaxy S4. And the model number is IGT-I9505. So we click on the device, we brought to the devices info page. And the first thing we are going to do is to download the factory images. So this is done by clicking on Get the builds here. And then downloading both the factory image, which you see I've already downloaded to speed up the process and downloading the recovery image, which I've also downloaded. And what we can do additionally is to download the checksum files. So this you would want it to save and just prepend something like SHA256, I mean I prepend something and then click on Save. And you see I've already done this as well, just say replace but these are very fast downloads because it's a small file. So once we've done this we go to installation and a warning box tells us to follow these installation instructions step by step precisely. And okay so going through the basic requirements we need one to read through the instructions at least once. Then secondly make sure that our computer has ADB and fast boot installed, so the Android SDK to actually communicate, be able to communicate with our computer. And then third, enable USB debugging on the device and then make sure that this is actually the right model that we want to install a custom operating system on. And to check that we can actually use the phone in its stock operating system and everything works. And sometimes you should download the latest factory image from Samsung in this case to also make sure that you have the latest firmware installed. And then sixth, if anything breaks then sure as it's not responsible. Now we can click on show instructions and the first thing we notice is that actually these installation instructions only work for Windows PCs and I'm not a new Windows PC, I'm using a Linux PC here. So since I can't follow through and download ODIN which is a Windows program that allows to communicate with the device while it's in download mode, which is kind of a similar thing to fast boot mode on Google Pixel devices, I'm going to find a page that shows the installation instructions for Linux PCs as well. So we need to go back to the linuxOS.org homepage, click on get linuxOS again, show discontinued the devices and go to the Samsung topic and then scroll down a bit and we're looking for a phone that is similar to ours and has a different installation instructions page and I just happen to know that GT-I9506 doesn't use ODIN to flash the operating system and clicking on installation and show instructions, we see that instead of ODIN, in this case Heimdall is used to communicate with the device from the computer and Heimdall is a cross-platform and open source tool for interfacing with the download mode on Samsung devices and it's available on Linux. As you can see I've changed the window configuration, so now we have on the right hand side a webcam feed showing the device, the Samsung Galaxy S4 and on the left hand side still the installation instructions open. So we're going through the basic requirements quickly again, we should really make sure that we have ADB installed and I already set that up on my computer, if you haven't done so then you can follow instructions by clicking on the here word and the third point is to enable USB debugging on your device, I will quickly show that to you. So from the lock screen we unlock the device and we go to settings and on more we scroll down to about device and then at the build number we click as many times as we need or we touch it as many times as we need to become a developer and now the developer options menu is unlocked which when we click on we see after debugging USB debugging which we will enable by pressing OK. Now that we've got the basic requirements out of the way we'll go to preparing for installation which in the first step requires us to install the Heimdall suit. Since I'm on Linux I follow these instructions and after downloading the Heimdall suit to install it and we can verify that Heimdall is indeed installed by running Heimdall version in the terminal Heimdall version which shows we have Heimdall 1.4.2 installed. In the second step we're going to power off the device and boot it into download mode so powering off the device just by holding the power button and power off and now with the device powered off we hold the volume down, the home and the power button. So we are shown a different screen which reads volume up, continue, volume down, cancel. So we'll proceed with volume up and now we've successfully booted the phone into the download mode and the third step we can skip since it's only for Windows users and in the fourth step we make sure that Heimdall is indeed being able to communicate with the phone by connecting a USB cable to it and the computer. Now that we've connected the USB cable we go on the terminal and type in the command Heimdall print pit. So this is outputting some information about the partitions on the device and what images are installed on them and then rebooting the device. So indeed the device rebooted and we can say that Heimdall is installed and working properly. Now that the device rebooted into the system we can proceed with the section on installing a custom recovery using Heimdall. In the first step we download the custom recovery image, in this case not TWRP but the nearest OS's own recovery image. Since we've already done that we just have one additional step to do and it is to actually verify that we've downloaded the tracked file using the checksum image file. So image.char256 and it spits out okay so we can be sure that we don't have a corrupted image file. In the second step we're going to power off the device and boot it into download mode. You've always seen this before so just unplug the USB cable before and then pressing the power button power off confirming and now that it's powered off we press the volume down home and power button together simultaneously and we see this familiar screen. Press the volume up button to boot the phone into download mode and insert the USB cable into the device again. I'm now issuing this Heimdall flash command which I'll copy over to the command line and we still have to change the image, the recovery file name and this should be the correct file name and pressing enter to issue the command and on the device we see a blue transfer bar appearing and now it's full. Going back to the installation instructions it tells us that indeed this blue transfer bar shows us the recovery image being flashed and now that it's full it's fully flashed and what we're going to do next is unplug the USB cable from the device and then manually reboot the device into recovery and on this phone we have a removable battery so we're going to remove the case and take the battery out. Now as I told you before these are not the device instructions for the actual model I have here and indeed they differ in how they can be booted into recovery mode so if you go to the actual device installation instructions page we see that with the device powered off we need to hold the home volume up and power button and then let go of the power button immediately when the phone vibrates but keep holding the other two keys and this is different from the installation instructions we have been looking at the whole time so putting the battery back in we hold the volume up the home and the power button and as soon as the phone vibrates we let go of the power button so this brought us to the recovery image to the recovery system and we have a few options here so going back to the other installation instructions page we will install lanyardOS from recovery so we've already downloaded the lanyardOS installation package just need to verify that we actually downloaded the correct file so the chart 256 some command again and this time we verify the factory image file which tells us okay so we've actually downloaded the correct file and it's not corrupted and second step basically tells us if we're not in recovery we should reboot it into recovery but we already in the recovery mode and next we're going to factory reset the phone and format data format data slash factory reset so this is again different from the installation instructions page we're looking at but on the previous on the actual one we see that yeah we should tap factory reset a menu option and then select format data slash factory reset and now we can side load the lanyardOS zip package by going back to the main menu and then selecting apply updates and then apply from adb and now we can plug the usb cable back into the device and now on the computer in the terminal we side load the factory image so adb side load okay this should be doing the trick and now in the terminal you see the progress and this is going to take a while to actually side load this image this the zip package now that the flashing processes has completed we put back into the recovery interface and going back to the installation instructions the sixth the sixth step is optional namely flashing some some add-ons we don't we don't flash any add-ons here and since everything is installed correctly we click on the arrow back button and select reboot system now which can take quite some time as you see in the box the first boot usually takes longer than 15 minutes depending on the device okay so there you have it we unplug the usb cable we should also not forget to she put the case back on and we agreed it with the hos creator which will help us set up the device i hope you enjoyed this video and see you next time