Read the original article:Wear Engine setFingerprint() 206 Error
Problem Description
When calling setFingerprint() in Huawei Wear Engine, a 206 error is encountered. The root cause lies in incorrect fingerprint value formatting, particularly with the public key used in the certificate.
Background Knowledge
The fingerprint must be the public key (in base64 format) derived from a valid certificate file (.cer). The correct method involves extracting the last certificate block and encoding the public key.
Troubleshooting Process
Open the
.cerfile, and copy the last paragraph (from-----BEGIN CERTIFICATE-----to-----END CERTIFICATE-----) into a new.cerfile.Open this new
.cerfile, click Details, and select Public Key to obtain thepubKey.Convert the
pubKeyinto Base64 format. You may use a third-party tool such as tomeko.net.Example Base64 encoded string:
BC5Z9/29Yn93xSa9XkQ2HN5GikugmXjor9se0VwnOENK9t4uFK4VlRpOHv4B3lphjIa7P6Sh61CFRsT0MZNhuV8=Construct the fingerprint using the format:
<App Package Name>_<Base64EncodedPubKey>Example:
com.huawei.wearengine_BC5Z9/29Yn93xSa9XkQ2HN5GikugmXjor9se0VwnOENK9t4uFK4VlRpOHv4B3lphjIa7P6Sh61CFRsT0MZNhuV8=
Analysis Conclusion
The 206 error is caused by an improperly formed fingerprint string. The fingerprint must follow the structure defined above, ensuring it matches the base64-encoded public key of the .cer certificate used.
Solution
·Extract the correct certificate section
·Obtain the public key
·Encode it properly in Base64
·Concatenate with the app package name to form the correct fingerprint
Verification Result
After correcting the fingerprint format using the described method, the setFingerprint() function executes successfully without error 206.
Top comments (0)