惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
量子位
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
IT之家
IT之家
F
Fortinet All Blogs
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Register - Security
The Register - Security
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
A
Arctic Wolf
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
Recent Announcements
Recent Announcements
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
P
Palo Alto Networks Blog
Y
Y Combinator Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AWS News Blog
AWS News Blog
有赞技术团队
有赞技术团队
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
aimingoo的专栏
aimingoo的专栏
Know Your Adversary
Know Your Adversary
Cyberwarzone
Cyberwarzone
Martin Fowler
Martin Fowler
The Hacker News
The Hacker News
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
博客园 - 聂微东
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
S
Securelist
T
The Exploit Database - CXSecurity.com
T
Threatpost
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
F
Full Disclosure

Black Hills Information Security, Inc.

Bad Habits: An ANTISOC Operation Same Problem, Different Angles: When Red Team and Blue Team Actually Talk to Each Other How to Identify and Exploit New Vulnerabilities Swapper – A Pure Regex Match/Replace Burp Extension A Practical Guide to BloodHound Data Collection Network Engineering Basics Signed, Trusted, and Abused: Proxy Execution via WebView2 Getting Started In Pentesting – Advice From The BHIS Pentest Lead Cloud Security: Tips and Resources for Securing the Cloud Lessons From A Chatbot Incident How to Lead Effective Tabletops Understanding GRC: How to Navigate Risks and Compliance Standards The “P” in PAM is for Persistence: Linux Persistence Technique Malware Analysis: How to Analyze and Understand Malware OSINT: How to Find, Use, and Control Open-Source Intelligence What to Do with Your First Home Lab When the SOC Goes to Deadwood: A Night to Remember Social Engineering and Microsoft SSPR: The Road to Pwnage is Paved with Good Intentions Common Cyber Threats Finding the Right Penetration Testing Company Deceptive-Auditing: An Active Directory Honeypots Tool The Curious Case of the Comburglar How to Set Smart Goals (That Actually Work For You) Inside the BHIS SOC: A Conversation with Hayden Covington Abusing Delegation with Impacket (Part 3): Resource-Based Constrained Delegation Why You Got Hacked – 2025 Super Edition Abusing Delegation with Impacket (Part 2): Constrained Delegation Abusing Delegation with Impacket (Part 1): Unconstrained Delegation GoSpoof – Turning Attacks into Intel Model Context Protocol (MCP) Bypassing WAFs Using Oversized Requests Getting Started with AI Hacking Part 2: Prompt Injection Wrangling Windows Event Logs with Hayabusa & SOF-ELK (Part 2) DomCat: A Domain Categorization Tool Wrangling Windows Event Logs with Hayabusa & SOF-ELK (Part 1) Microsoft Store and WinGet: Security Risks for Corporate Environments Default Web Content MailFail Commonly Abused Administrative Utilities: A Hidden Risk to Enterprise Security Stop Spoofing Yourself! Disabling M365 Direct Send Bypassing CSP with JSONP: Introducing JSONPeek and CSP B Gone Offensive Tooling Cheatsheets: An Infosec Survival Guide Resource DNS Triage Cheatsheet GraphRunner Cheatsheet Burp Suite Cheatsheet Impacket Cheatsheet Wireshark Cheatsheet Hashcat Cheatsheet EyeWitness Cheatsheet Nmap Cheatsheet Netcat (nc) Cheatsheet Hunt for Weak Spots in Your Wireless Network with Airodump-ng from the Aircrack-ng Suite Detecting ADCS Privilege Escalation Vulnerability Scanning with Nmap Getting Started with NetExec: Streamlining Network Discovery and Access How to Use Dirsearch Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 3: Arcanum Cyber Security Bot How to Design and Execute Effective Social Engineering Attacks by Phone Abusing S4U2Self for Active Directory Pivoting Why Use a Macro Pad? Espanso: Text Replacement, the Easy Way Caging Copilot: Lessons Learned in LLM Security Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 2: Copilot Augmenting Penetration Testing Methodology with Artificial Intelligence – Part 1: Burpference Intercepting Traffic for Mobile Applications that Bypass the System Proxy How to Root Android Phones Communicating Security to the C-Suite: A Strategic Approach Offline Memory Forensics With Volatility Getting Started with AI Hacking: Part 1 Go-Spoof: A Tool for Cyber Deception How to Test Adversary-in-the-Middle Without Hacking Tools Canary in the Code: Alert()-ing on XSS Exploits How to Hack Wi-Fi with No Wi-Fi Why Your Org Needs a Penetration Test Program Burp Suite Extension: Copy For Light at the End of the Dark Web Wi-Fi Forge: Practice Wi-Fi Security Without Hardware Avoiding Dirty RAGs: Retrieval-Augmented Generation with Ollama and LangChain Gone Phishing: Installing GoPhish and Creating a Campaign 5 Things We Are Going to Continue to Ignore in 2025 John Strand’s 5 Phase Plan For Starting in Computer Security Questions From a Beginner Threat Hunter GRC for Security Managers: From Checklists to Influence AI Large Language Models and Supervised Fine Tuning Attack Tactics 9: Shadow Creds for PrivEsc w/ Kent & Jordan One Active Directory Account Can Be Your Best Early Warning Introduction to Zeek Log Analysis Indecent Exposure: Your Secrets are Showing Creating Burp Extensions: A Beginner’s Guide Pitting AI Against AI: Using PyRIT to Assess Large Language Models (LLMs) The Top Ten List of Why You Got Hacked This Year (2023/2024) ICS Hard Knocks: Mitigations to Scenarios Found in ICS/OT Backdoors & Breaches Intro to Data Analytics Using SQL Finding Access Control Vulnerabilities with Autorize The Detection Engineering Process Cyber Risk Lessons We Can Learn From Hurricane Preparedness Intro to Desktop Application Testing Methodology What Is Penetration Testing? Adversary in the Middle (AitM): Post-Exploitation Pentesting, Threat Hunting, and SOC: An Overview
How to Install LineageOS on Your Android Device
BHIS · 2024-07-11 · via Black Hills Information Security, Inc.

