AOSP Hidden Framework APIs
Governed and reliable provision for complete framework AOSP JARs.
To provide a sustainable platform for building power-user apps, the JARs are created as part of a CI pipeline and published as Packages accessible from Releases. SDK JARs are merged with a complete framework JAR to include all AOSP classes and allow access to hidden APIs.
Up until now, power-user developers had to manually repack JARs, or rely on third-party repositories hosted by other developers to compile apps for Android™ with hidden APIs included. As repacking is tedious and error-prone, and using self-hosted JARs poses security risks, this project was born to provide the framework JARs in a semi-automatic, transparent fashion.
While some use reflection for hidden API access, it may be considered overkill, and is generally a "nasty" patch we'd like to avoid in favor of static binding.
Download pre-built JARs from Package Registry.
Add the configuration below to your pom.xml file:
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab.com/api/v4/projects/81628475/packages/maven</url>
</repository>
</repositories>Add this to your pom.xml dependencies block:
<dependency>
<groupId>indi.android</groupId>
<artifactId>aosp-framework-library</artifactId>
<version>(SDK LEVEL)</version>
</dependency>Load the maven package rules in MODULE.bazel and specify the artifact:
bazel_dep(name = "rules_jvm_external", version = "6.9")
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "maven",
artifacts = [
"indi.android:aosp-framework-library:(SDK LEVEL)",
],
repositories = [
"https://gitlab.com/api/v4/projects/81628475/packages/maven",
],
)
use_repo(maven, "maven")Specify dependencies wherever required:
deps = ["@maven//:indi_android_aosp_framework_library"],If the version you need is not uploaded yet, open an issue.
You can audit the build process and artifacts using Releases or Tags.
If there's an uncovered edge case or a missing feature—feel free to open an issue/PR.
A project maintainer triggers a CI pipeline with the following inputs:
api_level: Android API levelgsi_url: URL of a hosted GSI image, should match the API level provided
A CI pipeline runs to:
-
Set Up Tooling: Fetches
dex2jarto handle bytecode conversion and the Androidcmdline-toolsto interface with the official SDK. -
Retrieve Official SDK: Uses
sdkmanagerto download the standard "stub"android.jarfor the specifiedapi_level. -
Extract GSI Framework: Downloads the Generic System Image (GSI) from the provided
gsi_urland extracts the real framework.jar containing the full implementation. -
Convert DEX to Class Files: Runs
dex2jaron the GSI framework to transform Android DEX files back into Java.classfiles. -
Merge and Overlay: Unpacks both the official stub JAR and the converted framework classes. It then uses
rsyncto overlay the real code onto the stubs, effectively adding back the internal APIs protected by@hide. -
Repackage and Release: Re-zips the merged content into a custom framework JAR and publishes it as a Package (generic file and Maven), referenced by a Release and a Tag.
-
This repository is an independent project and is not affiliated with, endorsed by, or in any way officially connected with Google LLC or any of its subsidiaries. Android is a trademark of Google LLC.
-
The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.