datatheorem / TrustKit-Android

Easy SSL pinning validation and reporting for Android.
MIT License
583 stars 87 forks source link

Initialization fails on Android 7 Instant App #67

Open chihweil5 opened 4 years ago

chihweil5 commented 4 years ago

Describe the bug Hi, there seems to be an Android framework issue when building instant app on Android 7 where Truskit fails to initialize. After debugging, the root cause is coming from parsing the ApplicationInfo in this [method].(https://github.com/datatheorem/TrustKit-Android/blob/master/trustkit/src/main/java/com/datatheorem/android/trustkit/TrustKit.java#L231) When building instant app project, Android 7 somehow fails to create networkSecurityConfigRes=0x. This doesn't happen on the traditional app.

To Reproduce Here is the branch of a sample instant app modules: https://github.com/chihweil5/TrustKit-Android/tree/instant-app

The quick tryout solution I made is by changing this condition here, both instant app and app are working on Android 7. I am not sure if this is a proper fix although. Thanks in advance for looking into this issue!

App details:

Thank you!