File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,10 @@ class AndroidApplicationXmlElement extends XmlElement {
68
68
)
69
69
}
70
70
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 ( ) }
73
75
}
74
76
75
77
/**
@@ -234,14 +236,13 @@ class AndroidComponentXmlElement extends XmlElement {
234
236
*/
235
237
predicate hasExportedAttribute ( ) { this .hasAttribute ( "exported" ) }
236
238
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")) }
240
241
predicate isImplicitlyExported ( ) {
241
242
not this .hasExportedAttribute ( ) and
242
243
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
245
246
not this .getAnIntentFilterElement ( ) .hasLauncherCategoryElement ( ) and
246
247
not this .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( )
247
248
}
Original file line number Diff line number Diff line change 7
7
* @id java/android/implicitly-exported-component
8
8
* @tags security
9
9
* external/cwe/cwe-926
10
- * @precision high
10
+ * @precision medium
11
11
*/
12
12
13
13
import java
You can’t perform that action at this time.
0 commit comments