<!DOCTYPE html>
<html>
  <head>
    <meta name="generator" content="trueseeing {{toolchain.version}}">
    <title>Trueseeing Report</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <style>footer {padding-top:25px;padding-bottom:50px;text-align:right;} </style>
  </head>
  <body>
    <div class="container" role="main">
      <div class="jumbotron">
	<h1>Trueseeing Report</h1>
      </div>
      <div class="pageheader">
	<h2>1. Overview</h2>
      </div>
      <div>
	<p>We have analyzed the following application.</p>
	<ul>
{% if app.package %}
	  <li>Package name: {{app.package}}</li>
{% endif %}
{% if app.version_code %}
	  <li>Package version: {{app.version_name}} ({{app.version_code}})</li>
{% endif %}
{% if app.path %}
	  <li>Path: {{app.path}}</li>
{% endif %}
{% if app.size %}
	  <li>File size: {{app.size}}</li>
{% endif %}
{% if app.fp %}
	  <li>Fingerprint (SHA-256): {{app.fp}}</li>
{% endif %}
	</ul>

	<p>And here is summary of the report:</p>
	<ul>
	  <li>Report timestamp: {{ts}}</li>
	  <li>Trueseeing version: {{toolchain.version}}</li>
	</ul>
      </div>
      <div class="pageheader">
	<h2>2. Executive Summary</h2>
      </div>
      <div>
{% if issues %}
	<p>We have detected {{app.issues}} issues.</p>

	<div class="progress">
	  <div class="progress-bar progress-bar-danger progress-bar-striped" style="width: {{app.issues_critical / app.issues * 100}}%">
	    <span class="sr-only">{{app.issues_critical}}</span>
	  </div>
	  <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: {{app.issues_high / app.issues * 100}}%">
	    <span class="sr-only">{{app.issues_high}}</span>
	  </div>
	  <div class="progress-bar progress-bar-warning" style="width: {{app.issues_medium / app.issues * 100}}%">
	    <span class="sr-only">{{app.issues_medium}}</span>
	  </div>
	  <div class="progress-bar progress-bar-success" style="width: {{app.issues_low / app.issues * 100}}%">
	    <span class="sr-only">{{app.issues_low}}</span>
	  </div>
	  <div class="progress-bar progress-bar-info" style="width: {{app.issues_info / app.issues * 100}}%">
	    <span class="sr-only">{{app.issues_info}}</span>
	  </div>
	</div>
{% else %}
	<p>We have detected no issues.</p>
{% endif %}

	<table class="table table-hover">
	<thead>
	  <tr><th>Severity</th><th>Count</th></tr>
	</thead>
	<tbody>
	  <tr><td>Critical</td><td>{{app.issues_critical}}</td></tr>
	  <tr><td>High</td><td>{{app.issues_high}}</td></tr>
	  <tr><td>Medium</td><td>{{app.issues_medium}}</td></tr>
	  <tr><td>Low</td><td>{{app.issues_low}}</td></tr>
	  <tr><td>Info</td><td>{{app.issues_info}}</td></tr>
	</tbody>
	</table>

{% if issues %}
	<p>Detected issues are:</p>
	<ul>
	{% for issue in issues %}
	<li><a href="#issue-{{issue.no}}">{{issue.sev[0]}}{{issue.no+1}}. {{issue.title}}</a></li>
	{% endfor %}
	<ul>
{% endif %}

      </div>
      <div class="pageheader">
	<h2>3. Details</h2>
      </div>
{% if issues %}
      <div>
	<p>Below we describe the issues in detail:</p>
      </div>
      {% for issue in issues %}
      <div class="panel {{issue.severity_panel_style}}" id="issue-{{issue.no}}">
	<div class="panel-heading">
	  <h3 class="panel-title">3.{{issue.no+1}} {{issue.title}} <span class="badge">{{issue.insts|length}}</span></h3>
	</div>
	<div class="panel-body">
	    <h4>Synopsis</h4>
	    {% if issue.summary is not none %}
	    <p>{{issue.summary}}</p>
	    {% else %}
	    <p>No synopsis provided.</p>
	    {% endif %}
	    <h4>Description</h4>
	    {% if issue.desc is not none %}
	    <p>{{issue.desc}}</p>
	    {% else %}
	    <p>No description provided.</p>
	    {% endif %}
	    {% if issue.ref is not none %}
	    <h4>See Also</h4>
	    <p>{{issue.ref}}</p>
	    {% endif %}
	    {% if issue.sol is not none %}
	    <h4>Solution</h4>
	    <p>{{issue.sol}}</p>
	    {% endif %}
	    <h4>Risk Level</h4>
	    <p>{{issue.sev}}</p>
	    <h4>CVSS Score</h4>
	    <p>{{issue.score}} ({{issue.cvss}})</p>
	    <h4>Instances</h4>
	    <ul>
	      {% for i in issue.insts %}
	      {% if i.aff0 is not none %}
	      {% if i.aff1 is not none %}
	      <li>{{i.info|excerpt}} ({{i.aff0}}:{{i.aff1}})</li>
	      {% else %}
	      <li>{{i.info|excerpt}} ({{i.aff0}})</li>
	      {% endif %}
	      {% else %}
	      <li>{{i.info|excerpt}}</li>
	      {% endif %}
	      {% endfor %}
	    </ul>
	</div>
      </div>
      {% endfor %}
{% else %}
      <div>
	<p>We don't have any issue to be described here.</p>
      </div>
{% endif %}
      <hr>
    </div>
    <footer>
      <div class="container">
	<p>Report generated by <a href="https://github.com/alterakey/trueseeing">trueseeing</a> {{toolchain.version}}.</p>
      </div>
    </footer>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  </body>
</html>
