File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,8 +68,10 @@ class AndroidApplicationXmlElement extends XmlElement {
6868 )
6969 }
7070
71- /** Holds if this component element has an attribute with the name `permission`. */
72- predicate hasPermissionAttribute ( ) { exists ( this .getAttribute ( "permission" ) ) }
71+ /**
72+ * Holds if this application element has explicitly set a value for its `android:permission` attribute.
73+ */
74+ predicate requiresPermissions ( ) { this .getAnAttribute ( ) .( AndroidPermissionXmlAttribute ) .isFull ( ) }
7375}
7476
7577/**
@@ -234,14 +236,13 @@ class AndroidComponentXmlElement extends XmlElement {
234236 */
235237 predicate hasExportedAttribute ( ) { this .hasAttribute ( "exported" ) }
236238
237- /** Holds if this component element has an attribute with the name `permission`. */
238- predicate hasPermissionAttribute ( ) { exists ( this .getAttribute ( "permission" ) ) }
239-
239+ // /** Holds if this component element has an attribute with the name `permission`. */
240+ // predicate hasPermissionAttribute() { exists(this.getAttribute("permission")) }
240241 predicate isImplicitlyExported ( ) {
241242 not this .hasExportedAttribute ( ) and
242243 this .hasAnIntentFilterElement ( ) and // Note: did not use getAnIntentFilterElement since don't need a return value
243- not this .hasPermissionAttribute ( ) and
244- not this .getParent ( ) .( AndroidApplicationXmlElement ) .hasPermissionAttribute ( ) and
244+ not this .hasAttribute ( "permission" ) and // not seeing how isFull() is any better than this..., this seems to more directly check what I want...
245+ not this .getParent ( ) .( AndroidApplicationXmlElement ) .hasAttribute ( "permission" ) and
245246 not this .getAnIntentFilterElement ( ) .hasLauncherCategoryElement ( ) and
246247 not this .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( )
247248 }
Original file line number Diff line number Diff line change 77 * @id java/android/implicitly-exported-component
88 * @tags security
99 * external/cwe/cwe-926
10- * @precision high
10+ * @precision medium
1111 */
1212
1313import java
You can’t perform that action at this time.
0 commit comments