====== Information ====== * Custom builds of LineageOS for the Nexus 7 2013 (deb) ===== Prerequisites ===== * [[distros:fedora_workstation_gnome | Fedora Workstation]] ====== xda-developers ====== * https://forum.xda-developers.com/nexus-7-2013/development-lte/rom-lineageos-easy-microg-unifiednlp-t3647174 ====== Dependencies ====== **** sudo dnf install java-1.8.0-openjdk-devel ImageMagick-devel patch ncurses-compat-libs schedtool libstdc++.i686 glibc.i686 m4 && sync ====== Prepare Build Environment ====== ===== Cleanup ===== **** cd ~ && sudo rm -Rf ~/'android/lineage/'* ~/'.ccache' && sync ===== Install git-repo ===== * https://code.google.com/archive/p/git-repo mkdir -p ~/'bin' && wget -O ~/'bin/repo' 'https://storage.googleapis.com/git-repo-downloads/repo' && chmod +x ~/'bin/repo' ===== Configure Git ===== nano ~/'.gitconfig' [user] email = espionage724@x name = Sean Lynn Rhone [color] ui = auto ===== Initialize Repo ===== **** mkdir -p ~/'android/lineage' && cd ~/'android/lineage' && repo init --manifest-url='https://github.com/LineageOS/android.git' --manifest-branch='cm-14.1' --depth=1 && sync ===== Sources Management ===== ===== ASUS Manifest ===== * If wanting a clean source for backup, pull in the sources first, back it up, and then add this manifest ((this will add vendor-specific stuff to the sources and may be unnecessary for other devices)) mkdir -p ~/'android/lineage/.repo/local_manifests' && nano ~/'android/lineage/.repo/local_manifests/asus.xml' ==== Pull-in and Update Sources ==== * As of 2017/07/27, this downloads around 10GB for ''cm14.1'' ((this base size will grow over-time due to commits; TODO: figure out how to trim older commits?)) cd ~/'android/lineage' && repo sync --current-branch --network-only --jobs='4' --force-broken --force-sync && sync && repo sync --current-branch --local-only --jobs='16' && sync ==== Backup Sources ==== **** cd ~/'android/lineage' && tar -cvzf ~/'Downloads/lineageos-cm14.1-'$(date +%Y-%m-%d)'.tar.gz' '.repo' && cd ~ && sync ==== Restore Sources ==== **** mkdir -p ~/'android/lineage' && cd ~/'android/lineage' && tar -xvzf ~/'Downloads/lineageos-cm14.1-'*'.tar.gz' '.repo' && sync ====== Modifications ====== ===== Allow Signature Spoofing ===== * https://github.com/microg/android_packages_apps_GmsCore/blob/master/patches/android_frameworks_base-N.patch * This allows **microG Services Core** and **FakeStore** to fake GApps properly wget -O ~/'Downloads/GmsCore-android_frameworks_base-N.patch' 'https://raw.githubusercontent.com/microg/android_packages_apps_GmsCore/master/patches/android_frameworks_base-N.patch' && cd ~/'android/lineage' && patch --no-backup-if-mismatch --strip='1' --directory='frameworks/base' < ~/'Downloads/GmsCore-android_frameworks_base-N.patch' && rm -f ~/'Downloads/GmsCore-android_frameworks_base-N.patch' && sync ===== Allow Location Providers Outside /system ===== * https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/patches/android_frameworks_base-N.patch * This allows ** microG Services Core** to provide **UnifiedNlp** without having to be installed to ''/system/priv-app'' or having to have an outdated ''NetworkLocation.apk'' there wget -O ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' 'https://raw.githubusercontent.com/microg/android_packages_apps_UnifiedNlp/master/patches/android_frameworks_base-N.patch' && cd ~/'android/lineage' && patch --no-backup-if-mismatch --strip='1' --directory='frameworks/base' < ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' && rm -f ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' && sync ===== Steven Black's Unified Hosts File ===== * https://github.com/StevenBlack/hosts * This provides basic ad-blocking, anti-malware, and blocks other undesirable websites/connections rm -Rf '/tmp/master.zip' '/tmp/hosts-master' && wget 'https://github.com/StevenBlack/hosts/archive/master.zip' -O '/tmp/master.zip' && unzip '/tmp/master.zip' -d '/tmp' && python3 '/tmp/hosts-master/updateHostsFile.py' --auto --output ~/'android/lineage/system/core/rootdir/etc' && rm -Rf '/tmp/master.zip' '/tmp/hosts-master' && sync ===== Phone ===== * This needs done after breakfast sed -i 's/voice_capable">false/voice_capable">true/g' ~/'android/lineage/device/asus/deb/overlay/frameworks/base/core/res/res/values/config.xml' sed -i 's/aosp_base.mk/aosp_base_telephony.mk/g' ~/'android/lineage/device/asus/deb/lineage.mk' ====== Build Prep ====== ===== Cleanup ===== **** cd ~/'android/lineage' && make 'clobber' && sync ===== Set-up Environment ===== **** cd ~/'android/lineage' && source ~/'android/lineage/build/envsetup.sh' ===== Breakfast! ===== **** cd ~/'android/lineage' && breakfast 'deb' && sync ===== Environment Variables ===== ==== Disable ccache ==== **** unset 'CCACHE_DISABLE' && export 'CCACHE_DISABLE=1' ==== Jack ==== **** unset 'ANDROID_JACK_VM_ARGS' && export 'ANDROID_JACK_VM_ARGS=-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx12G' ====== Signed Build ====== ===== Key Management ===== ==== Generate ==== * Be sure to change ''emailAddress'' subject='/C=US/ST=Pennsylvania/L=Charleroi/O=Realm of Espionage/OU=Android/CN=Sean Lynn Rhone/emailAddress=espionage724@x' && mkdir ~/'.android-certs' && for x in releasekey platform shared media; do ~/'android/lineage/development/tools/make_key' ~/'.android-certs'/$x "$subject"; done ==== Backup ==== **** cd ~ && tar -cvzf ~/'Downloads/android-certs-'$(date +%Y-%m-%d)'.tar.gz' '.android-certs' && sync ==== Restore ==== **** cd ~ && tar -xvzf ~/'Downloads/android-certs-'*'.tar.gz' '.android-certs' && rm -f ~/'Downloads/android-certs-'*'.tar.gz' && sync ===== AIO ===== * Builds, signs the build, and generates a zip cd ~/'android/lineage' && mka target-files-package dist && sync && croot && ~/'android/lineage/build/tools/releasetools/sign_target_files_apks' -o -d ~/'.android-certs' ~/'android/lineage/out/dist/'*'-target_files-'*'.zip' ~/'android/lineage/signed-target_files.zip' && sync && ~/'android/lineage/build/tools/releasetools/ota_from_target_files' -k ~/'.android-certs/releasekey' --block --backup='true' ~/'android/lineage/signed-target_files.zip' ~/'Downloads/'$(date +%Y-%m-%d)'-lineageos-deb-unofficial.zip' && sync ===== Build ===== * This takes approximately 1 hour to complete cd ~/'android/lineage' && mka target-files-package dist && sync ===== Sign Build ===== **** croot && ~/'android/lineage/build/tools/releasetools/sign_target_files_apks' -o -d ~/'.android-certs' ~/'android/lineage/out/dist/'*'-target_files-'*'.zip' ~/'android/lineage/signed-target_files.zip' && sync ===== Generate Zip ===== **** ~/'android/lineage/build/tools/releasetools/ota_from_target_files' -k ~/'.android-certs/releasekey' --block --backup='true' ~/'android/lineage/signed-target_files.zip' ~/'Downloads/'$(date +%Y-%m-%d)'-lineageos-deb-unofficial.zip' && sync ===== Install Zip ===== * Flash ''~/Downloads/(date)-lineageos-deb-unofficial.zip'' ====== Unsigned Build ====== ===== Build and Generate Zip ===== * This takes approximately 1 hour to complete cd ~/'android/lineage' && croot && brunch 'deb' && sync ===== Install Zip ===== * Flash the 200MB+ zip found in ''~/android/lineage/out/target/product/deb'' ====== Nexus 7 Configuration ====== * [[devices:deb | Proceed here]] ====== Changelog ====== ===== Notes ===== * Unless otherwise specified, all uploaded builds are updated from the source (resync) prior to building * Changelog is listed oldest-to-newest ((new changelogs are on bottom)) ===== Changelog ===== * 2017/07/26: Initial build, 323 DPI, untested * 2017/07/27: Revert 323 DPI (back to stock 320), untested