Skip to content

Commit 1a82e21

Browse files
authored
Merge pull request github#13136 from jcogs33/jcogs33/revamp-java-source-kinds
Java: change `android-widget` MaD source kind to `remote`
2 parents 617107d + de15013 commit 1a82e21

File tree

6 files changed

+7
-16
lines changed

6 files changed

+7
-16
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-java.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ The following source kinds are supported:
315315

316316
Below is an enumeration of the remaining source kinds, but they are out of scope for this documentation:
317317

318-
- **contentprovider**, **android-widget**, **android-external-storage-dir**.
318+
- **contentprovider**, **android-external-storage-dir**.
319319

320320
sinkModel(package, type, subtypes, name, signature, ext, input, kind, provenance)
321321
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Changed the `android-widget` Java source kind to `remote`. Any custom data extensions that use the `android-widget` source kind will need to be updated accordingly in order to continue working.

java/ql/lib/ext/android.widget.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extensions:
33
pack: codeql/java-all
44
extensible: sourceModel
55
data:
6-
- ["android.widget", "EditText", True, "getText", "", "", "ReturnValue", "android-widget", "manual"]
6+
- ["android.widget", "EditText", True, "getText", "", "", "ReturnValue", "remote", "manual"]
77
- addsTo:
88
pack: codeql/java-all
99
extensible: summaryModel

java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ module ModelValidation {
287287
)
288288
or
289289
exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) |
290-
not kind = ["remote", "contentprovider", "android-widget", "android-external-storage-dir"] and
290+
not kind = ["remote", "contentprovider", "android-external-storage-dir"] and
291291
not kind.matches("qltest%") and
292292
result = "Invalid kind \"" + kind + "\" in source model."
293293
)

java/ql/lib/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ abstract class RemoteFlowSource extends DataFlow::Node {
3636
abstract string getSourceType();
3737
}
3838

39-
/**
40-
* A module for importing frameworks that define remote flow sources.
41-
*/
42-
private module RemoteFlowSources {
43-
private import semmle.code.java.frameworks.android.Widget
44-
}
45-
4639
private class ExternalRemoteFlowSource extends RemoteFlowSource {
4740
ExternalRemoteFlowSource() { sourceNode(this, "remote") }
4841

java/ql/lib/semmle/code/java/frameworks/android/Widget.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import java
44
private import semmle.code.java.dataflow.ExternalFlow
55
private import semmle.code.java.dataflow.FlowSources
66

7-
private class DefaultAndroidWidgetSources extends RemoteFlowSource {
8-
DefaultAndroidWidgetSources() { sourceNode(this, "android-widget") }
9-
10-
override string getSourceType() { result = "Android widget source" }
11-
}
12-
137
private class EditableToStringStep extends AdditionalTaintStep {
148
override predicate step(DataFlow::Node n1, DataFlow::Node n2) {
159
exists(MethodAccess ma |

0 commit comments

Comments
 (0)