question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QR-code example: generating SHA1 and SHA-256 base64 encoded checksum issue.

See original GitHub issue

Hello 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
GeorgeDewarcommented, Oct 18, 2017

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.

4reactions
jasonbaytoncommented, Oct 19, 2017

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",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a Base64 encoded SHA-256 hash in Java [closed]
We need to read the file contents and convert it into SHA256 and then convert it into Base64. Any pointer or sample code...
Read more >
Parse QR Code - CyberChef
The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis. ... Parse QR Code. Normalise image. pause...
Read more >
SYSTEM.Encryption - Caché & Ensemble 2018.1.4
This class provides class functions to perform data encryption, Base64 encoding, hashing, and generation of message authentication codes.
Read more >
Base64 encoder and decoder - Mobilefish.com
Email programs, for example, applies Base64 encoding where binary data such as images and ... the following Base64 encoded data is generated by...
Read more >
Hashing, Encryption, Encoding, Compression, Oh My! - 2022
Example : Base64 is a way of encoding binary into lower and ... Example: MD5, SHA-1, and SHA-256 are all cryptographic hash functions....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found