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

41 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, jre, build-tools }:
stdenv.mkDerivation rec {
pname = "apktool";
2020-12-04 06:11:41 +00:00
version = "2.5.0";
src = fetchurl {
2017-10-24 19:05:31 +01:00
urls = [
"https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${version}.jar"
"https://github.com/iBotPeaches/Apktool/releases/download/v${version}/apktool_${version}.jar"
];
2020-12-04 06:11:41 +00:00
sha256 = "1r4z0z2c1drjd4ynpf36dklxs3hq1wdnzh63mk2yk4mmk75xg4mk";
};
2021-07-26 19:58:33 +01:00
dontUnpack = true;
2017-01-26 01:45:36 +00:00
nativeBuildInputs = [ makeWrapper ];
sourceRoot = ".";
installPhase =
let
tools = builtins.head build-tools;
in ''
install -D ${src} "$out/libexec/apktool/apktool.jar"
mkdir -p "$out/bin"
makeWrapper "${jre}/bin/java" "$out/bin/apktool" \
--add-flags "-jar $out/libexec/apktool/apktool.jar" \
--prefix PATH : "${tools}/libexec/android-sdk/build-tools/${tools.version}"
'';
meta = with lib; {
description = "A tool for reverse engineering Android apk files";
homepage = "https://ibotpeaches.github.io/Apktool/";
license = licenses.asl20;
maintainers = with maintainers; [ offline ];
2017-01-26 01:45:36 +00:00
platforms = with platforms; unix;
};
}