Replies: 10 comments
-
Copying a signature will succeed even if the signature is not valid for the target APK. You can even copy a signature from an entirely different app and it will work as long as the target APK is unsigned and not larger than the source APK (as it will not insert the signature in the middle of the ZIP data). Copying an invalid signature is of course pointless as it will fail verification. Please note that (as the README says):
I don't know what you're trying to do, but e.g. copying a signature to a modified APK is not possible. This is a tool for reproducible builds only. You seem to be trying to copy a signature to an APK that's not valid for that APK, hence the error. If you want me to look into this, please confirm your use case matches the above, and provide more details on what exactly you're trying to do when you get that error. |
Beta Was this translation helpful? Give feedback.
-
Actually I am testing your tool |
Beta Was this translation helpful? Give feedback.
-
This seems likely to be the issue. I don't know how you removed the signature. Removing the signature files/block from the APK is easy. But you need to do it in a way that produces an APK that is bit-by-bit identical to the original unsigned APK. If e.g. any of the ZIP metadata is different, the v2/v3 signature will not be valid, even if all the files in the APK are identical (which is sufficient for v1). |
Beta Was this translation helpful? Give feedback.
-
Can provide me your social media anything where i send you video how i removed signature then maybe you know where is the problem |
Beta Was this translation helpful? Give feedback.
-
Actually, some differences like ZIP alignment in the unsigned APK will still produce identical signed APKs, as the alignment is modified during signing. So e.g. an unsigned APK that is not aligned will produce an identical APK as one that is aligned exactly the same way But this may allow you to remove the signature in such a way that the APK will verify after copying the signature back: import apksigcopier
apksigcopier.copy_apk("signed.apk", "unsigned.apk", exclude=apksigcopier.exclude_meta) |
Beta Was this translation helpful? Give feedback.
-
If I remove |
Beta Was this translation helpful? Give feedback.
-
I do not provide support for |
Beta Was this translation helpful? Give feedback.
-
Unsigned, yes (those are the v1 signature files, the v2 signature is in the APK signing block which is not preserved by most ZIP tools). But using standard ZIP tools to simply remove those files from the APK or creating a new APK without them will almost certainly produce different ZIP metadata and/or ordering, making the v2 signature invalid. |
Beta Was this translation helpful? Give feedback.
-
This only works because it will ensure all the ZIP metadata is copied correctly as well, unlike standard ZIP tools. And it will still likely fail if e.g. the v1 signature files are not stored at the end of the ZIP file where they can be removed without affecting the rest of the ZIP metadata. |
Beta Was this translation helpful? Give feedback.
-
There simply is no reliable way to remove the v2/v3 signature from an APK such that the original signature is still valid after copying it back. Nor is this a supported use case for |
Beta Was this translation helpful? Give feedback.
-
After use sign copy tool sign copy successful but that error i face
Verified failed by v2
give me solution to fixBeta Was this translation helpful? Give feedback.
All reactions