Example #1
0
 def run_coroutine(self):
     while True:
         _, method_invocation = (yield)
         if not isinstance(method_invocation, MethodInvocation):
             continue
         if valid_set_method_bool(method_invocation, str_bool="true", method_name=self.java_method_name):
             self.issues.append(Issue(category=self.category, name=self.name, severity=self.severity,
                                      description=self.description, line_number=method_invocation.position,
                                      file_object=self.file_path))
Example #2
0
 def run(self):
     for _, method_invocation in self.java_ast.filter(MethodInvocation):
         if valid_set_method_bool(method_invocation,
                                  str_bool="true",
                                  method_name="setJavaScriptEnabled"):
             self.issues.append(
                 Issue(category=self.category,
                       name=self.name,
                       severity=Severity.WARNING,
                       description=self.description,
                       line_number=method_invocation.position,
                       file_object=self.file_path))
Example #3
0
 def run(self):
     if self.min_sdk <= 15:
         self.issues.extend(
             webview_default_vulnerable(self.java_ast,
                                        method_name=self.java_method_name,
                                        issue_name=self.name,
                                        description=self.description,
                                        file_object=self.file_path,
                                        severity=self.severity))
     else:
         for _, method_invocation in self.java_ast.filter(MethodInvocation):
             if valid_set_method_bool(method_invocation,
                                      str_bool="true",
                                      method_name=self.java_method_name):
                 self.issues.append(
                     Issue(category=self.category,
                           name=self.name,
                           severity=self.severity,
                           description=self.description,
                           line_number=method_invocation.position,
                           file_object=self.file_path))