Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Not working with proguard #9

@frncs-eu

Description

@frncs-eu

Hi, first of all kudos for the great work.
I'd like to discuss about an issue I'm having with this package.
In order to make it work with proguard I had to exclude the package from obfuscation with:

-keep class com.criticalblue.reactnative.** {
*;
}

Since the package is using reflection to access the certPinner:

try {
            Class noparams[] = {};
            Class clazz = Class.forName("com.criticalblue.reactnative.GeneratedCertificatePinner");
            Method method = clazz.getDeclaredMethod("instance", noparams);
            certificatePinner = (CertificatePinner) method.invoke(null);
            Log.i(TAG, "Generated Certficate Pinner in use");
        } catch(Exception e){
            Log.e(TAG, "No Generated Certficate Pinner found - likely a pinset configuration error");
            Log.w(TAG, "CERTIFICATE PINNING NOT BEING USED");
        }

But excluding this package from obfuscation makes it extremely trivial for an attacker to decompile and bypass the pinning feature.
Wouldn't it be better to manually import the com.criticalblue.reactnative.GeneratedCertificatePinner package inside of CertPinnerPackage.java and invoke the static instance method instead of relying on reflection?
This would improve Proguard obfuscation without breaking the functionality.
Thank you,

Francesco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions