Register

The Newbie's Guide to Hacking the Galaxy Nexus

This is a discussion on The Newbie's Guide to Hacking the Galaxy Nexus within the Galaxy Nexus Hacking Guides forums, part of the Galaxy Nexus Development category; The Newbie's Guide to Hacking the Galaxy Nexus (c) 2012 by Seriana. GPLv3. Table of Contents Introduction The Galaxy Nexus Tools you need on the ...

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55
Like Tree14Likes

Thread: The Newbie's Guide to Hacking the Galaxy Nexus

  1. #1
    Milky Way
    Member #
    1985
    Liked
    15 times
    Join Date
    Dec 2011
    Posts
    38

    The Newbie's Guide to Hacking the Galaxy Nexus

    The Newbie's Guide to Hacking the Galaxy Nexus
    (c) 2012 by Seriana. GPLv3.


    Table of Contents
    1. Introduction
    2. The Galaxy Nexus
    3. Tools you need on the PC side
    4. Tools you'll want on the Android side
    5. Booting
    6. Unlocking
    7. Rooting
    8. Installing custom ROMs
    9. Backups
    10. Restore to stock
    11. Common Problems
    12. Miscellaneous
    13. Glossary
    14. Suggested ROMs
    15. Changelog



    1. Introduction

      Me: I'm an Android newbie. I'm a hardcore techie and an iPhone jailbreaking veteran, but it took me a bit to get comfortable rooting my new Nexus. While there are a lot of how-to tutorials that explain HOW to root the thing, I didn't find a good comprehensive explanation of how all the pieces fit together. Everything here I figured out in the last few days from scattered bits on the web and lots of experimentation.

      You: You're an Android newbie too! You're fairly technically proficient, and you know some Linux basics. You want to open the hood of your new toy and start tinkering, but you're not quite sure where to start.

      This guide: This is where I dump my brain into yours. I'm going to focus on conceptual understanding rather than creating another how-to guide. If I do it right you should be able to go from brand-new-stock to running custom ROMs without needing step-by-step instructions.

      Again, I'm a newbie too, just with a few days' more experience than you. If the guide is wrong or incomplete, please leave a message in the comments and I'll fix it!



    2. The Galaxy Nexus

      This is written for the Galaxy Nexus LTE (Verizon), codename "toro". The GSM version is the "maguro" and will need different images - look for the "toro" in filenames and know that you need "maguro" (or otherwise labelled GSM) versions instead. Much of what I'm writing is probably applicable to other Android devices as well, but I have no other Android experience to tell you how different it will be.

      Naming:
      Code:
      Model      Name   Device  Board  Radio
      ---------  -----  ------  -----  -----
      SCH-i515   mysid  toro    tuna   LTE
      SCH-i9250  yakju  maguro  tuna   GSM
      [INFO] Galaxy Nexus Versions - xda-developers

      The Galaxy Nexus is unusual because it does not have an SD slot. Instead everything goes into the userdata partition, and there's a virtual /mnt/sdcard AKA /data/media AKA "What you see when you plug in the USB cable". The stock recovery image will wipe this if you do a wipe/factory reset. Fortunately ClockworkMod Recovery (described below) is smarter and will preserve this data for you.

      The Galaxy Nexus's flash is divided into partitions. Here are some important ones:
      Code:
      name      size    mountpoint  purpose
      --------  ------  ----------  -----------------------------------------------------------
      system    643MiB  /system     the system software installed on your phone: "The ROM", RO
      recovery  12MiB   N/A         A self-contained alternate system (kernel, initrd, root fs)
      userdata  28GiB   /data       Where all your stuff (apps, docs, etc) goes, RW
      cache     425MiB  /cache      Scratch space used by apps.  For instance, map tiles.  RW
      boot      8MiB    N/A         The main kernel and initrd used when booting normally

    3. Tools you need on the PC side

      fastboot - This is used to USB-upload a new image (.img type) to any of the above partitions when you're in the bootloader (power on by holding all three buttons until you feel the bump, about 10s). It's also used to unlock the bootloader.
      Fastboot - CyanogenMod Wiki

      adb - Android Debugging Bridge. This allows all kinds of useful functions over USB while the main system is running and USB Debugging is enabled (Settings > Developer Options > USB Debugging). You can: get a shell, transfer files in or out, install packages, reboot into the bootloader or recovery, and much more.
      ADB - CyanogenMod Wiki

      You get both with the Android SDK. Some rooting kits will include a copy of them as well. You'll definitely want both for your tinkering pleasure.
      https://developer.android.com/sdk/index.html

      Samsung drivers
      Samsung

      You can get it all with Wug's Galaxy Nexus Root Toolkit, which lets you install it all with one click. It also lets you root the phone with another click, but once you have all the pieces installed it's easy and educational to finish rooting by hand.
      Galaxy Nexus Root Toolkit | WugFresh



    4. Tools you'll want on the Android side:

      su and Superuser.apk - Installing these is the core goal of rooting. su is the command line version; the apk is the GUI package. They usually come together as su.zip .
      Superuser

      ClockworkMod Recovery (CMR) - This is an alternate recovery image. You flash it to the recovery partition with either fastboot or ROM Manager. It has many essential features that let you backup and restore (NANDroid disk-image type), wipe the device WITHOUT wiping the userdata (the factory recovery wipes it all), install new ROMs (.zip type - it formats the /system partition and unzips the new software), and more.
      http://download.clockworkmod.com/rec...5.0.4-toro.img

      ClockworkMod Recovery Touch (CWMR Touch) - Aside from adding touchscreen support, this also improves the hardware buttons. The Nexus's buttons are bouncy and often skip several entries, and if you bounce them really good it will even disable them. CWMR Touch fixes these problems. It also uses a larger font which is nice for the very high DPI display on the GN.
      [Recovery]Touch Based ClockworkMod Recovery - RootzWiki
      http://dl.dropbox.com/u/3727513/cwmr...beta5_toro.img

      ROM Manager - This lets you control many functions of CMR from inside the regular OS, which is a little easier because CMR doesn't support touch. Automates downloading some ROMs, lets you run backups, lets you install new ROMs from a .zip, and allows you to flash CMR. For a few bucks you can get the "Pro" version which allows scheduled backups and other premium features. You can install it from the Marketplace.



    5. Booting

      The normal boot process: Power on > bootloader > kernel > initrd > mount root > everything starts up.

      Power on to bootloader: Hold all three buttons (vol+, vol-, power) until you feel the bump. The bootloader starts and gives you a menu. Go up and down with the volume keys, and press power to select an option.

      Recovery: Power on to bootloader > select recovery > recovery system loads > initrd > recovery menu.

      Flashing: Power on to bootloader > Use fastboot on your PC.



    6. Unlocking

      Unlocking just means flipping a bit so the bootloader will allow you to upload new images.

      Everything gets wiped when you do this, so back everything up first. This is the first thing I did with my phone so I didn't research pre-rooting backups, but generally: sync all your contacts and bookmarks to Google; copy all your files off to your PC; dig around and find if there's anything else you need to save.

      The Nexus is very brick-resistant. No matter how badly you screw things up the bootloader will allow you to fix it. Since the Nexus bootloader can be unlocked, you will never have to reflash it with a hacked one, which would risk bricking the phone if it went wrong.

      When you're ready, here's the magic: Power on to the bootloader (see Booting), then "fastboot oem unlock".

      You'll have to confirm that this may void your warranty. Yes, software can break hardware (something that cycles the battery excessively will wear it out; overclocking or overvolting will run the CPU hotter; flashing a defective baseband could fry the radio; etc), but most of the things we play with are safe.



    7. Rooting

      This is where you gain root / superuser access. This will let you (and apps that you permit) modify anything on the phone instead of being stuck in the safely padded playpen of the regular user account.

      You just need to get su and Superuser.apk installed in your /system partition. Unlock as above, then:

      Option 1: Manual (What I did my first time):
      • Copy su.zip to the userdata partition (just drag and drop it into your phone's storage)
      • Install CMR: Start the bootloader, then "fastboot flash rescue recovery-clockwork-5.5.0.4-toro.img"
      • Restart the bootloader > "Recovery mode" > "install zip from sdcard" > You can figure it out from here.


      Option 2: Automatic: "fastboot boot boot.superboot.img". I haven't tried it myself.

      Option 3: Install a custom ROM (/system image) that already has su and Superuser.apk installed. This is what I do now.



    8. Installing custom ROMs

      This is where you wipe out the read-only /system partition and flash a new one. These are usually distributed as .zip files. They contain the files for /system, sometimes some stuff for /data, a script to perform the installation, and a few other things.

      You don't have to unzip them and fool with the contents. Just copy them to the virtual SD card, reboot into ClockworkMod Recovery, wipe /data and /cache, then install the .zip file.

      The reason for the wipe is sometimes the new software isn't compatible with the old data. Fortunately you can restore your apps and data after imaging. Titanium Backup is the most popular technique, but there are others. The important thing is it's a file-level backup - I think the idea is to preserve things the new ROM installed in the /data partition.

      There are also other less-common methods to install a ROM. I'll write it up if I ever end up using them.



    9. Backups

      Do it before you regret it. I did my first one immediately after installing CMR. It's nice being able to go right back to stock, though you still can even without your own backup - you can download stock images and install them with fastboot.

      Backups come in two main flavors, just like on PCs: system images and file backups.

      Type 1: system images, AKA "NANDroid"

      System images are nice because after screwing stuff up you can just restore the image from some point in the past and everything will be just like it was before in one easy step. This technique is performed by booting in to ClockworkMod Recovery. The restore is also done through CMR which is really handy if you break things so bad you can't boot the system. The backups and restores can also be initiated using ROM Manager when things are working.

      After you back up your virtual SD card will have a "clockworkmod/backup/<date and time>" directory. Inside that you'll find these files:
      • cache.ext4.tar
      • data.ext4.tar
      • system.ext4.tar
        Each is a Unix tar archive of these partitions. It's like a zip file except it stores Unix ownership, permissions and special files (like the stuff in /dev) in addition to the regular files.


      • boot.img
      • recovery.img
        Raw block copies of these two partitions.


      • nandroid.md5
        Checksums for all the above to ensure they're correct before you restore.


      So as you can see, this is a very comprehensive backup type. After restoring EVERYTHING will be back the way it was except for /mnt/sdcard AKA /data/media AKA "What you see when you plug in the USB cable". The downside to this technique is they're pretty big (about 500MB) and your phone has to reboot into recovery each time you make a backup. On the other hand we have a generous 32GB of flash and it only takes a couple minutes. You should always run one before trying out a new ROM.
      Type 2: file backups - Titanium Backup and ADB backup

      This technique grabs all the applications and their settings from the /data partition and copies them into "Titanium Backup" in the virtual SD card. If things go wrong you restore everything by wiping everything, reinstalling the ROM image (recreating /system), redo the first-time setup, reinstall Titanium Backup from the market, and having it restore everything.

      Another variant of file backups is to use ADB: "adb backup -f today.ab -apk -all" will create a "today.ab" file that you can restore with "adb restore today.ab". Just like Titanium, this will have all the apk files and user data but it won't contain a /system image.


      Personally, I use NANDroid backups for all my actual backups, and I only use Titanium Backup when migrating between ROMs.

      Last bit: NANDroid and Titanium both save things to your virtual SD card. You should drag and drop these backups from your phone to your PC. That way if you lose the contents of the SD card (factory reset, lost phone, whatever) you can get it back. CMR takes care to preserve your virtual SD data, but Stuff Happens. Back it up.



    10. Restore to Stock

      I'd like to write this up in more detail, but until I do, here's a guide:

      [HOW TO] Unroot the VZW GN, Re-Lock the bootloader and Start Factory Fresh



    11. Common Problems

      "Unfortunately, the process android.process.acore has stopped."
      acore is responsible for your contact data. Some ROMs have incompatible versions of the database which is why they recommend wiping /data . You will get this error if you don't wipe or if you do a file-type restore which includes the contact data. The fix is easy: keep dismissing the error and go to Settings > Accounts & sync > toggle to "Off" > back > Apps > All > Contacts Storage > Force Stop > OK > Clear Data > OK. Reboot, re-enable sync, and all your contacts should sync back from Google and be stored in a compatible format for your ROM. I went from from Revolution 2.1.2 to Axi0m 2.4 with no wipe at all and this is the only fix required so far.


      CMR / ClockworkMod Recovery keeps disappearing every time I reboot!
      Or: I have anandroid with a red exclamation point when I try to boot into recovery!
      Factory ROMs (and some lightly-modified derivatives) re-flash the recovery image with the factory one every time they shut down. If you're stuck there, click all three buttons to get free and shut down, or just pull the battery. Flash ClockworkMod Recovery again from the bootloader using fastboot. Then rename or delete /system/recovery-from-boot.p to prevent it from happening again.



    12. Miscellaneous
      To change the DHCP hostname from android_big-hex-string, put "net.hostname=new-hostname" in /data/local.prop . Many other things can go in there - see 'getprop' and try setting them with 'setprop'.


    13. Glossary

      AOSP Android Open Source Project - This is the unmodified Android platform from Google. This only includes the open source components of Android, so a pure AOSP build will not include Google's closed-source apps like Calendar and YouTube; see also GApps. Many ROMs are based on starting from AOSP, optionally making some changes, then building everything - a true "from scratch" approach.
      boot.img This is what goes in the boot partition. It consists of: header, kernel, ramdisk, optional second stage.
      https://github.com/android/platform_...timg/bootimg.h
      Busybox The standard Android system is fairly sparse and lacks many of the standard utilities that are taken for granted on a Unix system - grep, find, less, and so on. Busybox is a popular way to get the standard collection installed on an embedded system by compiling them into a single statically linked binary, avoiding the problems of missing or conflicting system libraries. All the commands are then created as symlinks to the busybox binary, which then takes on the personality each program as those links are run. Most custom ROMs include Busybox, but you can also install it from the Market once you're rooted.
      CM9 CyanogenMod 9 - This is a very popular custom ROM for a very large number of devices. CM7 is a highly regarded modification of Android 2.3 (Gingerbread). CM9 (Android 4.0, Ice Cream Sandwich) is currently in development. While there are no official releases of CM9 yet (2012.01.09), several groups have packaged things up into pretty good releases.
      DeODEXing This involves unpacking some of the internal components of the ROM. This gives us access so we can start modifying those parts.
      What Is Odex And Deodex In Android [Complete Guide]
      GApps These are Google's closed-source applications (such as Calendar, Gmail, Gallery, YouTube, and more) that usually ship with factory ROMs. Pure AOSP builds will not include these and you have to download them separately. Other groups bundle them into their ROMs.
      kernel This is Linux itself. It has all the drivers, memory management, process scheduling, etc. Some groups create modified kernels which have better schedulers for smoother performance, underclocking/undervolting for battery life, etc.
      Trebuchet This is a popular alternative launcher originally developed for Cyanogenmod.



    14. Suggested ROMs
      There are a huge number of ROMs out there for the Galaxy Nexus! The community is doing a great job of producing quality custom software. I'm just going to mention three popular ones that will give you a place to start.

      Android Revolution HD is a conservative approach that takes the factory ROM and gently tunes it up for better performance without changing the user interface at all. Under the hood it's rooted, deodexed, debloatwared, and more. I found no compatiblity problems keeping my /data going between ARHD and the factory ROM, which makes it an easy one to try.
      [Rom] Android Revolution Hd™ 2.1.1 | High Quality & Performance | ICS | Legendary

      GummyNex is a good middle ground. This is an AOSP build with a good number of tastefully done, carefully tested features. Despite rapid development, the ROMs seem to be pretty bug-free.
      http://www.galaxynexusforum.com/foru...1-22-12-a.html

      If you want ALL the features and a pink unicorn, you need AOKP.
      [ROM] Android Open Kang Project - toro Milestone 3 - RootzWiki

      Don't limit yourself to this list. There are many other ROMs you can try with varying levels of features, refinement, bugs, and taste. It's worth looking to see if there's one that's made for just what you want. Here are a bunch more choices:
      [LIST] CDMA/LTE Galaxy Nexus ROMs


    15. Changelog

      2012.01.10 - Initial release
      2012.01.13 - Removed some commentary on warranties; added a link to a back-to-stock guide
      2012.01.22 - Added "Common Problems" section and fix for the acore problem
      2012.01.22 - Added CWMR Touch info
      2012.01.29 - Added Glossary and table of hardware names, fixed typos
      2012.01.29 - Improved formatting
      2012.02.03 - added Miscellaneous, Suggested Roms, BusyBox, Trebuchet

    == EOF ==
    Last edited by Seriana; 02-03-2012 at 04:59 AM. Reason: added Miscellaneous, Suggested Roms, BusyBox, Trebuchet
    Superbad, Nicolas, 1KDS and 5 others like this.

  2. # ADS
    Ads


  3. #2
    Milky Way
    Member #
    1985
    Liked
    15 times
    Join Date
    Dec 2011
    Posts
    38
    Added "Common Problems" section and fix for the acore problem

    Changes:
    Code:
    --- newbie.txt	2012/01/22 18:54:42	1.3
    +++ newbie.txt	2012/01/22 19:01:25
    @@ -13,7 +13,8 @@
     8.  Installing custom ROMs
     9.  Backups
     10. Restore to stock
    -11. Changelog
    +11. Common Problems
    +12. Changelog
     
     
     1.  Introduction
    @@ -169,9 +170,17 @@
     
     [HOW TO]  Unroot the VZW GN, Re-Lock the bootloader and Start Factory Fresh
     
    -11. Changelog
    +
    +11.  Common Problems
    +
    +"Unfortunately, the process android.process.acore has stopped."
    +acore is responsible for your contact data.  Some ROMs have incompatible versions of the database which is why they recommend wiping /data .  You will get this error if you don't wipe or if you do a file-type restore which includes the contact data.  The fix is easy: keep dismissing the error and go to Settings > Accounts & sync > toggle to "Off" > back > Apps > All > Contacts Storage > Force Stop > OK > Clear Data > OK.  Reboot, re-enable sync, and all your contacts should sync back from Google and be stored in a compatible format for your ROM.  I went from from Revolution 2.1.2 to Axi0m 2.4 with no wipe at all and this is the only fix required so far.
    +
    +
    +12. Changelog
     
     2012.01.10 - Initial release
     2012.01.13 - Removed some commentary on warranties; added a link to a back-to-stock guide
    +2012.01.22 - Added "Common Problems" section and fix for the acore problem
     
     == EOF ==
    Last edited by Seriana; 01-22-2012 at 04:23 PM. Reason: Improved formatting
    Zoom and yitping like this.

  4. #3
    Milky Way
    Member #
    1985
    Liked
    15 times
    Join Date
    Dec 2011
    Posts
    38
    Added CWMR Touch info

    Changes:
    Code:
    diff -u0 -r1.5 ./newbie.txt
    --- ./newbie.txt	2012/01/22 18:59:10	1.5
    +++ ./newbie.txt	2012/01/22 19:48:16
    @@ -73,0 +74,4 @@
    +ClockworkMod Recovery Touch (CWMR Touch) - Aside from adding touchscreen support, this also improves the hardware buttons.  The Nexus's buttons are bouncy and often skip several entries, and if you bounce them really good it will even disable them.  CWMR Touch fixes these problems.  It also uses a larger font which is nice for the very high DPI display on the GN.
    +[Recovery]Touch Based ClockworkMod Recovery - RootzWiki
    +http://dl.dropbox.com/u/3727513/cwmr...beta5_toro.img
    +
    @@ -184,0 +189,2 @@
    +2012.01.22 - Added CWMR Touch info
    +
    Last edited by Seriana; 01-22-2012 at 04:22 PM. Reason: Improved formatting

  5. #4
    Sirius
    Member #
    1127
    Liked
    60 times
    Join Date
    Dec 2011
    Posts
    397
    Nice work!
    ~পরিব্রাজক~

    He who desires but acts not, breeds pestilence.- W. Blake

  6. #5
    Milky Way
    Member #
    1985
    Liked
    15 times
    Join Date
    Dec 2011
    Posts
    38
    Thanks! It's always good to hear it's helpful for someone.

  7. #6
    Vega
    Member #
    422
    Liked
    23 times
    Join Date
    Nov 2011
    Location
    NYC, NY
    Posts
    592
    Great work! It is packed with information, but hard to read. Do you think, you could break it up in paragraphs?

    Sent from my Galaxy Nexus using Tapatalk

  8. #7
    Milky Way
    Member #
    1985
    Liked
    15 times
    Join Date
    Dec 2011
    Posts
    38
    Thanks!

    I'm not sure what you mean about paragraphs... It's in chapters and paragraphs now. This is what it looks like for me: http://i.imgur.com/2JhmX.png

    Is it different for you?

  9. #8
    Administrator
    Member #
    7
    Liked
    1736 times
    Join Date
    Aug 2011
    Posts
    16,051
    Quote Originally Posted by Justifi View Post
    Great work! It is packed with information, but hard to read. Do you think, you could break it up in paragraphs?

    Sent from my Galaxy Nexus using Tapatalk
    Don't read it on Tapatalk.

    Tap'd from my GNex

  10. #9
    Vega
    Member #
    422
    Liked
    23 times
    Join Date
    Nov 2011
    Location
    NYC, NY
    Posts
    592
    Quote Originally Posted by Mujibar View Post
    Don't read it on Tapatalk.

    Tap'd from my GNex
    That's interesting. I'm curious what percentage of users access this forum using tapatalk? Maybe we should do a poll? That maybe a good indicator of how the forum is accessed by the majority of users. Then posters and users will know how best to communicate.

    Sent from my Galaxy Nexus using Tapatalk

  11. #10
    Vega
    Member #
    422
    Liked
    23 times
    Join Date
    Nov 2011
    Location
    NYC, NY
    Posts
    592
    Quote Originally Posted by Seriana View Post
    Thanks!

    I'm not sure what you mean about paragraphs... It's in chapters and paragraphs now. This is what it looks like for me: http://i.imgur.com/2JhmX.png

    Is it different for you?
    I access this forum primarily on my phone using TapaTalk. That app formulates forums views for the screens smaller than a PC. Maybe when it's posted from a PC it doesn't recognize, line breaks.






    Sent from my Galaxy Nexus using Tapatalk

 

 
Page 1 of 6 123 ... LastLast

Remove Ads

Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Another Newbie Inbound
    By OSX2000 in forum New Member Introduction & Site Assistance
    Replies: 11
    Last Post: 04-30-2012, 10:27 AM
  2. What are your hacking plans for your Galaxy Nexus???
    By Garemlin in forum Galaxy Nexus Hacking & Mods [LTE/CDMA]
    Replies: 60
    Last Post: 01-11-2012, 09:36 PM
  3. Newbie Questions
    By davidlaw69 in forum Galaxy Nexus General Discussion
    Replies: 4
    Last Post: 01-07-2012, 03:01 PM

Search tags for this page

change galaxy nexus hostname
,

change hostname galaxy nexus

,
change nexus 7 hostname
,
fastboot kernel android-sdk nexus 4
,
galaxy nexus beginners guide
,
galaxy nexus change hostname
,

galaxy nexus hacks

,

galaxy nexus hostname

,
galaxy nexus noob guide
,
nexus 7 change hostname
,
nexus 7 host name
,
nexus 7 hostname
,

samsung galaxy nexus hacks

,

unfortunately the process android.process.acore has stopped galaxy nexus

,

unfortunately the process com.android.phone has stopped galaxy nexus

Click on a term to search for related topics.

Tags for this Thread