summary refs log tree commit diff
path: root/pkgs/development/tools/apksigcopier
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/development/tools/apksigcopier
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/development/tools/apksigcopier')
-rw-r--r--pkgs/development/tools/apksigcopier/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/development/tools/apksigcopier/default.nix b/pkgs/development/tools/apksigcopier/default.nix
new file mode 100644
index 00000000000..cc23081473a
--- /dev/null
+++ b/pkgs/development/tools/apksigcopier/default.nix
@@ -0,0 +1,60 @@
+{ lib
+, fetchFromGitHub
+, python3
+, installShellFiles
+, bash
+, pandoc
+, apksigner
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "apksigcopier";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "obfusk";
+    repo = "apksigcopier";
+    rev = "v${version}";
+    sha256 = "07ldq3q1x2lpb15q5s5i1pbg89sn6ah45amskm9pndqlh16z9k2x";
+  };
+
+  nativeBuildInputs = [ installShellFiles pandoc ];
+  propagatedBuildInputs = with python3.pkgs; [ click ];
+  checkInputs = with python3.pkgs; [ flake8 mypy pylint ];
+  makeWrapperArgs = [ "--prefix" "PATH" ":" "${lib.makeBinPath [ apksigner ]}" ];
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace /bin/bash ${bash}/bin/bash \
+      --replace 'apksigcopier --version' '${python3.interpreter} apksigcopier --version'
+  '';
+
+  postBuild = ''
+    make ${pname}.1
+  '';
+
+  checkPhase = ''
+    make test
+  '';
+
+  postInstall = ''
+    installManPage ${pname}.1
+  '';
+
+  meta = with lib; {
+    description = "Copy/extract/patch android apk signatures & compare apks";
+    longDescription = ''
+      apksigcopier is a tool for copying android APK signatures from a signed APK to an unsigned one (in order to verify reproducible builds).
+      It can also be used to compare two APKs with different signatures.
+      Its command-line tool offers four operations:
+
+      * copy signatures directly from a signed to an unsigned APK
+      * extract signatures from a signed APK to a directory
+      * patch previously extracted signatures onto an unsigned APK
+      * compare two APKs with different signatures (requires apksigner)
+    '';
+    homepage = "https://github.com/obfusk/apksigcopier";
+    license = with licenses; [ gpl3Plus ];
+    maintainers = [ maintainers.obfusk ];
+  };
+}