# Shared by Standard and Kids. Keep only names and members accessed dynamically.
# Optional libraries are not dependencies of these rules: unmatched rules are inert.

# SLGoogleReferrer probes this method by name before calling the v2 API directly.
# The other Google Install Referrer calls are direct and need no keep rules.
-keepclassmembers class com.android.installreferrer.api.ReferrerDetails {
    public java.lang.String getInstallVersion();
}

# SLReflectionInstallReferrer builds Samsung's client using class/method names.
-keep class com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerClient {
    public static com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerClient$Builder newBuilder(android.content.Context);
    public void startConnection(com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerStateListener);
    public com.samsung.android.sdk.sinstallreferrer.api.ReferrerDetails getInstallReferrer();
    public void endConnection();
}
-keepclassmembers class com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerClient$Builder {
    public com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerClient build();
}
# getMethod() runs on the concrete client, which can override these methods.
-keepclassmembers class * extends com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerClient {
    public void startConnection(com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerStateListener);
    public com.samsung.android.sdk.sinstallreferrer.api.ReferrerDetails getInstallReferrer();
    public void endConnection();
}
-keepclassmembers class com.samsung.android.sdk.sinstallreferrer.api.ReferrerDetails {
    public java.lang.String getInstallReferrer();
    public long getReferrerClickTimestampSeconds();
    public long getInstallBeginTimestampSeconds();
}
# Proxy creates the listener at runtime; its method names drive invoke() dispatch.
-keep interface com.samsung.android.sdk.sinstallreferrer.api.InstallReferrerStateListener {
    public void onInstallReferrerSetupFinished(int);
    public void onInstallReferrerServiceDisconnected();
}

# Singular.customRevenue checks Purchase's class name and reflects on these getters.
# Product getters vary across supported Billing versions; absent getters are harmless.
-keepnames class com.android.billingclient.api.Purchase
-keepclassmembers class com.android.billingclient.api.Purchase {
    public java.lang.String getOriginalJson();
    public java.lang.String getSignature();
    public java.lang.String getSku();
    public java.util.ArrayList getSkus();
    public java.util.List getSkus();
    public java.util.ArrayList getProducts();
    public java.util.List getProducts();
}

# WebView invokes annotated methods by name and inspects their runtime annotations.
# The Java caller constructs the bridge, so its class name need not be pinned.
-keepattributes RuntimeVisibleAnnotations
-keepclassmembers class com.singular.sdk.SingularJSInterface {
    @android.webkit.JavascriptInterface <methods>;
}

# Licensing and ordinary Java callbacks use direct references. They deliberately
# have no keep rules. Cross-platform plugins must retain their own JNI/reflection
# entry points; those bridge classes are maintained outside this SDK repository.
