Loading build.gradle +5 −5 Original line number Diff line number Diff line Loading @@ -14,7 +14,9 @@ buildscript { repositories { jcenter() mavenCentral() maven { url "https://maven.google.com" } } apply plugin: 'com.android.library' Loading @@ -41,10 +43,8 @@ android { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" //noinspection GradleDynamicVersion compile 'com.android.support:appcompat-v7:26.+' //noinspection GradleDynamicVersion compile 'com.android.support:cardview-v7:26.+' compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support:cardview-v7:26.0.1' //noinspection GradleDynamicVersion androidTestCompile 'com.android.support.test:runner:+' Loading src/main/java/at/bitfire/cert4android/TrustCertificateActivity.kt +7 −7 Original line number Diff line number Diff line Loading @@ -58,28 +58,28 @@ class TrustCertificateActivity: AppCompatActivity() { } else subject = cert.subjectDN.name var tv = findViewById(R.id.issuedFor) as TextView var tv = findViewById<TextView>(R.id.issuedFor) tv.text = subject tv = findViewById(R.id.issuedBy) as TextView tv = findViewById<TextView>(R.id.issuedBy) tv.text = cert.issuerDN.toString() val formatter = DateFormat.getDateInstance(DateFormat.LONG) tv = findViewById(R.id.validity_period) as TextView tv = findViewById<TextView>(R.id.validity_period) tv.text = getString(R.string.trust_certificate_validity_period_value, formatter.format(cert.notBefore), formatter.format(cert.notAfter)) tv = findViewById(R.id.fingerprint_sha1) as TextView tv = findViewById<TextView>(R.id.fingerprint_sha1) tv.text = fingerprint(cert, "SHA-1") tv = findViewById(R.id.fingerprint_sha256) as TextView tv = findViewById<TextView>(R.id.fingerprint_sha256) tv.text = fingerprint(cert, "SHA-256") } catch(e: CertificateParsingException) { Constants.log.log(Level.WARNING, "Couldn't parse certificate", e) } val btnAccept = findViewById(R.id.accept) as Button val cb = findViewById(R.id.fingerprint_ok) as CheckBox val btnAccept = findViewById<Button>(R.id.accept) val cb = findViewById<CheckBox>(R.id.fingerprint_ok) cb.setOnCheckedChangeListener { _, state -> btnAccept.isEnabled = state } } Loading Loading
build.gradle +5 −5 Original line number Diff line number Diff line Loading @@ -14,7 +14,9 @@ buildscript { repositories { jcenter() mavenCentral() maven { url "https://maven.google.com" } } apply plugin: 'com.android.library' Loading @@ -41,10 +43,8 @@ android { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" //noinspection GradleDynamicVersion compile 'com.android.support:appcompat-v7:26.+' //noinspection GradleDynamicVersion compile 'com.android.support:cardview-v7:26.+' compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support:cardview-v7:26.0.1' //noinspection GradleDynamicVersion androidTestCompile 'com.android.support.test:runner:+' Loading
src/main/java/at/bitfire/cert4android/TrustCertificateActivity.kt +7 −7 Original line number Diff line number Diff line Loading @@ -58,28 +58,28 @@ class TrustCertificateActivity: AppCompatActivity() { } else subject = cert.subjectDN.name var tv = findViewById(R.id.issuedFor) as TextView var tv = findViewById<TextView>(R.id.issuedFor) tv.text = subject tv = findViewById(R.id.issuedBy) as TextView tv = findViewById<TextView>(R.id.issuedBy) tv.text = cert.issuerDN.toString() val formatter = DateFormat.getDateInstance(DateFormat.LONG) tv = findViewById(R.id.validity_period) as TextView tv = findViewById<TextView>(R.id.validity_period) tv.text = getString(R.string.trust_certificate_validity_period_value, formatter.format(cert.notBefore), formatter.format(cert.notAfter)) tv = findViewById(R.id.fingerprint_sha1) as TextView tv = findViewById<TextView>(R.id.fingerprint_sha1) tv.text = fingerprint(cert, "SHA-1") tv = findViewById(R.id.fingerprint_sha256) as TextView tv = findViewById<TextView>(R.id.fingerprint_sha256) tv.text = fingerprint(cert, "SHA-256") } catch(e: CertificateParsingException) { Constants.log.log(Level.WARNING, "Couldn't parse certificate", e) } val btnAccept = findViewById(R.id.accept) as Button val cb = findViewById(R.id.fingerprint_ok) as CheckBox val btnAccept = findViewById<Button>(R.id.accept) val cb = findViewById<CheckBox>(R.id.fingerprint_ok) cb.setOnCheckedChangeListener { _, state -> btnAccept.isEnabled = state } } Loading