Skip to main content

Samsung Galaxy S4 Upgrade

OK, I won't moan about the NSA and GCHQ snooping overreach anymore - just secure everything you do to keep them and any other computer criminals out of your systems...

One way to improve security, is to install a proper GNU/Linux Android system on your stock smart phone.  To do that, you need to have super user (The Linux administrator account is known as the root user) access.  The process is generally described as rooting your phone.

By default, most phone manufacturers disable root access, since they do not want to be faced with a support nightmare due to millions of clueless users messing up their phones.

Once you have root access, you can install different software applications and delete the crud applications that the phone comes with.

There are various ways to get root access - you can do a minimal thing and only create a root account and install one or two basic utilities for root access, or you can completely replace the half baked Linux kernel that you get with your phone with a proper one that already has everything set up - this is much easier - but may not work in your region.

This guide is for the delightful little Samsung Galaxy S4 Mini GT-I9192. For other phones, you could use the links below to start the hunt for the correct versions of software.  Don't use the code linked below for a different phone model.

Get a Samsung Update

The first thing to do, is to get the latest Android build from Samsung, so that you can roll the phone back when you mess it up - not if, when...

Some friendly folks keep them here:
http://samsung-updates.com/device/?id=GT-I9192

For example KSA-I9192XXUAMH3-20131101105408.zip, which is the Saudi version sold in the middle east.

Some unfriendly folks keep trying to shut this archive down for no good reason, so you may have to root around on the net to find it again if it would disappear.


Make a Windows XP Virtual Machine

Get Oracle Virtualbox from https://www.virtualbox.org/wiki/Downloads and an old Windows XP install disk image.  I happen to own about a dozen copies of XP, so I have enough to last me till the next century.  Newer versions of Windows are ridiculously slow and XP works fine on a VM.

Once you installed it and also installed Guest Additions, make a tar backup of the whole thing so that you never have to install it again when it gets messed up with crudware - just untar a fresh VM from backup.

All of this works purrfectly fine on my Mac Pro.

Get the USB Driver

You also need the USB device drivers for the phone.  These are contained in a terrible buggy and unusable program by Samsung called Kies, which you can get here:
http://www.samsung.com/ae/support/usefulsoftware/KIES/JSP

The program looks nice, but it tends to crash as soon as you try to do anything serious with it, which of course can be a disaster if it would do so while downloading code to the phone.  I think it is written with Microsoft dotNet, which would explain it all.

You have to download and install the whole catastrophe just to get the USB driver.  This is one reason why I play on a Windows XP virtual machine on Oracle Virtualbox.  I don't want to mess up a perfectly good real machine with cruft.

Get the Odin Downloader

You can get the excellent Odin downloader from the friendly folks at XDA from here:
http://www.devfiles.co/download/HfyuZUjP/ODIN_v3.07.zip

Try to find the latest version though.

Get a Full Featured Amestris Linux Kernel

You can get a real, honest to goodness Linux kernel from the friendly folks at XDA here:
http://forum.xda-developers.com/attachment.php?attachmentid=2466812&d=1387635358

This kernel was prepared by MJ Nazari - Thank you MJ!

Unzip it with 7-Zip available from the good blokes here:
http://www.7-zip.org/download.html

Download Mode - the Three Button Salute

Getting the phone into download mode is a little tricky.  First, you got to convince the darn thing to turn off.  If you press the Home button and it turns on again, then it wasn't off...
  • First turn the phone off
  • Press Home, Volume, Power at the same time
  • Then when the green screen comes up, let go and press volume up


How to get a Virtualbox Virtual Machine to see the USB connection

Virtualbox has a few funnies and if you just plug the phone in and try to connect to it, then you may get a message to the effect that the USB port is already used by someone else. To get around that, set up a USB connection Filter, so that it will connect the right way automatically.

  • Power off the Windows VM
  • Plug the phone USB cord in
  • In the Virtualbox machine Settings, select port, USB
  • Add a Filter for the Samsung phone
  • Unplug the phone again
  • Start the Windows VM
  • Log in as Administrator
  • Plug the phone in

Windows should now recognize it, but you may still not have the device driver.

Install the horrid Samsung Kies software to get the device driver.

Rooting Method 1

Install a root capable kernel

Now finally, you can run the virtual machine, log in as administrator, put the phone in Download Mode, plug the phone in, run Odin, wait for it to show a green [COM5], select the kernel in the PDA field and load the phone:
  • Download the .tar file to your computer
  • Power off your phone and hold the Volume down + Home + Power buttons simultaneously to boot into Download mode, then press Volume Up
  • Start the Virtual Machine and log in as Administrator
  • Connect the phone to your computer and wait a bit for the dust to settle in Windows
  • Run Odin, select the tar file in the PDA or AP field
  • Make sure F.Reset.Time option is unchecked
  • Click on Start and wait a while for the kernel to download and save to flash memory
  • When done, your phone will reboot by itself
Now you should be the proud owner of a Samsung phone with a proper Linux distribution on it that you can install secure software of your own choosing on and one of the new utilities on the phone should be SuperSU.

Rooting Method 2

Use Clockwork Mod (CWM)

If Method 1 above doesn't work for you, then try the CWM method described here:

The instructions in that posting are pretty clear, except for navigating the Clockworkmod application, which took some fiddling around.

The advantage of this method, is that you will still run the stock Linux kernel and other software for your region, so everything on the phone should remain working.

Firstly, if something goes wrong and you cannot get into the Recovery Boot program, simply reset Odin, redo the Download Mode 3 finger salute and download the Recovery Clockwork tar file all over again.  I had to try multiple times before I got the hang of it.  You really have to hold the phone in your left hand when clicking the Start button, such that you can click Up Volume with your left thumb and press Home with your right hand (the 2 Button Salute) as soon as the phone vibrates.

Navigate the Clockwork menus using the volume button up/down and select an entry using the Home button - go back with the soft Back button to the right of the Home button.  

You may need to search around a bit to find the zip file on the SD card.  Once you get it, click Home.  When it is done, go back up in the menus till you get to the Reboot option.  Once rebooted, you should be able to find the SuperSU application on the phone.

This method finally worked for me, on my UAE (Saudi Arabian region) phone.

Problems

When the going gets tough, the tough gets going

Half the fun is dealing with all the problems - you certainly need to have a sense of Geek adventure for this process.

If the phone gets messed up, try again, or roll back to the Samsung stock regional version downloaded above.  Provided that you start off prepared and save a stock kernel for your regional carrier, you should not have to go and buy a new phone when things go south.  Well, let's hope so anyway.

On my first try, a few days ago with a completely different rooting method, the WiFi didn't work.  On my second try as above, the Cellphone network didn't work anymore, but WiFi worked fine - sigh.  However, after I reloaded the stock Saudi Arabian kernel yet again, the device worked again, so one can always roll back to the (unrooted) Samsung stock version.  The Clockwork Mod method finally worked and got my phone rooted successfully.

Once rooted one way or another, you can go and get Cyanogenmod (http://www.cyanogenmod.org/) or ParanoidAndroid (http://forum.xda-developers.com/paranoid-android) and change the whole look and feel of your new toy and install Orbot, Orweb, Chatsecure, SSH Autotunnel, SSH/SFTP Server, Terminal Emulator and other security applications to give the NSA/GCHQ/CSE the Salmon Arm Salute (http://toronto.ctvnews.ca/one-finger-salute-crude-to-ont-film-review-bd-1.368040).


La voila!

Herman

Comments

Popular posts from this blog

Parasitic Quadrifilar Helical Antenna

This article was reprinted in OSCAR News, March 2018:  http://www.amsat-uk.org If you want to receive Satellite Weather Pictures , then you need a decent antenna, otherwise you will receive more noise than picture. For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern .  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls. The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well understood. Therefore,

Patch Antenna Design with NEC2

The older free Numerical Electromagnetic Code version 2 (NEC2) from Lawrence Livermore Lab assumes an air dielectric.  This makes it hard (but not impossible) for a radio amateur to experiment with Printed Circuit Board Patch antennas and micro strip lines. Air Spaced Patch Antenna Radiation Pattern You could use the free ASAP simulation program , which handles thin dielectrics, you could shell out a few hundred Dollars for a copy of NEC4 , You could buy GEMACS if you live in the USA, or you could add distributed capacitors to a NEC2 model with LD cards (hook up one capacitor in the middle of each element.), but that is far too much money/trouble for most. More information on driving an array antenna can be found here: https://www.aeronetworks.ca/2019/03/driving-quad-patch-array-antenna.htm l Air Dielectric Patch   The obvious lazy solution is to accept the limitation and make an air dielectric patch antenna. An advantage of using air dielectric, is that the antenn

Weather Satellite Turnstile Antennas for the 2 meter Band

NEC2, 2 m band, 146 MHz, Yagi Turnstile Simulation and Build This article describes a Turnstile Antenna for the 2 meter band, 146 MHz amateur satcom, 137 MHz NOAA and Russian Meteor weather satellites.  Weather satellite reception is described here .  A quadrifilar helical antenna is described here .   Engineering, is the art of making what you need,  from what you can get. Radiation Pattern of the Three Element Yagi-Uda Antenna Once one combine and cross two Yagis, the pattern becomes distinctly twisted. The right hand polarization actually becomes visible in the radiation pattern plot, which I found really cool. Radiation Pattern of Six Element Turnstile Antenna Only a true RF Geek can appreciate the twisted invisible inner beauty of a herring bone antenna... Six Element Turnstile Antenna Essentially, it is three crosses on a stick.  The driven elements are broken in the middle at the drive points.  The other elements can go straight throug