Privacy-Period-Tracker/app/proguard-rules.pro

42 lines
2.0 KiB
Prolog

# Release builds are minified.
#
# When a rule is added here it must say what breaks without it a proguard file
# of unexplained -keep lines is a file nobody can ever safely shrink again.
# ---------------------------------------------------------------------------
# PRODUCT_PLAN.md §45: "Disable verbose logging in release builds."
# ---------------------------------------------------------------------------
#
# `checkNoHealthLogging` in the root build.gradle.kts already fails the build on
# any logging call in a module that can see a cycle date, and that is the real
# protection because it stops the line being written at all.
#
# This is the second layer, and it exists for the two cases a source guard
# cannot reach:
#
# - **A dependency logging on our behalf.** Room, WorkManager and the AndroidX
# libraries log, and a stack trace or a query they print can carry a value
# that came from a cycle record. The guard cannot see inside a library; R8
# can remove the call sites.
# - **A future module.** The guard reads a list of directories. Somebody adding
# a module and forgetting to list it gets no warning, because absence of a
# finding looks exactly like a clean result.
#
# `assumenosideeffects` lets R8 delete these calls entirely, arguments and all,
# rather than leaving a stripped string constant in the dex. It is safe here
# only because nothing in this app uses a Log return value `Log.d` returns an
# int nobody reads. If that ever stops being true, R8 will assume it is zero.
#
# Warning removed deliberately: `-dontwarn` is not used, because a warning here
# would mean the class shape changed and this rule stopped matching, which is
# exactly what we would want to hear about.
-assumenosideeffects class android.util.Log {
public static int v(...);
public static int d(...);
public static int i(...);
public static int w(...);
public static int e(...);
public static int wtf(...);
public static int println(...);
}