A command-line tool to generate a list of required missing Android OS Project blobs.

Overview

aosp-missing-blobs

aosp-missing-blobs is a nifty tool to identify required blobs (.so) that are missing from AOSP ROM builds, and to show which existing blobs rely on them. This will be particularly useful for ROM developers who want to ensure that they have not missed out any required proprietary OEM blobs.

Concept

Blobs (.so) and compiled binaries in Android need other blobs to work. It is possible to identify the dependencies for each blob by inspecting their ELF information:

$ readelf -d 
   
     | grep "\(NEEDED\)" | sed -r "s/.*\[(.*)\]/\1/"

   

Example (finding the dependencies of libqti_performance.so):

$ readelf -d libqti_performance.so | grep "\(NEEDED\)" | sed -r "s/.*\[(.*)\]/\1/"
libnativehelper.so
liblog.so
libcutils.so
libutils.so
libbase.so
[email protected]
libhidlbase.so
libhidltransport.so
libqti-perfd-client_system.so
libhwui.so
libc++.so
libc.so
libm.so
libdl.so

From the example, we can see that libqti_performance.so depends on libqti-perfd-client_system.so and [email protected].

aosp-missing-blobs uses this idea to identify all the dependencies of a given list of blobs, and to check whether any of these dependencies are not present.

Installation

Cargo

You can install with cargo after setting up Rust:

cargo install aosp-missing-blobs

Building

aosp-missing-blobs is written in Rust, hence you'll need Rust to be installed to build the project.

In the root directory of the repo, execute:

$ git clone https://github.com/joshchoo/aosp-missing-blobs
$ cd aosp-missing-blobs
$ cargo build --release

$ ./target/release/aosp-missing-blobs

A runnable aosp-missing-blobs binary will be produced.

Usage

This program takes as arguments a list of directories that contain compiled binaries and blobs (.so).

$ aosp-missing-blobs 
    
     
      
      

      
     
    
   

Search blob directories recursively:

$ aosp-missing-blobs -r 
   

   

Example

Assuming you have extracted the ROM's system.img and vendor.img to ~/system and ~/vendor, respectively, run the following:

$ aosp-missing-blobs ~/system/lib ~/vendor/lib

The program does the following:

  1. Search ~/system/lib and ~/vendor/lib directories for blobs.
  2. Identify dependencies of each blob found.
  3. Checks if required dependencies exist in ~/system/lib and ~/vendor/lib.
  4. Output a list of missing dependencies and existing blobs that need them.

Depending on how wide your search scope is, the program may flag out missing dependencies 'incorrectly'. Some dependencies may exist in other directories besides what the examples have shown. Other directories with blobs include the following:

  • /system/bin
  • /system/lib[64]
  • /system/lib[64]/vndk-28
  • /system/lib[64]/vndk-sp-28
  • /vendor/bin
  • /vendor/lib[64]
  • /vendor/lib[64]/vndk
  • Etc.

Take note that the more directories you specify as arguments, the longer the program will run for!

You might also like...
Generate a dependency list to thank them on README.

thanks-dependencies This generates list of dependencies. I think it's better to publish dependencies explicitly on documentation. Of course users can

Generate basic VCard QR codes from the command line.
Generate basic VCard QR codes from the command line.

vcard-qr Generate basic VCard QR codes from your terminal. Stick them on your things so people can contact you if they get lost! This little program i

Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

 A command-line utility that creates project structure.
A command-line utility that creates project structure.

petridish A command-line utility that creates project structure. If you have heard of the cookiecutter project, petridish is a rust implementation of

A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper with a

argmax argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper w

Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

auto-rust is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, utilizing procedural macros.
auto-rust is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, utilizing procedural macros.

Auto Rust auto-rust is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, util

CLI tool that extracts a regex pattern from a list of urls ( Rust )

rextract CLI tool that extracts a regex pattern from a list of urls. The tool is written in Rust and supports PCRE. Installation Step 1: Visit https:/

Comments
  • lib: Skip files unable to be read

    lib: Skip files unable to be read

    • Instead of aborting everything, let's just skip the files that errors out
    • Example: Warning: Could not read file libdl_android.so, skipping... Warning: Could not read file libm.so, skipping... Warning: Could not read file libdl.so, skipping... Warning: Could not read file libc.so, skipping... -proper list afterwards-

    Change-Id: I04fa06b7eec06ba965be8836c16f0f1da311955a

    opened by SebaUbuntu 9
  • can this tool be made recursive ?

    can this tool be made recursive ?

    its very hard to get all folders to be detected , maybe can this tool be made recursive so you can just set vendor and system as paths and the tool will recursivly scan folders

    opened by J0SH1X 6
  • Question

    Question

    Is it possible if we search recursively but only for specific blobs? Eg. I only want to print out what's needed by [email protected]

    opened by laleeroy 2
Releases(1.0-legacy)
Owner
Josh
I build mobile and web experiences! Formerly dabbled with embedded Android Operating Systems and Kernels. Now scratching the Rust itch.
Josh
This is an example Nostr rust project to enable '402 Payment Required' responses for requests to paid content.

Nostr Paywall Example This is an example Nostr rust project to enable 402 Payment Required responses for requests to paid content. To prove payment, a

Blake Jakopovic 6 May 6, 2023
Metaballs (blobs) coded in Rust. 100% software rendering.

Metaballs (blobs) coded in Rust. 100% software rendering. It is basically a Rust version of my old demo effect from the 90s (back then we'd use a fake Phong shading, though).

Maciej Sinilo 7 Dec 4, 2022
A low-level MVCC file format for storing blobs.

Sediment This repository isn't ready for public consumption. It just reached a stage where I wanted to start sharing ideas with others as well as usin

Khonsu Labs 24 Jan 8, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023
Send files between machines - no installation required!

skicka.pwy.io:99 Skicka (from Swedish send) allows to send files between machines - no installation required! Transmitting a file is as easy as piping

Patryk Wychowaniec 55 Jul 12, 2023
Command-line tool to generate Rust code for Google Cloud Spanner

nene nene is a command-line tool to generate Rust code for Google Cloud Spanner. nene uses database schema to generate code by using Information Schem

Naohiro Yoshida 3 Dec 7, 2021
belt is a command line app that can show your time from a list of selected time zones

A CLI app to show your time from a list of selected time zones, and a rust lib to parse dates in string formats that are commonly used.

Rollie Ma 23 Nov 4, 2022
tmplt is a command-line interface tool that allows you to quickly and easily set up project templates for various programming languages and frameworks

tmplt A User Friendly CLI Tool For Creating New Projects With Templates About tmplt is a command-line tool that lets users quickly create new projects

Humble Penguin 35 Apr 8, 2023
Cargo-about - 📜 Cargo plugin to generate list of all licenses for a crate 🦀

?? cargo-about Cargo plugin for generating a license listing for all dependencies of a crate See the book ?? for in-depth documentation. Please Note:

Embark 281 Jan 1, 2023