Fix upgrading from a build prior to cert pinning support

This commit is contained in:
Cameron Gutman 2019-07-16 20:08:41 -07:00
parent a1c659b7b8
commit dc97adc7a1
2 changed files with 12 additions and 9 deletions

View File

@ -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"

View File

@ -28,6 +28,8 @@ public class LegacyDatabaseReader2 {
details.manualAddress = c.getString(4); details.manualAddress = c.getString(4);
details.macAddress = c.getString(5); details.macAddress = c.getString(5);
// This column wasn't always present in the old schema
if (c.getColumnCount() >= 7) {
try { try {
byte[] derCertData = c.getBlob(6); byte[] derCertData = c.getBlob(6);
@ -38,6 +40,7 @@ public class LegacyDatabaseReader2 {
} catch (CertificateException e) { } catch (CertificateException e) {
e.printStackTrace(); e.printStackTrace();
} }
}
// This signifies we don't have dynamic state (like pair state) // This signifies we don't have dynamic state (like pair state)
details.state = ComputerDetails.State.UNKNOWN; details.state = ComputerDetails.State.UNKNOWN;