jeudi 7 juin 2018

Android P Restrictions on non-SDK interfaces - dark greylist vs blacklist

Developer Preview 3 came out today and I've noticed some changes related to non-SDK interfaces:

Accessing the following API produces different logs on DP2 and DP3

Class<?> androidIdClass = Class.forName("com.android.internal.R$id");
Integer search_close_btn = getFieldValue(androidIdClass, null, "search_close_btn");

DP2: Accessing hidden field Lcom/android/internal/R$id;->search_close_btn:I (blacklist, reflection)

Result: NoSuchFieldException, unable to access the field

DP3: Accessing hidden field Lcom/android/internal/R$id;->search_close_btn:I (dark greylist, reflection)

Result: the field is accessible

Can please someone explain why this field become available in DP3 and what is difference between dark greylist and blacklist ?





Aucun commentaire:

Enregistrer un commentaire