Other Language: 中文
AnalyzeSoGradlePlugin is a Gradle plugin for analyzing the source and architecture of Android so libraries, helping developers better understand the so files introduced by various dependencies in their project.
- Output the source and architecture information of so libraries
- Detect 16KB memory page size to help adapt to Android 15 requirements(Support 16 KB page sizes)
- Beautiful HTML report output to quickly identify native libraries that are not compatible with Android 15 and their sources
- Add task to aggregate all variants and generate a combined HTML report
- Integrate with LibChecker-Rules database to provide more detailed library information in the HTML report
- Issues and suggestions are welcome!
Purpose: the plugin runs objdump -p to parse ELF Program Headers for Align 2**N (page size). If you only need the so library source and architecture info, you can ignore this.
- Install binutils if missing:
- Debian/Ubuntu:
sudo apt-get install binutils - Fedora/RHEL/CentOS:
sudo dnf install binutils - Arch:
sudo pacman -S binutils
- Debian/Ubuntu:
- Usually works out of the box. If needed:
brew install binutils.
- Download and run the TDM-GCC installer: https://jmeubank.github.io/tdm-gcc/
- During setup, choose "Add to PATH" (or the equivalent option).
- Finish installation.
objdump.exewill be available to Gradle.
How to apply the Gradle plugin:
This plugin is published on Maven Central:
${LAST_VERSION}: (excluding 'v')
In your build.gradle file:
plugins {
id("io.github.ravenliao.analyze-so") version "$LAST_VERSION"
}After applying the plugin, Gradle will automatically generate analysis tasks for each build variant:
# Analyze so files for a specific variant
./gradlew analyze[VariantName]So
# For example, analyze debug variant
./gradlew analyzeDebugSo
# Analyze so files for all variant
./gradlew analyzeSoAfter running the analysis, the path to the detailed HTML report will be shown at the end of the task output. The report is typically located at:
app/build/reports/analyze-so/[VariantName]/analyze-so-report.html
For example, for the debug variant, the report will be at:
app/build/reports/analyze-so/Debug/analyze-so-report.html
- mainlxl/AnalyzeSoPlugin: This project references its implementation ideas
- LibChecker/LibChecker-Rules: Thank for so info database
Apache 2.0. See LICENSE for details.