[Nexus 5 Android Development] androcraze:
AlmostVanillaAOSP Marshmallow 6.0.1_81 [MOI10E] ROM for the Nexus 5

Description

An "almost vanilla" AOSP-based Marshmallow ROM for the Nexus 5.

Disclaimer

I am not responsible for anything that happens to your device. By downloading and flashing or installing these zips, you automatically agree that I won't be held liable for anything that happens to your phone.

Background

AlmostVanillaAOSP is an AOSP-based ROM directly using Google's source code with a few functional modifications; these modifications are fully-sourced and easily-installed prior to building the ROM. Included modifications are designed to fix bugs, enhance security, and improve "in the field" function.

Many users prefer a "vanilla" version of AOSP, without added factory bloat and proprietary software; a basic version of AOSP is a great building block to create a custom-featured ROM, or it can be left as-is by users desiring to live outside Google's realm.

Users shouldn't see any visual or functional difference between this ROM and a vanilla AOSP build; all changes are "under the hood". Please note that there has been no attempt to remove functionality or user choice with this ROM.

If you're looking for a 100% pure AOSP ROM, please install BreckZeBoulay's UntouchedAOSP ROM IN THIS THREAD

Included Modifications

Enabled the Doze option: Google's Doze option (built-into the AOSP code base), is a set of rules that puts an idle phone to sleep, reducing battery drain. For Doze to work, you have to have Google Play Services (GApps) installed. If you don't have Play Services installed, nothing happens and the phone still works fine. For more details on Doze, read HERE.

Option to add Google's current WebView: The WebView included with AOSP Marshmallow is locked-in at version 52, and the only way it will get updated is by installing a later ROM. With the stock AOSP code, users have no option to upgrade to a newer version; trying to upgrade results in browser crashes and instability. This "fix" allows installing the "Android System WebView" from the Play Store (currently at version 58); the Play Store version is kept current by Google. If you choose not to install the Play Store WebView version, the included version works fine, although at an increased security risk due to not having updates. DO NOT REMOVE THE INCLUDED WEBVIEW VERSION! Keep the original version that's located in /system/app, if you install another version; it's not "bloat". The Play Store Android System WebView can be found HERE.

Addition of Sony's suggested (and disapproved) Power Menu reboot option: Sony made attempts to add a reboot option to the Power Menu in the AOSP code; their efforts were rejected. However, Sony generously posted the code changes needed to enable this option, and they are included in this ROM. An interesting read on Sony's attempts can be found HERE. For details on implementing this feature post-install, please read the "Implementing Reboot" section below.

Removal of broken AOSP applications (Browser, Calendar, Email, and Exchange): AOSP Browser, AOSP Calendar, and AOSP Email (and by extension, AOSP Exchange) are hopelessly broken. I refuse to put broken applications in a ROM, even for "completeness". The good news is that Lightning Browser, Etar Calendar, and K9 Mail are open source and even better than the originals. Look in the "Suggested Open Source Applications" section below for links to these apps.

Removal of LiveWallpapers: The LiveWallpaper bloat has been removed from the ROM. The LiveWallpaperPicker app remains, so the functionality is still there. They're something that few people (if any) actually use.

Updated Launcher Icons to Material theme: The Material Dialer Icon is usually the first item folks ask for in AOSP ROMs. The Calendar, Dialer, and Gallery launcher icons were borrowed from the Cyanogenmod Github. The QuickSearchBox and Music launcher icons were modified from the icon set provided by Rammist on this WEBSITE. No other changes were made to the apps other than their launcher icons.

Added Option to Utilize UnifiedNlp Location: UnifiedNlp is a FLOSS (Free/Libre and Open Source Software) Wi-Fi- and cell-tower-based geolocation tool for Android by MaR-V-iN. His XDA thread can be found HERE. All that's been done is the addition of a single entry (org.microg.nlp) during build to the list of the ROM's network location services. Users who don't add the UnifiedNlp app will see no change or function with the ROM. For details on implementing UnifiedNlp with this ROM, please review Post #2 in this thread.

Sources and Source Patches

Source tree:

https://android.googlesource.com/platform/manifest -b android-6.0.1_r81

Nexus 5 (GSM/LTE) binaries for Android 6.0.1 (M4B30Z):

https://developers.google.com/android/drivers

Source Patches Used for ROM Build:

Bloat

Broken

Dialer-Gallery2-Calendar-Search-Music - Launcher Icons

Doze

Reboot Icons <- Required for the Reboot patch

Reboot

WebView

UnifiedNlp

Patch Installation Prior to Building ROM:

Put patch(es) in the AOSP build folder. This is how the patches and icon images were installed:

