mikehardy / react-native-update-apk

Update apk from non-play store servers, and update ios from app store in React Native.
MIT License
193 stars 57 forks source link

How to get the sha1? #44

Closed dhanababum closed 3 years ago

dhanababum commented 3 years ago

Hi,

Could someone help how to get the sha1?

I am right now using UpdateAPK.getInstalledSigningInfo()

But getting sha256.

mikehardy commented 3 years ago

This package only calculates the SHA-256 because it was my understanding SHA-1 was not useful cryptographically anymore, so I was not interested in it and did not implement it.

I only implemented SHA-256:

https://github.com/mikehardy/react-native-update-apk/blob/594096977684c8c26318aa1920edc742e65d68dc/android/src/main/java/net/mikehardy/rnupdateapk/RNUpdateAPK.java#L93-L105

If you need the SHA-1 and are willing to propose a PR for it I would be willing to merge it and release a version with SHA-1 support though. If you're not aware of it, the https://github.com/ds300/patch-package package is great as you can develop your solution directly in node_modules (so it's quite easy) while using patch-package to make it persistent in your project, then once you are sure it works you can post the PR here for a real release

Since this is not really an issue, and not actionable by me (I have no personal interest) I'm going to close it, but I will re-iterate I'm happy to collaborate on a PR if you propose one