Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
3
.method public static a(Ljava/security/cert/Certificate;)Ljava/lang/String;
.locals 2
instance-of v0, p0, Ljava/security/cert/X509Certificate;
if-nez v0, :cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "Certificate pinning requires X509 certificates"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "sha256/"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
check-cast p0, Ljava/security/cert/X509Certificate;
invoke-static {p0}, Lokhttp3/k;->b(Ljava/security/cert/X509Certificate;)Lokio/ByteString;
move-result-object v1
invoke-virtual {v1}, Lokio/ByteString;->base64()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.