How to Verify an APK's SHA-256 Hash Before You Install It

2026-12-01来源 dev.toEnglish

Every APK you install from outside the Play Store asks for one thing: trust. A SHA-256 hash is how you replace some of that trust with a check. The publisher publishes a long string of characters — the fingerprint of the exact file they released. Your download produces the same fingerprint only if it is bit-for-bit the file they released. If even one byte changed, the hash changes completely.

On Windows, no extra software is needed. Open Command Prompt in the folder holding the APK and run:

certutil -hashfile app.apk SHA256

On macOS or Linux, the equivalent is:

shasum -a 256 app.apk

On Android itself, a terminal app such as Termux gives you:

sha256sum app.apk

Each command prints the hash of your file. Compare it, character by character, with the hash the publisher lists for that version. Long strings are hard to compare by eye, so compare the first ten characters, the last ten, and a block in the middle — a tampered file will differ everywhere, not subtly.

Three outcomes are possible. If the hashes match, your file is the file the publisher released — that says nothing about whether the publisher itself is trustworthy, only that nothing changed the file on its way to you. If they do not match, delete the file and download again from the publisher's own site; a mismatch means a corrupted download at best and a repackaged file at worst. And if the publisher lists no hash at all, that absence is information too: you are being asked for blind trust, and you can decide how you feel about that.

A hash check pairs well with a multi-engine scan. Uploading the APK to VirusTotal shows whether any of dozens of scanners flag it. Neither check is a guarantee — scanners miss things, and a clean scan of a file only covers that file — but together they catch most of the realistic problems: swapped files, corrupted downloads, and known-bad repackages.

I care about this because I publish guides for GoldenWA, an unofficial WhatsApp mod for Android. Mods live outside the Play Store by definition, so the habits above matter more, not less: back up your chats first, verify the hash, scan the file, and keep the official app's own privacy settings in mind before switching — they now cover part of what people once needed a mod for. The current GoldenWA release and its details are on the official GoldenWA website. Verify first, install second, if at all.

原文:https://www.a8q9.cn/en/article/how-to-verify-an-apk-s-sha-256-hash-before-you-install-it-e7a718.html

相关文章