Skip to content

Kotlin implementation for onCreate override #101

@sebastianbuechler

Description

@sebastianbuechler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions