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

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

45 lines
1.1 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-07-23 12:40:09 +00:00
version = "2.8.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-07-23 12:40:09 +00:00
hash = "sha256-e0qOFwPiKNIG2ylkS3EUFofYoRG1WwObCLAt+kQ6sPk=";
};
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/";
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;
};
}