-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
After analyzing my app with the veridex tool, I found that there are two use cases for the reflection API in the Apptentive Android SDK.
Reflection unsupported Landroid/graphics/Typeface;->sSystemFontMap use(s):
Lcom/apptentive/android/sdk/util/Util;->replaceDefaultFont(Landroid/content/Context;Ljava/lang/String;)V
Lcom/apptentive/android/sdk/util/Util;->replaceDefaultFont(Landroid/content/Context;Ljava/lang/String;)V
The reason for this log is reflection field API usage getDeclaredField and it could break the app on Android 12. Here you can see the code snippet from Apptentive Android SDK.
com.apptentive.android.sdk.util.Util#replaceDefaultFont
try {
final Field staticField = Typeface.class.getDeclaredField("sSystemFontMap");
staticField.setAccessible(true);
staticField.set(null, newMap);
} catch (NoSuchFieldException e) {
ApptentiveLog.e(e, "Exception replacing system font");
logException(e);
} catch (IllegalAccessException e) {
ApptentiveLog.e(e, "Exception replacing system font");
logException(e);
}
.....
try {
final Field staticField = Typeface.class.getDeclaredField(staticTypefaceFieldName);
staticField.setAccessible(true);
staticField.set(null, newTypeface);
} catch (NoSuchFieldException e) {
ApptentiveLog.e(e, "Exception replacing system font");
logException(e);
} catch (IllegalAccessException e) {
ApptentiveLog.e(e, "Exception replacing system font");
logException(e);
}
The functionality of the replaceDefaultFont method, which currently relies on reflection, needs to be replaced with some supported API.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels