Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
fetchurl,
makeWrapper,
jdk_headless,
aapt,
}:
stdenv.mkDerivation rec {
pname = "apktool";
version = "2.12.1";
src = fetchurl {
urls = [
"https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${version}.jar"
"https://github.com/iBotPeaches/Apktool/releases/download/v${version}/apktool_${version}.jar"
];
hash = "sha256-Zs9FJKSkWn9WVn0Issm27CN7zdeM7mn9SlnIoCQ66vo=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
sourceRoot = ".";
installPhase = ''
install -D ${src} "$out/libexec/apktool/apktool.jar"
mkdir -p "$out/bin"
makeWrapper "${jdk_headless}/bin/java" "$out/bin/apktool" \
--add-flags "-jar $out/libexec/apktool/apktool.jar" \
--prefix PATH : ${lib.getBin aapt}
'';
meta = {
description = "Tool for reverse engineering Android apk files";
mainProgram = "apktool";
homepage = "https://ibotpeaches.github.io/Apktool/";
changelog = "https://github.com/iBotPeaches/Apktool/releases/tag/v${version}";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ offline ];
platforms = with lib.platforms; unix;
};
}