Merge "Support libraries (not just boot jars) that have hiddenapi"
am: f854d3e4be
Change-Id: Iebc8e83c009893d3ae66aeb7a8584da0c1f762fa
This commit is contained in:
@@ -33,7 +33,12 @@ var (
|
|||||||
DefaultLambdaStubsLibrary = "core-lambda-stubs"
|
DefaultLambdaStubsLibrary = "core-lambda-stubs"
|
||||||
SdkLambdaStubsPath = "prebuilts/sdk/tools/core-lambda-stubs.jar"
|
SdkLambdaStubsPath = "prebuilts/sdk/tools/core-lambda-stubs.jar"
|
||||||
|
|
||||||
// A list of the jars that provide information about usages of the hidden API.
|
// A list of the non-boot jars that provide hidden APIs, i.e. libraries.
|
||||||
|
HiddenAPIProvidingNonBootJars = []string{
|
||||||
|
"android.test.base",
|
||||||
|
}
|
||||||
|
|
||||||
|
// A list of the non-boot jars that provide information about usages of the hidden API.
|
||||||
HiddenAPIExtraAppUsageJars = []string{
|
HiddenAPIExtraAppUsageJars = []string{
|
||||||
// The core-oj-hiddenapi provides information for the core-oj jar.
|
// The core-oj-hiddenapi provides information for the core-oj jar.
|
||||||
"core-oj-hiddenapi",
|
"core-oj-hiddenapi",
|
||||||
|
@@ -59,7 +59,14 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, dexJar android.ModuleOu
|
|||||||
|
|
||||||
if !ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
|
if !ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
|
||||||
isBootJar := inList(ctx.ModuleName(), ctx.Config().BootJars())
|
isBootJar := inList(ctx.ModuleName(), ctx.Config().BootJars())
|
||||||
if isBootJar || inList(ctx.ModuleName(), config.HiddenAPIExtraAppUsageJars) {
|
// Check to see if this module provides part of the hiddenapi, i.e. is a boot jar or a white listed
|
||||||
|
// library.
|
||||||
|
isProvidingJar := isBootJar || inList(ctx.ModuleName(), config.HiddenAPIProvidingNonBootJars)
|
||||||
|
|
||||||
|
// If this module provides part of the hiddenapi or is a special module that simply provides information
|
||||||
|
// about the hiddenapi then extract information about the hiddenapi from the UnsupportedAppUsage
|
||||||
|
// annotations compiled into the classes.jar.
|
||||||
|
if isProvidingJar || inList(ctx.ModuleName(), config.HiddenAPIExtraAppUsageJars) {
|
||||||
// Derive the greylist from classes jar.
|
// Derive the greylist from classes jar.
|
||||||
flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
|
flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
|
||||||
metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
|
metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
|
||||||
@@ -67,7 +74,10 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, dexJar android.ModuleOu
|
|||||||
h.flagsCSVPath = flagsCSV
|
h.flagsCSVPath = flagsCSV
|
||||||
h.metadataCSVPath = metadataCSV
|
h.metadataCSVPath = metadataCSV
|
||||||
}
|
}
|
||||||
if isBootJar {
|
|
||||||
|
// If this module provides part of the hiddenapi then encode the information about the hiddenapi into
|
||||||
|
// the dex file created for this module.
|
||||||
|
if isProvidingJar {
|
||||||
hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", ctx.ModuleName()+".jar")
|
hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", ctx.ModuleName()+".jar")
|
||||||
h.bootDexJarPath = dexJar
|
h.bootDexJarPath = dexJar
|
||||||
hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)
|
hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)
|
||||||
|
Reference in New Issue
Block a user