nixpkgs-suyu/pkgs/development/tools/apksigcopier/default.nix

61 lines
1.7 KiB
Nix
Raw Normal View History

2021-07-04 18:38:15 +02:00
{ lib
, fetchFromGitHub
, python3
, installShellFiles
, bash
, pandoc
2021-07-24 22:24:24 +02:00
, apksigner
2021-07-04 18:38:15 +02:00
}:
python3.pkgs.buildPythonApplication rec {
pname = "apksigcopier";
2021-07-08 14:59:23 +02:00
version = "1.0.1";
2021-07-04 18:38:15 +02:00
src = fetchFromGitHub {
owner = "obfusk";
repo = "apksigcopier";
rev = "v${version}";
2021-07-08 14:59:23 +02:00
sha256 = "07ldq3q1x2lpb15q5s5i1pbg89sn6ah45amskm9pndqlh16z9k2x";
2021-07-04 18:38:15 +02:00
};
nativeBuildInputs = [ installShellFiles pandoc ];
propagatedBuildInputs = with python3.pkgs; [ click ];
checkInputs = with python3.pkgs; [ flake8 mypy pylint ];
2021-07-24 22:24:24 +02:00
makeWrapperArgs = [ "--prefix" "PATH" ":" "${lib.makeBinPath [ apksigner ]}" ];
2021-07-04 18:38:15 +02:00
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; {
2021-07-08 14:59:23 +02:00
description = "Copy/extract/patch android apk signatures & compare apks";
2021-07-04 18:38:15 +02:00
longDescription = ''
2021-07-08 14:59:23 +02:00
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:
2021-07-04 18:38:15 +02:00
* 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 ];
};
}