# SHX VPN R8 rules
#
# The native library (libandroidbridge) looks up Java classes and methods by
# name via JNI. R8 must not rename or remove any of them.

# --- JNI entry points called from native code by name ---

-keep class org.strongswan.android.logic.CharonVpnService {
    *;
}
# inner class BuilderAdapter is called from vpnservice_builder.c
-keep class org.strongswan.android.logic.CharonVpnService$BuilderAdapter {
    *;
}
-keep class org.strongswan.android.logic.SimpleFetcher {
    *;
}
-keep class org.strongswan.android.logic.NetworkManager {
    *;
}
-keep class org.strongswan.android.logic.Scheduler {
    *;
}
-keep class org.strongswan.android.logic.imc.AndroidImc {
    *;
}

# native methods (and classes containing them) must keep their names
-keepclasseswithmembernames class * {
    native <methods>;
}

# --- Content providers exported to other apps ---

-keep class org.strongswan.android.data.LogContentProvider {
    *;
}

# --- Parcelable CREATORs (RemediationInstruction etc.) ---

-keepclassmembers class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

# --- Enum values used via valueOf/values (VpnType, State, ErrorState...) ---

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# --- WebView / TextView reflection-free; keep line numbers for readable
#     crash reports in released APKs ---

-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

# --- squash warnings for optional dependencies referenced only from XML ---

-dontwarn org.bouncycastle.jsse.util.**
