apksigcopier(1)
β¨ apksigcopier(1) β General Commands Manual π
π NAME π
okay bestie, the name says it all π
apksigcopier β copy/extract/patch android APK signatures & compare APKs π¦
πΈ SYNOPSIS πΈ
okay so here are all the ways you can call it, bestie π§
apksigcopier copy [options] signed_apk unsigned_apk output_apk
apksigcopier extract [options] signed_apk output_dir
apksigcopier patch [options] metadata_dir unsigned_apk output_apk
apksigcopier compare [options] first_apk second_apk
apksigcopier --version
apksigcopier --help
apksigcopier [command] --help
π¦ DESCRIPTION π¦
ngl this tool is literally iconic β¨ it copies android APK signatures from a signed APK over to an unsigned one, which is how you verify reproducible builds π₯ It can also compare two APKs that have different signatures π
π COMMANDS π
π copy
Copy (extract & patch) signatures from signed to unsigned APK. It's giving "do both steps for me" energy π«Ά
π extract
Extract APK signatures from signed APK. Just pulling the signature stuff out, no drama π§
π patch
Patch extracted APK signatures onto unsigned APK. Slapping the signatures back on π
π₯ compare
Compare two APKs by copying the signature from the first to a copy of the second and checking if the resulting APK verifies. Main character behavior, fr fr π
This command requires apksigner(1). Bestie, you NEED this one installed or it won't work π
NB: copying from an APK v1-signed with signflinger to an APK signed with apksigner works, whereas the reverse fails; see the FAQ in the README. Heads up, this one is lowkey tricky π
π OPTIONS π
π copy/extract/patch
--v1-only [no|auto|yes]β Whether to expect only a v1 signature πΈnomeans a v2 signature is expected as well,automeans the presence of a v2 signature is detected automatically, andyesmeans a v2 signature is not expected (and ignored if it does exist). Default:no.
You can also set the environment variable APKSIGCOPIER_V1_ONLY instead π«Ά
π₯ compare
--unsignedβ Accept unsignedsecond_apkπ¦--min-sdk-versionβ Passed to apksigner(1) when verifying β¨--verify-cmdβ Command (with arguments) used to verify APKs. Default:apksigner verifyπ
π ENVIRONMENT VARIABLES π
The following environment variables can be set to 1, yes, or true to override the default behaviour. It's giving customization queen π
π§ APKSIGCOPIER_EXCLUDE_ALL_META
Exclude all metadata files, not just MANIFEST.MF π
π APKSIGCOPIER_COPY_EXTRA_BYTES
Copy extra bytes after data (e.g. an existing v2 signature) π
π APKSIGCOPIER_SKIP_REALIGNMENT
Skip realignment of ZIP entries π¦
π§ EXAMPLES π§
Okay bestie, here's how you actually use it π
πΈ extract
$ mkdir meta
$ apksigcopier extract signed.apk meta
$ ls -1 meta
8BEA2A77.RSA
8BEA2A77.SF
APKSigningBlock
APKSigningBlockOffset
MANIFEST.MF
π₯ patch
$ apksigcopier patch meta unsigned.apk out.apk
π copy
$ apksigcopier copy signed.apk unsigned.apk out.apk
π compare
$ apksigcopier compare foo-from-fdroid.apk foo-built-locally.apk
$ apksigcopier compare foo.apk --unsigned foo-unsigned.apk
π¦ SEE ALSO π¦
slay, go check out apksigner(1) π
π COPYRIGHT π
Copyright Β© 2023 FC Stegerman. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law π
π AUTHORS π
FC Stegerman <flx@obfusk.net>. The legend herself π
Version v1.1.1, dated 2023-02-08, is the latest tea β Love you bestie, byeee ππ«Άπ¦
π¦ where this page comes from
- debian bookworm: apksigcopier 1.1.1-1
- debian trixie: apksigcopier 1.1.1-1
- ubuntu noble: apksigcopier 1.1.1-1
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms