mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +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
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
versionName "7.4"
|
versionName "8.0"
|
||||||
versionCode = 195
|
versionCode = 196
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "root"
|
flavorDimensions "root"
|
||||||
|
@ -28,15 +28,18 @@ public class LegacyDatabaseReader2 {
|
|||||||
details.manualAddress = c.getString(4);
|
details.manualAddress = c.getString(4);
|
||||||
details.macAddress = c.getString(5);
|
details.macAddress = c.getString(5);
|
||||||
|
|
||||||
try {
|
// This column wasn't always present in the old schema
|
||||||
byte[] derCertData = c.getBlob(6);
|
if (c.getColumnCount() >= 7) {
|
||||||
|
try {
|
||||||
|
byte[] derCertData = c.getBlob(6);
|
||||||
|
|
||||||
if (derCertData != null) {
|
if (derCertData != null) {
|
||||||
details.serverCert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
details.serverCert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
||||||
.generateCertificate(new ByteArrayInputStream(derCertData));
|
.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)
|
// This signifies we don't have dynamic state (like pair state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user