summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andrei Onea <andreionea@google.com> 2020-08-07 14:56:59 +0100
committer Andrei-Valentin Onea <andreionea@google.com> 2020-08-13 13:42:10 +0000
commit02db072528792ab5ebb4ab4757a739b4dbd5617d (patch)
tree71d516be22c9e1b826ebcbd3a51a19c3192dd910
parentb53d3b6aa48c799c95fd6fc45579c41dfd25cea3 (diff)
Rename api lists
Use more inclusive terminology for hidden api lists: blocked(blocklist), unsupported, max-target-* and sdk (go/hiddenapi-list-renaming). Bug: 162500436 Test: build and check hiddenapi-flags.csv Change-Id: Id25fabe25450a8d1f4776c526b208716e2d06ff9
-rw-r--r--libartbase/base/hiddenapi_flags.h14
-rw-r--r--runtime/hidden_api.h4
-rw-r--r--test/674-hiddenapi/hiddenapi-flags.csv216
-rw-r--r--test/690-hiddenapi-same-name-methods/hiddenapi-flags.csv18
-rw-r--r--test/691-hiddenapi-proxy/hiddenapi-flags.csv2
-rw-r--r--test/999-redefine-hiddenapi/hiddenapi-flags.csv4
-rw-r--r--tools/class2greylist/src/com/android/class2greylist/Class2Greylist.java28
-rw-r--r--tools/hiddenapi/hiddenapi_test.cc270
-rwxr-xr-xtools/veridex/appcompat.sh2
-rw-r--r--tools/veridex/hidden_api_finder.cc4
10 files changed, 281 insertions, 281 deletions
diff --git a/libartbase/base/hiddenapi_flags.h b/libartbase/base/hiddenapi_flags.h
index 0868d17116..c8b171d049 100644
--- a/libartbase/base/hiddenapi_flags.h
+++ b/libartbase/base/hiddenapi_flags.h
@@ -132,13 +132,13 @@ class ApiList {
// Names corresponding to Values.
static constexpr const char* kValueNames[] = {
- "whitelist",
- "greylist",
- "blacklist",
- "greylist-max-o",
- "greylist-max-p",
- "greylist-max-q",
- "greylist-max-r",
+ "sdk",
+ "unsupported",
+ "blocked",
+ "max-target-o",
+ "max-target-p",
+ "max-target-q",
+ "max-target-r",
};
// Names corresponding to DomainApis.
diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h
index 1d96184d53..7565869852 100644
--- a/runtime/hidden_api.h
+++ b/runtime/hidden_api.h
@@ -203,8 +203,8 @@ class MemberSignature {
void LogAccessToEventLog(uint32_t sampled_value, AccessMethod access_method, bool access_denied);
// Calls back into managed code to notify VMRuntime.nonSdkApiUsageConsumer that
- // |member| was accessed. This is usually called when an API is on the black,
- // dark grey or light grey lists. Given that the callback can execute arbitrary
+ // |member| was accessed. This is usually called when an API is unsupported,
+ // conditionally or unconditionally blocked. Given that the callback can execute arbitrary
// code, a call to this method can result in thread suspension.
void NotifyHiddenApiListener(AccessMethod access_method);
};
diff --git a/test/674-hiddenapi/hiddenapi-flags.csv b/test/674-hiddenapi/hiddenapi-flags.csv
index 42626f7f5c..1596f14051 100644
--- a/test/674-hiddenapi/hiddenapi-flags.csv
+++ b/test/674-hiddenapi/hiddenapi-flags.csv
@@ -1,108 +1,108 @@
-LNullaryConstructorBlacklistAndCorePlatformApi;-><init>()V,blacklist,core-platform-api
-LNullaryConstructorBlacklist;-><init>()V,blacklist
-LNullaryConstructorDarkGreylist;-><init>()V,greylist-max-o
-LNullaryConstructorLightGreylist;-><init>()V,greylist
-LParentClass;->fieldPackageBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPackageBlacklist:I,blacklist
-LParentClass;->fieldPackageDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPackageLightGreylist:I,greylist
-LParentClass;->fieldPackageStaticBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPackageStaticBlacklist:I,blacklist
-LParentClass;->fieldPackageStaticDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPackageStaticLightGreylist:I,greylist
-LParentClass;->fieldPrivateBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPrivateBlacklist:I,blacklist
-LParentClass;->fieldPrivateDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPrivateLightGreylist:I,greylist
-LParentClass;->fieldPrivateStaticBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPrivateStaticBlacklist:I,blacklist
-LParentClass;->fieldPrivateStaticDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPrivateStaticLightGreylist:I,greylist
-LParentClass;->fieldProtectedBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldProtectedBlacklist:I,blacklist
-LParentClass;->fieldProtectedDarkGreylist:I,greylist-max-o
-LParentClass;->fieldProtectedLightGreylist:I,greylist
-LParentClass;->fieldProtectedStaticBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldProtectedStaticBlacklist:I,blacklist
-LParentClass;->fieldProtectedStaticDarkGreylist:I,greylist-max-o
-LParentClass;->fieldProtectedStaticLightGreylist:I,greylist
-LParentClass;->fieldPublicBlacklistAndCorePlatformApiB:I,blacklist,core-platform-api
-LParentClass;->fieldPublicBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPublicBlacklistB:I,blacklist
-LParentClass;->fieldPublicBlacklist:I,blacklist
-LParentClass;->fieldPublicDarkGreylistB:I,greylist-max-o
-LParentClass;->fieldPublicDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPublicLightGreylistB:I,greylist
-LParentClass;->fieldPublicLightGreylist:I,greylist
-LParentClass;->fieldPublicStaticBlacklistAndCorePlatformApiB:I,blacklist,core-platform-api
-LParentClass;->fieldPublicStaticBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentClass;->fieldPublicStaticBlacklistB:I,blacklist
-LParentClass;->fieldPublicStaticBlacklist:I,blacklist
-LParentClass;->fieldPublicStaticDarkGreylistB:I,greylist-max-o
-LParentClass;->fieldPublicStaticDarkGreylist:I,greylist-max-o
-LParentClass;->fieldPublicStaticLightGreylistB:I,greylist
-LParentClass;->fieldPublicStaticLightGreylist:I,greylist
-LParentClass;-><init>(DB)V,greylist-max-o
-LParentClass;-><init>(DC)V,blacklist
-LParentClass;-><init>(DI)V,blacklist,core-platform-api
-LParentClass;-><init>(DZ)V,greylist
-LParentClass;-><init>(FB)V,greylist-max-o
-LParentClass;-><init>(FC)V,blacklist
-LParentClass;-><init>(FI)V,blacklist,core-platform-api
-LParentClass;-><init>(FZ)V,greylist
-LParentClass;-><init>(IB)V,greylist-max-o
-LParentClass;-><init>(IC)V,blacklist
-LParentClass;-><init>(II)V,blacklist,core-platform-api
-LParentClass;-><init>(IZ)V,greylist
-LParentClass;-><init>(JB)V,greylist-max-o
-LParentClass;-><init>(JC)V,blacklist
-LParentClass;-><init>(JI)V,blacklist,core-platform-api
-LParentClass;-><init>(JZ)V,greylist
-LParentClass;->methodPackageBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPackageBlacklist()I,blacklist
-LParentClass;->methodPackageDarkGreylist()I,greylist-max-o
-LParentClass;->methodPackageLightGreylist()I,greylist
-LParentClass;->methodPackageStaticBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPackageStaticBlacklist()I,blacklist
-LParentClass;->methodPackageStaticDarkGreylist()I,greylist-max-o
-LParentClass;->methodPackageStaticLightGreylist()I,greylist
-LParentClass;->methodPrivateBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPrivateBlacklist()I,blacklist
-LParentClass;->methodPrivateDarkGreylist()I,greylist-max-o
-LParentClass;->methodPrivateLightGreylist()I,greylist
-LParentClass;->methodPrivateStaticBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPrivateStaticBlacklist()I,blacklist
-LParentClass;->methodPrivateStaticDarkGreylist()I,greylist-max-o
-LParentClass;->methodPrivateStaticLightGreylist()I,greylist
-LParentClass;->methodProtectedBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodProtectedBlacklist()I,blacklist
-LParentClass;->methodProtectedDarkGreylist()I,greylist-max-o
-LParentClass;->methodProtectedLightGreylist()I,greylist
-LParentClass;->methodProtectedStaticBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodProtectedStaticBlacklist()I,blacklist
-LParentClass;->methodProtectedStaticDarkGreylist()I,greylist-max-o
-LParentClass;->methodProtectedStaticLightGreylist()I,greylist
-LParentClass;->methodPublicBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPublicBlacklist()I,blacklist
-LParentClass;->methodPublicDarkGreylist()I,greylist-max-o
-LParentClass;->methodPublicLightGreylist()I,greylist
-LParentClass;->methodPublicStaticBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentClass;->methodPublicStaticBlacklist()I,blacklist
-LParentClass;->methodPublicStaticDarkGreylist()I,greylist-max-o
-LParentClass;->methodPublicStaticLightGreylist()I,greylist
-LParentInterface;->fieldPublicStaticBlacklistAndCorePlatformApi:I,blacklist,core-platform-api
-LParentInterface;->fieldPublicStaticBlacklist:I,blacklist
-LParentInterface;->fieldPublicStaticDarkGreylist:I,greylist-max-o
-LParentInterface;->fieldPublicStaticLightGreylist:I,greylist
-LParentInterface;->methodPublicBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentInterface;->methodPublicBlacklist()I,blacklist
-LParentInterface;->methodPublicDarkGreylist()I,greylist-max-o
-LParentInterface;->methodPublicDefaultBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentInterface;->methodPublicDefaultBlacklist()I,blacklist
-LParentInterface;->methodPublicDefaultDarkGreylist()I,greylist-max-o
-LParentInterface;->methodPublicDefaultLightGreylist()I,greylist
-LParentInterface;->methodPublicLightGreylist()I,greylist
-LParentInterface;->methodPublicStaticBlacklistAndCorePlatformApi()I,blacklist,core-platform-api
-LParentInterface;->methodPublicStaticBlacklist()I,blacklist
-LParentInterface;->methodPublicStaticDarkGreylist()I,greylist-max-o
-LParentInterface;->methodPublicStaticLightGreylist()I,greylist
+LNullaryConstructorBlacklistAndCorePlatformApi;-><init>()V,blocked,core-platform-api
+LNullaryConstructorBlacklist;-><init>()V,blocked
+LNullaryConstructorDarkGreylist;-><init>()V,max-target-o
+LNullaryConstructorLightGreylist;-><init>()V,unsupported
+LParentClass;->fieldPackageBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPackageBlacklist:I,blocked
+LParentClass;->fieldPackageDarkGreylist:I,max-target-o
+LParentClass;->fieldPackageLightGreylist:I,unsupported
+LParentClass;->fieldPackageStaticBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPackageStaticBlacklist:I,blocked
+LParentClass;->fieldPackageStaticDarkGreylist:I,max-target-o
+LParentClass;->fieldPackageStaticLightGreylist:I,unsupported
+LParentClass;->fieldPrivateBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPrivateBlacklist:I,blocked
+LParentClass;->fieldPrivateDarkGreylist:I,max-target-o
+LParentClass;->fieldPrivateLightGreylist:I,unsupported
+LParentClass;->fieldPrivateStaticBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPrivateStaticBlacklist:I,blocked
+LParentClass;->fieldPrivateStaticDarkGreylist:I,max-target-o
+LParentClass;->fieldPrivateStaticLightGreylist:I,unsupported
+LParentClass;->fieldProtectedBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldProtectedBlacklist:I,blocked
+LParentClass;->fieldProtectedDarkGreylist:I,max-target-o
+LParentClass;->fieldProtectedLightGreylist:I,unsupported
+LParentClass;->fieldProtectedStaticBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldProtectedStaticBlacklist:I,blocked
+LParentClass;->fieldProtectedStaticDarkGreylist:I,max-target-o
+LParentClass;->fieldProtectedStaticLightGreylist:I,unsupported
+LParentClass;->fieldPublicBlacklistAndCorePlatformApiB:I,blocked,core-platform-api
+LParentClass;->fieldPublicBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPublicBlacklistB:I,blocked
+LParentClass;->fieldPublicBlacklist:I,blocked
+LParentClass;->fieldPublicDarkGreylistB:I,max-target-o
+LParentClass;->fieldPublicDarkGreylist:I,max-target-o
+LParentClass;->fieldPublicLightGreylistB:I,unsupported
+LParentClass;->fieldPublicLightGreylist:I,unsupported
+LParentClass;->fieldPublicStaticBlacklistAndCorePlatformApiB:I,blocked,core-platform-api
+LParentClass;->fieldPublicStaticBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentClass;->fieldPublicStaticBlacklistB:I,blocked
+LParentClass;->fieldPublicStaticBlacklist:I,blocked
+LParentClass;->fieldPublicStaticDarkGreylistB:I,max-target-o
+LParentClass;->fieldPublicStaticDarkGreylist:I,max-target-o
+LParentClass;->fieldPublicStaticLightGreylistB:I,unsupported
+LParentClass;->fieldPublicStaticLightGreylist:I,unsupported
+LParentClass;-><init>(DB)V,max-target-o
+LParentClass;-><init>(DC)V,blocked
+LParentClass;-><init>(DI)V,blocked,core-platform-api
+LParentClass;-><init>(DZ)V,unsupported
+LParentClass;-><init>(FB)V,max-target-o
+LParentClass;-><init>(FC)V,blocked
+LParentClass;-><init>(FI)V,blocked,core-platform-api
+LParentClass;-><init>(FZ)V,unsupported
+LParentClass;-><init>(IB)V,max-target-o
+LParentClass;-><init>(IC)V,blocked
+LParentClass;-><init>(II)V,blocked,core-platform-api
+LParentClass;-><init>(IZ)V,unsupported
+LParentClass;-><init>(JB)V,max-target-o
+LParentClass;-><init>(JC)V,blocked
+LParentClass;-><init>(JI)V,blocked,core-platform-api
+LParentClass;-><init>(JZ)V,unsupported
+LParentClass;->methodPackageBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPackageBlacklist()I,blocked
+LParentClass;->methodPackageDarkGreylist()I,max-target-o
+LParentClass;->methodPackageLightGreylist()I,unsupported
+LParentClass;->methodPackageStaticBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPackageStaticBlacklist()I,blocked
+LParentClass;->methodPackageStaticDarkGreylist()I,max-target-o
+LParentClass;->methodPackageStaticLightGreylist()I,unsupported
+LParentClass;->methodPrivateBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPrivateBlacklist()I,blocked
+LParentClass;->methodPrivateDarkGreylist()I,max-target-o
+LParentClass;->methodPrivateLightGreylist()I,unsupported
+LParentClass;->methodPrivateStaticBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPrivateStaticBlacklist()I,blocked
+LParentClass;->methodPrivateStaticDarkGreylist()I,max-target-o
+LParentClass;->methodPrivateStaticLightGreylist()I,unsupported
+LParentClass;->methodProtectedBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodProtectedBlacklist()I,blocked
+LParentClass;->methodProtectedDarkGreylist()I,max-target-o
+LParentClass;->methodProtectedLightGreylist()I,unsupported
+LParentClass;->methodProtectedStaticBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodProtectedStaticBlacklist()I,blocked
+LParentClass;->methodProtectedStaticDarkGreylist()I,max-target-o
+LParentClass;->methodProtectedStaticLightGreylist()I,unsupported
+LParentClass;->methodPublicBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPublicBlacklist()I,blocked
+LParentClass;->methodPublicDarkGreylist()I,max-target-o
+LParentClass;->methodPublicLightGreylist()I,unsupported
+LParentClass;->methodPublicStaticBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentClass;->methodPublicStaticBlacklist()I,blocked
+LParentClass;->methodPublicStaticDarkGreylist()I,max-target-o
+LParentClass;->methodPublicStaticLightGreylist()I,unsupported
+LParentInterface;->fieldPublicStaticBlacklistAndCorePlatformApi:I,blocked,core-platform-api
+LParentInterface;->fieldPublicStaticBlacklist:I,blocked
+LParentInterface;->fieldPublicStaticDarkGreylist:I,max-target-o
+LParentInterface;->fieldPublicStaticLightGreylist:I,unsupported
+LParentInterface;->methodPublicBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentInterface;->methodPublicBlacklist()I,blocked
+LParentInterface;->methodPublicDarkGreylist()I,max-target-o
+LParentInterface;->methodPublicDefaultBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentInterface;->methodPublicDefaultBlacklist()I,blocked
+LParentInterface;->methodPublicDefaultDarkGreylist()I,max-target-o
+LParentInterface;->methodPublicDefaultLightGreylist()I,unsupported
+LParentInterface;->methodPublicLightGreylist()I,unsupported
+LParentInterface;->methodPublicStaticBlacklistAndCorePlatformApi()I,blocked,core-platform-api
+LParentInterface;->methodPublicStaticBlacklist()I,blocked
+LParentInterface;->methodPublicStaticDarkGreylist()I,max-target-o
+LParentInterface;->methodPublicStaticLightGreylist()I,unsupported
diff --git a/test/690-hiddenapi-same-name-methods/hiddenapi-flags.csv b/test/690-hiddenapi-same-name-methods/hiddenapi-flags.csv
index 001ab80db9..217992267b 100644
--- a/test/690-hiddenapi-same-name-methods/hiddenapi-flags.csv
+++ b/test/690-hiddenapi-same-name-methods/hiddenapi-flags.csv
@@ -1,9 +1,9 @@
-LSpecificClass;->foo()Ljava/lang/Double;,blacklist
-LDirectMethods;->foo()Ljava/lang/Integer;,blacklist
-LDirectMethods;->foo()Ljava/lang/Boolean;,blacklist
-LVirtualMethods;->foo()Ljava/lang/Integer;,blacklist
-LVirtualMethods;->foo()Ljava/lang/Boolean;,blacklist
-LSyntheticMethods;->foo()Ljava/lang/Integer;,blacklist
-LSyntheticMethods;->foo()Ljava/lang/Boolean;,blacklist
-LNonSyntheticMethods;->foo()Ljava/lang/Integer;,blacklist
-LNonSyntheticMethods;->foo()Ljava/lang/Boolean;,blacklist \ No newline at end of file
+LSpecificClass;->foo()Ljava/lang/Double;,blocked
+LDirectMethods;->foo()Ljava/lang/Integer;,blocked
+LDirectMethods;->foo()Ljava/lang/Boolean;,blocked
+LVirtualMethods;->foo()Ljava/lang/Integer;,blocked
+LVirtualMethods;->foo()Ljava/lang/Boolean;,blocked
+LSyntheticMethods;->foo()Ljava/lang/Integer;,blocked
+LSyntheticMethods;->foo()Ljava/lang/Boolean;,blocked
+LNonSyntheticMethods;->foo()Ljava/lang/Integer;,blocked
+LNonSyntheticMethods;->foo()Ljava/lang/Boolean;,blocked \ No newline at end of file
diff --git a/test/691-hiddenapi-proxy/hiddenapi-flags.csv b/test/691-hiddenapi-proxy/hiddenapi-flags.csv
index cc00e1674e..042ea087a8 100644
--- a/test/691-hiddenapi-proxy/hiddenapi-flags.csv
+++ b/test/691-hiddenapi-proxy/hiddenapi-flags.csv
@@ -1 +1 @@
-LMyInterface;->hidden()V,blacklist \ No newline at end of file
+LMyInterface;->hidden()V,blocked \ No newline at end of file
diff --git a/test/999-redefine-hiddenapi/hiddenapi-flags.csv b/test/999-redefine-hiddenapi/hiddenapi-flags.csv
index 7f632d38ce..b3bfe0a0a5 100644
--- a/test/999-redefine-hiddenapi/hiddenapi-flags.csv
+++ b/test/999-redefine-hiddenapi/hiddenapi-flags.csv
@@ -1,2 +1,2 @@
-Lart/Test999;->foo()V,blacklist
-Lart/Test999;->bar:I,blacklist
+Lart/Test999;->foo()V,blocked
+Lart/Test999;->bar:I,blocked
diff --git a/tools/class2greylist/src/com/android/class2greylist/Class2Greylist.java b/tools/class2greylist/src/com/android/class2greylist/Class2Greylist.java
index 1e9ddd2886..22d4b70bd0 100644
--- a/tools/class2greylist/src/com/android/class2greylist/Class2Greylist.java
+++ b/tools/class2greylist/src/com/android/class2greylist/Class2Greylist.java
@@ -39,32 +39,32 @@ import java.util.Set;
import java.util.stream.Collectors;
/**
- * Build time tool for extracting a list of members from jar files that have the @UsedByApps
- * annotation, for building the greylist.
+ * Build time tool for extracting a list of members from jar files that have the
+ * @UnsupportedAppUsage annotation, for building the non SDK API lists.
*/
public class Class2Greylist {
private static final String UNSUPPORTED_APP_USAGE_ANNOTATION =
"android.compat.annotation.UnsupportedAppUsage";
- private static final String FLAG_GREYLIST = "greylist";
- private static final String FLAG_BLACKLIST = "blacklist";
- private static final String FLAG_GREYLIST_MAX_O = "greylist-max-o";
- private static final String FLAG_GREYLIST_MAX_P = "greylist-max-p";
- private static final String FLAG_GREYLIST_MAX_Q = "greylist-max-q";
- private static final String FLAG_GREYLIST_MAX_R = "greylist-max-r";
+ private static final String FLAG_UNSUPPORTED = "unsupported";
+ private static final String FLAG_BLOCKED = "blocked";
+ private static final String FLAG_MAX_TARGET_O = "max-target-o";
+ private static final String FLAG_MAX_TARGET_P = "max-target-p";
+ private static final String FLAG_MAX_TARGET_Q = "max-target-q";
+ private static final String FLAG_MAX_TARGET_R = "max-target-r";
private static final String FLAG_PUBLIC_API = "public-api";
private static final Map<Integer, String> TARGET_SDK_TO_LIST_MAP;
static {
Map<Integer, String> map = new HashMap<>();
- map.put(null, FLAG_GREYLIST);
- map.put(0, FLAG_BLACKLIST);
- map.put(26, FLAG_GREYLIST_MAX_O);
- map.put(28, FLAG_GREYLIST_MAX_P);
- map.put(29, FLAG_GREYLIST_MAX_Q);
- map.put(30, FLAG_GREYLIST_MAX_R);
+ map.put(null, FLAG_UNSUPPORTED);
+ map.put(0, FLAG_BLOCKED);
+ map.put(26, FLAG_MAX_TARGET_O);
+ map.put(28, FLAG_MAX_TARGET_P);
+ map.put(29, FLAG_MAX_TARGET_Q);
+ map.put(30, FLAG_MAX_TARGET_R);
TARGET_SDK_TO_LIST_MAP = Collections.unmodifiableMap(map);
}
diff --git a/tools/hiddenapi/hiddenapi_test.cc b/tools/hiddenapi/hiddenapi_test.cc
index 06294a1af9..81e3f16047 100644
--- a/tools/hiddenapi/hiddenapi_test.cc
+++ b/tools/hiddenapi/hiddenapi_test.cc
@@ -267,42 +267,42 @@ class HiddenApiTest : public CommonRuntimeTest {
TEST_F(HiddenApiTest, InstanceFieldNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetIFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceFieldLightGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceFieldLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:I,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->ifield:I,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetIFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceFieldDarkGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceFieldDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:I,greylist-max-o" << std::endl
- << "LMain;->ifield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:I,max-target-o" << std::endl
+ << "LMain;->ifield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetIFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceFieldBlacklistMatch) {
+TEST_F(HiddenApiTest, InstanceFieldblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:I,blacklist" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:I,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetIFieldHiddenFlags(*dex_file));
@@ -311,8 +311,8 @@ TEST_F(HiddenApiTest, InstanceFieldBlacklistMatch) {
TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:I,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:I,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -320,8 +320,8 @@ TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch1) {
TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:I,blacklist,greylist" << std::endl;
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:I,blocked,unsupported" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -329,8 +329,8 @@ TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch2) {
TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:I,greylist,greylist-max-o" << std::endl
- << "LMain;->ifield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->ifield:I,unsupported,max-target-o" << std::endl
+ << "LMain;->ifield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -338,42 +338,42 @@ TEST_F(HiddenApiTest, InstanceFieldTwoListsMatch3) {
TEST_F(HiddenApiTest, StaticFieldNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:LBadType1;,greylist" << std::endl
- << "LMain;->sfield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->sfield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->sfield:LBadType1;,unsupported" << std::endl
+ << "LMain;->sfield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->sfield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetSFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticFieldLightGreylistMatch) {
+TEST_F(HiddenApiTest, StaticFieldLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:Ljava/lang/Object;,greylist" << std::endl
- << "LMain;->sfield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->sfield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->sfield:Ljava/lang/Object;,unsupported" << std::endl
+ << "LMain;->sfield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->sfield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetSFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticFieldDarkGreylistMatch) {
+TEST_F(HiddenApiTest, StaticFieldDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:LBadType1;,greylist" << std::endl
- << "LMain;->sfield:Ljava/lang/Object;,greylist-max-o" << std::endl
- << "LMain;->sfield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->sfield:LBadType1;,unsupported" << std::endl
+ << "LMain;->sfield:Ljava/lang/Object;,max-target-o" << std::endl
+ << "LMain;->sfield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetSFieldHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticFieldBlacklistMatch) {
+TEST_F(HiddenApiTest, StaticFieldblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:LBadType1;,greylist" << std::endl
- << "LMain;->sfield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->sfield:Ljava/lang/Object;,blacklist" << std::endl;
+ << "LMain;->sfield:LBadType1;,unsupported" << std::endl
+ << "LMain;->sfield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->sfield:Ljava/lang/Object;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetSFieldHiddenFlags(*dex_file));
@@ -382,8 +382,8 @@ TEST_F(HiddenApiTest, StaticFieldBlacklistMatch) {
TEST_F(HiddenApiTest, StaticFieldTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:LBadType1;,greylist" << std::endl
- << "LMain;->sfield:Ljava/lang/Object;,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->sfield:LBadType1;,unsupported" << std::endl
+ << "LMain;->sfield:Ljava/lang/Object;,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -391,8 +391,8 @@ TEST_F(HiddenApiTest, StaticFieldTwoListsMatch1) {
TEST_F(HiddenApiTest, StaticFieldTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->sfield:Ljava/lang/Object;,blacklist,greylist" << std::endl;
+ << "LMain;->sfield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->sfield:Ljava/lang/Object;,blocked,unsupported" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -400,8 +400,8 @@ TEST_F(HiddenApiTest, StaticFieldTwoListsMatch2) {
TEST_F(HiddenApiTest, StaticFieldTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->sfield:Ljava/lang/Object;,greylist,greylist-max-o" << std::endl
- << "LMain;->sfield:LBadType3;,blacklist" << std::endl;
+ << "LMain;->sfield:Ljava/lang/Object;,unsupported,max-target-o" << std::endl
+ << "LMain;->sfield:LBadType3;,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -409,42 +409,42 @@ TEST_F(HiddenApiTest, StaticFieldTwoListsMatch3) {
TEST_F(HiddenApiTest, InstanceMethodNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->imethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->imethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->imethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->imethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->imethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetIMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceMethodLightGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceMethodLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(J)V,greylist" << std::endl
- << "LMain;->imethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->imethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->imethod(J)V,unsupported" << std::endl
+ << "LMain;->imethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->imethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetIMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceMethodDarkGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceMethodDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->imethod(J)V,greylist-max-o" << std::endl
- << "LMain;->imethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->imethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->imethod(J)V,max-target-o" << std::endl
+ << "LMain;->imethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetIMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceMethodBlacklistMatch) {
+TEST_F(HiddenApiTest, InstanceMethodblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->imethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->imethod(J)V,blacklist" << std::endl;
+ << "LMain;->imethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->imethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->imethod(J)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetIMethodHiddenFlags(*dex_file));
@@ -453,8 +453,8 @@ TEST_F(HiddenApiTest, InstanceMethodBlacklistMatch) {
TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->imethod(J)V,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->imethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->imethod(J)V,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -462,8 +462,8 @@ TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch1) {
TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->imethod(J)V,blacklist,greylist" << std::endl;
+ << "LMain;->imethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->imethod(J)V,blocked,unsupported" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -471,8 +471,8 @@ TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch2) {
TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->imethod(J)V,greylist,greylist-max-o" << std::endl
- << "LMain;->imethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->imethod(J)V,unsupported,max-target-o" << std::endl
+ << "LMain;->imethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -480,42 +480,42 @@ TEST_F(HiddenApiTest, InstanceMethodTwoListsMatch3) {
TEST_F(HiddenApiTest, StaticMethodNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->smethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->smethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->smethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->smethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->smethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetSMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticMethodLightGreylistMatch) {
+TEST_F(HiddenApiTest, StaticMethodLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(Ljava/lang/Object;)V,greylist" << std::endl
- << "LMain;->smethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->smethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->smethod(Ljava/lang/Object;)V,unsupported" << std::endl
+ << "LMain;->smethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->smethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetSMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticMethodDarkGreylistMatch) {
+TEST_F(HiddenApiTest, StaticMethodDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->smethod(Ljava/lang/Object;)V,greylist-max-o" << std::endl
- << "LMain;->smethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->smethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->smethod(Ljava/lang/Object;)V,max-target-o" << std::endl
+ << "LMain;->smethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetSMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticMethodBlacklistMatch) {
+TEST_F(HiddenApiTest, StaticMethodblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->smethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->smethod(Ljava/lang/Object;)V,blacklist" << std::endl;
+ << "LMain;->smethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->smethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->smethod(Ljava/lang/Object;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetSMethodHiddenFlags(*dex_file));
@@ -524,8 +524,8 @@ TEST_F(HiddenApiTest, StaticMethodBlacklistMatch) {
TEST_F(HiddenApiTest, StaticMethodTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->smethod(Ljava/lang/Object;)V,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->smethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->smethod(Ljava/lang/Object;)V,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -533,8 +533,8 @@ TEST_F(HiddenApiTest, StaticMethodTwoListsMatch1) {
TEST_F(HiddenApiTest, StaticMethodTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->smethod(Ljava/lang/Object;)V,blacklist,greylist" << std::endl;
+ << "LMain;->smethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->smethod(Ljava/lang/Object;)V,blocked,unsupported" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -542,8 +542,8 @@ TEST_F(HiddenApiTest, StaticMethodTwoListsMatch2) {
TEST_F(HiddenApiTest, StaticMethodTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->smethod(Ljava/lang/Object;)V,greylist,greylist-max-o" << std::endl
- << "LMain;->smethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->smethod(Ljava/lang/Object;)V,unsupported,max-target-o" << std::endl
+ << "LMain;->smethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -551,42 +551,42 @@ TEST_F(HiddenApiTest, StaticMethodTwoListsMatch3) {
TEST_F(HiddenApiTest, InstanceNativeMethodNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->inmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->inmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->inmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->inmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->inmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetINMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceNativeMethodLightGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceNativeMethodLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(C)V,greylist" << std::endl
- << "LMain;->inmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->inmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->inmethod(C)V,unsupported" << std::endl
+ << "LMain;->inmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->inmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetINMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceNativeMethodDarkGreylistMatch) {
+TEST_F(HiddenApiTest, InstanceNativeMethodDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->inmethod(C)V,greylist-max-o" << std::endl
- << "LMain;->inmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->inmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->inmethod(C)V,max-target-o" << std::endl
+ << "LMain;->inmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetINMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, InstanceNativeMethodBlacklistMatch) {
+TEST_F(HiddenApiTest, InstanceNativeMethodblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->inmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->inmethod(C)V,blacklist" << std::endl;
+ << "LMain;->inmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->inmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->inmethod(C)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetINMethodHiddenFlags(*dex_file));
@@ -595,8 +595,8 @@ TEST_F(HiddenApiTest, InstanceNativeMethodBlacklistMatch) {
TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->inmethod(C)V,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->inmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->inmethod(C)V,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -604,8 +604,8 @@ TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch1) {
TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(C)V,blacklist,greylist" << std::endl
- << "LMain;->inmethod(LBadType2;)V,greylist-max-o" << std::endl;
+ << "LMain;->inmethod(C)V,blocked,unsupported" << std::endl
+ << "LMain;->inmethod(LBadType2;)V,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -613,8 +613,8 @@ TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch2) {
TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->inmethod(C)V,greylist,greylist-max-o" << std::endl
- << "LMain;->inmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->inmethod(C)V,unsupported,max-target-o" << std::endl
+ << "LMain;->inmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -622,42 +622,42 @@ TEST_F(HiddenApiTest, InstanceNativeMethodTwoListsMatch3) {
TEST_F(HiddenApiTest, StaticNativeMethodNoMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->snmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->snmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->snmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->snmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->snmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Sdk(), GetSNMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticNativeMethodLightGreylistMatch) {
+TEST_F(HiddenApiTest, StaticNativeMethodLightunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(Ljava/lang/Integer;)V,greylist" << std::endl
- << "LMain;->snmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->snmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,unsupported" << std::endl
+ << "LMain;->snmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->snmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Unsupported(), GetSNMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticNativeMethodDarkGreylistMatch) {
+TEST_F(HiddenApiTest, StaticNativeMethodDarkunsupportedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->snmethod(Ljava/lang/Integer;)V,greylist-max-o" << std::endl
- << "LMain;->snmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->snmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,max-target-o" << std::endl
+ << "LMain;->snmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::MaxTargetO(), GetSNMethodHiddenFlags(*dex_file));
}
-TEST_F(HiddenApiTest, StaticNativeMethodBlacklistMatch) {
+TEST_F(HiddenApiTest, StaticNativeMethodblockedMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->snmethod(LBadType2;)V,greylist-max-o" << std::endl
- << "LMain;->snmethod(Ljava/lang/Integer;)V,blacklist" << std::endl;
+ << "LMain;->snmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->snmethod(LBadType2;)V,max-target-o" << std::endl
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::Blocked(), GetSNMethodHiddenFlags(*dex_file));
@@ -666,8 +666,8 @@ TEST_F(HiddenApiTest, StaticNativeMethodBlacklistMatch) {
TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch1) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(LBadType1;)V,greylist" << std::endl
- << "LMain;->snmethod(Ljava/lang/Integer;)V,blacklist,greylist-max-o" << std::endl;
+ << "LMain;->snmethod(LBadType1;)V,unsupported" << std::endl
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,blocked,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -675,8 +675,8 @@ TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch1) {
TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch2) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(Ljava/lang/Integer;)V,blacklist,greylist" << std::endl
- << "LMain;->snmethod(LBadType2;)V,greylist-max-o" << std::endl;
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,blocked,unsupported" << std::endl
+ << "LMain;->snmethod(LBadType2;)V,max-target-o" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -684,8 +684,8 @@ TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch2) {
TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch3) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->snmethod(Ljava/lang/Integer;)V,greylist,greylist-max-o" << std::endl
- << "LMain;->snmethod(LBadType3;)V,blacklist" << std::endl;
+ << "LMain;->snmethod(Ljava/lang/Integer;)V,unsupported,max-target-o" << std::endl
+ << "LMain;->snmethod(LBadType3;)V,blocked" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
@@ -693,9 +693,9 @@ TEST_F(HiddenApiTest, StaticNativeMethodTwoListsMatch3) {
TEST_F(HiddenApiTest, InstanceFieldCorePlatformApiMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:I,greylist,core-platform-api" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:I,unsupported,core-platform-api" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::CorePlatformApi() |
@@ -705,9 +705,9 @@ TEST_F(HiddenApiTest, InstanceFieldCorePlatformApiMatch) {
TEST_F(HiddenApiTest, InstanceFieldTestApiMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:I,greylist,test-api" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:I,unsupported,test-api" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_NE(dex_file.get(), nullptr);
ASSERT_EQ(hiddenapi::ApiList::TestApi()
@@ -717,9 +717,9 @@ TEST_F(HiddenApiTest, InstanceFieldTestApiMatch) {
TEST_F(HiddenApiTest, InstanceFieldUnknownFlagMatch) {
ScratchFile dex, flags_csv;
OpenStream(flags_csv)
- << "LMain;->ifield:LBadType1;,greylist" << std::endl
- << "LMain;->ifield:LBadType2;,greylist-max-o" << std::endl
- << "LMain;->ifield:I,greylist,unknown-flag" << std::endl;
+ << "LMain;->ifield:LBadType1;,unsupported" << std::endl
+ << "LMain;->ifield:LBadType2;,max-target-o" << std::endl
+ << "LMain;->ifield:I,unsupported,unknown-flag" << std::endl;
auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex);
ASSERT_EQ(dex_file.get(), nullptr);
}
diff --git a/tools/veridex/appcompat.sh b/tools/veridex/appcompat.sh
index ce90c06491..a4fc46a5d8 100755
--- a/tools/veridex/appcompat.sh
+++ b/tools/veridex/appcompat.sh
@@ -28,7 +28,7 @@ if [[ -e ${SCRIPT_DIR}/veridex && \
exec ${SCRIPT_DIR}/veridex \
--core-stubs=${SCRIPT_DIR}/system-stubs.zip:${SCRIPT_DIR}/org.apache.http.legacy-stubs.zip \
--api-flags=${SCRIPT_DIR}/hiddenapi-flags.csv \
- --exclude-api-lists=whitelist,invalid \
+ --exclude-api-lists=sdk,invalid \
$@
fi
diff --git a/tools/veridex/hidden_api_finder.cc b/tools/veridex/hidden_api_finder.cc
index e740cf4cbf..3b512ebc8d 100644
--- a/tools/veridex/hidden_api_finder.cc
+++ b/tools/veridex/hidden_api_finder.cc
@@ -33,7 +33,7 @@ void HiddenApiFinder::CheckMethod(uint32_t method_id,
VeridexResolver* resolver,
MethodReference ref) {
// Note: we always query whether a method is in boot, as the app
- // might define blacklisted APIs (which won't be used at runtime).
+ // might define blocked APIs (which won't be used at runtime).
const auto& name = HiddenApi::GetApiMethodName(resolver->GetDexFile(), method_id);
method_locations_[name].push_back(ref);
}
@@ -42,7 +42,7 @@ void HiddenApiFinder::CheckField(uint32_t field_id,
VeridexResolver* resolver,
MethodReference ref) {
// Note: we always query whether a field is in a boot, as the app
- // might define blacklisted APIs (which won't be used at runtime).
+ // might define blocked APIs (which won't be used at runtime).
const auto& name = HiddenApi::GetApiFieldName(resolver->GetDexFile(), field_id);
field_locations_[name].push_back(ref);
}