public class NetworkSecurityConfigDetector
extends com.android.tools.lint.detector.api.ResourceXmlDetector
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.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 |
ATTR_DIGEST |
static com.android.tools.lint.detector.api.Implementation |
IMPLEMENTATION |
static com.android.tools.lint.detector.api.Issue |
INSECURE_CONFIGURATION
Base configuration allows cleartext by default.
|
static com.android.tools.lint.detector.api.Issue |
ISSUE
Validate the entire network-security-config descriptor.
|
static com.android.tools.lint.detector.api.Issue |
MISSING_BACKUP_PIN
No backup pin specified.
|
static com.android.tools.lint.detector.api.Issue |
PIN_SET_EXPIRY
Validate the pin-set expiration attribute and warn if the expiry is in the near future.
|
static java.util.Set<java.lang.String> |
VALID_BASE_TAGS |
| Constructor and Description |
|---|
NetworkSecurityConfigDetector()
Constructs a new
NetworkSecurityConfigDetector |
| Modifier and Type | Method and Description |
|---|---|
boolean |
appliesTo(com.android.resources.ResourceFolderType folderType) |
void |
beforeCheckRootProject(com.android.tools.lint.detector.api.Context context) |
static java.util.List<java.lang.String> |
getAttributeSpellingSuggestions(java.lang.String errorAttribute,
java.lang.String parentTag)
For a given misspelled attribute, return the allowed suggestions/corrections.
|
static java.util.List<java.lang.String> |
getSupportedPinDigestAlgorithms()
Used by the IDE for quick fixes.
|
static java.util.List<java.lang.String> |
getTagSpellingSuggestions(java.lang.String errorTag,
java.lang.String parentTag)
For a given misspelled attribute, return the allowed suggestions/corrections.
|
static boolean |
isAttributeSpellingError(java.lang.String errorMessage)
For a given error message created by this lint detector, returns whether the error was due to
a typo in an attribute name.
|
static boolean |
isTagSpellingError(java.lang.String errorMessage) |
void |
visitDocument(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Document document) |
afterCheckEachProject, afterCheckFile, afterCheckLibraryProject, afterCheckProject, afterCheckRootProject, analyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesTo, appliesToResourceRefs, beforeCheckEachProject, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkDslPropertyAssignment, checkDslPropertyAssignment, checkFolder, checkInstruction, checkMethodCall, createPsiVisitor, createUastHandler, fix, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicableMethodNames, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, getCustomVisitor, getSpeed, inheritAnnotation, isApplicableAnnotationUsage, isCallGraphRequired, visitAnnotationUsage, visitAnnotationUsage, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitElement, visitElementAfter, visitMethod, visitMethod, visitMethodCall, visitReference, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final com.android.tools.lint.detector.api.Implementation IMPLEMENTATION
public static final com.android.tools.lint.detector.api.Issue ISSUE
public static final com.android.tools.lint.detector.api.Issue PIN_SET_EXPIRY
public static final com.android.tools.lint.detector.api.Issue MISSING_BACKUP_PIN
public static final com.android.tools.lint.detector.api.Issue INSECURE_CONFIGURATION
public static final java.lang.String ATTR_DIGEST
public static final java.util.Set<java.lang.String> VALID_BASE_TAGS
public NetworkSecurityConfigDetector()
NetworkSecurityConfigDetectorpublic boolean appliesTo(@NonNull
com.android.resources.ResourceFolderType folderType)
appliesTo in interface com.android.tools.lint.detector.api.XmlScannerappliesTo in class com.android.tools.lint.detector.api.ResourceXmlDetectorpublic void beforeCheckRootProject(@NonNull
com.android.tools.lint.detector.api.Context context)
beforeCheckRootProject in class com.android.tools.lint.detector.api.Detectorpublic void visitDocument(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Document document)
visitDocument in interface com.android.tools.lint.detector.api.XmlScannervisitDocument in class com.android.tools.lint.detector.api.Detectorpublic static boolean isAttributeSpellingError(@NonNull
java.lang.String errorMessage)
errorMessage - The error message associated with this detector.@NonNull
public static java.util.List<java.lang.String> getAttributeSpellingSuggestions(@NonNull
java.lang.String errorAttribute,
@NonNull
java.lang.String parentTag)
errorAttribute - the misspelled attributeparentTag - the parent tag used for determining the allowed attributespublic static boolean isTagSpellingError(@NonNull
java.lang.String errorMessage)
errorMessage - The error message associated with this detector.@NonNull
public static java.util.List<java.lang.String> getTagSpellingSuggestions(@NonNull
java.lang.String errorTag,
@NonNull
java.lang.String parentTag)
errorTag - the misspelled attributeparentTag - the parent tag used for determining the allowed attributespublic static java.util.List<java.lang.String> getSupportedPinDigestAlgorithms()