public class PrivateApiDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.Detector.UastScanner
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.JavaPsiScanner, com.android.tools.lint.detector.api.Detector.JavaScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FOR_NAME |
static java.lang.String |
GET_CLASS |
static java.lang.String |
GET_DECLARED_METHOD |
static com.android.tools.lint.detector.api.Issue |
ISSUE
Using hidden/private APIs
|
static java.lang.String |
LOAD_CLASS |
Constructor and Description |
---|
PrivateApiDetector()
Constructs a new
PrivateApiDetector check |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
getApplicableMethodNames() |
static java.lang.String |
getClassFromMemberLookup(org.jetbrains.uast.UCallExpression call)
Given a Class#getMethodDeclaration or getFieldDeclaration etc call,
figure out the corresponding class name the method is being invoked on
|
void |
visitMethod(com.android.tools.lint.detector.api.JavaContext context,
org.jetbrains.uast.UCallExpression node,
com.intellij.psi.PsiMethod method) |
afterCheckFile, afterCheckLibraryProject, afterCheckProject, applicableSuperClasses, appliesTo, appliesTo, appliesToResourceRefs, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkClass, checkFolder, checkInstruction, createJavaVisitor, createPsiVisitor, createUastHandler, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableNodeTypes, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, getSpeed, getSpeed, run, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitMethod, visitReference, visitReference, visitResourceReference, visitResourceReference, visitResourceReference
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicableSuperClasses, appliesToResourceRefs, createUastHandler, getApplicableConstructorTypes, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, visitClass, visitClass, visitConstructor, visitReference, visitResourceReference
public static final java.lang.String LOAD_CLASS
public static final java.lang.String FOR_NAME
public static final java.lang.String GET_CLASS
public static final java.lang.String GET_DECLARED_METHOD
public static final com.android.tools.lint.detector.api.Issue ISSUE
public PrivateApiDetector()
PrivateApiDetector
checkpublic java.util.List<java.lang.String> getApplicableMethodNames()
getApplicableMethodNames
in interface com.android.tools.lint.detector.api.Detector.UastScanner
getApplicableMethodNames
in class com.android.tools.lint.detector.api.Detector
public void visitMethod(@NonNull com.android.tools.lint.detector.api.JavaContext context, @NonNull org.jetbrains.uast.UCallExpression node, @NonNull com.intellij.psi.PsiMethod method)
visitMethod
in interface com.android.tools.lint.detector.api.Detector.UastScanner
visitMethod
in class com.android.tools.lint.detector.api.Detector
@Nullable public static java.lang.String getClassFromMemberLookup(@NonNull org.jetbrains.uast.UCallExpression call)
call
- the Class.getDeclaredMethod(String, Class[])
or Class.getDeclaredField(String)
call