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";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "2.10.0";
|
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"
|
|
|
|
];
|
2024-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-wDUKu6tTFCSN/i7gyQfe9O3RT2+u8fXTctPUq9KPBDE=";
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool for reverse engineering Android apk files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "apktool";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://ibotpeaches.github.io/Apktool/";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/iBotPeaches/Apktool/releases/tag/v${version}";
|
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
|
|
|
};
|
|
|
|
}
|