Skip to content

Repository files navigation

APK Link Gradle Plugin

A Gradle plugin for Android projects that converts APK files to JAR libraries and automatically adds them as compile only dependencies to your project.

Memory Requirements

Due to the resource-intensive nature of APK processing, it's recommended to allocate at least 4GB of memory to Gradle:

Add the following to your gradle.properties file:

org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8

Installation

Add the jitpack.io repository to settings.gradle

pluginManagement {

    repositories {
        ...
        maven(url = "https://jitpack.io")
    }

    resolutionStrategy {
        eachPlugin {
            if (requested.id.toString() == "dev.marcelsoftware.apklink-gradle") {
                useModule("dev.marcelsoftware:ApkLink-Gradle:${requested.version}")
            }
        }
    }
}

Apply the plugin in your build.gradle.kts

id("dev.marcelsoftware.apklink-gradle") version "1.0.2"

Usage

Configure the plugin in your build.gradle.kts

apklink {
    // Configuration goes here
}

Configuration

Using a local apk file

apklink {
    apkFile = file("path/to/your/app.apk")
    // Optional: specify a custom output location for the JAR
    outputFile = file("${buildDir}/libs/app.jar")
}

Downloading from APKPure

apklink {
    apkpure {
        packageName = "com.example.app"
        // Optional: specify a specific version
        version = "1.2.3"
    }
}

Downloading from a URL

apklink {
    url {
        url = "https://example.com/download/app.apk"
        // Optional: specify a custom filename
        fileName = "app.apk"
    }
}

License

MIT License

Credits

This plugin uses dex2jar for APK to JAR conversion.

About

A Gradle plugin for Android projects that converts APK files to JAR libraries and automatically adds them as compile only dependencies to your project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages