Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin implementation for onCreate override #101

Open
sebastianbuechler opened this issue Sep 26, 2022 · 0 comments
Open

Kotlin implementation for onCreate override #101

sebastianbuechler opened this issue Sep 26, 2022 · 0 comments

Comments

@sebastianbuechler
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant