- domainsDatabaseHelper.saveDomain(currentDomainDatabaseId, domainNameString, javaScriptEnabledBoolean, firstPartyCookiesEnabledBoolean, thirdPartyCookiesEnabledBoolean, domStorageEnabledEnabledBoolean, formDataEnabledBoolean, userAgentString, fontSizeInt,
- displayWebpageImagesInt);
+ domainsDatabaseHelper.updateDomain(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled,
+ domStorageEnabled, formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests,
+ userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
+
+ // Update the pinned SSL certificate if a new one is checked.
+ if (currentWebsiteCertificateRadioButton.isChecked()) {
+ // Store the values from the SSL certificate.
+ String issuedToCommonName = currentSslCertificate.getIssuedTo().getCName();
+ String issuedToOrganization = currentSslCertificate.getIssuedTo().getOName();
+ String issuedToOrganizationalUnit = currentSslCertificate.getIssuedTo().getUName();
+ String issuedByCommonName = currentSslCertificate.getIssuedBy().getCName();
+ String issuedByOrganization = currentSslCertificate.getIssuedBy().getOName();
+ String issuedByOrganizationalUnit = currentSslCertificate.getIssuedBy().getUName();
+ long startDateLong = currentSslCertificate.getValidNotBeforeDate().getTime();
+ long endDateLong = currentSslCertificate.getValidNotAfterDate().getTime();
+
+ // Update the database.
+ domainsDatabaseHelper.updatePinnedSslCertificate(currentDomainDatabaseId, issuedToCommonName, issuedToOrganization, issuedToOrganizationalUnit, issuedByCommonName, issuedByOrganization,
+ issuedByOrganizationalUnit, startDateLong, endDateLong);
+ }
+
+ // Update the pinned IP addresses if new ones are checked.
+ if (currentIpAddressesRadioButton.isChecked()) {
+ // Get the current IP addresses.
+ String currentIpAddresses = currentIpAddressesTextView.getText().toString();
+
+ // Update the database.
+ domainsDatabaseHelper.updatePinnedIpAddresses(currentDomainDatabaseId, currentIpAddresses);
+ }