Giter Club home page Giter Club logo

apk2aar's Introduction

APK to AAR Converter

This project converts an APK file into an Android AAR library. It uses apktool to decompile the APK and gradle to build the AAR. The library will be named after the package name from the manifest with _library appended.

Prerequisites

Ensure you have the following installed on your system:

  • Node.js
  • Java 8
  • Gradle
  • apktool (apktool_2.9.3.jar should be placed in the root directory of this project)

Project Structure

apk-to-aar
├── apktool_2.9.3.jar
├── index.js
├── package.json
└── templates
    ├── build.gradle
    ├── settings.gradle
    └── gradle
        └── wrapper
            ├── gradle-wrapper.jar
            └── gradle-wrapper.properties

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd apk-to-aar
  2. Install dependencies:

    npm install
  3. Ensure apktool_2.9.3.jar is placed in the root directory of the project.

Usage

To convert an APK to an AAR, use the following command:

npm start -- --input path/to/your.apk

Options

  • -i, --input <path>: APK file path (required)
  • -x, --exclude <classes>: Classes to exclude, comma separated
  • -r, --exclude-resources: Exclude resources from AAR
  • -h, --help: Display help

Examples

  1. Convert an APK to AAR:

    npm start -- --input path/to/your.apk
  2. Convert an APK to AAR and exclude specific classes:

    npm start -- --input path/to/your.apk -x ClassToExclude1,ClassToExclude2
  3. Convert an APK to AAR and exclude resources:

    npm start -- --input path/to/your.apk -r

Output

The generated AAR file will be located in the out/<apk_name>/<package_name>_library/build/outputs/aar/ directory.

Example:

AAR file generated: /path/to/project/out/com.example.app/com.example.app_library/build/outputs/aar/com.example.app_library-release.aar

Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

apk2aar's People

Contributors

luca-saggese avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.