Sunday, March 16, 2014

Cyanogenmod 11.0 (KitKat 4.4) on Samsung S3 Mini

Maclaw & Marcin have done a lot of good, hard work to port cyanogenmod (CM) to the ARM processor used by my phone, the Samsung SIII Mini (GT-8190N). I'm not deep into the whole android scene, but from what I gather, cyanogenmod is basically a modified and enhanced version of the core open source android software which is released by Google. It keeps up to date (meaning I was able to install the latest version -- Kit Kat), and replaces some proprietary software provided by Samsung that was less than optimal (in particular the Radio Interface Layer [RIL] which was been shown to have a pretty major backdoor).  The main downside on my phone is that there is no Near Field Communication (NFC) support, something my version of the S3 Mini does have; however I don't currently anticipate using it so no biggie.

CM also adds "privacy guard" which allows the user to control permissions on a per-app basis (ie, one can choose to not allow Facebook to access ones contacts or location, while still allowing google maps to). I find it very troubling that Google did not include this in the first place (in fact, the software exists and was removed by Google when kit kat was released). I understand that Google's value-add is to piece together many bits of information about users and the world as possible. But users should have a say in this as well, not to mention that even if users trust google with this information, it doesn't mean they trust all app developers, even if they still want to use their apps!

Anyway, I found it worth using, and so this post is about how to install CM on the GT-8190(n).

0) Backup your apps using Titanium Backup, and other things (contacts, SMS, call logs, etc.) using Super Backup. Titanium backup will need developer options/USB debugging enabled: Go to Settings->About phone. Tap on Build settings 7 times. Then return to settings, go to the new Developer options menu and select to allow debugging. The non-obvious trick with Titanium is that you can do "batch actions" by using the menu button on bottom left, this allows you to backup all apps+data, eg. These should be on your external SD card and, to be safe, also your PC. Also enable Google storage of app settings from within your phone's Settings->Backup & Reset. Save any photos on internal storage to your computer. Finally, save the Launcher's layout (in Nova, use Nova Settings to save to SD card), and backup app settings to SD card (in my case, K9, DoggCatcher and iNotes definitely need backup if not using Titanium, and they may need to be moved to the SD card).
1) Make sure you have samsung's USB drivers installed
2) Get Odin_golden from Novafusion.pl's downloads; unzip it.
3) Go to Maclaw's download page and get the latest nightly build of CM [Select the ODIN link next to the download -- you should get a .ODIN_TWRP.zip file!], after verifying that it appears to be stable by reading the comments. The release notes always say it is stable, which is something of a running joke. It is changing constantly, and mostly getting better, but sometimes things break that you need, so it's best to check first. Then unzip the file to a temporary directory. Get the latest Google apps .zip from here, choosing the package you want (I use "full"), and copy that zip to the SD card on the phone. You may want to de-select some of the apps in the package you selected, by creating a gapps-config.txt file in the same directory as the .zip on the SD card, listing the apps you don't want (with no spaces in the names) one per line. To be sure of their names, you can install it once and have a look at the pa_gapps_log.txt file that is created (then rinse and repeat). Disconnect the phone from the PC.
4) Run Odin from the directory you unzipped it to; click PDA and find the .tar.md5 file you just created. It should verify the hash code. Now power off your phone. At this point, press and hold the HOME, VOLUME DOWN, and POWER buttons until you get a warning screen.  Plug it into your computer and press volume up to continue. At this point ODIN should recognize the phone and you can begin the flash process by pressing Start.
5) Once complete, the phone will reboot. When you see the samsung logo, Press and hold the HOME, VOLUME UP, and POWER buttons. The Samsung welcome screen will flash twice and you finally come to the blue teamwin TWRP recovery screen
6) If this is the first time you've installed this version of CM (eg, 11.0), then do a complete wipe of the phone; it is worth changing the file system for cache and data to f2fs when you do this, by selecting advanced wipe->change filesystem. Otherwise, you shouldn't need to wipe unless something strange has changed between versions; however to be safe you could wipe "Dalvik cache" and "cache" after the next step (7).
7) Next, still in TWRP recovery, install app, and select the google apps zip you put on the SD card. Finally, reboot.
8) Now you should be back to your phone. It's time to get it working again. First, enable your google account in Settings->Backup & Reset; in order for it to have an effect, it must be enabled before you install apps (if you did a complete wipe, you can instead do this during the setup process at first startup). Next, use Google Play to install Titanium backup and set the backup location to point to your ext. SD card. Batch action to restore apps with data (then all the configurations you had before for those apps will be magically restored). Don't forget to restore Super Backup and restore contacts/SMS/call logs.
8b) If not using titanium,or if you didn't do a complete wipe, you may also need to restore many apps' settings - at least Nova desktop, K9, DoggCatcher, iNotes in my case.
9) To use the FM radio, install the app Spirit FM (download the free version from here) if you haven't previously, as the samsung radio app will be missing.
10) It may be advisable to update the baseband from samsung as well; for GT-8190N they are available here and can be installed using TWRP- copy the zip to the phone, and select install from TWRP, then reboot twice; this may improve radio performance and possibly also battery life. At one point my phone was rebooting during phone calls, and this fixed it.

You should be up and running. Enjoy your faster, safer, cleaner phone!


Edit: Revised to use titanium backup and the latest google apps package as of Feb, 2015.