nixpkgs/pkgs/development/tools/apktool/default.nix

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

46 lines
1.2 KiB
Nix
Raw Normal View History

2023-07-23 12:40:09 +00:00
{ lib
, stdenv
, fetchurl
, makeWrapper
, jdk_headless
, aapt
}:
stdenv.mkDerivation rec {
pname = "apktool";
2023-12-08 10:24:21 +00:00
version = "2.9.1";
src = fetchurl {
2017-10-24 18:05:31 +00:00
urls = [
"https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${version}.jar"
"https://github.com/iBotPeaches/Apktool/releases/download/v${version}/apktool_${version}.jar"
];
2023-12-08 10:24:21 +00:00
hash = "sha256-3nzoqhCay2Sef2nP6RAw/8INvMRu3Yq79sLR42z8zXs=";
};
2021-07-26 18:58:33 +00:00
dontUnpack = true;
2017-01-26 01:45:36 +00:00
nativeBuildInputs = [ makeWrapper ];
sourceRoot = ".";
installPhase =
2023-07-23 12:40:09 +00:00
''
install -D ${src} "$out/libexec/apktool/apktool.jar"
mkdir -p "$out/bin"
2023-07-23 12:40:09 +00:00
makeWrapper "${jdk_headless}/bin/java" "$out/bin/apktool" \
--add-flags "-jar $out/libexec/apktool/apktool.jar" \
2023-07-23 12:40:09 +00:00
--prefix PATH : ${lib.getBin aapt}
'';
meta = with lib; {
description = "A tool for reverse engineering Android apk files";
2023-07-23 12:40:09 +00:00
homepage = "https://ibotpeaches.github.io/Apktool/";
2023-12-08 11:43:53 +00:00
changelog = "https://github.com/iBotPeaches/Apktool/releases/tag/v${version}";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2023-07-23 12:40:09 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ offline ];
2023-07-23 12:40:09 +00:00
platforms = with platforms; unix;
};
}