Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, fetchurl, makeWrapper, jre, build-tools }:
2
3stdenv.mkDerivation rec {
4 pname = "apktool";
5 version = "2.4.1";
6
7 src = fetchurl {
8 urls = [
9 "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${version}.jar"
10 "https://github.com/iBotPeaches/Apktool/releases/download/v${version}/apktool_${version}.jar"
11 ];
12 sha256 = "0ljsh8nx065isnyzzrwddypikkfhyqsww0w02cgwgh8x3lhndsxx";
13 };
14
15 phases = [ "installPhase" ];
16
17 nativeBuildInputs = [ makeWrapper ];
18
19 sourceRoot = ".";
20
21 installPhase = ''
22 install -D ${src} "$out/libexec/apktool/apktool.jar"
23 mkdir -p "$out/bin"
24 makeWrapper "${jre}/bin/java" "$out/bin/apktool" \
25 --add-flags "-jar $out/libexec/apktool/apktool.jar" \
26 --prefix PATH : "${builtins.head build-tools}/libexec/android-sdk/build-tools/28.0.3"
27 '';
28
29 meta = with stdenv.lib; {
30 description = "A tool for reverse engineering Android apk files";
31 homepage = "https://ibotpeaches.github.io/Apktool/";
32 license = licenses.asl20;
33 maintainers = with maintainers; [ offline ];
34 platforms = with platforms; unix;
35 };
36
37}