Skip to content

Commit a3a62dc

Browse files
fix: reintroduce CT info updates when possible (#19)
follow-up on #16 There's a low risk that outdated CT info breaks apps, but it makes them a little less safe. With this fix, automated updates from appmattus:certificatetransparency will continue to come in for apps on RN >= 0.77 (or using kotlin 2), but apps built with kotlin 1 will be stuck on the update from ~a week ago
1 parent df52231 commit a3a62dc

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

android/build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,18 @@ dependencies {
9696

9797
// package-specific dependencies
9898
implementation("com.facebook.react:react-native:+")
99-
implementation("com.appmattus.certificatetransparency:certificatetransparency-android:2.5.0")
99+
100+
/*
101+
* See https://github.com/bamlab/react-native-app-security/issues/15
102+
* appmattus.certificatetransparency >= 2.5.75 is built with Kotlin 2.
103+
* However, React Native projects < 0.77 are usually built with Kotlin 1.
104+
* Avoid failing builds, at the cost of not getting the latest CT info
105+
* TODO: Remove this when React Native 0.76 is EOL
106+
*/
107+
def certificateTransparencyVersion = "2.5+"
108+
if (getKotlinVersion().startsWith("1.")) {
109+
certificateTransparencyVersion = "2.5.74"
110+
}
111+
112+
implementation("com.appmattus.certificatetransparency:certificatetransparency:${certificateTransparencyVersion}")
100113
}

0 commit comments

Comments
 (0)