Apply review suggestions

This commit is contained in:
Joe Farebrother
2022-10-13 13:23:47 +01:00
parent e6dd3673a1
commit f48b57c95a
2 changed files with 6 additions and 7 deletions

View File

@@ -2,24 +2,23 @@
import java import java
import semmle.code.java.security.SensitiveActions import semmle.code.java.security.SensitiveActions
import semmle.code.xml.AndroidManifest
/** An Android Layout XML file. */ /** An Android Layout XML file. */
class AndroidLayoutXmlFile extends XmlFile { private class AndroidLayoutXmlFile extends XmlFile {
AndroidLayoutXmlFile() { this.getAbsolutePath().matches("%/res/layout/%.xml") } AndroidLayoutXmlFile() { this.getRelativePath().matches("%/res/layout/%.xml") }
} }
/** An XML element that represents an editable text field. */ /** An XML element that represents an editable text field. */
class AndroidEditableXmlElement extends XmlElement { class AndroidEditableXmlElement extends XmlElement {
XmlAttribute inputType; AndroidXmlAttribute inputType;
XmlAttribute id; AndroidXmlAttribute id;
AndroidEditableXmlElement() { AndroidEditableXmlElement() {
this.getFile() instanceof AndroidLayoutXmlFile and this.getFile() instanceof AndroidLayoutXmlFile and
inputType = this.getAnAttribute() and inputType = this.getAnAttribute() and
inputType.getNamespace().getPrefix() = "android" and
inputType.getName() = "inputType" and inputType.getName() = "inputType" and
id = this.getAnAttribute() and id = this.getAnAttribute() and
id.getNamespace().getPrefix() = "android" and
id.getName() = "id" id.getName() = "id"
} }

View File

@@ -7,7 +7,7 @@
* @id java/android/sensitive-keyboard-cache * @id java/android/sensitive-keyboard-cache
* @tags security * @tags security
* external/cwe/cwe-524 * external/cwe/cwe-524
* @precision high * @precision medium
*/ */
import java import java