master c92753328596 cached
152 files
530.7 KB
127.1k tokens
386 symbols
1 requests
Download .txt
Showing preview only (583K chars total). Download the full file or copy to clipboard to get everything.
Repository: SecUSo/privacy-friendly-netmonitor
Branch: master
Commit: c92753328596
Files: 152
Total size: 530.7 KB

Directory structure:
gitextract_et81zfgx/

├── .github/
│   └── workflows/
│       └── changelog.yml
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING
├── LICENSE.txt
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   ├── de/
│       │   │   │   └── bjoernr/
│       │   │   │       └── ssllabs/
│       │   │   │           ├── Api.java
│       │   │   │           ├── Console.java
│       │   │   │           └── ConsoleUtilities.java
│       │   │   └── org/
│       │   │       └── secuso/
│       │   │           └── privacyfriendlynetmonitor/
│       │   │               ├── Activities/
│       │   │               │   ├── AboutActivity.java
│       │   │               │   ├── Adapter/
│       │   │               │   │   ├── AppListRecyclerAdapter.java
│       │   │               │   │   ├── ExpandableHistoryListAdapter.java
│       │   │               │   │   ├── ExpandableListAdapter.java
│       │   │               │   │   ├── ExpandableReportAdapter.java
│       │   │               │   │   ├── FragmentDayListAdapter.java
│       │   │               │   │   └── PagerAdapter.java
│       │   │               │   ├── AppConnections_Chart.java
│       │   │               │   ├── BaseActivity.java
│       │   │               │   ├── HelpActivity.java
│       │   │               │   ├── HelpDataDump.java
│       │   │               │   ├── HistoryActivity.java
│       │   │               │   ├── HistoryDetailActivity.java
│       │   │               │   ├── MainActivity.java
│       │   │               │   ├── ReportDetailActivity.java
│       │   │               │   ├── SelectHistoryAppsActivity.java
│       │   │               │   ├── SettingsActivity.java
│       │   │               │   ├── SplashActivity.java
│       │   │               │   └── TutorialActivity.java
│       │   │               ├── Assistant/
│       │   │               │   ├── AsyncCertVal.java
│       │   │               │   ├── AsyncDNS.java
│       │   │               │   ├── Const.java
│       │   │               │   ├── ExecCom.java
│       │   │               │   ├── KnownPorts.java
│       │   │               │   ├── PrefManager.java
│       │   │               │   ├── RunStore.java
│       │   │               │   ├── TLType.java
│       │   │               │   └── ToolBox.java
│       │   │               ├── ConnectionAnalysis/
│       │   │               │   ├── Collector.java
│       │   │               │   ├── Detector.java
│       │   │               │   ├── PassiveService.java
│       │   │               │   ├── Report.java
│       │   │               │   └── ServiceHandler.java
│       │   │               ├── DatabaseUtil/
│       │   │               │   ├── DBApp.java
│       │   │               │   ├── GenerateReportEntities.java
│       │   │               │   └── ReportEntity.java
│       │   │               └── fragment/
│       │   │                   ├── Fragment_day.java
│       │   │                   ├── Fragment_month.java
│       │   │                   └── Fragment_week.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── background_border.xml
│       │       │   ├── button_fullwidth.xml
│       │       │   ├── ic_clear.xml
│       │       │   ├── ic_delete.xml
│       │       │   ├── ic_help.xml
│       │       │   ├── ic_history.xml
│       │       │   ├── ic_menu_info.xml
│       │       │   ├── ic_play_arrow.xml
│       │       │   ├── ic_refresh.xml
│       │       │   ├── ic_search_white_24dp.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_sort_white_24dp.xml
│       │       │   ├── ic_stop.xml
│       │       │   ├── ic_tutorial.xml
│       │       │   ├── ic_tutorial_inverted.xml
│       │       │   └── splash_screen.xml
│       │       ├── layout/
│       │       │   ├── activity_about.xml
│       │       │   ├── activity_help.xml
│       │       │   ├── activity_help_content.xml
│       │       │   ├── activity_history.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_main_app_bar.xml
│       │       │   ├── activity_main_content.xml
│       │       │   ├── activity_report.xml
│       │       │   ├── activity_report_app_bar.xml
│       │       │   ├── activity_report_content.xml
│       │       │   ├── activity_report_detail.xml
│       │       │   ├── activity_report_detail_content.xml
│       │       │   ├── activity_select_history_apps.xml
│       │       │   ├── activity_settings.xml
│       │       │   ├── activity_splash.xml
│       │       │   ├── activity_tutorial.xml
│       │       │   ├── app_list_group.xml
│       │       │   ├── app_list_item.xml
│       │       │   ├── app_report_detail_layout.xml
│       │       │   ├── content_history.xml
│       │       │   ├── content_select_history_apps.xml
│       │       │   ├── fragment_charts.xml
│       │       │   ├── fragment_list_item.xml
│       │       │   ├── help_list_group.xml
│       │       │   ├── help_list_item.xml
│       │       │   ├── history_list_group.xml
│       │       │   ├── history_list_item.xml
│       │       │   ├── main_nav_header.xml
│       │       │   ├── report_detail_item.xml
│       │       │   ├── report_list_group.xml
│       │       │   ├── report_list_group_header.xml
│       │       │   ├── report_list_item.xml
│       │       │   ├── toolbar.xml
│       │       │   ├── tutorial_slide1.xml
│       │       │   ├── tutorial_slide2.xml
│       │       │   └── tutorial_slide3.xml
│       │       ├── menu/
│       │       │   ├── applistseletion_menu.xml
│       │       │   ├── main_drawer.xml
│       │       │   └── toolbar_menu.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       ├── values-de/
│       │       │   └── strings.xml
│       │       ├── values-ja/
│       │       │   └── strings.xml
│       │       └── xml/
│       │           ├── preferences.xml
│       │           └── searchable.xml
│       └── test/
│           └── java/
│               └── bjoernr/
│                   └── ssllabs/
│                       ├── ApiAssert.java
│                       └── ApiTest.java
├── build.gradle
├── fastlane/
│   └── metadata/
│       └── android/
│           ├── ar/
│           │   └── summary.txt
│           ├── de/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── de-DE/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── en-US/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── eo/
│           │   └── summary.txt
│           ├── es/
│           │   └── summary.txt
│           ├── fr/
│           │   └── summary.txt
│           ├── he/
│           │   └── summary.txt
│           ├── it/
│           │   └── summary.txt
│           ├── ja/
│           │   └── summary.txt
│           ├── nb/
│           │   └── summary.txt
│           ├── nn/
│           │   └── summary.txt
│           ├── pl/
│           │   └── summary.txt
│           ├── pt/
│           │   └── summary.txt
│           ├── pt-BR/
│           │   └── summary.txt
│           ├── pt-PT/
│           │   └── summary.txt
│           ├── ro/
│           │   └── summary.txt
│           ├── ru/
│           │   └── summary.txt
│           ├── tr/
│           │   └── summary.txt
│           ├── uk/
│           │   └── summary.txt
│           ├── zh-CN/
│           │   └── summary.txt
│           └── zh-TW/
│               └── summary.txt
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/changelog.yml
================================================
name: Changelog Generation

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  changelog:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: 'recursive'
          ref: master
      - uses: rhysd/changelog-from-release/action@v3
        with:
          file: CHANGELOG.md
          pull_request: true
          github_token: ${{ secrets.GITHUB_TOKEN }}
          commit_summary_template: 'update changelog for %s changes'
          args: -l 2
          header: |
            # Changelog


================================================
FILE: .gitignore
================================================
# Built application files
/*/build/

# Crashlytics configuations
com_crashlytics_export_strings.xml

# Local configuration file (sdk path, etc)
local.properties

# Gradle generated files
.gradle/

#build files
build/

# Idea configuations
.idea/

# Signing files
.signing/

# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Documents
*.pdf
*.doc
*.docx
*.odt

#APK
*.apk


================================================
FILE: CHANGELOG.md
================================================
# Changelog

<a name="v2.1"></a>
## [Netmonitor (Privacy Friendly) v2.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.1) - 24 Sep 2020

- small bugfixes
- upgraded compile and target Android versions
- updated dependencies and libraries
- disabled for Android 10 and later
- updated SECUSO references
- fixed notification for newer Android versions

[Changes][v2.1]


<a name="v2.0"></a>
## [Privacy Friendly Netmonitor v2.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.0) - 29 Mar 2018

* Improvement history function: Apps with the Internet permission can be chosen and monitored
* Redesign

[Changes][v2.0]


<a name="v1.2"></a>
## [Privacy Friendly Netmonitor v1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.2) - 12 Oct 2017

- Bug fixing
- Icon updates
- Better handling of unknown apps

[Changes][v1.2]


<a name="v1.1.4"></a>
## [Privacy Friendly Net Monitor v1.1.4](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.4) - 09 Mar 2017

Blocking of screenshots removed

[Changes][v1.1.4]


<a name="v1.1.3"></a>
## [Privacy Friendly Net Monitor v1.1.3](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.3) - 04 Mar 2017

- Android 4 Support added
- Icons refinements (list icons, splash icons, unloadable icons)
- Help page refinement
- Bug Fixes


[Changes][v1.1.3]


<a name="v1.1.2"></a>
## [Privacy Friendly Net Monitor v1.1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.2) - 28 Feb 2017

- MinSDK reset to 21 


[Changes][v1.1.2]


<a name="v1.1.1"></a>
## [Privacy Friendly Net Monitor v1.1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.1) - 21 Feb 2017

- Refinements of translations
- Downgrade to SDK 23 is target


[Changes][v1.1.1]


<a name="v1.1"></a>
## [Privacy Friendly Net Monitor v1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1) - 20 Feb 2017

Adding of SSL Rating


[Changes][v1.1]


<a name="v1.0"></a>
## [Privacy Friendly Net Monitor v1.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.0) - 21 Jan 2017

Privacy Friendly Net Monitor is an Android application that can identify and monitor active network connections of applications that are installed on the mobile device. 
It monitors active network sockets and provides information about the scanned connections and apps. The invoking app is identified and listed with it's name, package and icon. The Connection's local and remote socket information (ip/port) is displayed along with a resolved hostname information and protocol evaluation based on well-known ports. Known un-/encrypted protocols are automatically marked. Privacy Friendly Net Monitor does not require a rooted device.

Privacy Friendly Net Monitor is optimized regarding the user’s privacy. It doesn’t use any tracking mechanisms, neither it displays any advertisement. It belongs to the Privacy Friendly Apps group developed by the SECUSO research group at Technische Universität Darmstadt, Germany.


[Changes][v1.0]


[v2.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v2.0...v2.1
[v2.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.2...v2.0
[v1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.4...v1.2
[v1.1.4]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.3...v1.1.4
[v1.1.3]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.2...v1.1.3
[v1.1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.1...v1.1.2
[v1.1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1...v1.1.1
[v1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.0...v1.1
[v1.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/tree/v1.0

<!-- Generated by https://github.com/rhysd/changelog-from-release v3.7.1 -->


================================================
FILE: CONTRIBUTING
================================================
# How to contribute

We encourage open source developers to support the Privacy Friendly Apps. 
We also wish to keep it as easy as possible to contribute. There are a few 
guidelines that we need contributors to follow.
For further questions we refer to the contact details on the [Privacy Friendly Apps website](https://secuso.org/pfa). 

## Reporting of Issues

* Make sure you have a [GitHub account](https://github.com/signup/free).
* Open an issue in the corresponding app's repository, assuming one does not already exist.
  * Clearly describe the issue including steps to reproduce when it is a bug.
    In some cases screenshots can be supportive. 
  * Make sure you mention the Android version and the device you have used when 
    you encountered the issue. 
* Make your description as precise as possible.
	
## Making Changes

* Make sure you have a [GitHub account](https://github.com/signup/free).
* Find an issue that you wish to close. If the issue you wish to close is not 
  present, open it. Make sure that the issue has one of the following labels
  which are set by our team:
  * Bug
  * Enhancement
  * Help wanted
  * No integration planned 
  That means that we have already reviewed the issue. If you wish to add a 
  translation, opening an issue is not required. 
* Fork the repository on GitHub.
* Create a topic branch from where you want to base your work (usually master branch).
  * To quickly create a topic branch based on master, run `git checkout -b
    fix/master/my_contribution master`. 
  *	Please avoid working directly on the `master` branch.
* Make commits of logical units in english language.
* Make sure your commit messages are in the proper format. If the commit
  addresses an issue filed in the Github repository, start the first line 
  of the commit with a hash followed by the issue number (e.g. #42).
* Make sure you have added the necessary tests for your changes.
* Run all available tests to assure nothing else was accidentally broken.

### Unwanted Changes

The Privacy Friendly Apps are a group of Android apps that are optimized regarding
the user's privacy. Therefore, Pull Requests that contain the following functionality
will be rejected:
* Analytics or advertisement frameworks
* User tracking (e.g. sending of data to a third party)
* Any that use of libraries that do not comply the license of the corresponding Privacy
  Friendly App (GPLv3 or Apache2).  
* Unnecessary use of Android permissions. If new functionality is added that requires
  the usage of an Android permission you should clearly explain the Pull Request why
  this permission is required.
* New translations/languages  

## Submitting Changes

* Push your changes to a topic branch in your fork of the repository.
* Submit a Pull Request to the repository of the corresponding Privacy Friendly App.
* Indicate that you have read this policy by writing the second word of the section "unwanted changes"
* Our team looks at Pull Requests on a regular basis and assigns a reviewer.  
* After feedback has been given we expect responses within one month. After one
  month we might close the pull request if no activity is shown.
   


================================================
FILE: LICENSE.txt
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
[![Twitter](https://img.shields.io/badge/twitter-@SECUSOResearch-%231DA1F2.svg?&style=flat-square&logo=twitter&logoColor=1DA1F2)][Twitter]
[![Mastodon](https://img.shields.io/badge/mastodon-@SECUSO__Research@baw%C3%BC.social-%233088D4.svg?&style=flat-square&logo=mastodon&logoColor=3088D4)][Mastodon]

[Mastodon]: https://xn--baw-joa.social/@SECUSO_Research
[Twitter]: https://twitter.com/SECUSOResearch

<img src="https://github.com/SecUSo/privacy-friendly-netmonitor/raw/master/fastlane/metadata/android/en-US/images/icon.png"
     alt="Privacy Friendly Netmonitor Icon"
     width="120px"
     align="right"
     style="float: right; margin-right: 10px;" />
# Privacy Friendly Net Monitor #

> :warning: :warning: :warning: **Please note:** This project is no longer officially maintained. In an attempt to focus our maintenance efforts, we have decided to stop the maintenance of some projects, including this one. This means that there will be no further feature updates or bugfixes planned for this app (exceptions only in cases of severe security or privacy issues). Consequently, the app has also been removed from the stores.
If someone is interested in taking over the maintenance of this app, please do not hesitate to contact us: pfa@secuso.org

This app monitors active network sockets and provides information on the scanned connections and apps. The invoking app is identified and listed with it's name, package and icon. The Connection's local and remote socket information (ip/port) is displayed along with a resolved hostname information and protocol evaluation based on well-known ports. Known un-/encrypted protocols are automatically marked. Additional features can be activated in the settings tab. This includes a panel for detailed technical information on connections, a logging functionality to keep scan results, a remote analysis of TLS-Servers via SSL-Labs API, a database connection to save selected reports in a history and charts to visualize the reports in different time intervals.

This app is optimized regarding the user’s privacy. It doesn’t use any tracking mechanisms, neither it displays any advertisement. It belongs to the Privacy Friendly Apps group developed by the SECUSO research group at Karlsruhe Institute of Technology, Germany.

## Motivation ##
This application has been developed to raise user awareness for the constant and unobserved communication behaviour of mobil device application. Additionally a coarse, technical analysis of the connections can help to identify unsecure, privacy-violating or malicious communicating behaviour of installed applications.

## Building ##

### API Reference ###
Mininum SDK: 22 Target SDK: 26 

### Setup ###
* Android Studio 3.0.1

### Future Enhancements ###
possible additional features
- raw socket inspection
- ip locating feature
- export of identified information
- display of additional remote host information (SSLLabs)
- long term goal: addtitional active service, perfoming (deep) packet inspection with VPN-Capture implementation

### License ###

Privacy Friendly Net Monitor is licensed under the GPLv3. Copyright (C) 2015 - 2018 Felix Tsala Schiller

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

The icons used in the nagivation drawer are licensed under the CC BY 2.5. In addition to them the app uses icons from Google Design Material Icons licensed under Apache License Version 2.0. All other images (the logo of Privacy Friendly Apps, the SECUSO logo, the app logos and the spash screen icon) copyright [SECUSO](www.secuso.org) (2019).

This application uses SSL Labs APIs v1.24.4 by Qualys SSL Labs (Terms of use: https://www.ssllabs.com/downloads/Qualys_SSL_Labs_Terms_of_Use.pdf) and  Java SSL Labs API by Björn Roland GLicense: GPLv3, https://github.com/bjoernr-de/java-ssllabs-api)

Privacy Friendly Net Monitor is a non-root variant of TLSMetric android app (https://bitbucket.org/schillef/tlsmetric/overview) by Felix Tsala Schiller.

### Contributors ###

App Icon:</br>
Markus Hau

Developers:</br>
Felix Tsala Schiller</br>
Tobias Burger</br>
Marco Egermaier

Contributors (Github):</br>
Yonjuni </br>
Kamuno</br>
di72nn</br>
stevesoltys</br>
FroggieFrog 





================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId 'org.secuso.privacyfriendlynetmonitor'
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 9
        versionName "2.1"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }

}

android {
    lintOptions {
        disable 'MissingTranslation'
    }
}

//added by TB (needed for Studio 3.0.0) and for the charts
allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}

dependencies {
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'org.greenrobot:greendao:3.3.0'
    implementation 'net.zetetic:android-database-sqlcipher:3.5.9'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'

    testImplementation 'junit:junit:4.12'
    testImplementation 'org.json:json:20180813'
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\fs\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.secuso.privacyfriendlynetmonitor">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

    <uses-sdk
        android:maxSdkVersion="28" />

    <application
        android:name=".DatabaseUtil.DBApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        <activity
            android:name=".Activities.SplashActivity"
            android:label="@string/app_name"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Activities.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name=".Activities.ReportDetailActivity"
            android:label="@string/headline_report_detail"
            android:parentActivityName=".Activities.MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>
        <activity
            android:name=".Activities.AboutActivity"
            android:label="@string/about"
            android:parentActivityName=".Activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>
        <activity
            android:name=".Activities.HelpActivity"
            android:label="@string/help"
            android:parentActivityName=".Activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>
        <activity
            android:name=".Activities.SettingsActivity"
            android:label="@string/title_activity_settings"
            android:parentActivityName=".Activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>
        <activity
            android:name=".Activities.TutorialActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>

        <service
            android:name=".ConnectionAnalysis.PassiveService"
            android:enabled="true"
            android:label="org.secuso.privacyfriendlynetmonitor.NetMonitorPassiveService"
            android:permission="android.permission.BIND_SERVICE" />

        <activity
            android:name=".Activities.HistoryActivity"
            android:label="@string/title_activity_history"
            android:parentActivityName=".Activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.MainActivity" />
        </activity>
        <activity
            android:name=".Activities.HistoryDetailActivity"
            android:label="@string/title_activity_history_detail"
            android:parentActivityName=".Activities.HistoryActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.HistoryActivity" />
        </activity>
        <activity
            android:name=".Activities.SelectHistoryAppsActivity"
            android:configChanges="orientation"
            android:label="@string/title_activity_select_history_apps"
            android:parentActivityName=".Activities.HistoryDetailActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateHidden">

            <!-- android:launchMode="singleTask" -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:resource="@xml/searchable"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity" />
        </activity>
        <activity
            android:name=".Activities.AppConnections_Chart"
            android:configChanges="orientation"
            android:label="@string/title_activity_app_report__detail"
            android:parentActivityName=".Activities.HistoryDetailActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme">

            <!-- android:launchMode="singleTask" -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity" />
        </activity>
    </application>

</manifest>

================================================
FILE: app/src/main/java/de/bjoernr/ssllabs/Api.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package de.bjoernr.ssllabs;

import org.json.JSONObject;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * Java-SSLLabs-API
 * <p>
 * This Java library provides basic access to the SSL Labs API
 * and is build upon the official API documentation at
 * https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md
 *
 * @author Björn Roland <https://github.com/bjoernr-de>
 * @license GNU GENERAL PUBLIC LICENSE v3
 */
public class Api {
    private static final String API_URL = "https://api.ssllabs.com/api/v2";
    private static final String VERSION = "0.0.1-SNAPSHOT";

    /**
     * Fetch API information
     * API Call: info
     *
     * @return JSONObject
     */
    public JSONObject fetchApiInfo() {
        String jsonString;
        JSONObject json = new JSONObject();

        try {
            jsonString = sendApiRequest("info", null);
            json = new JSONObject(jsonString);
        } catch (Exception ignored) {
        }

        return (json);
    }

    /**
     * Fetch host information
     * API Call: analyze
     *
     * @param    host
     * @param    publish
     * @param    startNew
     * @param    fromCache
     * @param    maxAge
     * @param    all
     * @param    ignoreMismatch
     * @return JSONObject
     */
    public JSONObject fetchHostInformation(String host, boolean publish, boolean startNew, boolean fromCache, String maxAge, String all, boolean ignoreMismatch) {
        String jsonString;
        JSONObject json = new JSONObject();

        try {
            Map<String, String> parameters = new HashMap<String, String>();

            parameters.put("host", host);
            parameters.put("publish", booleanToOnOffString(publish));
            parameters.put("startNew", booleanToOnOffString(startNew));
            parameters.put("fromCache", booleanToOnOffString(fromCache));
            parameters.put("maxAge", maxAge);
            parameters.put("all", all);
            parameters.put("ignoreMismatch", booleanToOnOffString(ignoreMismatch));

            jsonString = sendApiRequest("analyze", parameters);
            json = new JSONObject(jsonString);
        } catch (Exception ignored) {
        }

        return (json);
    }

    /**
     * Same as fetchHostInformation() but prefer caching
     * fetchHostInformation() with proper parameters can also be used
     * API Call: analyze
     *
     * @param    host
     * @param    maxAge
     * @param    publish
     * @param    ignoreMismatch
     * @return JSONObject
     */
    public JSONObject fetchHostInformationCached(String host, String maxAge, boolean publish, boolean ignoreMismatch) {
        return (fetchHostInformation(host, publish, false, true, maxAge, "done", ignoreMismatch));
    }

    /**
     * Fetch endpoint data
     * API Call: getEndpointData
     *
     * @param    host
     * @param    s
     * @param    fromCache
     * @return JSONObject
     */
    public JSONObject fetchEndpointData(String host, String s, boolean fromCache) {
        String jsonString;
        JSONObject json = new JSONObject();

        try {
            Map<String, String> parameters = new HashMap<String, String>();

            parameters.put("host", host);
            parameters.put("s", s);
            parameters.put("fromCache", booleanToOnOffString(fromCache));

            jsonString = sendApiRequest("getEndpointData", parameters);
            json = new JSONObject(jsonString);
        } catch (Exception ignored) {
        }

        return (json);
    }

    /**
     * Fetch status codes
     * API Call: getStatusCodes
     *
     * @return JSONObject
     */
    public JSONObject fetchStatusCodes() {
        String jsonString;
        JSONObject json = new JSONObject();

        try {
            jsonString = sendApiRequest("getStatusCodes", null);
            json = new JSONObject(jsonString);
        } catch (Exception ignored) {
        }

        return (json);
    }

    /**
     * Send custom API request and return API response
     *
     * @param    apiCall
     * @param    parameters
     * @return String
     */
    public String sendCustomApiRequest(String apiCall, Map<String, String> parameters) {
        String jsonString = "";

        try {
            jsonString = sendApiRequest(apiCall, parameters);
        } catch (Exception ignored) {
        }

        return (jsonString);
    }

    /**
     * Sends an api request and return api response
     *
     * @param    apiCall
     * @param    parameters
     * @return String
     * @throws IOException
     */
    private String sendApiRequest(String apiCall, Map<String, String> parameters) throws IOException {
        URL url = new URL(API_URL + "/" + apiCall);

        if (parameters != null) {
            url = new URL(url.toString() + buildGetParameterString(parameters));
        }

        InputStream is = url.openStream();
        int nextByteOfData = 0;

        StringBuffer apiResponseBuffer = new StringBuffer();

        while ((nextByteOfData = is.read()) != -1) {
            apiResponseBuffer.append((char) nextByteOfData);
        }

        is.close();

        return (apiResponseBuffer.toString());
    }

    /**
     * Helper function to build GET parameter string
     *
     * @param    parameters
     * @return String
     */
    private String buildGetParameterString(Map<String, String> parameters) {
        String getParameterString = "";

        for (Map.Entry<String, String> param : parameters.entrySet()) {
            if (param.getValue() == null) {
                continue;
            }

            getParameterString += (getParameterString.length() < 1) ? ("?") : ("&");

            getParameterString += param.getKey() + "=" + param.getValue();
        }

        return (getParameterString);
    }

    /**
     * Helper function to cast boolean to on/off string
     *
     * @param b
     * @return
     */
    private String booleanToOnOffString(boolean b) {
        return (b == true) ? "on" : "off";
    }

    /**
     * Getter for API_URL
     *
     * @return String
     */
    public static String getApiUrl() {
        return API_URL;
    }

    /**
     * Getter for VERSION
     *
     * @return String
     */
    public static String getVersion() {
        return VERSION;
    }
}

================================================
FILE: app/src/main/java/de/bjoernr/ssllabs/Console.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package de.bjoernr.ssllabs;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.Map;

/**
 * Command line interface class
 *
 * @author Björn Roland <https://github.com/bjoernr-de>
 */
public class Console {

    public static void main(String[] args) {
        printHeader();

        if (args.length == 1 && (args[0].equals("--info") || args[0].equals("-i"))) {
            handleInfo();
        } else if ((args.length > 0 && args.length <= 6) && (args[0].equals("--host-information") || args[0].equals("-hi"))) {
            handleHostInformation(args);
        } else {
            printUsage();
        }
    }

    public static void handleInfo() {
        Api ssllabsApi = new Api();

        JSONObject apiInfo = ssllabsApi.fetchApiInfo();
        Map<String, Object> map = null;
        try {
            map = ConsoleUtilities.jsonToMap(apiInfo);
        } catch (JSONException ignore) {

        }
        System.out.println("API information");
        System.out.println("");
        System.out.println(ConsoleUtilities.mapToConsoleOutput(map));
    }

    public static void handleHostInformation(String[] args) {
        //API parameters
        String host = ConsoleUtilities.arrayValueMatchRegex(args, "-h=(.+)");
        boolean publish = false;
        boolean startNew = false;
        boolean fromCache = false;
        String maxAge = null;
        String all = null;
        boolean ignoreMismatch = false;

        if (host == null) {
            //host not found in arguments
            printUsage();
            return;
        }

        String[] possibleArguments = {"-p", "-c", "-m", "-a", "-i"};

        for (String arg : possibleArguments) {
            if (ConsoleUtilities.arrayValueMatchRegex(args, arg) == null) {
                //if argument is not in args array, continue with next possible argument
                continue;
            }

            switch (arg) {
                case "-p":
                    publish = true;
                    break;
                case "-c":
                    fromCache = true;
                    break;
                case "-m":
                    maxAge = ConsoleUtilities.arrayValueMatchRegex(args, "-m=(.+)");
                    break;
                case "-a":
                    all = ConsoleUtilities.arrayValueMatchRegex(args, "-a=(.+)");
                    break;
                case "-i":
                    ignoreMismatch = true;
                    break;
            }
        }

        Api ssllabsApi = new Api();

        JSONObject hostInformation = ssllabsApi.fetchHostInformation(host, publish, startNew, fromCache, maxAge, all, ignoreMismatch);

        Map<String, Object> map = null;
        try {
            map = ConsoleUtilities.jsonToMap(hostInformation);
        } catch (JSONException ignore) {
        }

        System.out.println("Host information");
        System.out.println("");
        System.out.println(ConsoleUtilities.mapToConsoleOutput(map));
    }

    public static void printHeader() {
        System.out.println("");
        System.out.println("   ___                    _____ _____ _      _           _            ___  ______ _____ ");
        System.out.println("  |_  |                  /  ___/  ___| |    | |         | |          / _ \\ | ___ \\_   _|");
        System.out.println("    | | __ ___   ____ _  \\ `--.\\ `--.| |    | |     __ _| |__  ___  / /_\\ \\| |_/ / | |  ");
        System.out.println("    | |/ _` \\ \\ / / _` |  `--. \\`--. \\ |    | |    / _` | '_ \\/ __| |  _  ||  __/  | |  ");
        System.out.println("/\\__/ / (_| |\\ V / (_| | /\\__/ /\\__/ / |____| |___| (_| | |_) \\__ \\ | | | || |    _| |_ ");
        System.out.println("\\____/ \\__,_| \\_/ \\__,_| \\____/\\____/\\_____/\\_____/\\__,_|_.__/|___/ \\_| |_/\\_|    \\___/ ");
        System.out.println("by Bjoern Roland <https://github.com/bjoernr-de>");
        System.out.println("and contributors (https://github.com/bjoernr-de/java-ssllabs-api/graphs/contributors)");
        System.out.println("-------------------------------------------------");
        System.out.println("");
    }

    public static void printUsage() {
        String jarName = "java-ssllabs-api-" + Api.getVersion() + ".jar";
        String jarExecution = "java -jar " + jarName;

        System.out.println("Help");
        System.out.println(jarExecution);
        System.out.println("");

        System.out.println("-i, --info");
        System.out.println("	Fetch API information");
        System.out.println("");
        System.out.println("-hi, --host-information");
        System.out.println("	Mandatory parameter:");
        System.out.println("	-h, --host (String)");
        System.out.println("");
        System.out.println("	Additional parameter:");
        System.out.println("	-p, --publish (boolean) - default value is false");
        System.out.println("	-c, --fromCache (boolean) - default value is false");
        System.out.println("	-m, --maxAge (String)");
        System.out.println("	-a, --all (String)");
        System.out.println("	-i, --ignoreMismatch (boolean) - default value is false");
        System.out.println("");
        System.out.println("	Example:");
        System.out.println("	" + jarExecution + " -hi -h=https://ssllabs.com -p -c -m=\"1\"");
    }
}

================================================
FILE: app/src/main/java/de/bjoernr/ssllabs/ConsoleUtilities.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package de.bjoernr.ssllabs;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ConsoleUtilities {
    private static String newLine = "\n";

    /*
     * Special thanks to Vikas Gupta (http://stackoverflow.com/users/2915208/vikas-gupta)
     * http://stackoverflow.com/questions/21720759/convert-a-json-string-to-a-hashmap
     *
     * START code of Vikas Gupta from stackoverflow
     */
    public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException {
        Map<String, Object> retMap = new HashMap<String, Object>();

        if (json != JSONObject.NULL) {
            retMap = toMap(json);
        }
        return retMap;
    }

    public static Map<String, Object> toMap(JSONObject object) throws JSONException {
        Map<String, Object> map = new HashMap<String, Object>();

        Iterator<String> keysItr = object.keys();
        while (keysItr.hasNext()) {
            String key = keysItr.next();
            Object value = object.get(key);

            if (value instanceof JSONArray) {
                value = toList((JSONArray) value);
            } else if (value instanceof JSONObject) {
                value = toMap((JSONObject) value);
            }
            map.put(key, value);
        }
        return map;
    }

    public static List<Object> toList(JSONArray array) throws JSONException {
        List<Object> list = new ArrayList<Object>();
        for (int i = 0; i < array.length(); i++) {
            Object value = array.get(i);
            if (value instanceof JSONArray) {
                value = toList((JSONArray) value);
            } else if (value instanceof JSONObject) {
                value = toMap((JSONObject) value);
            }
            list.add(value);
        }
        return list;
    }
    // END code of Vikas Gupta from stackoverflow

    public static String mapToConsoleOutput(Map<String, Object> map) {
        String consoleOutput = "";

        for (Map.Entry<String, Object> entry : map.entrySet()) {
            consoleOutput += entry.getKey() + " = " + entry.getValue().toString();
            consoleOutput += newLine;
        }

        return (consoleOutput);
    }

    public static String arrayValueMatchRegex(String[] array, String regex) {
        Pattern p = Pattern.compile(regex);

        for (int i = 0; i < array.length; i++) {
            Matcher m = p.matcher(array[i]);

            while (m.find()) {
                try {
                    return (m.group(1));
                } catch (Exception ignored) {
                    //possible IndexOutOfBoundsException
                }
            }
        }

        return null;
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AboutActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */

package org.secuso.privacyfriendlynetmonitor.Activities;

import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;
import org.secuso.privacyfriendlynetmonitor.BuildConfig;
import org.secuso.privacyfriendlynetmonitor.R;

/**
 * Activity displaying information about Privacy Friendly Net Monitor App
 */
public class AboutActivity extends AppCompatActivity {

    /**
     *
     * @param savedInstanceState
     */
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        RunStore.setContext(this);

        ActionBar ab = getSupportActionBar();
        if (ab != null) {
            ab.setDisplayHomeAsUpEnabled(true);
        }

        View mainContent = findViewById(R.id.main_content);
        if (mainContent != null) {
            mainContent.setAlpha(0);
            mainContent.animate().alpha(1).setDuration(BaseActivity.MAIN_CONTENT_FADEIN_DURATION);
        }

        overridePendingTransition(0, 0);

        ((TextView) findViewById(R.id.javaAPIURL)).setMovementMethod(LinkMovementMethod.getInstance());
        ((TextView) findViewById(R.id.APIURL)).setMovementMethod(LinkMovementMethod.getInstance());
        ((TextView) findViewById(R.id.secusoWebsite)).setMovementMethod(LinkMovementMethod.getInstance());
        ((TextView) findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance());
        ((TextView) findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME);
    }
}

================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/AppListRecyclerAdapter.java
================================================
package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.R;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * Created by tobias on 09.03.18.
 */

public class AppListRecyclerAdapter extends RecyclerView.Adapter<AppListRecyclerAdapter.ViewHolder>{

    private List<String> app_list_name;

    private Context context;


    private SharedPreferences selectedAppsPreferences;
    private SharedPreferences.Editor editor;

    public static class ViewHolder extends RecyclerView.ViewHolder {
        // each data item is just a string in this case
        public TextView appGroupTitle;
        public TextView appInstallDate;
        public ImageView appIcon;
        public SwitchCompat appSwitch;

        public String appFullName;


        public ViewHolder(View view) {
            super(view);
            this.appGroupTitle = (TextView) view.findViewById(R.id.appGroupTitle);
            this.appInstallDate = (TextView) view.findViewById(R.id.appInstalledOn);
            this.appIcon = (ImageView) view.findViewById(R.id.appGroupIcon);
            this.appSwitch = (SwitchCompat) view.findViewById(R.id.switchAppOnOffHistory);
            this.appFullName = "";

        }
    }

    public AppListRecyclerAdapter(List<String> app_list_name, Context context) {
        this.app_list_name = app_list_name;
        this.context = context;

        selectedAppsPreferences = context.getSharedPreferences("SELECTEDAPPS", 0);
        editor = selectedAppsPreferences.edit();

    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        // create a new view
        View itemView = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.app_list_group, parent, false);
        return new ViewHolder(itemView);

    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, final int position) {
          String appName = app_list_name.get(position);
          holder.appFullName = appName;

        if (Collector.getAppsToIncludeInScan().contains(holder.appFullName)) {
            holder.appSwitch.setChecked(true);
        } else {
            holder.appSwitch.setChecked(false);
        }

        PackageManager packageManager = context.getPackageManager();

        try {
            holder.appGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));

            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd. MMM yyyy, HH:mm");
            Date date = new Date(packageManager.getPackageInfo(appName, 0).firstInstallTime);
            holder.appInstallDate.setText("Installed:  " + simpleDateFormat.format(date));

            holder.appIcon.setImageDrawable(packageManager.getApplicationIcon(appName));
        } catch (PackageManager.NameNotFoundException e) {

        }

        holder.appSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean bChecked) {

                String appName = holder.appFullName;
                if (bChecked) {
                    if (!Collector.getAppsToIncludeInScan().contains(appName)) {
                        Collector.addAppToIncludeInScan(appName);
                        editor.putString(appName, appName);
                        editor.commit();
                        holder.appSwitch.setChecked(true);
                    }
                } else {
                    if (Collector.getAppsToIncludeInScan().contains(appName)) {
                        Collector.deleteAppFromIncludeInScan(appName);
                        editor.remove(appName);
                        editor.commit();
                        holder.appSwitch.setChecked(false);
                    }
                }
            }
        });

    }

    @Override
    public int getItemCount() {
        return app_list_name.size();
    }


}




================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableHistoryListAdapter.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.content.Context;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.HashMap;
import java.util.List;

/**
 * Created by m4rc0 on 04.12.2017.
 * Adapter to display the Apps in the history
 */

public class ExpandableHistoryListAdapter extends BaseExpandableListAdapter {

    private Context context;
    private List<String> uidList;
    private HashMap<String, List<ReportEntity>> reportListDetail;

    /**
     *
     * @param context
     * @param uidList
     * @param reportListDetail
     */
    public ExpandableHistoryListAdapter(Context context, List<String> uidList,
                                        HashMap<String, List<ReportEntity>> reportListDetail) {
        this.context = context;
        this.uidList = uidList;
        this.reportListDetail = reportListDetail;

    }

    /**
     * @param groupPosition
     * @param childPosititon
     * @return child
     */
    @Override
    public Object getChild(int groupPosition, int childPosititon) {
        return this.reportListDetail.get(this.uidList.get(groupPosition))
                .get(childPosititon);
    }

    /**
     * @param groupPosition
     * @param childPosition
     * @return child id
     */
    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    /**
     * @param groupPosition
     * @param childPosition
     * @param isLastChild
     * @param convertView
     * @param parent
     * @return chield view
     */
    @Override
    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {

        ReportEntity reportEntity = ((ReportEntity) getChild(groupPosition, childPosition));
        final String dnsHostName = reportEntity.getRemoteHost();

        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.history_list_item, null);
        }

        TextView txtListChild = (TextView) convertView.findViewById(R.id.history_item_1);
        txtListChild.setText(dnsHostName);

        TextView history_item_2_type = (TextView) convertView.findViewById(R.id.history_item_2_type);
        history_item_2_type.setText(R.string.expandable_history_list_adapter_time_stamp);

        TextView history_item_2_val = (TextView) convertView.findViewById(R.id.history_item_2_val);
        history_item_2_val.setText(reportEntity.getTimeStamp());

        return convertView;
    }

    /**
     * @param groupPosition
     * @return children count
     */
    @Override
    public int getChildrenCount(int groupPosition) {
        return this.reportListDetail.get(this.uidList.get(groupPosition)).size();
    }

    /**
     * @param groupPosition
     * @return group
     */
    @Override
    public Object getGroup(int groupPosition) {
        return this.reportListDetail.get(groupPosition);
    }


    /**
     * @return group count
     */
    @Override
    public int getGroupCount() {
        return this.reportListDetail.size();
    }

    /**
     * @param groupPosition
     * @return group Position as ID
     */
    @Override
    public long getGroupId(int groupPosition) {
        return groupPosition;
    }

    /**
     * @param groupPosition
     * @param isExpanded
     * @param convertView
     * @param parent
     * @return group View
     */
    @Override
    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {

        LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = layoutInflater.inflate(R.layout.history_list_group, null);
        String appName = "";
        PackageManager packageManager = context.getPackageManager();

        try {
            appName = reportListDetail.get(uidList.get(groupPosition)).get(0).getAppName();
        } catch (IndexOutOfBoundsException e) {
            if (Collector.getKnownUIDs().containsKey(uidList.get(groupPosition))) {
                appName = Collector.getKnownUIDs().get(uidList.get(groupPosition));
            } else {
                appName = packageManager.getNameForUid((new Integer(uidList.get(groupPosition))));
            }
        }

        TextView historyGroupTitle = (TextView) convertView.findViewById(R.id.historyGroupTitle);
        TextView historyGroupSubtitle = (TextView) convertView.findViewById(R.id.historyGroupSubtitle);

        try {
//            if(reportListDetail == null || reportListDetail.isEmpty() || reportListDetail.get(appName) == null || reportListDetail.get(appName).isEmpty()){
            if(getChildrenCount(groupPosition) != 0){
                historyGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));
            } else {
                historyGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)) + " " + context.getString(R.string.history_no_data_collected));
            }
        } catch (PackageManager.NameNotFoundException e) {
            historyGroupTitle.setText(appName);
        }

        historyGroupSubtitle.setText(appName);

        ImageView imgView = (ImageView) convertView.findViewById(R.id.historyGroupIcon);

        try {
            imgView.setImageDrawable(packageManager.getApplicationIcon(appName));
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        return convertView;
    }

    @Override
    public boolean hasStableIds() {
        return false;
    }

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {
        return true;
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableListAdapter.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.R;

import java.util.HashMap;
import java.util.List;

/**
 * Adapter displaying contents in the help activity
 * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial
 * last access 27th October 2016
 */

public class ExpandableListAdapter extends BaseExpandableListAdapter {

    private Context context;
    private List<String> expandableListTitle;
    private HashMap<String, List<String>> expandableListDetail;

    /**
     *
     * @param context
     * @param expandableListTitle
     * @param expandableListDetail
     */
    public ExpandableListAdapter(Context context, List<String> expandableListTitle,
                                 HashMap<String, List<String>> expandableListDetail) {
        this.context = context;
        this.expandableListTitle = expandableListTitle;
        this.expandableListDetail = expandableListDetail;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return child
     */
    @Override
    public Object getChild(int listPosition, int expandedListPosition) {
        return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))
                .get(expandedListPosition);
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return child id
     */
    @Override
    public long getChildId(int listPosition, int expandedListPosition) {
        return expandedListPosition;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @param isLastChild
     * @param convertView
     * @param parent
     * @return child view
     */
    @Override
    public View getChildView(int listPosition, final int expandedListPosition,
                             boolean isLastChild, View convertView, ViewGroup parent) {
        final String expandedListText = (String) getChild(listPosition, expandedListPosition);
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.help_list_item, null);
        }
        TextView expandedListTextView = (TextView) convertView
                .findViewById(R.id.expandedListItem);
        expandedListTextView.setText(expandedListText);
        return convertView;
    }

    /**
     *
     * @param listPosition
     * @return children count
     */
    @Override
    public int getChildrenCount(int listPosition) {
        return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))
                .size();
    }

    /**
     *
     * @param listPosition
     * @return group
     */
    @Override
    public Object getGroup(int listPosition) {
        return this.expandableListTitle.get(listPosition);
    }

    /**
     * group count
     * @return
     */
    @Override
    public int getGroupCount() {
        return this.expandableListTitle.size();
    }

    /**
     *
     * @param listPosition
     * @return group id
     */
    @Override
    public long getGroupId(int listPosition) {
        return listPosition;
    }

    /**
     *
     * @param listPosition
     * @param isExpanded
     * @param convertView
     * @param parent
     * @return group view
     */
    @Override
    public View getGroupView(int listPosition, boolean isExpanded,
                             View convertView, ViewGroup parent) {
        String listTitle = (String) getGroup(listPosition);
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context.
                    getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.help_list_group, null);
        }
        TextView listTitleTextView = (TextView) convertView
                .findViewById(R.id.listTitle);
        listTitleTextView.setTypeface(null, Typeface.BOLD);
        listTitleTextView.setText(listTitle);
        return convertView;
    }

    /**
     *
     * @return false
     */
    @Override
    public boolean hasStableIds() {
        return false;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return true
     */
    @Override
    public boolean isChildSelectable(int listPosition, int expandedListPosition) {
        return true;
    }
}

================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableReportAdapter.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Assistant.Const;
import org.secuso.privacyfriendlynetmonitor.Assistant.KnownPorts;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.HashMap;
import java.util.List;

/**
 * Adapter displaying information in the ReportActivity
 */
public class ExpandableReportAdapter extends BaseExpandableListAdapter {

    private Context context;
    private List<Integer> uidList;
    private HashMap<Integer, List<Report>> reportListDetail;

    /**
     *
     * @param context
     * @param expandableListTitle
     * @param expandableListDetail
     */
    public ExpandableReportAdapter(Context context, List<Integer> expandableListTitle,
                                   HashMap<Integer, List<Report>> expandableListDetail) {
        this.context = context;
        this.uidList = expandableListTitle;
        this.reportListDetail = expandableListDetail;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return child
     */
    @Override
    public Object getChild(int listPosition, int expandedListPosition) {
        return this.reportListDetail.get(this.uidList.get(listPosition))
                .get(expandedListPosition);
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return child id
     */
    @Override
    public long getChildId(int listPosition, int expandedListPosition) {
        return expandedListPosition;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @param isLastChild
     * @param convertView
     * @param parent
     * @return child view
     */
    @Override
    public View getChildView(int listPosition, final int expandedListPosition, boolean isLastChild,
                             View convertView, ViewGroup parent) {

        //Build information from reports of one App (UID)
        Report r = (Report) getChild(listPosition, expandedListPosition);
        final String item1;
        final String item2_type;
        final String item2_value;

        //Set hostname if resolved by AsyncDNS class
        if (Collector.hasHostName(r.remoteAdd.getHostAddress())) {
            item1 = Collector.getDnsHostName(r.remoteAdd.getHostAddress());
        } else {
            item1 = "" + r.remoteAdd.getHostAddress();
        }
        //Set connection info or server rating
        if (Collector.isCertVal && KnownPorts.isTlsPort(r.remotePort) && Collector.hasHostName(r.remoteAdd.getHostAddress())) {
            if (item1.equals(Collector.getCertHost(item1))) {
                item2_type = "SSL Server Rating:";
                item2_value = Collector.getMetric(item1);
            } else {
                item2_type = "SSL Server Rating:";
                if (item1.equals(Collector.getCertHost(item1))) {
                    item2_value = Collector.getMetric(item1);
                } else {
                    item2_value = Collector.getMetric(item1) + " (" + Collector.getCertHost(item1)
                            + ")";
                }
            }
        } else {
            item2_type = "Connection Info:";
            item2_value = KnownPorts.CompileConnectionInfo(r.remotePort, r.type);
        }

        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.report_list_item, null);
        }

        //Fill textviews
        TextView textView = (TextView) convertView.findViewById(R.id.report_item_1);
        //final int height = textView.getHeight();
        textView.setText(item1);
        textView = (TextView) convertView.findViewById(R.id.report_item_2_type);
        textView.setText(item2_type);
        textView = (TextView) convertView.findViewById(R.id.report_item_2_val);
        textView.setText(item2_value);

        //Set warning colour if settings are set
        SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        textView.setTextColor(context.getResources().getColor(getWarningColor(item2_value)));
        if (!mSharedPreferences.getBoolean(Const.IS_HIGHLIGHTED, true)) {
            textView.setTextColor((int) R.color.text_dark);
        }

        return convertView;
    }

    /**
     * Get the warning color of a connection.
     * @param value
     * @return warning color as int
     */
    private int getWarningColor(String value) {
        if (value.contains(Const.STATUS_TLS) || value.substring(0, 1).equals("A")) {
            return (R.color.green);
        } else if (value.contains(Const.STATUS_INCONCLUSIVE) || value.substring(0, 1).equals("B") || value.substring(0, 1).equals("C")) {
            return (R.color.orange);
        } else if (value.contains(Const.STATUS_UNSECURE) || value.substring(0, 1).equals("T") ||
                value.substring(0, 1).equals("F") || value.substring(0, 1).equals("D") ||
                value.substring(0, 1).equals("E")) {
            return R.color.red;
        } else {
            return R.color.text_dark;
        }
    }

    /**
     *
     * @param listPosition
     * @return children count
     */
    @Override
    public int getChildrenCount(int listPosition) {
        return this.reportListDetail.get(this.uidList.get(listPosition))
                .size();
    }

    /**
     *
     * @param listPosition
     * @return group
     */
    @Override
    public Object getGroup(int listPosition) {
        return this.uidList.get(listPosition);
    }

    /**
     *
     * @return group count
     */
    @Override
    public int getGroupCount() {
        return this.uidList.size();
    }

    /**
     *
     * @param listPosition
     * @return group id
     */
    @Override
    public long getGroupId(int listPosition) {
        return listPosition;
    }

    /**
     *
     * @param listPosition
     * @param isExpanded
     * @param convertView
     * @param parent
     * @return group view
     */
    @Override
    public View getGroupView(int listPosition, boolean isExpanded,
                             View convertView, ViewGroup parent) {
        int uid = (int) getGroup(listPosition);
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context.
                    getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.report_list_group, null);
        }
        TextView textViewTitle = (TextView) convertView.findViewById(R.id.reportGroupTitle);
        textViewTitle.setTypeface(null, Typeface.BOLD);
        TextView textViewSubtitle = (TextView) convertView.findViewById(R.id.reportGroupSubtitle);
        ImageView imgView = (ImageView) convertView.findViewById(R.id.reportGroupIcon);

        //add system app tag
        if (uid <= 10000) {
            textViewTitle.setText(Collector.getLabel(uid) +
                    " (" + reportListDetail.get(uid).size() + ")" + " [System]");
        } else {
            textViewTitle.setText(Collector.getLabel(uid) +
                    " (" + reportListDetail.get(uid).size() + ")");
        }
        textViewSubtitle.setText(Collector.getPackage(uid));
        imgView.setImageDrawable(Collector.getIcon(uid));

        return convertView;
    }

    /**
     *
     * @return false
     */
    @Override
    public boolean hasStableIds() {
        return false;
    }

    /**
     *
     * @param listPosition
     * @param expandedListPosition
     * @return true
     */
    @Override
    public boolean isChildSelectable(int listPosition, int expandedListPosition) {
        return true;
    }

}

================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/FragmentDayListAdapter.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */

package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;
import org.secuso.privacyfriendlynetmonitor.R;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by m4rc0 on 14.01.2018.
 * Adapter adds reports to day, week and month fragments.
 */
public class FragmentDayListAdapter extends RecyclerView.Adapter<FragmentDayListAdapter.ViewHolder> {

    List<ReportEntity> reportEntities;
    Context context;

    /**
     *
     * @param reportEntities
     * @param context
     */
    public FragmentDayListAdapter(List<ReportEntity> reportEntities, Context context) {
        this.reportEntities = reportEntities;
        this.context = context;
    }

    /**
     * View Holder for items.
     */
    public static class ViewHolder extends RecyclerView.ViewHolder {

        public RelativeLayout relativeLayout;

        public ViewHolder(RelativeLayout itemView) {
            super(itemView);
            relativeLayout = itemView;
        }
    }

    /**
     *
     * @param parent
     * @param viewType
     * @return ViewHolder
     */
    @Override
    public FragmentDayListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        RelativeLayout relativeLayout = (RelativeLayout) LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_list_item, parent, false);

        ViewHolder vh = new ViewHolder(relativeLayout);
        return vh;
    }

    /**
     *
     * @param holder
     * @param position
     */
    @Override
    public void onBindViewHolder(FragmentDayListAdapter.ViewHolder holder, int position) {

        final ReportEntity reportEntity = reportEntities.get(position);

        TextView textViewAppName = holder.relativeLayout.findViewById(R.id.fragment_appname);
        TextView textViewTimestamp = holder.relativeLayout.findViewById(R.id.fragment_timestamp_value);
        TextView textViewConnectionInfo = holder.relativeLayout.findViewById(R.id.fragment_conncection_info_value);

        textViewAppName.setText(reportEntity.getRemoteAddress());
        textViewTimestamp.setText(reportEntity.getTimeStamp());
        textViewConnectionInfo.setText(reportEntity.getConnectionInfo());

        holder.relativeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                List<String> detailsList = prepareData(reportEntity);
                Intent intent = new Intent(context, HistoryDetailActivity.class);
                intent.putExtra("Details", (ArrayList) detailsList);
                context.startActivity(intent);

            }
        });
    }

    /**
     *
     * @return item count
     */
    @Override
    public int getItemCount() {
        return reportEntities.size();
    }

    /**
     *
     * @param reportEntity
     * @return list with prepared data
     */
    private List<String> prepareData(ReportEntity reportEntity) {

        PackageManager packageManager = context.getPackageManager();

        String details = "";
        List<String> detailsList = new ArrayList<String>();

        String appName = reportEntity.getAppName();
        detailsList.add(appName);

        String uid = reportEntity.getUserID();
        detailsList.add(uid);

        PackageInfo packageInfo = null;

        try {
            packageInfo = packageManager.getPackageInfo(appName, 0);
        } catch (PackageManager.NameNotFoundException e) {
            System.out.println("Could not find package info for " + appName + ".");
        }

        details = packageInfo.versionName;
        detailsList.add(details);

        details = new Date(packageInfo.firstInstallTime).toString();
        detailsList.add(details);

        details = reportEntity.getRemoteAddress();
        detailsList.add(details);

        details = reportEntity.getRemoteHex();
        detailsList.add(details);

        details = reportEntity.getRemoteHost();
        detailsList.add(details);

        details = reportEntity.getLocalAddress();
        detailsList.add(details);

        details = reportEntity.getLocalHex();
        detailsList.add(details);

        details = reportEntity.getServicePort();
        detailsList.add(details);

        details = reportEntity.getPayloadProtocol();
        detailsList.add(details);

        details = reportEntity.getTransportProtocol();
        detailsList.add(details);

        details = reportEntity.getLocalPort();
        detailsList.add(details);

        details = reportEntity.getTimeStamp();
        detailsList.add(details);

        details = reportEntity.getConnectionInfo();
        detailsList.add(details);

        return detailsList;
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/PagerAdapter.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */

package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;

import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_day;
import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_month;
import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_week;

/**
 * Created by tobias on 04.01.18.
 * Adapter for fragment pager.
 */
public class PagerAdapter extends FragmentStatePagerAdapter {
    int mNumOfTabs;
    Bundle data;

    /**
     *
     * @param fm
     * @param NumOfTabs
     * @param appSubName
     */
    public PagerAdapter(FragmentManager fm, int NumOfTabs, String appSubName) {
        super(fm);
        this.mNumOfTabs = NumOfTabs;
        data = new Bundle();
        data.putString("AppName", appSubName);
    }

    /**
     *
     * @param position
     * @return item
     */
    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                Fragment_day tab_day = new Fragment_day();
                tab_day.setArguments(data);
                return tab_day;
            case 1:
                Fragment_week tab_week = new Fragment_week();
                tab_week.setArguments(data);
                return tab_week;
            case 2:
                Fragment_month tab_month = new Fragment_month();
                tab_month.setArguments(data);
                return tab_month;
            default:
                return null;
        }
    }

    /**
     *
     * @return number of tabs
     */
    @Override
    public int getCount() {
        return mNumOfTabs;
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AppConnections_Chart.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */

package org.secuso.privacyfriendlynetmonitor.Activities;

import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;

import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.PagerAdapter;
import org.secuso.privacyfriendlynetmonitor.R;

/**
 * Created by tobias on 04.01.18.
 * App Connection chart class to visualize reports in different time intervals.
 */
public class AppConnections_Chart extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        String appName = getIntent().getStringExtra(("AppName"));
        setTitle(appName);
        String appSubName = getIntent().getStringExtra(("AppSubName"));


        setContentView(R.layout.app_report_detail_layout);

        TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_day));
        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_week));
        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_month));
        tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);

        final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
        final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(),
                appSubName);
        viewPager.setAdapter(adapter);
        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {

            @Override
            public void onTabSelected(TabLayout.Tab tab) {
                viewPager.setCurrentItem(tab.getPosition());
            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(TabLayout.Tab tab) {

            }
        });

    }

}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/BaseActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import com.google.android.material.navigation.NavigationView;
import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener;
import androidx.core.app.TaskStackBuilder;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;

import org.secuso.privacyfriendlynetmonitor.R;

/**
 * Base activity for other activities
 */
public class BaseActivity extends AppCompatActivity implements OnNavigationItemSelectedListener {

    // delay to launch nav drawer item, to allow close animation to play
    static final int NAVDRAWER_LAUNCH_DELAY = 250;
    // fade in and fade out durations for the main content when switching between
    // different Activities of the app through the Nav Drawer
    static final int MAIN_CONTENT_FADEOUT_DURATION = 150;
    static final int MAIN_CONTENT_FADEIN_DURATION = 250;

    // Navigation drawer:
    DrawerLayout mDrawerLayout;
    NavigationView mNavigationView;

    // Helper
    private Handler mHandler;
    protected SharedPreferences mSharedPreferences;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);

        mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        mHandler = new Handler();

        //ActionBar ab = getSupportActionBar();
        //if (ab != null) {
        //    mActionBar = ab;
        //    ab.setDisplayHomeAsUpEnabled(true);
        //}

        overridePendingTransition(0, 0);
    }

    @Override
    public void onBackPressed() {
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else {
            super.onBackPressed();
        }
    }

    protected int getNavigationDrawerID() {
        return 0;
    }

    @Override
    public boolean onNavigationItemSelected(MenuItem item) {
        final int itemId = item.getItemId();

        return goToNavigationItem(itemId);
    }

    protected boolean goToNavigationItem(final int itemId) {

        if (itemId == getNavigationDrawerID()) {
            // just close drawer because we are already in this activity
            mDrawerLayout.closeDrawer(GravityCompat.START);
            return true;
        }

        // delay transition so the drawer can close
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                callDrawerItem(itemId);
            }
        }, NAVDRAWER_LAUNCH_DELAY);

        mDrawerLayout.closeDrawer(GravityCompat.START);

        selectNavigationItem(itemId);

        // fade out the active activity
        View mainContent = findViewById(R.id.main_content);
        if (mainContent != null) {
            mainContent.animate().alpha(0).setDuration(MAIN_CONTENT_FADEOUT_DURATION);
        }
        return true;
    }

    // set active navigation item
    void selectNavigationItem(int itemId) {
        for (int i = 0; i < mNavigationView.getMenu().size(); i++) {
            boolean b = itemId == mNavigationView.getMenu().getItem(i).getItemId();
            mNavigationView.getMenu().getItem(i).setChecked(b);
        }
    }

    /**
     * Enables back navigation for activities that are launched from the NavBar. See
     * {@code AndroidManifest.xml} to find out the parent activity names for each activity.
     *
     * @param intent
     */
    private void createBackStack(Intent intent) {
        TaskStackBuilder builder = TaskStackBuilder.create(this);
        builder.addNextIntentWithParentStack(intent);
        builder.startActivities();
    }

    private void callDrawerItem(final int itemId) {

        Intent intent;

        switch (itemId) {
            case R.id.nav_main:
                intent = new Intent(this, MainActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                break;
            case R.id.nav_history:
                intent = new Intent(this, HistoryActivity.class);
                createBackStack(intent);
                break;
            case R.id.nav_about:
                intent = new Intent(this, AboutActivity.class);
                createBackStack(intent);
                break;
            case R.id.nav_help:
                intent = new Intent(this, HelpActivity.class);
                createBackStack(intent);
                break;
            case R.id.nav_settings:
                intent = new Intent(this, SettingsActivity.class);
                intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName());
                intent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true);
                createBackStack(intent);
                break;
            case R.id.nav_tutorial:
                TutorialActivity.setTutorial_click(true);
                intent = new Intent(this, TutorialActivity.class);
                createBackStack(intent);
                break;
            default:
        }
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        setToolbar();
    }

    public void setToolbar() {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        if (getSupportActionBar() == null) {
            setSupportActionBar(toolbar);
        }

        mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, mDrawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        mDrawerLayout.addDrawerListener(toggle);
        toggle.syncState();

        mNavigationView = (NavigationView) findViewById(R.id.nav_view);
        mNavigationView.setNavigationItemSelectedListener(this);

        selectNavigationItem(getNavigationDrawerID());

        View mainContent = findViewById(R.id.main_content);
        if (mainContent != null) {
            mainContent.setAlpha(0);
            mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);
        }
    }
}

================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.os.Bundle;
import android.widget.ExpandableListView;

import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableListAdapter;
import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Activity for help contents
 * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial
 */

public class HelpActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_help);
        RunStore.setContext(this);

        ExpandableListAdapter expandableListAdapter;
        HelpDataDump helpDataDump = new HelpDataDump(this);

        ExpandableListView generalExpandableListView = (ExpandableListView) findViewById(R.id.generalExpandableListView);

        HashMap<String, List<String>> expandableListDetail = helpDataDump.getDataGeneral();
        List<String> expandableListTitleGeneral = new ArrayList<>(expandableListDetail.keySet());
        expandableListAdapter = new ExpandableListAdapter(this, expandableListTitleGeneral, expandableListDetail);
        generalExpandableListView.setAdapter(expandableListAdapter);

        overridePendingTransition(0, 0);
    }

    protected int getNavigationDrawerID() {
        return R.id.nav_help;
    }

}

================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpDataDump.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.content.Context;

import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * Activity for displaying help content.
 * <p>
 * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial
 * last access 27th October 2016
 */

class HelpDataDump {

    private Context context;

    HelpDataDump(Context context) {
        this.context = context;
    }

    HashMap<String, List<String>> getDataGeneral() {
        HashMap<String, List<String>> expandableListDetail = new LinkedHashMap<>();

        List<String> general = new ArrayList<>();
        general.add(context.getResources().getString(R.string.help_whatis_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_whatis), general);

        List<String> features1 = new ArrayList<>();
        features1.add(context.getResources().getString(R.string.help_feature_one_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_feature_one), features1);

        List<String> features2 = new ArrayList<>();
        features2.add(context.getResources().getString(R.string.help_feature_two_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_feature_two), features2);

        List<String> features3 = new ArrayList<>();
        features3.add(context.getResources().getString(R.string.help_feature_three_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_feature_three), features3);

        List<String> features4 = new ArrayList<>();
        features4.add(context.getResources().getString(R.string.help_feature_four_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_feature_four), features4);

        List<String> features5 = new ArrayList<>();
        features5.add(context.getResources().getString(R.string.help_feature_five_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_feature_five), features5);

        List<String> privacy = new ArrayList<>();
        privacy.add(context.getResources().getString(R.string.help_privacy_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_privacy), privacy);

        List<String> permissions = new ArrayList<>();
        permissions.add(context.getResources().getString(R.string.help_permission_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_permission), permissions);

        List<String> sysuser = new ArrayList<>();
        sysuser.add(context.getResources().getString(R.string.help_sysuser_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_sysuser), sysuser);

        List<String> un_encrypted_ports = new ArrayList<>();
        un_encrypted_ports.add(context.getResources().getString(R.string.help_un_encrypted_ports_answer));
        expandableListDetail.put(context.getResources().getString(R.string.help_un_encrypted_ports), un_encrypted_ports);

        return expandableListDetail;
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableHistoryListAdapter;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;
import org.secuso.privacyfriendlynetmonitor.R;

import java.sql.Date;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;

/**
 * Acitivity for handling the history. All the selected Apps are tracked and shown as a history
 */

public class HistoryActivity extends BaseActivity {

    private ExpandableListView expListView;
    private ExpandableHistoryListAdapter historyReportAdapter;

    private ReportEntityDao reportEntityDao;
    private HashMap<String, List<ReportEntity>> historyReportMap;
    private List<String> keys;

    private SharedPreferences selectedAppsPreferences;
    private SharedPreferences.Editor editor;
    private ProgressBar progressBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_history);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        progressBar = findViewById(R.id.selectHistoryProgressBar);
        progressBar.setVisibility(View.GONE);

        // load DB
        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();
        reportEntityDao = daoSession.getReportEntityDao();

        selectedAppsPreferences = getSharedPreferences("SELECTEDAPPS", 0);
        editor = selectedAppsPreferences.edit();

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                progressBar.setVisibility(View.VISIBLE);
                startActivity(new Intent(HistoryActivity.this, SelectHistoryAppsActivity.class));
            }
        });

        // delete DB
        Button deleteDB = (Button) findViewById(R.id.deleteDB);
        deleteDB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                deleteConfirmation();
            }
        });

        activateHistoryView();
    }

    @Override
    public void onPostResume() {
        super.onPostResume();
        progressBar.setVisibility(View.GONE);
    }

    private void activateHistoryView() {
        expListView = (ExpandableListView) findViewById(R.id.list_history);
        final HashMap<String, List<ReportEntity>> historyReports = provideHistoryReports();

        TextView textView = (TextView) findViewById(R.id.noData);
        if (historyReports.isEmpty()) {
            if (textView.getVisibility() == View.INVISIBLE) {
                textView.setVisibility(View.VISIBLE);
            }
        } else {

            if (textView.getVisibility() == View.VISIBLE) {
                textView.setVisibility(View.INVISIBLE);
            }
        }

        historyReportAdapter = new ExpandableHistoryListAdapter(this, new ArrayList<>(historyReports.keySet()), historyReports);

        expListView.setAdapter(historyReportAdapter);

        expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            @Override
            public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
                ReportEntity reportEntity = historyReports.get(keys.get(groupPosition)).get(childPosition);
                List<String> detailsList = prepareData(reportEntity);
                Intent intent = new Intent(getBaseContext(), HistoryDetailActivity.class);
                intent.putExtra("Details", (ArrayList) detailsList);
                startActivity(intent);
                return false;
            }
        });

        expListView.setOnItemLongClickListener(new ExpandableListView.OnItemLongClickListener() {
            @Override
            public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
                TextView tx1 = (TextView) view.findViewById(R.id.historyGroupTitle);
                String appName = tx1.getText().toString();
                TextView tx2 = (TextView) view.findViewById(R.id.historyGroupSubtitle);
                String appSubName = tx2.getText().toString();
                Intent myIntent = new Intent(HistoryActivity.this, AppConnections_Chart.class);
                myIntent.putExtra("AppName", appName);
                myIntent.putExtra("AppSubName", appSubName);
                startActivity(myIntent);

                return false;
            }
        });
    }

    /**
     * Get details from db entities an save in List
     *
     * @param reportEntity
     * @return details list
     */
    private List<String> prepareData(ReportEntity reportEntity) {

        PackageManager packageManager = getPackageManager();

        String details = "";
        List<String> detailsList = new ArrayList<String>();

        String appName = reportEntity.getAppName();
        detailsList.add(appName);

        String uid = reportEntity.getUserID();
        detailsList.add(uid);

        PackageInfo packageInfo = null;

        try {
            packageInfo = packageManager.getPackageInfo(appName, 0);
        } catch (PackageManager.NameNotFoundException e) {
            System.out.println("Could not find package info for " + appName + ".");
        }

        details = packageInfo.versionName;
        detailsList.add(details);

        details = new Date(packageInfo.firstInstallTime).toString();
        detailsList.add(details);

        details = reportEntity.getRemoteAddress();
        detailsList.add(details);

        details = reportEntity.getRemoteHex();
        detailsList.add(details);

        details = reportEntity.getRemoteHost();
        detailsList.add(details);

        details = reportEntity.getLocalAddress();
        detailsList.add(details);

        details = reportEntity.getLocalHex();
        detailsList.add(details);

        details = reportEntity.getServicePort();
        detailsList.add(details);

        details = reportEntity.getPayloadProtocol();
        detailsList.add(details);

        details = reportEntity.getTransportProtocol();
        detailsList.add(details);

        details = reportEntity.getLocalPort();
        detailsList.add(details);

        details = reportEntity.getTimeStamp();
        detailsList.add(details);

        details = reportEntity.getConnectionInfo();
        detailsList.add(details);

        return detailsList;
    }

    /**
     * @return HashMap with saved Reports
     */
    private HashMap<String, List<ReportEntity>> provideHistoryReports() {

        historyReportMap = new HashMap<String, List<ReportEntity>>();
        List<String> appendedApps = new ArrayList<String>();

        List<String> userIDs = new ArrayList<String>();
        List<ReportEntity> allReportEntities = reportEntityDao.loadAll();

        for (ReportEntity reportEntity : allReportEntities) {
            String userID = reportEntity.getUserID();
            if (!userIDs.contains(userID)) {
                userIDs.add(userID);
                List<ReportEntity> tempReportList = new ArrayList<ReportEntity>();
                tempReportList.add(reportEntity);

                if (!appendedApps.contains(reportEntity.getAppName())) {
                    appendedApps.add(reportEntity.getAppName());
                }

                historyReportMap.put(userID, tempReportList);
            } else {
                historyReportMap.get(userID).add(reportEntity);
            }
        }

        List<String> appsToInclude = Collector.getAppsToIncludeInScan();
        if (!appsToInclude.isEmpty()) {
            appsToInclude = new ArrayList<String>(new LinkedHashSet<String>(appsToInclude));
            appsToInclude.removeAll(appendedApps);
            if (!appsToInclude.isEmpty()) {
                for (String appName : appsToInclude) {
                    try {
                        int uid = getPackageManager().getApplicationInfo(appName, 0).uid;
                        if (!Collector.getKnownUIDs().containsKey(uid)) {
                            Collector.addKnownUIDs((new String()).valueOf(uid), appName);
                        }
                        historyReportMap.put((new String()).valueOf(uid), new ArrayList<ReportEntity>());
                    } catch (PackageManager.NameNotFoundException e) {
                    }
                }
                appsToInclude.clear();
            }
        }

        keys = new ArrayList<>(historyReportMap.keySet());

        for (String key : keys) {
            Collections.reverse(historyReportMap.get(key));
        }

        return historyReportMap;
    }

    @Override
    public void onResume() {
        super.onResume();
        activateHistoryView();
    }

    protected int getNavigationDrawerID() {
        return R.id.nav_history;
    }


    /**
     * show confirmation after deletion.
     */
    private void deleteConfirmation() {

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.dialogTitle);
        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

                reportEntityDao.deleteAll();
                activateHistoryView();
                Toast.makeText(getApplicationContext(), "All reports have been deleted.", Toast.LENGTH_SHORT).show();

            }
        });
        builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                Toast.makeText(getApplicationContext(), "Deletion canceled.", Toast.LENGTH_SHORT).show();
            }
        });
        System.out.println("Building complete");
        AlertDialog dialog = builder.create();
        dialog.show();

    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryDetailActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
import androidx.drawerlayout.widget.DrawerLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by m4rc0 on 06.12.2017.
 * This actitivty shows the details of on history report.
 */

public class HistoryDetailActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_report_detail);
        RunStore.setContext(this);

        //Get saved data from report entity
        List<String> details = getIntent().getStringArrayListExtra("Details");
        List<String[]> detailList = prepareData(details);


        final HistoryDetailActivity.DetailAdapter adapter = new HistoryDetailActivity.DetailAdapter(this, R.layout.report_detail_item, detailList);
        final ListView listview = (ListView) findViewById(R.id.report_detail_list_view);
        listview.setAdapter(adapter);

        View view_header = getLayoutInflater().inflate(R.layout.report_list_group_header, null);
        PackageManager packageManager = this.getPackageManager();
        String appName = details.get(0);

        ImageView imgView = (ImageView) view_header.findViewById(R.id.reportGroupIcon_header);
        TextView textView1 = (TextView) view_header.findViewById(R.id.reportGroupTitle_header);
        TextView textView2 = (TextView) view_header.findViewById(R.id.reportGroupSubtitle_header);

        try {
            imgView.setImageDrawable(packageManager.getApplicationIcon(appName));
            textView1.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));
        } catch (PackageManager.NameNotFoundException e) {
        }

        textView2.setText(appName);

        listview.addHeaderView(view_header);
    }

    /**
     * @param unpreparedDetails
     * @return prepared data as list.
     */
    public List<String[]> prepareData(List<String> unpreparedDetails) {


        List<String[]> detailsList = new ArrayList<String[]>();

        String[] details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_uid));
        details[1] = unpreparedDetails.get(1);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_app_version));
        details[1] = unpreparedDetails.get(2);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_installed_on));
        details[1] = unpreparedDetails.get(3);
        detailsList.add(details);

        details = new String[2];
        details[0] = "";
        details[1] = "";
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_remote_address));
        details[1] = unpreparedDetails.get(4);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_remote_hex));
        details[1] = unpreparedDetails.get(5);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_remote_host));
        details[1] = unpreparedDetails.get(6);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_local_address));
        details[1] = unpreparedDetails.get(7);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_local_hex));
        details[1] = unpreparedDetails.get(8);
        detailsList.add(details);

        details = new String[2];
        details[0] = "";
        details[1] = "";
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_service_port));
        details[1] = unpreparedDetails.get(9);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_payload_protocol));
        details[1] = unpreparedDetails.get(10);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_transport_protocol));
        details[1] = unpreparedDetails.get(11);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_local_port));
        details[1] = unpreparedDetails.get(12);
        detailsList.add(details);

        details = new String[2];
        details[0] = "";
        details[1] = "";
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_timestamp));
        details[1] = unpreparedDetails.get(13);
        detailsList.add(details);

        details = new String[2];
        details[0] = (getString(R.string.history_detail_activity_connection_info));
        details[1] = unpreparedDetails.get(14);
        detailsList.add(details);

        return detailsList;
    }

    /**
     * Detail Adapter sets relevant information.
     */
    public class DetailAdapter extends ArrayAdapter<String[]> {

        DetailAdapter(Context context, int resource, List<String[]> detailList) {
            super(context, resource, detailList);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

            View v = convertView;
            if (v == null) {
                LayoutInflater vi;
                vi = LayoutInflater.from(getContext());
                v = vi.inflate(R.layout.report_detail_item, null);
            }


            //Get string array and set it to text fields

            String[] detail = getItem(position);

            TextView type = (TextView) v.findViewById(R.id.report_detail_item_type);
            TextView value = (TextView) v.findViewById(R.id.report_detail_item_value);

            if (detail[0] != null && detail[1] != null) {
                type.setText(detail[0]);
                value.setText(detail[1]);
            } else {
                type.setText("");
                value.setText("");
            }
            return v;
        }
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/MainActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;


import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableReportAdapter;
import org.secuso.privacyfriendlynetmonitor.Assistant.Const;
import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.PassiveService;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Activity providing main service controls and reports inspection
 */
public class MainActivity extends BaseActivity implements SwipeRefreshLayout.OnRefreshListener {

    private SwipeRefreshLayout swipeRefreshLayout;
    private ExpandableListView expListView;
    private HashMap<Integer, List<Report>> reportMap;

    private static ReportEntityDao reportEntityDao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        RunStore.setContext(this);
        RunStore.setAppContext(getApplicationContext());
        //Save context state

        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();
        reportEntityDao = daoSession.getReportEntityDao();

        // Uncomment to generate Dummy Database Entries
//        GenerateReportEntities.generateReportEntities(this, reportEntityDao);

        // Load apps to include in scan
        SharedPreferences selectedAppsPreferences = getSharedPreferences("SELECTEDAPPS", 0);
        Map<String, String> selectedAppsMap = (Map<String, String>) selectedAppsPreferences.getAll();
        Collection<String> selectedAppsList = selectedAppsMap.values();
        for (String appName : selectedAppsList) {
            if (!Collector.getAppsToIncludeInScan().contains(appName)) {
                Collector.addAppToIncludeInScan(appName);
            }
        }

        Collector.addAppToExcludeFromScan("app.android.unknown");
        Collector.addAppToExcludeFromScan("app.unknown");
        Collector.addAppToExcludeFromScan("unknown");
        //This is an App that is used as an example for the History. In the first start only this is
        //APP is shown in the list, then selection are possible

        if (!RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {
            activateMainView();
        } else {
            activateReportView();
        }

        overridePendingTransition(0, 0);
    }

    // On start button press activate second view (report)
    private void setButtonListener() {
        final FloatingActionButton startStop = findViewById(R.id.mainFAB);
        startStop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ProgressBar progressBar = findViewById(R.id.mainProgressBar);
                progressBar.setVisibility(View.VISIBLE);

                startStopTrigger();
            }
        });
    }

    //Trigger switches between activity, based service running indicator
    private void startStopTrigger() {
        if (!RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {
            if (Const.IS_DEBUG)
                Log.d(Const.LOG_TAG, getResources().getString(R.string.passive_service_start));
            RunStore.getServiceHandler().startPassiveService();
            Intent intent = new Intent(RunStore.getContext(), MainActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
        } else {
            if (Const.IS_DEBUG)
                Log.d(Const.LOG_TAG, getResources().getString(R.string.passive_service_stop));
            RunStore.getServiceHandler().stopPassiveService();
            Intent intent = new Intent(RunStore.getContext(), MainActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
        }
    }

    //Activate the main layout
    private void activateMainView() {
        setContentView(R.layout.activity_main);
        super.setToolbar();

        final FloatingActionButton startStop = findViewById(R.id.mainFAB);
        TextView textView = (TextView) findViewById(R.id.main_text_startstop);
        textView.setText(R.string.main_text_stopped);
        setButtonListener();
        getNavigationDrawerID();
    }


    //activate the report layout
    private void activateReportView() {
        setContentView(R.layout.activity_report);
        super.setToolbar();
        getNavigationDrawerID();

        //Initiate ListView functionality
        swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
        reportMap = Collector.provideSimpleReports(reportEntityDao);
        expListView = (ExpandableListView) findViewById(R.id.list);
        final ExpandableReportAdapter reportAdapter = new ExpandableReportAdapter(this, new ArrayList<>(reportMap.keySet()), reportMap);
        expListView.setAdapter(reportAdapter);
        swipeRefreshLayout.setOnRefreshListener(this);

        //Showing Swipe Refresh animation on activity create
        swipeRefreshLayout.post(new Runnable() {
                                    @Override
                                    public void run() {
                                        swipeRefreshLayout.setRefreshing(true);
                                        refreshAdapter();
                                    }
                                }
        );

        expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            @Override
            public boolean onChildClick(ExpandableListView expandableListView, View view, final int i, final int i1, final long l) {
                expListView = (ExpandableListView) findViewById(R.id.list);
                ExpandableReportAdapter adapter = (ExpandableReportAdapter) expListView.getExpandableListAdapter();
                final Report r = (Report) adapter.getChild(i, i1);

                if (mSharedPreferences.getBoolean(Const.IS_DETAIL_MODE, false)) {
                    view.animate().setDuration(500).alpha((float) 0.5)
                            .withEndAction(new Runnable() {
                                @Override
                                public void run() {

                                    Collector.provideDetail(r.uid, r.remoteAddHex);
                                    Intent intent = new Intent(getApplicationContext(), ReportDetailActivity.class);
                                    startActivity(intent);
                                }
                            });
                    return true;
                    // if no detail mode and server analysis is complete, goto SSL Labs
                } else if (mSharedPreferences.getBoolean(Const.IS_CERTVAL, false) &&
                        Collector.hasHostName(r.remoteAdd.getHostAddress()) &&
                        Collector.hasGrade(Collector.getDnsHostName(r.remoteAdd.getHostAddress()))) {
                    String url = Const.SSLLABS_URL +
                            Collector.getCertHost(Collector.getDnsHostName(r.remoteAdd.getHostAddress()));
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                    startActivity(browserIntent);
                    return false;
                } else {
                    try{
                        view.animate().setDuration(500).alpha((float) 0.5)
                                .withEndAction(new Runnable() {
                                    @Override
                                    public void run() {

                                        Collector.provideDetail(r.uid, r.remoteAddHex);
                                        Intent intent = new Intent(getApplicationContext(), ReportDetailActivity.class);
                                        startActivity(intent);
                                    }
                                });
                    } catch (Exception e){
                        return false;
                    }
                    return false;
                }
            }
        });

        FloatingActionButton fab = findViewById(R.id.reportFAB);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Collector.saveReports(reportEntityDao);
                startStopTrigger();
            }
        });
    }

    @Override
    protected int getNavigationDrawerID() {
        return R.id.nav_main;
    }


    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    //refresh the adapter-list
    public void refreshAdapter() {
        swipeRefreshLayout.setRefreshing(true);

        reportMap = Collector.provideSimpleReports(reportEntityDao);
        final ExpandableReportAdapter reportAdapter = new ExpandableReportAdapter(this, new ArrayList<>(reportMap.keySet()), reportMap);
        expListView.setAdapter(reportAdapter);

        //Set swipe text and icon visible, if connections are empty
        setSwipeInfo((reportAdapter.getGroupCount() > 0));
        swipeRefreshLayout.setRefreshing(false);
    }

    //Set information to refresh view, when adapter is empty (no connections scanned yet)
    private void setSwipeInfo(boolean b) {
        final ImageView icon = (ImageView) findViewById(R.id.report_empty_icon);
        final TextView text = (TextView) findViewById(R.id.report_empty_text);
        if (b) {
            icon.setVisibility(View.GONE);
            text.setVisibility(View.GONE);
        } else {
            icon.setVisibility(View.VISIBLE);
            text.setVisibility(View.VISIBLE);
        }
    }

    //Refresh the adapter when swipe triggers
    @Override
    public void onRefresh() {
        refreshAdapter();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.onCreateOptionsMenu(menu);
    }

    //listener of the toolbar buttons
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId()) {
            case R.id.action_refresh:
                refreshAdapter();
                break;
            default:
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    //refresh menu on layout change
    public boolean onPrepareOptionsMenu(Menu menu) {
        menu.clear();
        if (RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {
            getMenuInflater().inflate(R.menu.toolbar_menu, menu);
        }
        return super.onPrepareOptionsMenu(menu);
    }
}


================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/ReportDetailActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */

package org.secuso.privacyfriendlynetmonitor.Activities;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.drawerlayout.widget.DrawerLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import org.secuso.privacyfriendlynetmonitor.Assistant.Const;
import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;
import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Report Detail Panel. List all reports of a connection, invoked by Report Panel (ReportActivity)
 */
public class ReportDetailActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_report_detail);
        RunStore.setContext(this);

        //Get reports from collector class
        ArrayList<String[]> detailList = Collector.sDetailReportList;
        final DetailAdapter adapter = new DetailAdapter(this, R.layout.report_detail_item, detailList);
        final ListView listview = (ListView) findViewById(R.id.report_detail_list_view);
        listview.setAdapter(adapter);

        View view_header = getLayoutInflater().inflate(R.layout.report_list_group_header, null);
        listview.addHeaderView(view_header);

        //Ende Löschen
        final Report report = Collector.sDetailReport;
        ImageView icon_header = (ImageView) view_header.findViewById(R.id.reportGroupIcon_header);
        icon_header.setImageDrawable(Collector.getIcon(report.uid));
        TextView label_header = (TextView) view_header.findViewById(R.id.reportGroupTitle_header);
        label_header.setText(Collector.getLabel(report.uid));
        TextView pkg_header = (TextView) view_header.findViewById(R.id.reportGroupSubtitle_header);
        pkg_header.setText(Collector.getPackage(report.uid));

        //Add certificate information - open link to ssl labs
        if (mSharedPreferences.getBoolean(Const.IS_CERTVAL, false) && Collector.hasHostName(report.remoteAdd.getHostAddress()) &&
                Collector.hasGrade(Collector.getDnsHostName(report.remoteAdd.getHostAddress()))) {
            TextView ssllabs = (TextView) findViewById(R.id.report_detail_ssllabs_result);
            ssllabs.setVisibility(View.VISIBLE);
            ssllabs.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    String url = Const.SSLLABS_URL +
                            Collector.getCertHost(Collector.getDnsHostName(report.remoteAdd.getHostAddress()));
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                    startActivity(browserIntent);
                }
            });

        }

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    //Implementation of List Adapter
    class DetailAdapter extends ArrayAdapter<String[]> {

        DetailAdapter(Context context, int resource, List<String[]> detailList) {

            super(context, resource, detailList);
        }

        //Get detail information from collector class and write to adapter views
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

            View v = convertView;
            if (v == null) {
                LayoutInflater vi;
                vi = LayoutInflater.from(getContext());
                v = vi.inflate(R.layout.report_detail_item, null);
            }

            //Get string array and set it to text fields
            String[] detail = getItem(position);
            TextView type = (TextView) v.findViewById(R.id.report_detail_item_type);
            TextView value = (TextView) v.findViewById(R.id.report_detail_item_value);
            if (detail[0] != null && detail[1] != null) {
                type.setText(detail[0]);
                value.setText(detail[1]);
            } else {
                type.setText("");
                value.setText("");
            }
            return v;
        }
    }
}



================================================
FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SelectHistoryAppsActivity.java
================================================
/*
    Privacy Friendly Net Monitor (Net Monitor)
    - Copyright (2015 - 2017) Felix Tsala Schiller

    ###################################################################

    This file is part of Net Monitor.

    Net Monitor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Net Monitor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.

    Diese Datei ist Teil von Net Monitor.

    Net Monitor ist Freie Software: Sie können es unter den Bedingungen
    der GNU General Public License, wie von der Free Software Foundation,
    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
    veröffentlichten Version, weiterverbreiten und/oder modifizieren.

    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber
    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    Siehe die GNU General Public License für weitere Details.

    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.

    ###################################################################

    This app has been created in affiliation with SecUSo-Department of Technische Universität
    Darmstadt.

    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher
    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).

    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller
    https://bitbucket.org/schillef/tlsmetric/overview.

 */
package org.secuso.privacyfriendlynetmonitor.Activities;

import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import androidx.core.view.MenuItemCompat;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;

import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.AppListRecyclerAdapter;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;
import org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;
import org.secuso.privacyfriendlynetmonitor.R;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import static org.secuso.privacyfriendlynetmonitor.Assistant.RunStore.getContext;

/**
 * Activity for the list of all installed apps with internet permission.
 * The list can be sorted alphabeic and after installed date.
 * A search function for the list is implemented.
 */

public class SelectHistoryAppsActivity extends AppCompatActivity {

    private List<String> app_list_name;
    private ReportEntityDao reportEntityDao;
    private SharedPreferences selectedAppsPreferences;
    private SharedPreferences.Editor editor;

    private RecyclerView appListRecyclerView;
    private RecyclerView.Adapter appListRecyclerAdapter;
    private RecyclerView.LayoutManager recyclerLayoutManager;


    //Variables to sort alphabetic and accodring to installed date
    //the displayed app names are in the keys of the map, the value is the long Name
    private Map<String, String> sortMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_history_apps);

        // load DB
        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();
        reportEntityDao = daoSession.getReportEntityDao();

        ActionBar ab = getSupportActionBar();
        if (ab != null) {
            ab.setDisplayShowHomeEnabled(true);
        }

        selectedAppsPreferences = getSharedPreferences("SELECTEDAPPS", 0);
        editor = selectedAppsPreferences.edit();

        show_APP_list();

    }

    //method to load all the Apps in the listeview, sorted alphabetic form the start
    private void show_APP_list() {
        app_list_name = provideAppList();

        appListRecyclerView = (RecyclerView) findViewById(R.id.list_selection_app_recycler);
        recyclerLayoutManager = new LinearLayoutManager(this);
        appListRecyclerView.setLayoutManager(recyclerLayoutManager);

        // specify an adapter
        appListRecyclerAdapter = new AppListRecyclerAdapter(app_list_name, this);
        appListRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
        appListRecyclerView.setAdapter(appListRecyclerAdapter);

    }

    //method to check for internet permission
    // 1. returns a list with Strings --> goes into the app_list_name
    // 2. fills the Map sort_map
    private List<String> provideAppList() {

        ArrayList<String> packageNames = new ArrayList<>();
        PackageManager p = this.getPackageManager();
        final List<PackageInfo> packs = p.getInstalledPackages(0);
        List<PackageInfo> packs_permission = p.getInstalledPackages(PackageManager.GET_PERMISSIONS);

        //This FOR goes through every app that is installed on the device according to
        // --> p.getInstalledPackages(0);
        for (int i = 0; i < packs.size(); i++) {
            PackageInfo pinfo = packs.get(i); //This Var has the actual Information about an app (not the permission)
            PackageInfo appPermission = packs_permission.get(i);
            //If the App has NULL permissions then skip it
            if (ap
Download .txt
gitextract_et81zfgx/

├── .github/
│   └── workflows/
│       └── changelog.yml
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING
├── LICENSE.txt
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   ├── de/
│       │   │   │   └── bjoernr/
│       │   │   │       └── ssllabs/
│       │   │   │           ├── Api.java
│       │   │   │           ├── Console.java
│       │   │   │           └── ConsoleUtilities.java
│       │   │   └── org/
│       │   │       └── secuso/
│       │   │           └── privacyfriendlynetmonitor/
│       │   │               ├── Activities/
│       │   │               │   ├── AboutActivity.java
│       │   │               │   ├── Adapter/
│       │   │               │   │   ├── AppListRecyclerAdapter.java
│       │   │               │   │   ├── ExpandableHistoryListAdapter.java
│       │   │               │   │   ├── ExpandableListAdapter.java
│       │   │               │   │   ├── ExpandableReportAdapter.java
│       │   │               │   │   ├── FragmentDayListAdapter.java
│       │   │               │   │   └── PagerAdapter.java
│       │   │               │   ├── AppConnections_Chart.java
│       │   │               │   ├── BaseActivity.java
│       │   │               │   ├── HelpActivity.java
│       │   │               │   ├── HelpDataDump.java
│       │   │               │   ├── HistoryActivity.java
│       │   │               │   ├── HistoryDetailActivity.java
│       │   │               │   ├── MainActivity.java
│       │   │               │   ├── ReportDetailActivity.java
│       │   │               │   ├── SelectHistoryAppsActivity.java
│       │   │               │   ├── SettingsActivity.java
│       │   │               │   ├── SplashActivity.java
│       │   │               │   └── TutorialActivity.java
│       │   │               ├── Assistant/
│       │   │               │   ├── AsyncCertVal.java
│       │   │               │   ├── AsyncDNS.java
│       │   │               │   ├── Const.java
│       │   │               │   ├── ExecCom.java
│       │   │               │   ├── KnownPorts.java
│       │   │               │   ├── PrefManager.java
│       │   │               │   ├── RunStore.java
│       │   │               │   ├── TLType.java
│       │   │               │   └── ToolBox.java
│       │   │               ├── ConnectionAnalysis/
│       │   │               │   ├── Collector.java
│       │   │               │   ├── Detector.java
│       │   │               │   ├── PassiveService.java
│       │   │               │   ├── Report.java
│       │   │               │   └── ServiceHandler.java
│       │   │               ├── DatabaseUtil/
│       │   │               │   ├── DBApp.java
│       │   │               │   ├── GenerateReportEntities.java
│       │   │               │   └── ReportEntity.java
│       │   │               └── fragment/
│       │   │                   ├── Fragment_day.java
│       │   │                   ├── Fragment_month.java
│       │   │                   └── Fragment_week.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── background_border.xml
│       │       │   ├── button_fullwidth.xml
│       │       │   ├── ic_clear.xml
│       │       │   ├── ic_delete.xml
│       │       │   ├── ic_help.xml
│       │       │   ├── ic_history.xml
│       │       │   ├── ic_menu_info.xml
│       │       │   ├── ic_play_arrow.xml
│       │       │   ├── ic_refresh.xml
│       │       │   ├── ic_search_white_24dp.xml
│       │       │   ├── ic_settings.xml
│       │       │   ├── ic_sort_white_24dp.xml
│       │       │   ├── ic_stop.xml
│       │       │   ├── ic_tutorial.xml
│       │       │   ├── ic_tutorial_inverted.xml
│       │       │   └── splash_screen.xml
│       │       ├── layout/
│       │       │   ├── activity_about.xml
│       │       │   ├── activity_help.xml
│       │       │   ├── activity_help_content.xml
│       │       │   ├── activity_history.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_main_app_bar.xml
│       │       │   ├── activity_main_content.xml
│       │       │   ├── activity_report.xml
│       │       │   ├── activity_report_app_bar.xml
│       │       │   ├── activity_report_content.xml
│       │       │   ├── activity_report_detail.xml
│       │       │   ├── activity_report_detail_content.xml
│       │       │   ├── activity_select_history_apps.xml
│       │       │   ├── activity_settings.xml
│       │       │   ├── activity_splash.xml
│       │       │   ├── activity_tutorial.xml
│       │       │   ├── app_list_group.xml
│       │       │   ├── app_list_item.xml
│       │       │   ├── app_report_detail_layout.xml
│       │       │   ├── content_history.xml
│       │       │   ├── content_select_history_apps.xml
│       │       │   ├── fragment_charts.xml
│       │       │   ├── fragment_list_item.xml
│       │       │   ├── help_list_group.xml
│       │       │   ├── help_list_item.xml
│       │       │   ├── history_list_group.xml
│       │       │   ├── history_list_item.xml
│       │       │   ├── main_nav_header.xml
│       │       │   ├── report_detail_item.xml
│       │       │   ├── report_list_group.xml
│       │       │   ├── report_list_group_header.xml
│       │       │   ├── report_list_item.xml
│       │       │   ├── toolbar.xml
│       │       │   ├── tutorial_slide1.xml
│       │       │   ├── tutorial_slide2.xml
│       │       │   └── tutorial_slide3.xml
│       │       ├── menu/
│       │       │   ├── applistseletion_menu.xml
│       │       │   ├── main_drawer.xml
│       │       │   └── toolbar_menu.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       ├── values-de/
│       │       │   └── strings.xml
│       │       ├── values-ja/
│       │       │   └── strings.xml
│       │       └── xml/
│       │           ├── preferences.xml
│       │           └── searchable.xml
│       └── test/
│           └── java/
│               └── bjoernr/
│                   └── ssllabs/
│                       ├── ApiAssert.java
│                       └── ApiTest.java
├── build.gradle
├── fastlane/
│   └── metadata/
│       └── android/
│           ├── ar/
│           │   └── summary.txt
│           ├── de/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── de-DE/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── en-US/
│           │   ├── full_description.txt
│           │   ├── short_description.txt
│           │   └── title.txt
│           ├── eo/
│           │   └── summary.txt
│           ├── es/
│           │   └── summary.txt
│           ├── fr/
│           │   └── summary.txt
│           ├── he/
│           │   └── summary.txt
│           ├── it/
│           │   └── summary.txt
│           ├── ja/
│           │   └── summary.txt
│           ├── nb/
│           │   └── summary.txt
│           ├── nn/
│           │   └── summary.txt
│           ├── pl/
│           │   └── summary.txt
│           ├── pt/
│           │   └── summary.txt
│           ├── pt-BR/
│           │   └── summary.txt
│           ├── pt-PT/
│           │   └── summary.txt
│           ├── ro/
│           │   └── summary.txt
│           ├── ru/
│           │   └── summary.txt
│           ├── tr/
│           │   └── summary.txt
│           ├── uk/
│           │   └── summary.txt
│           ├── zh-CN/
│           │   └── summary.txt
│           └── zh-TW/
│               └── summary.txt
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
Download .txt
SYMBOL INDEX (386 symbols across 44 files)

FILE: app/src/main/java/de/bjoernr/ssllabs/Api.java
  class Api (line 69) | public class Api {
    method fetchApiInfo (line 79) | public JSONObject fetchApiInfo() {
    method fetchHostInformation (line 105) | public JSONObject fetchHostInformation(String host, boolean publish, b...
    method fetchHostInformationCached (line 139) | public JSONObject fetchHostInformationCached(String host, String maxAg...
    method fetchEndpointData (line 152) | public JSONObject fetchEndpointData(String host, String s, boolean fro...
    method fetchStatusCodes (line 177) | public JSONObject fetchStatusCodes() {
    method sendCustomApiRequest (line 197) | public String sendCustomApiRequest(String apiCall, Map<String, String>...
    method sendApiRequest (line 216) | private String sendApiRequest(String apiCall, Map<String, String> para...
    method buildGetParameterString (line 243) | private String buildGetParameterString(Map<String, String> parameters) {
    method booleanToOnOffString (line 265) | private String booleanToOnOffString(boolean b) {
    method getApiUrl (line 274) | public static String getApiUrl() {
    method getVersion (line 283) | public static String getVersion() {

FILE: app/src/main/java/de/bjoernr/ssllabs/Console.java
  class Console (line 61) | public class Console {
    method main (line 63) | public static void main(String[] args) {
    method handleInfo (line 75) | public static void handleInfo() {
    method handleHostInformation (line 90) | public static void handleHostInformation(String[] args) {
    method printHeader (line 148) | public static void printHeader() {
    method printUsage (line 162) | public static void printUsage() {

FILE: app/src/main/java/de/bjoernr/ssllabs/ConsoleUtilities.java
  class ConsoleUtilities (line 63) | public class ConsoleUtilities {
    method jsonToMap (line 72) | public static Map<String, Object> jsonToMap(JSONObject json) throws JS...
    method toMap (line 81) | public static Map<String, Object> toMap(JSONObject object) throws JSON...
    method toList (line 99) | public static List<Object> toList(JSONArray array) throws JSONException {
    method mapToConsoleOutput (line 114) | public static String mapToConsoleOutput(Map<String, Object> map) {
    method arrayValueMatchRegex (line 125) | public static String arrayValueMatchRegex(String[] array, String regex) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AboutActivity.java
  class AboutActivity (line 66) | public class AboutActivity extends AppCompatActivity {
    method onCreate (line 72) | protected void onCreate(Bundle savedInstanceState) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/AppListRecyclerAdapter.java
  class AppListRecyclerAdapter (line 26) | public class AppListRecyclerAdapter extends RecyclerView.Adapter<AppList...
    class ViewHolder (line 36) | public static class ViewHolder extends RecyclerView.ViewHolder {
      method ViewHolder (line 46) | public ViewHolder(View view) {
    method AppListRecyclerAdapter (line 57) | public AppListRecyclerAdapter(List<String> app_list_name, Context cont...
    method onCreateViewHolder (line 66) | @Override
    method onBindViewHolder (line 75) | @Override
    method getItemCount (line 125) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableHistoryListAdapter.java
  class ExpandableHistoryListAdapter (line 72) | public class ExpandableHistoryListAdapter extends BaseExpandableListAdap...
    method ExpandableHistoryListAdapter (line 84) | public ExpandableHistoryListAdapter(Context context, List<String> uidL...
    method getChild (line 97) | @Override
    method getChildId (line 108) | @Override
    method getChildView (line 121) | @Override
    method getChildrenCount (line 148) | @Override
    method getGroup (line 157) | @Override
    method getGroupCount (line 166) | @Override
    method getGroupId (line 175) | @Override
    method getGroupView (line 187) | @Override
    method hasStableIds (line 232) | @Override
    method isChildSelectable (line 237) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableListAdapter.java
  class ExpandableListAdapter (line 70) | public class ExpandableListAdapter extends BaseExpandableListAdapter {
    method ExpandableListAdapter (line 82) | public ExpandableListAdapter(Context context, List<String> expandableL...
    method getChild (line 95) | @Override
    method getChildId (line 107) | @Override
    method getChildView (line 121) | @Override
    method getChildrenCount (line 141) | @Override
    method getGroup (line 152) | @Override
    method getGroupCount (line 161) | @Override
    method getGroupId (line 171) | @Override
    method getGroupView (line 184) | @Override
    method hasStableIds (line 204) | @Override
    method isChildSelectable (line 215) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableReportAdapter.java
  class ExpandableReportAdapter (line 74) | public class ExpandableReportAdapter extends BaseExpandableListAdapter {
    method ExpandableReportAdapter (line 86) | public ExpandableReportAdapter(Context context, List<Integer> expandab...
    method getChild (line 99) | @Override
    method getChildId (line 111) | @Override
    method getChildView (line 125) | @Override
    method getWarningColor (line 190) | private int getWarningColor(String value) {
    method getChildrenCount (line 209) | @Override
    method getGroup (line 220) | @Override
    method getGroupCount (line 229) | @Override
    method getGroupId (line 239) | @Override
    method getGroupView (line 252) | @Override
    method hasStableIds (line 284) | @Override
    method isChildSelectable (line 295) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/FragmentDayListAdapter.java
  class FragmentDayListAdapter (line 75) | public class FragmentDayListAdapter extends RecyclerView.Adapter<Fragmen...
    method FragmentDayListAdapter (line 85) | public FragmentDayListAdapter(List<ReportEntity> reportEntities, Conte...
    class ViewHolder (line 93) | public static class ViewHolder extends RecyclerView.ViewHolder {
      method ViewHolder (line 97) | public ViewHolder(RelativeLayout itemView) {
    method onCreateViewHolder (line 109) | @Override
    method onBindViewHolder (line 122) | @Override
    method getItemCount (line 151) | @Override
    method prepareData (line 161) | private List<String> prepareData(ReportEntity reportEntity) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/PagerAdapter.java
  class PagerAdapter (line 65) | public class PagerAdapter extends FragmentStatePagerAdapter {
    method PagerAdapter (line 75) | public PagerAdapter(FragmentManager fm, int NumOfTabs, String appSubNa...
    method getItem (line 87) | @Override
    method getCount (line 111) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AppConnections_Chart.java
  class AppConnections_Chart (line 64) | public class AppConnections_Chart extends AppCompatActivity {
    method onCreate (line 66) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/BaseActivity.java
  class BaseActivity (line 73) | public class BaseActivity extends AppCompatActivity implements OnNavigat...
    method onCreate (line 90) | @Override
    method onBackPressed (line 107) | @Override
    method getNavigationDrawerID (line 117) | protected int getNavigationDrawerID() {
    method onNavigationItemSelected (line 121) | @Override
    method goToNavigationItem (line 128) | protected boolean goToNavigationItem(final int itemId) {
    method selectNavigationItem (line 157) | void selectNavigationItem(int itemId) {
    method createBackStack (line 170) | private void createBackStack(Intent intent) {
    method callDrawerItem (line 176) | private void callDrawerItem(final int itemId) {
    method onPostCreate (line 213) | @Override
    method setToolbar (line 219) | public void setToolbar() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpActivity.java
  class HelpActivity (line 67) | public class HelpActivity extends BaseActivity {
    method onCreate (line 69) | @Override
    method getNavigationDrawerID (line 88) | protected int getNavigationDrawerID() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpDataDump.java
  class HelpDataDump (line 67) | class HelpDataDump {
    method HelpDataDump (line 71) | HelpDataDump(Context context) {
    method getDataGeneral (line 75) | HashMap<String, List<String>> getDataGeneral() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryActivity.java
  class HistoryActivity (line 87) | public class HistoryActivity extends BaseActivity {
    method onCreate (line 100) | @Override
    method onPostResume (line 139) | @Override
    method activateHistoryView (line 145) | private void activateHistoryView() {
    method prepareData (line 200) | private List<String> prepareData(ReportEntity reportEntity) {
    method provideHistoryReports (line 266) | private HashMap<String, List<ReportEntity>> provideHistoryReports() {
    method onResume (line 319) | @Override
    method getNavigationDrawerID (line 325) | protected int getNavigationDrawerID() {
    method deleteConfirmation (line 333) | private void deleteConfirmation() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryDetailActivity.java
  class HistoryDetailActivity (line 74) | public class HistoryDetailActivity extends BaseActivity {
    method onCreate (line 76) | @Override
    method prepareData (line 114) | public List<String[]> prepareData(List<String> unpreparedDetails) {
    class DetailAdapter (line 210) | public class DetailAdapter extends ArrayAdapter<String[]> {
      method DetailAdapter (line 212) | DetailAdapter(Context context, int resource, List<String[]> detailLi...
      method getView (line 216) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/MainActivity.java
  class MainActivity (line 88) | public class MainActivity extends BaseActivity implements SwipeRefreshLa...
    method onCreate (line 96) | @Override
    method setButtonListener (line 135) | private void setButtonListener() {
    method startStopTrigger (line 149) | private void startStopTrigger() {
    method activateMainView (line 168) | private void activateMainView() {
    method activateReportView (line 181) | private void activateReportView() {
    method getNavigationDrawerID (line 262) | @Override
    method onDestroy (line 268) | @Override
    method refreshAdapter (line 274) | public void refreshAdapter() {
    method setSwipeInfo (line 287) | private void setSwipeInfo(boolean b) {
    method onRefresh (line 300) | @Override
    method onCreateOptionsMenu (line 305) | @Override
    method onOptionsItemSelected (line 311) | @Override
    method onPrepareOptionsMenu (line 325) | public boolean onPrepareOptionsMenu(Menu menu) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/ReportDetailActivity.java
  class ReportDetailActivity (line 77) | public class ReportDetailActivity extends BaseActivity {
    method onCreate (line 79) | @Override
    method onDestroy (line 122) | @Override
    class DetailAdapter (line 128) | class DetailAdapter extends ArrayAdapter<String[]> {
      method DetailAdapter (line 130) | DetailAdapter(Context context, int resource, List<String[]> detailLi...
      method getView (line 136) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SelectHistoryAppsActivity.java
  class SelectHistoryAppsActivity (line 88) | public class SelectHistoryAppsActivity extends AppCompatActivity {
    method onCreate (line 104) | @Override
    method show_APP_list (line 126) | private void show_APP_list() {
    method provideAppList (line 143) | private List<String> provideAppList() {
    method onCreateOptionsMenu (line 181) | @Override
    method onOptionsItemSelected (line 257) | @Override
    method sortAlphabetic_asc (line 292) | private void sortAlphabetic_asc() {
    method sortAlphabetic_desc (line 304) | private void sortAlphabetic_desc() {
    method sortInstalledDate_asc (line 316) | private void sortInstalledDate_asc() {
    method sortInstalledDate_desc (line 348) | private void sortInstalledDate_desc() {
    class AscComparator (line 380) | class AscComparator implements Comparator {
      method AscComparator (line 383) | public AscComparator(Map map) {
      method compare (line 387) | @Override
    class DescComparator (line 393) | class DescComparator implements Comparator {
      method DescComparator (line 396) | public DescComparator(Map map) {
      method compare (line 400) | @Override
    method onBackPressed (line 406) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SettingsActivity.java
  class SettingsActivity (line 71) | public class SettingsActivity extends BaseActivity {
    method onPreferenceChange (line 77) | @Override
    method isXLargeTablet (line 107) | private static boolean isXLargeTablet(Context context) {
    method bindPreferenceSummaryToValue (line 121) | private static void bindPreferenceSummaryToValue(Preference preference) {
    method onCreate (line 133) | @Override
    method getNavigationDrawerID (line 143) | @Override
    method isValidFragment (line 152) | protected boolean isValidFragment(String fragmentName) {
    class GeneralPreferenceFragment (line 161) | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
      method onCreate (line 163) | @Override
      method onOptionsItemSelected (line 177) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SplashActivity.java
  class SplashActivity (line 32) | public class SplashActivity extends AppCompatActivity {
    method onCreate (line 34) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/TutorialActivity.java
  class TutorialActivity (line 78) | public class TutorialActivity extends AppCompatActivity {
    method setTutorial_click (line 89) | public static void setTutorial_click(boolean tutorial_click) {
    method onCreate (line 93) | @Override
    method addBottomDots (line 170) | private void addBottomDots(int currentPage) {
    method getItem (line 189) | private int getItem(int i) {
    method launchHomeScreen (line 193) | private void launchHomeScreen() {
    method launchHelp (line 201) | private void launchHelp() {
    method onPageSelected (line 212) | @Override
    method onPageScrolled (line 230) | @Override
    method onPageScrollStateChanged (line 235) | @Override
    method changeStatusBarColor (line 242) | private void changeStatusBarColor() {
    class MyViewPagerAdapter (line 251) | public class MyViewPagerAdapter extends PagerAdapter {
      method MyViewPagerAdapter (line 254) | public MyViewPagerAdapter() {
      method instantiateItem (line 257) | @Override
      method getCount (line 267) | @Override
      method isViewFromObject (line 272) | @Override
      method destroyItem (line 278) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncCertVal.java
  class AsyncCertVal (line 68) | public class AsyncCertVal extends AsyncTask<Void, Void, Void> {
    method AsyncCertVal (line 72) | public AsyncCertVal() {
    method doInBackground (line 76) | @Override
    method fetchHostInfo (line 85) | private void fetchHostInfo(List<String> urls) {
    method getMaxAssessments (line 120) | private int getMaxAssessments() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncDNS.java
  class AsyncDNS (line 54) | public class AsyncDNS extends AsyncTask<String, Void, String> {
    method doInBackground (line 57) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/Const.java
  type Const (line 56) | public interface Const {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ExecCom.java
  class ExecCom (line 60) | public class ExecCom extends Thread {
    method user (line 63) | static void user(String string) {
    method userForResult (line 78) | public static String userForResult(String string) {
    method readFully (line 109) | public static String readFully(InputStream is) throws IOException {
    method closeSilently (line 120) | public static void closeSilently(Object... xs) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/KnownPorts.java
  class KnownPorts (line 52) | public class KnownPorts {
    method resolvePort (line 58) | public static String resolvePort(int port) {
    method CompileConnectionInfo (line 66) | public static String CompileConnectionInfo(int remotePort, TLType type) {
    method isTlsPort (line 82) | public static boolean isTlsPort(int i) {
    method isInconclusivePort (line 87) | public static boolean isInconclusivePort(int i) {
    method isUnsecurePort (line 92) | public static boolean isUnsecurePort(int i) {
    method initPortMap (line 99) | public static void initPortMap() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/PrefManager.java
  class PrefManager (line 26) | public class PrefManager {
    method PrefManager (line 31) | public PrefManager(Context context) {
    method setFirstTimeLaunch (line 35) | public static void setFirstTimeLaunch(boolean isFirstTime) {
    method isFirstTimeLaunch (line 39) | public static boolean isFirstTimeLaunch() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/RunStore.java
  class RunStore (line 56) | public class RunStore {
    method setContext (line 62) | public static void setContext(Activity activity) {
    method getContext (line 66) | public static Context getContext() {
    method getServiceHandler (line 71) | public static ServiceHandler getServiceHandler() {
    method setAppContext (line 78) | public static void setAppContext(Context appContext) {
    method getAppContext (line 82) | public static Context getAppContext() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/TLType.java
  type TLType (line 54) | public enum TLType {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ToolBox.java
  class ToolBox (line 66) | public class ToolBox {
    method printHexBinary (line 71) | public static String printHexBinary(byte[] data) {
    method hexStringToByteArray (line 81) | public static byte[] hexStringToByteArray(String s) {
    method printExportHexString (line 92) | public static String printExportHexString(byte[] data) {
    method getIfs (line 103) | public String getIfs(Context context) {
    method hexToBin (line 115) | private int hexToBin(char ch) {
    method getLocalAddress (line 123) | public static InetAddress getLocalAddress() {
    method isAnalyzerServiceRunning (line 143) | public static boolean isAnalyzerServiceRunning() {
    method searchByteArray (line 155) | public static int searchByteArray(byte[] input, byte[] searchedFor) {
    method longToFourBytes (line 188) | public static byte[] longToFourBytes(long l) {
    method intToTwoBytes (line 199) | public static byte[] intToTwoBytes(int i) {
    method fourBytesToLong (line 209) | public static long fourBytesToLong(byte[] b) {
    method twoBytesToInt (line 218) | public static int twoBytesToInt(byte[] b) {
    method reverseByteArray (line 227) | public static byte[] reverseByteArray(byte[] b) {
    method hexToIp6 (line 239) | public static String hexToIp6(String hexaIP) {
    method hexToIp4 (line 254) | public static String hexToIp4(String hexa) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Collector.java
  class Collector (line 81) | public class Collector {
    method provideSimpleReports (line 109) | public static HashMap<Integer, List<Report>> provideSimpleReports(Repo...
    method sortMapByLabels (line 117) | private static LinkedHashMap<Integer, List<Report>> sortMapByLabels() {
    method sortListByName (line 144) | private static void sortListByName(ArrayList<ArrayList<Report>> list) {
    method filterReports (line 157) | private static HashMap<Integer, List<Report>> filterReports() {
    method updateSettings (line 180) | static void updateSettings() {
    method saveReports (line 186) | public static void saveReports(ReportEntityDao reportEntityDao) {
    method updateReports (line 265) | public static void updateReports(ReportEntityDao reportEntityDao) {
    method fillCertRequests (line 284) | private static void fillCertRequests() {
    method sortReportsToMap (line 306) | private static void sortReportsToMap() {
    method hasGrade (line 318) | public static boolean hasGrade(String hostname) {
    method pull (line 332) | private static void pull() {
    method resolveHosts (line 342) | public static void resolveHosts() {
    method updateCertVal (line 364) | static void updateCertVal() {
    method fillPackageInformation (line 371) | private static void fillPackageInformation() {
    method deepCopyReportList (line 392) | private static ArrayList<Report> deepCopyReportList(ArrayList<Report> ...
    method updatePackageCache (line 410) | private static void updatePackageCache() {
    method addSysPackage (line 429) | private static void addSysPackage() {
    method getPackages (line 447) | private static List<PackageInfo> getPackages(Context context) {
    method printAllPackages (line 455) | private static void printAllPackages() {
    method getIcon (line 463) | public static Drawable getIcon(int uid) {
    method getDefaultIcon (line 481) | private static Drawable getDefaultIcon() {
    method getIconOld (line 489) | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
    method getIconNew (line 494) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    method getLabel (line 500) | public static String getLabel(int uid) {
    method getPackage (line 516) | public static String getPackage(int uid) {
    method getDnsHostName (line 525) | public static String getDnsHostName(String hostAdd) {
    method hasHostName (line 534) | public static Boolean hasHostName(String hostAdd) {
    method getCertHost (line 539) | public static String getCertHost(String hostname) {
    method getMetric (line 557) | public static String getMetric(String hostname) {
    method readEndpoints (line 586) | private static String readEndpoints(Map<String, Object> map) {
    method handleInvalidDomainName (line 605) | private static void handleInvalidDomainName(Map<String, Object> map) {
    method updateCertHostHandler (line 625) | public static void updateCertHostHandler() {
    method analyseReady (line 640) | public static boolean analyseReady(Map<String, Object> map) {
    method provideDetail (line 646) | public static void provideDetail(int uid, byte[] remoteAddHex) {
    method filterReportsByAdd (line 653) | private static ArrayList<Report> filterReportsByAdd(int uid, byte[] re...
    method buildDetailStrings (line 665) | private static void buildDetailStrings(ArrayList<Report> filterList) {
    method getTransportState (line 726) | private static String getTransportState(byte[] state) {
    method getAppsToIncludeInScan (line 774) | public static List<String> getAppsToIncludeInScan() {
    method addAppToIncludeInScan (line 779) | public static void addAppToIncludeInScan(String appToInclude) {
    method deleteAppFromIncludeInScan (line 784) | public static void deleteAppFromIncludeInScan(String appName) {
    method getAppsToExcludeFromScan (line 789) | public static List<String> getAppsToExcludeFromScan() {
    method addAppToExcludeFromScan (line 794) | public static void addAppToExcludeFromScan(String appToExclude) {
    method deleteAppToExcludeFromScan (line 799) | public static void deleteAppToExcludeFromScan(String appToExclude) {
    method getKnownUIDs (line 804) | public static HashMap<String, String> getKnownUIDs() {
    method addKnownUIDs (line 809) | public static void addKnownUIDs(String key, String value) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Detector.java
  class Detector (line 70) | class Detector {
    method updateReportMap (line 82) | static void updateReportMap() {
    method updateOrAdd (line 93) | private static void updateOrAdd(ArrayList<Report> reportList) {
    method removeOldReports (line 108) | private static void removeOldReports() {
    method getCurrentConnections (line 120) | private static ArrayList<Report> getCurrentConnections() {
    method parseNetOutput (line 133) | private static List<Report> parseNetOutput(String readIn, TLType type) {
    method initReport (line 146) | private static Report initReport(String splitLine, TLType type) {
    method initReport4 (line 163) | private static Report initReport4(String[] splitTabs, TLType type) {
    method initReport6 (line 199) | private static Report initReport6(String[] splitTabs, TLType type) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/PassiveService.java
  class PassiveService (line 77) | public class PassiveService extends Service {
    method getVersionString (line 93) | private String getVersionString(int id) {
    method getStringNew (line 101) | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
    method getStringOld (line 106) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    method createNotificationChannel (line 111) | private void createNotificationChannel() {
    method onCreate (line 123) | @Override
    method loadNotificationBitmaps (line 133) | private void loadNotificationBitmaps() {
    method startThread (line 138) | public void startThread() {
    method interrupt (line 173) | private void interrupt() {
    method onBind (line 179) | @Override
    method onUnbind (line 185) | @Override
    method onStartCommand (line 192) | @Override
    method onDestroy (line 198) | @Override
    method onTaskRemoved (line 204) | @Override
    class AnalyzerBinder (line 210) | public class AnalyzerBinder extends Binder {
      method getService (line 211) | PassiveService getService() {
    method showAppNotification (line 229) | private void showAppNotification() {
    method showWarningNotification (line 255) | private void showWarningNotification() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Report.java
  class Report (line 65) | public class Report implements Serializable {
    method Report (line 68) | Report(ByteBuffer bb, TLType type) {
    method touch (line 123) | public void touch() {
    method initIP4 (line 132) | private void initIP4(ByteBuffer bb) {
    method initIP6 (line 149) | private void initIP6(ByteBuffer bb) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/ServiceHandler.java
  class ServiceHandler (line 62) | public class ServiceHandler {
    method isServiceRunning (line 69) | public boolean isServiceRunning(Class<?> serviceClass) {
    method onServiceConnected (line 80) | public void onServiceConnected(ComponentName className, IBinder servic...
    method onServiceDisconnected (line 91) | public void onServiceDisconnected(ComponentName className) {
    method startPassiveService (line 103) | public void startPassiveService() {
    method stopPassiveService (line 110) | public void stopPassiveService() {
    method bindPassiveService (line 117) | public void bindPassiveService(Context context) {
    method unbindPassiveService (line 124) | public void unbindPassiveService(Context context) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/DBApp.java
  class DBApp (line 66) | public class DBApp extends Application {
    method onCreate (line 78) | @Override
    method getDaoSession (line 90) | public DaoSession getDaoSession() {
    class DBAppAsyncTask (line 94) | static class DBAppAsyncTask extends AsyncTask {
      method doInBackground (line 96) | @Override

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/GenerateReportEntities.java
  class GenerateReportEntities (line 69) | public class GenerateReportEntities {
    method generateReportEntities (line 71) | public static void generateReportEntities(Context context, ReportEntit...
    method getRandomString (line 182) | private static String getRandomString() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/ReportEntity.java
  class ReportEntity (line 62) | @Entity(
    method ReportEntity (line 102) | @Generated(hash = 15093572)
    method ReportEntity (line 125) | @Generated(hash = 683167796)
    method getId (line 129) | public Long getId() {
    method setId (line 133) | public void setId(Long id) {
    method getAppName (line 137) | public String getAppName() {
    method setAppName (line 141) | public void setAppName(String appName) {
    method getUserID (line 145) | public String getUserID() {
    method setUserID (line 149) | public void setUserID(String userID) {
    method getTimeStamp (line 153) | public String getTimeStamp() {
    method setTimeStamp (line 157) | public void setTimeStamp(String timeStamp) {
    method getRemoteAddress (line 161) | public String getRemoteAddress() {
    method setRemoteAddress (line 165) | public void setRemoteAddress(String remoteAddress) {
    method getRemoteHex (line 169) | public String getRemoteHex() {
    method setRemoteHex (line 173) | public void setRemoteHex(String remoteHex) {
    method getRemoteHost (line 177) | public String getRemoteHost() {
    method setRemoteHost (line 181) | public void setRemoteHost(String remoteHost) {
    method getLocalAddress (line 185) | public String getLocalAddress() {
    method setLocalAddress (line 189) | public void setLocalAddress(String localAddress) {
    method getLocalHex (line 193) | public String getLocalHex() {
    method setLocalHex (line 197) | public void setLocalHex(String localHex) {
    method getServicePort (line 201) | public String getServicePort() {
    method setServicePort (line 205) | public void setServicePort(String servicePort) {
    method getPayloadProtocol (line 209) | public String getPayloadProtocol() {
    method setPayloadProtocol (line 213) | public void setPayloadProtocol(String payloadProtocol) {
    method getTransportProtocol (line 217) | public String getTransportProtocol() {
    method setTransportProtocol (line 221) | public void setTransportProtocol(String transportProtocol) {
    method getLocalPort (line 225) | public String getLocalPort() {
    method setLocalPort (line 229) | public void setLocalPort(String localPort) {
    method getConnectionInfo (line 233) | public String getConnectionInfo() {
    method setConnectionInfo (line 237) | public void setConnectionInfo(String connectionInfo) {
    method toString (line 241) | @Override
    method toStringWithoutTimestamp (line 261) | public String toStringWithoutTimestamp() {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_day.java
  class Fragment_day (line 98) | public class Fragment_day extends Fragment {
    method onCreateView (line 110) | @Override
    method fillChart (line 188) | private void fillChart(View view, BarChart chart) {
    method loadFilteredList (line 288) | private void loadFilteredList(String appName) {
    method fillRecyclerList (line 341) | private void fillRecyclerList(View view, List<ReportEntity> reportEnti...
    method getEntityHour (line 353) | private int getEntityHour(ReportEntity reportEntity) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_month.java
  class Fragment_month (line 96) | public class Fragment_month extends Fragment {
    method onCreateView (line 110) | @Override
    method fillChart (line 189) | private void fillChart(View view, BarChart chart) {
    method loadFilteredList (line 266) | private void loadFilteredList(String appName) {
    method fillRecyclerList (line 311) | private void fillRecyclerList(View view, List<ReportEntity> reportEnti...
    method getEntityDate (line 323) | private Date getEntityDate(ReportEntity reportEntity) {
    method getDaysBetween (line 339) | public int getDaysBetween(Date d1, Date d2) {

FILE: app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_week.java
  class Fragment_week (line 96) | public class Fragment_week extends Fragment {
    method onCreateView (line 110) | @Override
    method fillChart (line 192) | private void fillChart(View view, BarChart chart) {
    method loadFilteredList (line 269) | private void loadFilteredList(String appName) {
    method fillRecyclerList (line 314) | private void fillRecyclerList(View view, List<ReportEntity> reportEnti...
    method getEntityDate (line 326) | private Date getEntityDate(ReportEntity reportEntity) {
    method getDaysBetween (line 342) | public int getDaysBetween(Date d1, Date d2) {

FILE: app/src/test/java/bjoernr/ssllabs/ApiAssert.java
  class ApiAssert (line 58) | public class ApiAssert extends Assert {
    method assertApiDataFetched (line 59) | public static void assertApiDataFetched(JSONObject apiData) {
    method assertApiResponseCode (line 63) | public static void assertApiResponseCode(String apiUrl, int expected) {

FILE: app/src/test/java/bjoernr/ssllabs/ApiTest.java
  class ApiTest (line 56) | public class ApiTest {
    method testFetchApiInformation (line 57) | @Test
    method testFetchHostInformation (line 66) | @Test
    method testFetchHostInformationCached (line 75) | @Test
    method testFetchEndpointData (line 83) | @Test
    method testFetchStatusCodes (line 91) | @Test
    method testFailedCustomApiRequest (line 99) | @Test
Condensed preview — 152 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (580K chars).
[
  {
    "path": ".github/workflows/changelog.yml",
    "chars": 560,
    "preview": "name: Changelog Generation\n\non:\n  release:\n    types: [published]\n  workflow_dispatch:\n\njobs:\n  changelog:\n    runs-on: "
  },
  {
    "path": ".gitignore",
    "chars": 675,
    "preview": "# Built application files\n/*/build/\n\n# Crashlytics configuations\ncom_crashlytics_export_strings.xml\n\n# Local configurati"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 3934,
    "preview": "# Changelog\n\n<a name=\"v2.1\"></a>\n## [Netmonitor (Privacy Friendly) v2.1](https://github.com/SecUSo/privacy-friendly-netm"
  },
  {
    "path": "CONTRIBUTING",
    "chars": 3168,
    "preview": "# How to contribute\n\nWe encourage open source developers to support the Privacy Friendly Apps. \nWe also wish to keep it "
  },
  {
    "path": "LICENSE.txt",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 4746,
    "preview": "[![Twitter](https://img.shields.io/badge/twitter-@SECUSOResearch-%231DA1F2.svg?&style=flat-square&logo=twitter&logoColor"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 2078,
    "preview": "apply plugin: 'com.android.application'\napply plugin: 'org.greenrobot.greendao'\n\nandroid {\n    compileSdkVersion 29\n    "
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 668,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 6171,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/Api.java",
    "chars": 8515,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/Console.java",
    "chars": 7469,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/ConsoleUtilities.java",
    "chars": 5034,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AboutActivity.java",
    "chars": 3898,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/AppListRecyclerAdapter.java",
    "chars": 4561,
    "preview": "package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.content"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableHistoryListAdapter.java",
    "chars": 8498,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableListAdapter.java",
    "chars": 6933,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableReportAdapter.java",
    "chars": 10453,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/FragmentDayListAdapter.java",
    "chars": 7341,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/PagerAdapter.java",
    "chars": 3886,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AppConnections_Chart.java",
    "chars": 4232,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/BaseActivity.java",
    "chars": 8896,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpActivity.java",
    "chars": 3686,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpDataDump.java",
    "chars": 5411,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryActivity.java",
    "chars": 13193,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryDetailActivity.java",
    "chars": 9090,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/MainActivity.java",
    "chars": 13701,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/ReportDetailActivity.java",
    "chars": 6700,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SelectHistoryAppsActivity.java",
    "chars": 17934,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SettingsActivity.java",
    "chars": 7624,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SplashActivity.java",
    "chars": 2302,
    "preview": "/**\n * This file is part of Privacy Friendly Password Generator.\n * Privacy Friendly Password Generator is free software"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/TutorialActivity.java",
    "chars": 9787,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncCertVal.java",
    "chars": 4852,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncDNS.java",
    "chars": 2437,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/Const.java",
    "chars": 3484,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ExecCom.java",
    "chars": 4915,
    "preview": "\n/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    #############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/KnownPorts.java",
    "chars": 25109,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/PrefManager.java",
    "chars": 1631,
    "preview": "/**\n * This file is part of Privacy Friendly Password Generator.\n * Privacy Friendly Password Generator is free software"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/RunStore.java",
    "chars": 2971,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/TLType.java",
    "chars": 2304,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ToolBox.java",
    "chars": 9367,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Collector.java",
    "chars": 32807,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n    ###############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Detector.java",
    "chars": 8548,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/PassiveService.java",
    "chars": 10206,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Report.java",
    "chars": 5597,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/ServiceHandler.java",
    "chars": 5438,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/DBApp.java",
    "chars": 4571,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/GenerateReportEntities.java",
    "chars": 8181,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/ReportEntity.java",
    "chars": 8066,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_day.java",
    "chars": 16441,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_month.java",
    "chars": 14890,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_week.java",
    "chars": 15069,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/main/res/drawable/background_border.xml",
    "chars": 182,
    "preview": "<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\" >\n    <stroke android:wi"
  },
  {
    "path": "app/src/main/res/drawable/button_fullwidth.xml",
    "chars": 282,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_clear.xml",
    "chars": 374,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_delete.xml",
    "chars": 365,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_help.xml",
    "chars": 545,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_history.xml",
    "chars": 553,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_menu_info.xml",
    "chars": 443,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_play_arrow.xml",
    "chars": 304,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_refresh.xml",
    "chars": 385,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "app/src/main/res/drawable/ic_search_white_24dp.xml",
    "chars": 534,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_settings.xml",
    "chars": 1141,
    "preview": "<vector android:alpha=\"0.60\" android:height=\"24dp\"\n    android:viewportHeight=\"24.0\" android:viewportWidth=\"24.0\"\n    an"
  },
  {
    "path": "app/src/main/res/drawable/ic_sort_white_24dp.xml",
    "chars": 342,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_stop.xml",
    "chars": 303,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_tutorial.xml",
    "chars": 368,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_tutorial_inverted.xml",
    "chars": 368,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/splash_screen.xml",
    "chars": 379,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item"
  },
  {
    "path": "app/src/main/res/layout/activity_about.xml",
    "chars": 6914,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/activity_help.xml",
    "chars": 1410,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android."
  },
  {
    "path": "app/src/main/res/layout/activity_help_content.xml",
    "chars": 772,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_history.xml",
    "chars": 3968,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android."
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 985,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android."
  },
  {
    "path": "app/src/main/res/layout/activity_main_app_bar.xml",
    "chars": 1314,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schema"
  },
  {
    "path": "app/src/main/res/layout/activity_main_content.xml",
    "chars": 2135,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    android:id=\"@+id/main_content\"\n    xmlns:android=\"http://sche"
  },
  {
    "path": "app/src/main/res/layout/activity_report.xml",
    "chars": 1368,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android."
  },
  {
    "path": "app/src/main/res/layout/activity_report_app_bar.xml",
    "chars": 595,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout\n    xmlns:android=\"http://sc"
  },
  {
    "path": "app/src/main/res/layout/activity_report_content.xml",
    "chars": 2427,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    android:id=\"@+id/report_content_layout\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_report_detail.xml",
    "chars": 1419,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android."
  },
  {
    "path": "app/src/main/res/layout/activity_report_detail_content.xml",
    "chars": 1114,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    x"
  },
  {
    "path": "app/src/main/res/layout/activity_select_history_apps.xml",
    "chars": 628,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://s"
  },
  {
    "path": "app/src/main/res/layout/activity_settings.xml",
    "chars": 1934,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout\n    xmlns:android=\"http://schemas.andr"
  },
  {
    "path": "app/src/main/res/layout/activity_splash.xml",
    "chars": 792,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xml"
  },
  {
    "path": "app/src/main/res/layout/activity_tutorial.xml",
    "chars": 1746,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xm"
  },
  {
    "path": "app/src/main/res/layout/app_list_group.xml",
    "chars": 2075,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/app_list_item.xml",
    "chars": 593,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/app_report_detail_layout.xml",
    "chars": 1077,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schem"
  },
  {
    "path": "app/src/main/res/layout/content_history.xml",
    "chars": 1141,
    "preview": "<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n  "
  },
  {
    "path": "app/src/main/res/layout/content_select_history_apps.xml",
    "chars": 646,
    "preview": "<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com"
  },
  {
    "path": "app/src/main/res/layout/fragment_charts.xml",
    "chars": 2640,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andro"
  },
  {
    "path": "app/src/main/res/layout/fragment_list_item.xml",
    "chars": 2404,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    a"
  },
  {
    "path": "app/src/main/res/layout/help_list_group.xml",
    "chars": 594,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n   "
  },
  {
    "path": "app/src/main/res/layout/help_list_item.xml",
    "chars": 587,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    "
  },
  {
    "path": "app/src/main/res/layout/history_list_group.xml",
    "chars": 1739,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/history_list_item.xml",
    "chars": 1422,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/main_nav_header.xml",
    "chars": 1551,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/report_detail_item.xml",
    "chars": 926,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  "
  },
  {
    "path": "app/src/main/res/layout/report_list_group.xml",
    "chars": 1733,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/report_list_group_header.xml",
    "chars": 1900,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
  },
  {
    "path": "app/src/main/res/layout/report_list_item.xml",
    "chars": 1415,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  "
  },
  {
    "path": "app/src/main/res/layout/toolbar.xml",
    "chars": 666,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.google.android.material.appbar.AppBarLayout\n    android:layout_width=\"match_"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide1.xml",
    "chars": 1565,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide2.xml",
    "chars": 1579,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide3.xml",
    "chars": 1579,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/main/res/menu/applistseletion_menu.xml",
    "chars": 1896,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"h"
  },
  {
    "path": "app/src/main/res/menu/main_drawer.xml",
    "chars": 1251,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <group and"
  },
  {
    "path": "app/src/main/res/menu/toolbar_menu.xml",
    "chars": 576,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"h"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 1085,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#024265</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 888,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"nav_header_vertical"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 13396,
    "preview": "<resources>\n    <!-- APP GLOBAL -->\n    <string name=\"app_name\" translatable=\"false\">Net Monitor</string>\n    <string na"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 3270,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "app/src/main/res/values-de/strings.xml",
    "chars": 10999,
    "preview": "<resources>\n    <!-- MAIN -->\n    <string name=\"main_button_text_off\">Net Monitor starten</string>\n    <string name=\"mai"
  },
  {
    "path": "app/src/main/res/values-ja/strings.xml",
    "chars": 6081,
    "preview": "<resources>\n    <!-- APP GLOBAL -->\n\n    <!-- MAIN -->\n    <string name=\"main_button_text_off\">Net Monitor を開始</string>\n"
  },
  {
    "path": "app/src/main/res/xml/preferences.xml",
    "chars": 2143,
    "preview": "<PreferenceScreen\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n        <SwitchPreference\n           "
  },
  {
    "path": "app/src/main/res/xml/searchable.xml",
    "chars": 195,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<searchable\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/test/java/bjoernr/ssllabs/ApiAssert.java",
    "chars": 3109,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "app/src/test/java/bjoernr/ssllabs/ApiTest.java",
    "chars": 3749,
    "preview": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ##############"
  },
  {
    "path": "build.gradle",
    "chars": 596,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "fastlane/metadata/android/ar/summary.txt",
    "chars": 54,
    "preview": "عرض اتصالات الشبكة المستخدمة من قبل التطبيقات المثبتة\n"
  },
  {
    "path": "fastlane/metadata/android/de/full_description.txt",
    "chars": 2456,
    "preview": "HINWEIS: Aufgrund von Änderungen der Android APIs von Android 9 auf Android 10, funktioniert diese App nicht in Android "
  },
  {
    "path": "fastlane/metadata/android/de/short_description.txt",
    "chars": 74,
    "preview": "(SECUSO) Net Monitor zeigt den Netzwerkverkehr der installierten Apps an.\n"
  },
  {
    "path": "fastlane/metadata/android/de/title.txt",
    "chars": 30,
    "preview": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/de-DE/full_description.txt",
    "chars": 2456,
    "preview": "HINWEIS: Aufgrund von Änderungen der Android APIs von Android 9 auf Android 10, funktioniert diese App nicht in Android "
  },
  {
    "path": "fastlane/metadata/android/de-DE/short_description.txt",
    "chars": 74,
    "preview": "(SECUSO) Net Monitor zeigt den Netzwerkverkehr der installierten Apps an.\n"
  },
  {
    "path": "fastlane/metadata/android/de-DE/title.txt",
    "chars": 30,
    "preview": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/en-US/full_description.txt",
    "chars": 2427,
    "preview": "\nNOTICE: Due to changes in the respective Android APIs from Android 9 to Android 10, this app does not work in Android 1"
  },
  {
    "path": "fastlane/metadata/android/en-US/short_description.txt",
    "chars": 57,
    "preview": "(SECUSO) Shows active network activity of installed apps\n"
  },
  {
    "path": "fastlane/metadata/android/en-US/title.txt",
    "chars": 30,
    "preview": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/eo/summary.txt",
    "chars": 81,
    "preview": "Listigi interretajn konektojn de instalitaj aplikaĵojhttps://hosted.weblate.org/\n"
  },
  {
    "path": "fastlane/metadata/android/es/summary.txt",
    "chars": 53,
    "preview": "Muestra las conexiones de red de las apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/fr/summary.txt",
    "chars": 58,
    "preview": "Affiche les connexions réseau des applications installées\n"
  },
  {
    "path": "fastlane/metadata/android/he/summary.txt",
    "chars": 39,
    "preview": "מציג חיבוריות רשת של יישומונים מותקנים\n"
  },
  {
    "path": "fastlane/metadata/android/it/summary.txt",
    "chars": 51,
    "preview": "Mostra le connessioni di rete delle app installate\n"
  },
  {
    "path": "fastlane/metadata/android/ja/summary.txt",
    "chars": 24,
    "preview": "インストール済みアプリのネットワーク接続を表示\n"
  },
  {
    "path": "fastlane/metadata/android/nb/summary.txt",
    "chars": 55,
    "preview": "Viser nettverkstilkoblinger for installerte programmer\n"
  },
  {
    "path": "fastlane/metadata/android/nn/summary.txt",
    "chars": 49,
    "preview": "Vis nettverks­tilkoplingar for installerte appar\n"
  },
  {
    "path": "fastlane/metadata/android/pl/summary.txt",
    "chars": 55,
    "preview": "Pokazuje połączenia sieciowe zainstalowanych aplikacji\n"
  },
  {
    "path": "fastlane/metadata/android/pt/summary.txt",
    "chars": 47,
    "preview": "Mostra as conexões de rede das apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/pt-BR/summary.txt",
    "chars": 50,
    "preview": "Mostra conexões de rede de aplicativos instalados\n"
  },
  {
    "path": "fastlane/metadata/android/pt-PT/summary.txt",
    "chars": 47,
    "preview": "Mostra as conexões de rede das apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/ro/summary.txt",
    "chars": 57,
    "preview": "Afișează conexiunile de rețea ale aplicațiilor instalate\n"
  },
  {
    "path": "fastlane/metadata/android/ru/summary.txt",
    "chars": 56,
    "preview": "Показывает сетевые подключения установленных приложений\n"
  },
  {
    "path": "fastlane/metadata/android/tr/summary.txt",
    "chars": 47,
    "preview": "Yüklü uygulamaların ağ bağlantılarını gösterir\n"
  },
  {
    "path": "fastlane/metadata/android/uk/summary.txt",
    "chars": 53,
    "preview": "Показує з'єднання встановлених застосунків з мережею\n"
  },
  {
    "path": "fastlane/metadata/android/zh-CN/summary.txt",
    "chars": 13,
    "preview": "显示已安装应用的网络连接\n"
  },
  {
    "path": "fastlane/metadata/android/zh-TW/summary.txt",
    "chars": 13,
    "preview": "顯示已安裝應用的網絡連接\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 231,
    "preview": "#Wed Sep 23 12:58:20 CEST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
  },
  {
    "path": "gradle.properties",
    "chars": 783,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "settings.gradle",
    "chars": 15,
    "preview": "include ':app'\n"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the SecUSo/privacy-friendly-netmonitor GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 152 files (530.7 KB), approximately 127.1k tokens, and a symbol index with 386 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!