ouya-saviors/ouya-game-data

Release certificate information

Closed this issue · 2 comments

How did you obtain and add the information in #84?
I'd like to add it to the create-from-apk.php script

I used 7z and openssl. Basically, just extract the 'META-INF/*.RSA' from the APK and use openssl params to output the subject and fingerprint. Here is the PowerShell code that you can use as a reference:

$Path = ".\*.apk"
$CertPath = "META-INF/*.RSA"
Get-ChildItem -File $Path | ForEach-Object {
    Remove-Item $CertPath -Force -ea silent
    7z x $_.FullName -aoa $CertPath | Out-Null
    if (Test-Path $CertPath) {
        $Cert = openssl pkcs7 -inform DER -in $CertPath -print_certs | openssl x509 -noout -subject -fingerprint -sha256
        $cert_subject, $cert_fingerprint = $Cert -replace "^.*?=" -split "`n"
        $cert_subject, $cert_fingerprint
    }
}

Would you like me to take a stab at translating this to bash? I assume that you can do it a good bit faster.

Thanks! I added it to the script.