Hey guys, my name is Connor. I am a web developer here at BHIS who also loves hacking phones. Particularly, Android phones! Today, I am going to show you the basics on installing LineageOS onto your Android device while providing extra detail and background on the installation process as a whole. Although this tutorial is aimed at installing LineageOS specifically, the lessons taught here can be applied to installing other ROMs for your device. 

What is Lineage? Why Lineage? 

To understand Lineage, it would be good to first go over a little bit of history regarding Android. Android’s Operating System is an open-source Linux operating system that is maintained by Google. This does not mean that someone can access the OS code for flagship phones such as the Samsung Galaxy, Google Pixel, OnePlus, etc. as they have added closed source code on top of the open-source base Android OS code. This baseline Android OS is exactly what LineageOS takes advantage of. It is a distribution of the open-source baseline Android code that is distributed for a massive number of smartphones. These distributions allow older phones to upgrade to newer Android OS versions without getting a factory update, extending the life of these phones greatly. This open-source version of Android also allows users to root their phones, giving them extra permissions as well as the removal of the Google API from the OS entirely (which is impossible with the built-in OS of most smartphones).  

A WORD OF CAUTION BEFORE CONTINUING 

Before continuing, it is worth noting that installing a new OS onto any Android device is risky. Data will be formatted during the installation process, which means you should make sure to BACK UP ALL IMPORTANT FILES before continuing! There is also the risk of “bricking” your smartphone. This is when the bootloader is no longer functional and cannot load either LineageOS or the original operating system, leaving the phone in an unusable state. During the installation, the option to not install GApps (Google apps, such as play store, Google Maps, Gmail, etc) will be available If you choose to not install GApps, just know that there will be apps that will not work properly and many that may not run entirely. Due to these potential dangers listed above, it is best to install LineageOS on a smartphone that is sitting on your shelf or in your drawer, and not the current phone you have in use. If you do wish to install LineageOS on your most current smartphone, proceed with caution!  

What you need to get started 

  • An Android smartphone (preferably an older phone that is supported by LineageOS (see the supported devices here) with developer mode enabled. 
  • A computer/laptop with Android ADB platform tools installed to an accessible directory (should include fastboot as well). We will go over downloading this in the tutorial, so do not worry if you do not have these yet. 
  • A wire capable of connecting and transferring data between your Android phone and computer. This usually can be a charging wire that is USB to Micro USB. 
  • A copy of the LineageOS ROM file for your specific device (we will go over getting this in the tutorial) 
  • A recovery ROM for fastboot. LineageOS offers their own recovery software that we will use, but TWRP is a common recovery ROM that people use as well. If you are already comfortable with TWRP, then feel free to use it! 
  • .APK files for installing any specific apps that require pre-boot installation (see recommendations below). These are not required to install the OS, but often are wanted by users and must be installed into the system before the first bootup of the OS. 
  • A can-do attitude! 

Recommended (but optional) packages to install: 

  • Magisk – A systemless root app, that makes granting and revoking super user privileges to apps easy. 
  • MindTheGaaps – a package that contains Google apps such as play store, Gmail, Google Maps, etc. This is good for people who want the Google apps included with the open-source nature of LineageOS (Note: if your goal is to create a “ghost phone,” do not use Google services). 
  • Fdroid – It is an alternative app store that carries a decent library of good apps, games, utilities, etc. 

Getting everything ready to go 

Assuming you have your Android device ready to go, let’s get the computer or laptop set up for this job. First and foremost, we are going to install Android platform tools. These tools include both the Android Development Bus (adb) and fastboot tools. LineageOS has a really good guide on installing the necessary tools. You can also download the development tools directly from the Android site

Once we have Android platform tools installed, we need to see if adb works. To get adb to work with your Android device, the device must be running with developer mode enabled. To do this, go into the “about” section of your phone settings. Once there, find the build number and tap on it around 10 times until developer mode is activated. If you cannot find the build number, I recommend you Google how to enable developer mode for your phone. Now that you can access the developer options, make sure to enable USB Debugging, and OEM Unlocking can be enabled if your system supports it. 

 Once this is ready to go, plug your Android device into the computer. There should be a dialog on your Android device that asks if you should enable USB debugging. Make sure to allow it (you can also say “always allow” so you don’t have to allow it every time). Once it is allowed, entering the command “adb devices” in your command prompt/terminal should show your Android device. 

Now that we have adb installed and set up, we will need the ROM files necessary for LineageOS installation. Head to the devices page of the LineageOS site and find your device. Once you see your model, click on it to view useful info such as the special boot modes and how to access them, as well as quirks that are known for your device. Click the “Get the Builds Here” link in the downloads section to get the 2-3 files you need for installation (should be a .zip file as well as a .img file).  

Click the installation link to see the step-by-step for your device. I am going to be going over the general steps, but I recommend going through the specific installation guide for your device from LineageOS, alongside this guide (you can access it from the devices page on the LineageOS website). Given that guide is specific for every device, those instructions will be more important than the general guide of this article. 

A note on LineageOS official ROM files vs unofficial ROM files: You may notice that LineageOS supports a good number of older devices on their website. Due to the open-source nature of LineageOS, there are places you can go (often XDA forums) that will have links to ROM files that are LineageOS-built to run on an unofficial device. These ROM files often work well enough to get the phone running, with some of the devices garnering a massive number of developers and support. You can, if you wish, use these unofficial ROMs, but you should be cautious, as there is little support for these unofficial builds and unofficial sources could be malicious, so caution is advised. I only recommend using unofficial builds of LineageOS if you know what you are doing and have installed LineageOS before. 

Free the bootloader 

The first step you need to make on your Android device is unlocking the bootloader. This will vary greatly across each device, and I recommend you follow the instructions on your LineageOS installation guide for your specific device. Be warned: unlocking the bootloader will reset your phone, meaning you will lose all data and apps. Make sure everything is backed up before continuing! If your guide does not include instructions on how to unlock the bootloader or a link to a guide, a quick Google search should point you in the right direction. Once the bootloader is unlocked, you can proceed to the next step. 

Quick note on adb, fastboot, and the bootloader: Adb is often run when the Android device is booted up and running (the phone is running as normal and not in the bootloader). Fastboot commands run when the device is rebooted into the bootloader. When the device is operational, running “fastboot devices” will return nothing, but typing “adb devices” will show your phone (assuming USB debugging was enabled). Vice versa when you are in the bootloader, so there is no need for alarm when adb does not return anything in the bootloader.  

When the bootloader is present, you will not see any devices using the adb command.  

Adb will only be accessible during the bootloader process when it is specifically enabled in recovery, but is not needed during the bulk of the bootloader process. The bootloader itself can be thought of as the BIOS of a phone. It is what will load the OS after boot. The reason it must be unlocked is to allow us to make changes to what the bootloader loads upon boot. 

A little more in-depth with the bootloader, unlocking, and the boot up process of Android devices in general 

The LineageOS wiki will guide you through the process of getting the bootloader unlocked and ready to install the OS, but let’s take a moment before we begin that process to really understand what we are doing under the hood. If you want to continue with the installation process, feel free to jump to the next section. 

When the Android device starts up, the low-level code instantiates the memory of the system. Once the memory is set, the code can begin checking the partitions and boot images. If something is off or improperly loaded, recovery will be booted up. If everything passes ok, the boot image begins loading and instantiating. After everything is properly loaded and run, the OS starts up and the user can begin interacting with the phone. 

What we are doing when installing LineageOS is replacing the boot images that come from the phone vendor with Lineage’s own boot image. To install this, we must be in the bootloader level. Unlocking the bootloader will give the bootloader permission to install/modify system images and various files. The recovery image that was downloaded alongside the LineageOS image will allow us to install the OS image through the recovery process, as well as other various APK files (we will discuss this more in detail later).  

This is where the fun begins… accessing recovery 

Now that our bootloader is cleared, we are good to flash the recovery image to the bootloader and truly begin the installation process. There are multiple ways you can access the bootloader, but the two most straightforward ways are through the physical buttons on your phone, and the adb command. Every phone is different in configuration but restarting the phone and holding “volume down and power” together, or some similar combination of buttons, should give you access to the bootloader menu (feel free to Google the exact combination for your device or check the LineageOS instructions for your device). If you have your phone still connected to the PC with a terminal open, another option is entering the command “adb -d reboot bootloader” in your terminal.  

Your Bootloader look may vary, but it should be similar looking to this 

You should see the device turn off for a brief moment and restart in the bootloader. For some devices, you may get a warning about the bootloader being unlocked, but you can ignore this message, as that is exactly what we need for installation.  

Once the menu is active, try entering and executing the command, “fastboot devices”. You should see your device ID there. If it is there, the next step is to flash the recovery image. When you “flash” an image to the bootloader, you are booting something up that is different than the traditional vendor image. This means instead of booting into the normal OS that is run by the vendor, we will boot into the LineageOS recovery image. Look at your installation guide for your specific device for the exact command, but it should be close to the command “fastboot flash boot [NameOfYourBoot].img” or “fastboot flash recovery recovery.img”. Running this command should boot up the recovery.  

Now that recovery is running, we can install Lineage. 

Installing LineageOS (And other apps) 

Now that we have recovery booted up and running, we can begin installing the actual zip package containing the OS. 

NOTE: Please read through this section ENTIRELY before executing any commands, as there are steps that must be performed in order to successfully install. This is the POINT OF NO RETURN. Once you start loading the files of LineageOS, there is no going back! 

Tap the section of recovery that says, “factory reset”. Choose the option within that menu that states “Format data/ factory reset”. This will remove all data in the system, as well as system files.  

Once this finishes, you can return to the menu and begin sideloading the OS zip file. Sideloading is a term used by Android developers and modders that allows packages such as zip files and APKs to be installed through the adb, rather than the Google Play store or other software store. Select “Apply Update” and then the “Apply from ADB” from the menu. This enables the adb temporarily, which will allow us to run the sideload commands. Make sure to check the exact command in your specific device guide on the LineageOS website, but the command should look similar to “adb -d sideload [filename of LineageOS package].zip”.  

Once the install is complete, it may ask you to reboot, but do not reboot if you are planning on installing certain root software such as Magisk or low-level apps such as Google Apps or mind the GAPPS. These apps require installation in this recovery BEFORE the new OS boots up and initializes. You can install all these apps in a similar way by sideloading them through the adb. Tap the “Apply Update” and “Apply from ADB” option that you selected before to turn the adb capabilities back on. From there, you can simply install each desired apk package by typing in “adb -d sideload [package].apk”.” 

Once you have installed the packages you like, tap the “reboot system now” option and enjoy your new OS! 

Stuck? Need some extra help?

Feel free to reach out to the tool-sharing channel of our Discord



Ready to learn more?

Level up your skills with affordable classes from Antisyphon!

Pay-What-You-Can Training

Available live/virtual and on-demand