Skip to content

Commit

Permalink
Add proguard rules to remove kotlin assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Sep 13, 2022
1 parent 8c0bf6b commit cd0b7d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
signingConfig = signingConfigs.getByName("release")
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
buildFeatures {
Expand Down
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Remove Kotlin assertions
# https://www.guardsquare.com/blog/eliminating-data-leaks-caused-by-kotlin-assertions
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
public static void checkNotNull(...);
public static void checkExpressionValueIsNotNull(...);
public static void checkNotNullExpressionValue(...);
public static void checkParameterIsNotNull(...);
public static void checkNotNullParameter(...);
public static void checkReturnedValueIsNotNull(...);
public static void checkFieldIsNotNull(...);
public static void throwUninitializedPropertyAccessException(...);
public static void throwNpe(...);
public static void throwJavaNpe(...);
public static void throwAssert(...);
public static void throwIllegalArgument(...);
public static void throwIllegalState(...);
}

0 comments on commit cd0b7d8

Please sign in to comment.