2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, jre, build-tools }:
|
2014-05-22 14:29:36 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "apktool";
|
2021-09-06 01:52:11 +01:00
|
|
|
version = "2.6.0";
|
2014-05-22 14:29:36 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
2021-09-06 01:52:11 +01:00
|
|
|
sha256 = "sha256-91CjzSwflC8n9ff9XRfq2jva/wpmQ/SduEfoQlef3aU=";
|
2014-05-22 14:29:36 +01:00
|
|
|
};
|
|
|
|
|
2021-07-26 19:58:33 +01:00
|
|
|
dontUnpack = true;
|
2014-05-22 14:29:36 +01:00
|
|
|
|
2017-01-26 01:45:36 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-05-22 14:29:36 +01:00
|
|
|
|
2015-07-28 01:55:55 +01:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-07-24 12:40:07 +01: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}"
|
|
|
|
'';
|
2014-05-22 14:29:36 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2014-05-22 14:29:36 +01:00
|
|
|
description = "A tool for reverse engineering Android apk files";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://ibotpeaches.github.io/Apktool/";
|
2014-05-22 14:29:36 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline ];
|
2017-01-26 01:45:36 +00:00
|
|
|
platforms = with platforms; unix;
|
2014-05-22 14:29:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|