• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Copyright (C) 2018 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# We want to be at the root for simplifying the "out" detection
18# logic.
19if [ ! -d art ]; then
20  echo "Script needs to be run at the root of the android tree."
21  exit 1
22fi
23
24# Logic for setting out_dir from build/make/core/envsetup.mk:
25if [[ -z $OUT_DIR ]]; then
26  if [[ -z $OUT_DIR_COMMON_BASE ]]; then
27    OUT=out
28  else
29    OUT=${OUT_DIR_COMMON_BASE}/${PWD##*/}
30  fi
31else
32  OUT=${OUT_DIR}
33fi
34
35PACKAGING=${OUT}/target/common/obj/PACKAGING
36
37if [ -z "$ANDROID_HOST_OUT" ] ; then
38  ANDROID_HOST_OUT=${OUT}/host/linux-x86
39fi
40
41echo "NOTE: appcompat.sh is still under development. It can report"
42echo "API uses that do not execute at runtime, and reflection uses"
43echo "that do not exist. It can also miss on reflection uses."
44
45
46${ANDROID_HOST_OUT}/bin/veridex \
47    --core-stubs=${PACKAGING}/core_dex_intermediates/classes.dex:${PACKAGING}/oahl_dex_intermediates/classes.dex \
48    --blacklist=${PACKAGING}/hiddenapi-blacklist.txt \
49    --light-greylist=${PACKAGING}/hiddenapi-light-greylist.txt \
50    --dark-greylist=${PACKAGING}/hiddenapi-dark-greylist.txt \
51    $@
52