Skip to content

IndiTheo/AOSP-Hidden-Framework-APIs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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.

Why

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.

Usage

Download pre-built JARs from Package Registry.

Maven

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>

Bazel

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"],

SDK Requests

If the version you need is not uploaded yet, open an issue.

Governance

You can audit the build process and artifacts using Releases or Tags.

Contributing

If there's an uncovered edge case or a missing feature—feel free to open an issue/PR.

Dependencies

Build Process

A project maintainer triggers a CI pipeline with the following inputs:

  • api_level: Android API level
  • gsi_url: URL of a hosted GSI image, should match the API level provided

A CI pipeline runs to:

  1. Set Up Tooling: Fetches dex2jar to handle bytecode conversion and the Android cmdline-tools to interface with the official SDK.

  2. Retrieve Official SDK: Uses sdkmanager to download the standard "stub" android.jar for the specified api_level.

  3. Extract GSI Framework: Downloads the Generic System Image (GSI) from the provided gsi_url and extracts the real framework.jar containing the full implementation.

  4. Convert DEX to Class Files: Runs dex2jar on the GSI framework to transform Android DEX files back into Java .class files.

  5. Merge and Overlay: Unpacks both the official stub JAR and the converted framework classes. It then uses rsync to overlay the real code onto the stubs, effectively adding back the internal APIs protected by @hide.

  6. 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.

Credits

Notice

  • 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.

License

GNU General Public License v2

About

Governed and reliable provision for complete framework AOSP JARs (Mirrored from GitLab)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors