Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APK signing/validation in pure python #313

Closed
reox opened this issue Sep 12, 2017 · 9 comments
Closed

APK signing/validation in pure python #313

reox opened this issue Sep 12, 2017 · 9 comments

Comments

@reox
Copy link
Member

reox commented Sep 12, 2017

It would be nice to be able to validate signatures of APKs using pure python code.

We would need to create the MANIFEST.MF file and check against the signature.

Then we could return all items that are not signed but in the APK or all items that are signed but create a wrong signature (e.g. wrong hash).

@subho007
Copy link
Member

subho007 commented Oct 3, 2017

Ref: #332 (comment)

@eighthave
Copy link
Contributor

F-Droid would also love this feature, we're tracking it here: https://gitlab.com/fdroid/fdroidserver/issues/94

These two libraries also look promising:

@eighthave
Copy link
Contributor

@eighthave eighthave changed the title APK Singning validation APK Signing validation Feb 20, 2018
@eighthave eighthave changed the title APK Signing validation APK signing/validation in pure python Feb 20, 2018
@reox
Copy link
Member Author

reox commented May 2, 2018

@shuxin maybe we can integrate your https://github.com/shuxin/apk-signature-verify into androguard?

@eighthave
Copy link
Contributor

eighthave commented May 2, 2018 via email

@reox
Copy link
Member Author

reox commented May 2, 2018 via email

@shuxin
Copy link
Contributor

shuxin commented May 4, 2018

Yeah, If you like it, I'll port it to python3, and rewrite it with api friendly.

  • support rsa(md5/sha1/sha256/sha512)/dsa(sha1/shasha256/sha512)/ecdsa(sha256/sha512),
  • without build,
  • without openssl/cryptography/M2Crypto,
  • without any binary like so/pyd/dll/dylib,

@eighthave
Copy link
Contributor

That would be amazing! fdroid would use it. In case you haven't seen it already, there is a nice collection of APKs for testing signature verification. Its part of the source repo for apksigner:

https://android.googlesource.com/platform/tools/apksig/+/refs/heads/master/src/test/resources/com/android/apksig

@shuxin
Copy link
Contributor

shuxin commented May 4, 2018

Thanks for the testing information. try my new version. https://github.com/shuxin/apk-signature-verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants