2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, jdk_headless
|
|
|
|
, aapt
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "apktool";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "2.8.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"
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-e0qOFwPiKNIG2ylkS3EUFofYoRG1WwObCLAt+kQ6sPk=";
|
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 =
|
2023-08-04 22:07:22 +00:00
|
|
|
''
|
2021-08-05 21:33:18 +00:00
|
|
|
install -D ${src} "$out/libexec/apktool/apktool.jar"
|
|
|
|
mkdir -p "$out/bin"
|
2023-08-04 22:07:22 +00:00
|
|
|
makeWrapper "${jdk_headless}/bin/java" "$out/bin/apktool" \
|
2021-08-05 21:33:18 +00:00
|
|
|
--add-flags "-jar $out/libexec/apktool/apktool.jar" \
|
2023-08-04 22:07:22 +00:00
|
|
|
--prefix PATH : ${lib.getBin aapt}
|
2021-08-05 21:33:18 +00:00
|
|
|
'';
|
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";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://ibotpeaches.github.io/Apktool/";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2023-08-04 22:07:22 +00:00
|
|
|
license = licenses.asl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2023-08-04 22:07:22 +00:00
|
|
|
platforms = with platforms; unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|