Giving A Second Life To My Nexus 7 2013 Tablet

I was a big fan of the Nexus products brought by Google with pure Android experience, and I enjoyed repairing their hardware myself when they were broken, I repaired Nexus phones and tablets (4/5/7) screens, batteries, buttons, and chargers dozen times, but I’ve never had to change their native Android OS.

Here I’m trying to give a second life to my Nexus 7 (2013) LTE that is still in a perfect condition, sleeping in my library between books, with an obsolete Android 6.0.1 and a security patch of May 2016.

In this post I’ll document the different ways and tools I’m trying to bring a recent and up to date Android versions in a Nexus 7 (2013) LTE, please note that this is a work in progress, so I’ll add new details from time to time.

Initial Conditions:
Nexus 7 2013 LTE
Android version: 6.0.1
Android security patch level: May 2016
PRODUCT NAME – deb
VARIANT – deb 32G
HW VERSION – rev_e
BOOTLOADER VERSION – FLO-04.06
BASEBADN VERSION – DEB-Z00_2.44.0_0213
CARRIER INFO – None
SERIAL NUMBER –
SIGNING – yes
SECURE BOOT – enabled
LOCK STATE – locked
–> Never altered anything in the tablet: No root, no specific bootloader or recovery, no oem unlock…etc.

Step 0: Backup
Never say it enough, the next steps will remove everything on the tablet, so if you have important files and data save them.

Step 1: Install TWRP
From what I know, the first step is to install TWRP that will allow me to install any specific ROM with more options.
TWRP replaces the default stock recovery mode of Android, it needs unlocked bootloader, and that means that the tablet reset will not be the same as before.

Here is the official tutorial to install TWRP on Nexus 7 2013 LTE : https://twrp.me/asus/asusnexus72013lte.html
Since I have non root device and no installed TWRP app, I’ll follow the Fastboot Install Method.

Fastboot Install Method requires ADB and Fastboot tool that I already have on my PC.
It requires also to enable USB debugging.

For ADB/Fastboot, download them from Android website here: https://developer.android.com/studio/releases/platform-tools

To enable USB debug: Options -> Developer options -> Toggle on the “USB debugging”.
(If you see a pop up asking for permission for the PC, accept it)
If you don’t see the Developer options menu: Options -> About tablet -> Press 7x Build number

You can test Android tools and USB debugging by making a simple reboot.
Open a command console, go to the ADB directory and:
adb reboot

Download latest TWRP for Nexus 7 2013 here: https://eu.dl.twrp.me/deb/
Note: “deb” is the codename of the tablet, not to be confused with debian or deb package of Linux.
Copy it in the ADB directory.

Reboot the tablet in bootloader mode:
adb reboot bootloader

Flash the TWRP image as recovery:
fastboot flash recovery twrp-3.1.1-0deb.img

Doing that without unlocking the bootloader gives the below error:
FAILED (remote: ‘Bootloader is locked.’)

Unlocking the bootloader with the command:
fastboot oem unlock

Select “Yes” with volume buttons, and confirm with ON/OFF button.
As I mentioned before all data will be lost.

This will take about a minute, after that the bootloader screen will show again, and the line LOCK STATE will be “unlocked”.

Try again to flash the TWRP image as recovery:
fastboot flash recovery twrp-3.1.1-0deb.img

This time it should work correctly.

Reboot the tablet:
fastboot reboot

The tablet reboot in TWRP UI, but after some time it shows red errors:
Failed to mount ‘/data’ (Invalid argument)
The tablet will be in a loop reboot again and again showing the same errors.

I think that this is because TWRP can’t access or decrypt my data partition (that I don’t care about anyway…)
Trying to wipe my data: Turn OFF the phone, then press ON & Volume down to be in bootloader menu.
Wipe user data and reboot in TWRP recovery:
fastboot format userdata
fastboot reboot recovery
I don’t see anymore the errors in TWRP console start up, after 2 tries to boot in recovery, I can see TWRP menu.

Swipe to allow modifications.
Now I have all the options to install/wipe/backup/restore… ROMs on my tablet.

The next step? Find a good ROM and install it!

Step 1: Install LineageOS

This distribution is recommended as lightweight, not too much different from stock version and with more options.
LineageOS is the old famous Cyanogen(Mod) ROM.

Nexus 7 is no more supported by LineageOS, There is two options to have it:
1- Build yourself the image following the instructions: https://wiki.lineageos.org/devices/flo/build
2- Use an image built by someone else, the recent one I found is in XDA forums: [ROM][UNOFFICIAL][9] LineageOS 16.0 [deb][flo]

To go fast and just have a look to the UI and overall system I’ll use directly the latest image built downloaded here: lineage-16.0-20190808-UNOFFICIAL-deb.zip (Size 7363Mo)

It is recommended to install Open GApps at the same time, otherwise it will not be possible to configure a Google account, download apps…etc. Download it here https://opengapps.org/, choose as configuration ARM/9.0/Pico.

Copy the two zip file in the ADB directory.
Boot the tablet in recovery mode of TWRP.
Wipe the partitions (system, data, …)
Go back and select Advanced -> Sideload, adnd swipe to confirm.
(Sideload gives the possibility to install zip images from the PC.)

On PC side, check it:
adb devices

It should show the serial number of the tablet and the status sideload

Flash the LineageOS image:
adb sideload lineage-16.0-20190808-UNOFFICIAL-deb.zip

You can see the percentage progress in the console and in the TWRP UI.

Honestly I don’t know if I have to install the two zip simultaneously (I think there is a way to select them but not in sideload) or one after the other, so I did first LineageOS, then went back to sideload again and started for Open GApps.
adb sideload open_gapps-arm64-9.0-pico-20190810.zip

Anyway the Open GApps didn’t work with error 64, I did an error, the tablet architecture is ARM, not ARM64 as I selected in the website.
Downloaded the correct version again: open_gapps-arm-9.0-pico-20190810.zip (93MB)
adb sideload open_gapps-arm-9.0-pico-20190810.zip
The installation failed for another reason this time (error 70), saying insufficient storage space in system partition, knowing that I chose the very small version Nano…
Is this due to the Android 9 version that takes all the system partition of a 2013 device?
Comparing LineageOS image to last Google image there is +200MB more.
That said, trying to install Open GApps stock with 600MB will be a big challenge later…

I found in TWRP menu a way to resize the system partition:
Wipe -> Advanced Wipe -> Check “System” partition -> Repair or Change File System
Here you can find the information about the partition:
Present: Yes
Removable: No
Size: 837MB
Used: 782MB
Free: 55MB
Backup Size: 782MB

The free space of 55MB isn’t sufficient for any Open GApps version even the Nano with 93MB.

Pressing the button “Resize File System” has no effect and I don’t see how to specify the size to take from Data partition.

At this level I think I need to find a way to change the Nexus partition, and this is a normal issue since I’m trying to install recent OS that are bigger than the ones used back to 2013.

To be continued.
—-

Featured image source: https://flic.kr/p/o7ZmL9

3 Responses

  1. K. Koontz at | | Reply

    You need to 1) repartition the Nexus 7 to run an Android 9+ ROM and run an updated version of TWRP that accomodates this change You can read about it at this thread on XDA: https://forum.xda-developers.com/nexus-7-2013/orig-development/repartition-nexus-7-2013-repartition-t3844386 The other thing people tend not to notice is that if you have only a 16 gb Nexus 7 you’ll have a harder time flashing a Lineage OS ROM based on Android 9. No idea why honestly. I’ve got a 16 gb “flo” Nexus 7 and a 32 gb “deb” Nexus 7 and have used the deb_clamor_repartition.zip file to repartition both and install the modified TWRP recovery (that ends in _UA) on both. I can install Lineage ROMS fine on the deb device with 32 gb onboard but only AICP ROM and AOSP extended seem to run on the flo Nexus 7. The latter two run just fine once I flash either of those two ROM and use the “pico” version of Open GApps to install on the newly sized data partition. I hope this helps.

  2. K. Koontz at | | Reply

    This is another alleged solution https://forum.xda-developers.com/showpost.php?p=76278047&postcount=19 but one that I have not personally tried. This https://forum.xda-developers.com/nexus-7-2013/development/rom-aicp-14-0-p-t3924163 is the AICP ROM that I’ve found to be the best, most recent one (in Sept 2019) for my flo Nexus 7.

Please comment with your real name using good manners.

Leave a Reply