mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 10:32:43 +00:00
Fix upgrading from a build prior to cert pinning support
This commit is contained in:
parent
a1c659b7b8
commit
dc97adc7a1
@ -7,8 +7,8 @@ android {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
|
||||
versionName "7.4"
|
||||
versionCode = 195
|
||||
versionName "8.0"
|
||||
versionCode = 196
|
||||
}
|
||||
|
||||
flavorDimensions "root"
|
||||
|
@ -28,15 +28,18 @@ public class LegacyDatabaseReader2 {
|
||||
details.manualAddress = c.getString(4);
|
||||
details.macAddress = c.getString(5);
|
||||
|
||||
try {
|
||||
byte[] derCertData = c.getBlob(6);
|
||||
// This column wasn't always present in the old schema
|
||||
if (c.getColumnCount() >= 7) {
|
||||
try {
|
||||
byte[] derCertData = c.getBlob(6);
|
||||
|
||||
if (derCertData != null) {
|
||||
details.serverCert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
||||
.generateCertificate(new ByteArrayInputStream(derCertData));
|
||||
if (derCertData != null) {
|
||||
details.serverCert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
||||
.generateCertificate(new ByteArrayInputStream(derCertData));
|
||||
}
|
||||
} catch (CertificateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (CertificateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// This signifies we don't have dynamic state (like pair state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user