TrustKit-Android icon indicating copy to clipboard operation
TrustKit-Android copied to clipboard

Kotlin implementation for onCreate override

Open sebastianbuechler opened this issue 2 years ago • 0 comments

Describe the bug I've used the documentation https://github.com/datatheorem/TrustKit-Android/blob/master/docs/getting-started.md#adding-trustkit-as-a-dependency for integrating TrustKit into a Flutter app with Kotlin. When trying to initialize TrustKit with the Pinning Policy (https://github.com/datatheorem/TrustKit-Android/blob/master/docs/getting-started.md#initializing-trustkit-with-the-pinning-policy) I can only see the java implementation of the onCreate override, but most Flutter applications use by default Kotlin.

What would the override function look like for Kotlin?

TrustKit configuration

<!-- res/xml/network_security_config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <!-- Pin the domain www.datatheorem.com -->
  <!-- Official Android N API -->
  <domain-config>
    <domain>www.example.com</domain>
    <pin-set>
      <pin digest="SHA-256">GhPDsCxTrzTCSrlW+tqM8Clv4wTj9t44C8tn+48IS6Y=</pin>
    </pin-set>
    <!-- TrustKit Android API -->
    <!-- Do not enforce pinning validation -->
    <trustkit-config enforcePinning="true">
      <!-- Add a reporting URL for pin validation reports -->
      <report-uri>http://report.datatheorem.com/log_report</report-uri>
    </trustkit-config>
  </domain-config>
</network-security-config>

App details:

  • App target SDK: 21
  • App language: Flutter with Dart and Kotlin
  • Android version to reproduce the bug: any

sebastianbuechler avatar Sep 26 '22 16:09 sebastianbuechler