Skip to content

anirudhmalik/apktool-android

Repository files navigation

apktool-android

Android CI Release License

apktool-android is an Android library (AAR) that runs Apktool’s decode → edit project tree → rebuild flow inside your app process. You get a normal resource/smali workspace on disk and a rebuilt APK without relying on a desktop CLI, Termux, adb shell, or root. The AAR ships per-ABI libaapt2.so (fully static, NDK-built) and a small entry point—ApktoolAndroid.configure(Context)—that points Apktool at executable-safe paths on Android (nativeLibraryDir, app filesDir / cacheDir).

Scope

In scope Out of scope
In-app decode/build using ApkDecoder / ApkBuilder with Android-safe Config Installing or documenting the desktop apktool JAR/CLI workflow
Bundled aapt2 as libaapt2.so + optional self-build docs under aapt2-build/ Fork maintenance of upstream Apktool feature roadmaps

Documentation

Doc Purpose
USAGE.md Android integration: Gradle, manifest, ApktoolAndroid, full Config reference, threading, heap, releases
aapt2-build/README.md Rebuild and install libaapt2.so for jniLibs/; output contract; licence notes
aapt2-build/SELF_BUILD_PLAN.md Self-build strategy, patch stack, and historical runbook
aapt2-build/patches/README.md Canonical vs recipe-local patches; re-export procedures

Build (library AAR)

./gradlew :brut.apktool:apktool-android:assembleRelease
# Output: brut.apktool/apktool-android/build/outputs/aar/apktool-android-release.aar

Note: If you drop only that AAR into another app, you must also vendor the runtime JARs from ./gradlew :brut.apktool:apktool-android:collectRuntimeJars — see USAGE.md — Gradle integration.

For JVM/unit tests on apktool-lib and instrumented tests, see Building from source in USAGE.md.

Acknowledgments

  • iBotPeaches/Apktool — The resource table, smali/DEX, and rebuild pipeline live in apktool-lib and come from the main Apktool project. apktool-android only adds the Android packaging, paths, and aapt2 binary story.
  • ReVanced/aapt2 — The cross-compile recipe (CMake, AOSP submodule pin, patch flow) is vendored under aapt2-build/recipe/ and extended as documented in aapt2-build/README.md.
  • Critical aapt2 patches (authors) — We keep canonical diffs under aapt2-build/patches/ for audit and attribution:

License

Apache-2.0 — see LICENSE.md. The vendored ReVanced build scripts under aapt2-build/recipe/ are GPL-3.0 (their LICENSE is preserved). The shipped libaapt2.so binaries and the AAR are not GPL-3.0; see Licence story in aapt2-build/README.md.

About

Android library that runs Apktool’s APK decode → edit → rebuild flow inside your app, with bundled static libaapt2.so and no desktop CLI, Termux, or root.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors