2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, jre, build-tools }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "apktool";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "2.6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
|
|
|
"https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${version}.jar"
|
|
|
|
"https://github.com/iBotPeaches/Apktool/releases/download/v${version}/apktool_${version}.jar"
|
|
|
|
];
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "sha256-vCuah6xahpBbbKNDwhoNs7w3vdURVLyc32VSPZWJXTQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
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}"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A tool for reverse engineering Android apk files";
|
|
|
|
homepage = "https://ibotpeaches.github.io/Apktool/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline ];
|
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|