QR-code example: generating SHA1 and SHA-256 base64 encoded checksum issue.
See original GitHub issueHello everybody,
I’m using your QR-code example and trying to generate exact APK checksum (gJD2YwtOiWJHkSMkkIfLRlj-quNqG1fb6v100QmzM9w=) of the APK provided in example QR code http://down-box.appspot.com/qr/nQB0tw7b. I want to make sure I’m doing it the right way for my app.
Anyways, I was not sure if given checksum was generated with SHA1 or SHA-256 so I tried both.
When I tried cat TestDPC_4005.apk | openssl dgst -binary -sha1 | openssl base64
for SHA1
result was
qimlbnIVNEA2qtWpIr9O2m9O0XE=
When I tried cat TestDPC_4005.apk | openssl dgst -binary -sha256 | openssl base64
for SHA256
result was
z0KB1LIGCu3T+o7cDGP6Hpo6hNP+OhXjAfl1uWOJFU8=
I even tried some of the online tools for generating these checksums (https://hash.online-convert.com/sha1-generator) and results were the same. I could not get the exact one that was given in example. Is there any step that I’m missing here that was not described in the documentation?
Could you please give example of tool/command you use to generate it or at least some hints of what could go wrong in my case.
Thanks in advance.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
I have the same problem, which I’m trying to solve right now. In the meantime, I wanted to pass on a tip I’ve discovered (in case you haven’t). The UI tries to get you to factory reset the device after the failure, and the documentation states “If the checksum doesn’t match an error will be shown to the user and the user will be asked to factory reset the device.”.
You do not have to. You can hold down the power button and simply restart the device. Your WiFi settings will remain and you can carry on testing.
What you see in the example in the OP (http://down-box.appspot.com/qr/nQB0tw7b) is an admin signature checksum. What you’re generating with these commands is a package checksum, they’ll be different 😃
The signature checksum AFAIK won’t change between DPC updates, while the package checksum will. If you’d like to use a package ID checksum instead, replace:
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "xyzzy",
with
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM": "xyzzy",