patch -p0 < M4B30X_Reboot.patch
patch -p0 < M4B30X_WebView.patch
patch -p0 < M4B30X_Doze.patch
patch -p0 < M4B30X_Bloat.patch
patch -p0 < MOB31T_Broken.patch
patch -p0 < MOB31T_UnifiedNlp.patch

unzip M4B30X_Reboot_Icons.zip
unzip M4B30X_Dialer-Gallery2-Calendar-Search-Music_Icons.zip

find . \( -name \*.orig -o -name \*.rej \) -delete

NOTE on ".rej" and ".orig" generated files:

Patches that succeed but have ***ANY*** issue generate additional ".orig" files in the same folders as the original files.

Patches that fail generate a ".rej" extension file in the same folder as the original file. A failed patch must be investigated before proceeding further.

For example:

frameworks/base/core/res/res/values/config.xml
frameworks/base/core/res/res/values/symbols.xml

Both of the above files are modified by two or more patch files. An initial patch will work fine, but subsequent patches are noted with notices like "Hunk #1 succeeded at 306 (offset 1 line)". The patch applied fine, but the patch command is notifying you that when it went to apply the patch, the lines weren't where they were originally expected to be (shifted down XX number of lines). As long as the patch didn't fail with output like "Hunk #1 FAILED at 58.", you're good. However, even though the patch was successful, it still generates a "config.xml.orig" or a "symbols.xml.orig" file when there is a conflict.

Now the problem: those ".xml.rej" and ".xml.orig" files, despite having incorrect endings and not being actual ".xml" files, are treated during build as valid .xml files. Since the config.xml.orig and config.xml file are in the same folder and almost identical, the build will fail as it's seeing the duplication. AOSP appears to parse all files in certain folders, regardless of extension.

The following command will eliminate those ".orig" and ".rej" files, should they appear:

find . \( -name \*.orig -o -name \*.rej \) -delete

To revert installed patches, with the patches in the AOSP build folder:

Execute the following commands:

patch -p0 -R < M4B30X_WebView.patch
patch -p0 -R < M4B30X_Reboot.patch
patch -p0 -R < M4B30X_Doze.patch
patch -p0 -R < M4B30X_Bloat.patch
patch -p0 -R < MOB31T_Broken.patch
patch -p0 -R < MOB31T_UnifiedNlp.patch

find . \( -name \*.orig -o -name \*.rej \) -delete

NOTE: any icon images you've unzipped can't be reverted.

Known Bugs

None yet.

GPL

The kernel included with this ROM was pulled directly from the AOSP source tree. No modifications have been made to any of the kernel sources or the kernel itself.

For the source tree for the AOSP-supplied kernel, please check HERE.

The GPL v2 license can be found HERE.

AlmostVanillaAOSP ROM Download

LATEST: AndroidFileHost | Mediafire

AlmostVanillaAOSP[6.0.1_r81-MOI10E]Hammerhead-20171004.zip

SHA256: 7fcdb2dd0e349b1b99eefc55f9e49b0fd07c9e2ad1054848840019a88434c2b5

OLDER RELEASES can be found here: AndroidFileHost

AOSP Changelogs - Does not include AlmostVanilla changes.

Generated using the following bash script:

#!/bin/bash
#
#
#
repo forall -c '
if git rev-parse android-6.0.1_r79 >/dev/null 2>&1
then
git log --oneline --no-merges android-6.0.1_r79..android-6.0.1_r80
else
git log --oneline --no-merges android-6.0.1_r80
fi
' | cat

android-6.0.1_r79 to r80

Add-on Downloads - In TWRP-flashable format.

Radio/Modem Download, Version M4B30X_M8974A-2.0.50.2.30: AndroidFileHost | Mediafire

- The current modem-radio for the N5 is M8974A-2.0.50.2.30, from the M4B30X ROM.

Video Green Line Fix, Version 6.0.1_r77-M4B30Z: AndroidFileHost | Mediafire

- Fixes the green line along the edge of video frames.

- Pulled from the latest factory N5 ROM, M4B30Z_6.0.1_r77.

Qualcomm Time Service Fix, Version 6.0.1: AndroidFileHost | Mediafire | Older Versions

- Fixes the date and time resetting on successive boots.

UnifiedNlp(GAPPS), Version 1.6.8: AndroidFileHost | Mediafire

- A flashable version of UnifiedNlp(GAPPS) that installs to /system. Only for AlmostVanillaAOSP[6.0.1_r79-MOB31T]Hammerhead-20170418.zip or later versions WITH built-in UnifiedNlp support.

- For details on implementing UnifiedNlp with this ROM, please review Post #2 in this thread.

N5 Boot Animations: This THREAD has an assortment of N5 flashable and tested bootanimations.

Debloating Tools: Look at this thread THREAD for debloating scripts to eliminate unwanted or redundant applications.

Wallpapers

AOSP doesn't include any wallpapers for the Launcher/Home Screen. To help beautify your N5, I've included some links to stock Android and Nitrogen OS wallpaper in Post #3.

Installation

PLEASE ASK QUESTIONS IF YOU HAVE THEM!

General ROM & GApps Install Procedure:

--------

PREPARATION:

1. Flash current factory ROM via PC (to get current modem radio)

2. Install TWRP via adb

3. Create empty GApps text files as per directions HERE

4. Copy ROM, empty text files, and install items to phone from PC

FLASH & INSTALL:

1. Boot to TWRP

2. Reboot to recovery (TWRP) from within TWRP

3. Wipe everything but internal storage

4. Flash the ROM

5. Flash a bootanimation, TimeService, Green line fix

6. Reboot to System

7. Configure Time, WiFi, APN, Reboot Menu

8. Reboot to TWRP

9. Flash GApps (Delta GApps MM PROCEDURE

10. Reboot to System

11. Set permissions for GApps (Contacts, Play Store, Google Play Services)

12. Reboot back to System

13. Setup Google Account

14. Install Play Store Apps

15. Install APKs manually

16. Reboot to TWRP

17. Run debloat script.

18. Reboot to TWRP

19. Flash UnifiedNlp app

20. Install SuperUser (PHH's is fine)

21. Reboot to System.

22. Done

#6, rebooting to System BEFORE flashing GApps, is VERY important.

GOOD LUCK!

Screen Shots

FAQ

Q: How can I verify the running WebView version of my ROM?

A: Use HTML5test WebView from HERE.

Q: Does Doze work in this build?

A: Yes. You'll need GApps installed for it to work properly. You do not have to enable anything; it is active by default.

Q: How can I check and see if Doze is enabled on this ROM?

A: Download and install the APK from this THREAD.

Q: My date and time keeps resetting on successive boots?

A: Solution is to install the Qualcomm TimeService app (a proprietary application) - the 6.0.1 version is available HERE

Q: Can I use this ROM with Android Pay?

A: No. Only approved factory ROMs from Google can use Android Pay. If you want Android Pay on the Nexus 5, install a Marshmallow factory image.

Q: Where can I get the Marshmallow bootanimation? I'm only seeing the AOSP default framework bootanimation.

A: Try Post #1 in this Boot Animation Collection.

Q: Where can I find your build tree?

A: There is no build tree for this ROM, other than the full source code as provided by Google. Any modifications to this source code are noted under "Patches".

Q: Can you add new features to this ROM?

A: The goals of this ROM are a stock AOSP feel and security. "Features" other than bug-fixes and security enhancements aren't a priority and probably won't be added.

Q: Which GApps are recommended?

A: Deltadroid's GApps are highly recommended using this installation PROCEDURE

Q: How do I install GApps?

A: A general procedure to install ROM with GApps:

Don't flash the ROM together with GApps in the same ZIP queue because this will cause the Installation Wizard to run on first boot. Due to Google Play permissions errors the Wizard will keep crashing and you won't be able to bypass this. Solution:

1. Boot to TWRP

2. Reboot to recovery (TWRP) from within TWRP

3. Wipe everything but storage

4. Flash the ROM

5. Flash a bootanimation, TimeService, Green line fix

6. Reboot to System

7. Configure Time, WiFi, APN, Reboot Menu

8. Reboot to TWRP

9. Flash GApps

10. Reboot to System (Yes, you'll probably get Play Services "FC" messages until you perform #11, below)

11. Immediately toggle application permissions to "ON" under "Settings -> Apps -> ... -> System show" for:

- Google Contacts Sync
- Google Play Services
- Google Play Store

12. Reboot back to System

13. Setup Google Account via "Settings -> Accounts -> Add account -> Google"

14. Install Play Store Apps

15. Install APKs manually

16. Reboot to TWRP

17. Run debloat script.

18. Reboot to TWRP

19. Install SuperUser (PHH's is fine)

20. Reboot to System.

21. Done

Q: My Google Play Store / Google Play Services / Apps keep crashing?

A: This is a permissions issue. Please read the "Which GApps are recommended?" answer above.

You can try System Settings > Apps (top right menu button) > Show System,

and set the following to resolve most crashes:

Google Contacts Sync > Contacts permission

Google Play Services > All permissions

Google Play Store > All permissions

Q: Can you patch the ROM to deal directly with the GApps permissions issue?

A: No. It's a security policies issue, and there's no desire to override those policies.

Q: Where is the System Tuner UI?

A: Enable Developer Options (under "About Phone", tap "Build Number" seven times), then long-press the settings icon in the notification shade/bar.

Q: How do I get root?

A: PHH's SuperUser is highly recommended. Install the SuperUser APK (F-Droid or Play Store), then flash the superuser.zip from HERE. It works flawlessly, and it's open source.

Q: Can I use this ROM with MultiROM?

A: UntouchedAOSP users were successful with MultiROM. AlmostVanillaAOSP should work equally-well.

Q: AOSP Calendar (and Etar Calendar) won't sync with my on-line Google calendar. How can I make syncing work?

A: Flash the Google Calendar Sync addon for 6.0.0+ add-on from this THREAD, located under "Additional Kitkat, Lollipop, Marshmallow, and Nougat gapps addons". Ensure that permissions are granted in Settings -> Apps for "Google Calendar Sync". You'll need to enable "Show system" under the ". . ." in the upper right of the Apps window,

Q: I get a green line on one side of the frames when recording video. How can I fix this?

A: Go to the "Add-on Downloads" section in this post and get the "Video Green Line Fix" download.

Q: I'm having issues with Location and certain apps (Chronus, f.lux, Google Fit, etc.). How can I fix this?

A: This isn't a ROM issue; it's an AOSP issue. Review POST #2 in this AlmostVanillaAOSP thread for a solution using UnifiedNlp. For a long, detailed answer, look at Mar-v-in's initial response in this GITHUB POST. Hopefully the following will be a short-enough summary:

Google started with an open Location API that was used for AOSP and Google's factory ROMs.

Google created a new Play Services Location API that isn't included is AOSP code and it's only included in factory ROMs.

Google recommends that developers use the newer, closed API version.

Despite the fact that there are few differences between the old and new API, some developers are migrating solely to the new, stranding AOSP users.

Possible solutions for those AOSP users not having access to the new Location API:

Use the solution in POST #2 of this thread.

Forget about custom ROMs, only install factory ROMs (yeah, right!).

Only use and support apps that use the open Location API (all of the applications listed in post #1 of this thread -- requiring Location -- under "Suggested Open Source Applications" support the older Open Location API).

Ask developers if they're willing to modify their applications to fall-back to the open API if the Google one isn't available, or just use the open API.

For other AOSP ROMs, use the procedure as outlined by [MENTION=5785796]alessio89g[/MENTION] in this POST

Q: How about a Nougat ROM?

A: Until things stablize on the development front, no. There are driver issues for Nougat on the N5 that have yet to be resolved. It was hoped that there'd be a very vanilla Nougat N5 build, with very detailed modifications of the source tree; documented changes seem to be all over the place, with developers more focused on "features" than straightforward builds. There is a "CleanAOSP" Nougat ROM, but I don't know much about it.

Implementing Reboot

Activate Developer Options: Go to "Settings -> About phone", scroll-down to "Build number", and tap it seven (7) times (first image).

Activate System UI Tuner: Swipe the top of the screen twice, until you get the below image. Long-press the gear icon. When you let go, a wrench icon appears (second image).

Go to "Settings -> System UI Tuner", toggle "Show restart in global actions menu":

Go to "Settings -> Developer options", scroll down and verify "Restart shortcut" is toggled:

NOTE:

"Developer options -> Restart shortcut" and

"System UI Tuner -> Show restart in global actions menu"

are tied together; toggling one automatically toggles the other.

Either method will activate the Reboot menu.

Suggested Open Source Applications

AdAway (requires root) - XDA

Add to Calendar - F-Droid

Amaze File Manager (root capable) - F-Droid | Play Store

AnySoft Keyboard - F-Droid | Play Store

Barcode Scanner - F-Droid | Play Store

Battery Widget - F-Droid | Play Store

Calendar Widget - F-Droid | Play Store

Etar Calendar- F-Droid | Play Store

Flym News Reader - F-Droid | Play Store

Forecastie (uses Open Location API) - F-Droid | Play Store

K9 Mail - F-Droid | Play Store

Lightning Browser - F-Droid | Play Store

Mathdroid - F-Droid | Play Store

MuPDF - F-Droid | Play Store

No-Frills CPU Control (requires root) - F-Droid | Play Store

Open Camera - F-Droid | Play Store

QK SMS - F-Droid | Play Store

QuickDic - F-Droid | Play Store

Simple Gallery - F-Droid | Play Store

SMS Backup+ - F-Droid | Play Store

Solitare CG - F-Droid | Play Store

Turbo Editor - F-Droid | Play Store

Vanilla Music - F-Droid | Play Store

VLC (ARMv7) - FTP | FTP-testing | Play Store

Thanks:

[MENTION=4913921]BreckZeBoulay[/MENTION] - for inspiration, guidance, keeping up the good fight, and teaching me how to build a ROM

[MENTION=5227588]Deltadroid[/MENTION] - for an awesome GApps package, and listening to users

[MENTION=4311521]MattDN93[/MENTION] - for listening to users and being a cheerleader

[MENTION=426561]Scott[/MENTION] - for his incredible walkthrough in this THREAD