[
  {
    "path": ".github/workflows/changelog.yml",
    "content": "name: Changelog Generation\n\non:\n  release:\n    types: [published]\n  workflow_dispatch:\n\njobs:\n  changelog:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          submodules: 'recursive'\n          ref: master\n      - uses: rhysd/changelog-from-release/action@v3\n        with:\n          file: CHANGELOG.md\n          pull_request: true\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          commit_summary_template: 'update changelog for %s changes'\n          args: -l 2\n          header: |\n            # Changelog\n"
  },
  {
    "path": ".gitignore",
    "content": "# Built application files\n/*/build/\n\n# Crashlytics configuations\ncom_crashlytics_export_strings.xml\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Gradle generated files\n.gradle/\n\n#build files\nbuild/\n\n# Idea configuations\n.idea/\n\n# Signing files\n.signing/\n\n# User-specific configurations\n.idea/libraries/\n.idea/workspace.xml\n.idea/tasks.xml\n.idea/.name\n.idea/compiler.xml\n.idea/copyright/profiles_settings.xml\n.idea/encodings.xml\n.idea/misc.xml\n.idea/modules.xml\n.idea/scopes/scope_settings.xml\n.idea/vcs.xml\n*.iml\n\n# OS-specific files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n\n# Documents\n*.pdf\n*.doc\n*.docx\n*.odt\n\n#APK\n*.apk\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n<a name=\"v2.1\"></a>\n## [Netmonitor (Privacy Friendly) v2.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.1) - 24 Sep 2020\n\n- small bugfixes\n- upgraded compile and target Android versions\n- updated dependencies and libraries\n- disabled for Android 10 and later\n- updated SECUSO references\n- fixed notification for newer Android versions\n\n[Changes][v2.1]\n\n\n<a name=\"v2.0\"></a>\n## [Privacy Friendly Netmonitor v2.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.0) - 29 Mar 2018\n\n* Improvement history function: Apps with the Internet permission can be chosen and monitored\n* Redesign\n\n[Changes][v2.0]\n\n\n<a name=\"v1.2\"></a>\n## [Privacy Friendly Netmonitor v1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.2) - 12 Oct 2017\n\n- Bug fixing\n- Icon updates\n- Better handling of unknown apps\n\n[Changes][v1.2]\n\n\n<a name=\"v1.1.4\"></a>\n## [Privacy Friendly Net Monitor v1.1.4](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.4) - 09 Mar 2017\n\nBlocking of screenshots removed\n\n[Changes][v1.1.4]\n\n\n<a name=\"v1.1.3\"></a>\n## [Privacy Friendly Net Monitor v1.1.3](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.3) - 04 Mar 2017\n\n- Android 4 Support added\n- Icons refinements (list icons, splash icons, unloadable icons)\n- Help page refinement\n- Bug Fixes\n\n\n[Changes][v1.1.3]\n\n\n<a name=\"v1.1.2\"></a>\n## [Privacy Friendly Net Monitor v1.1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.2) - 28 Feb 2017\n\n- MinSDK reset to 21 \n\n\n[Changes][v1.1.2]\n\n\n<a name=\"v1.1.1\"></a>\n## [Privacy Friendly Net Monitor v1.1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.1) - 21 Feb 2017\n\n- Refinements of translations\n- Downgrade to SDK 23 is target\n\n\n[Changes][v1.1.1]\n\n\n<a name=\"v1.1\"></a>\n## [Privacy Friendly Net Monitor v1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1) - 20 Feb 2017\n\nAdding of SSL Rating\n\n\n[Changes][v1.1]\n\n\n<a name=\"v1.0\"></a>\n## [Privacy Friendly Net Monitor v1.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.0) - 21 Jan 2017\n\nPrivacy Friendly Net Monitor is an Android application that can identify and monitor active network connections of applications that are installed on the mobile device. \nIt 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.\n\nPrivacy 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.\n\n\n[Changes][v1.0]\n\n\n[v2.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v2.0...v2.1\n[v2.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.2...v2.0\n[v1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.4...v1.2\n[v1.1.4]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.3...v1.1.4\n[v1.1.3]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.2...v1.1.3\n[v1.1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.1...v1.1.2\n[v1.1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1...v1.1.1\n[v1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.0...v1.1\n[v1.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/tree/v1.0\n\n<!-- Generated by https://github.com/rhysd/changelog-from-release v3.7.1 -->\n"
  },
  {
    "path": "CONTRIBUTING",
    "content": "# How to contribute\n\nWe encourage open source developers to support the Privacy Friendly Apps. \nWe also wish to keep it as easy as possible to contribute. There are a few \nguidelines that we need contributors to follow.\nFor further questions we refer to the contact details on the [Privacy Friendly Apps website](https://secuso.org/pfa). \n\n## Reporting of Issues\n\n* Make sure you have a [GitHub account](https://github.com/signup/free).\n* Open an issue in the corresponding app's repository, assuming one does not already exist.\n  * Clearly describe the issue including steps to reproduce when it is a bug.\n    In some cases screenshots can be supportive. \n  * Make sure you mention the Android version and the device you have used when \n    you encountered the issue. \n* Make your description as precise as possible.\n\t\n## Making Changes\n\n* Make sure you have a [GitHub account](https://github.com/signup/free).\n* Find an issue that you wish to close. If the issue you wish to close is not \n  present, open it. Make sure that the issue has one of the following labels\n  which are set by our team:\n  * Bug\n  * Enhancement\n  * Help wanted\n  * No integration planned \n  That means that we have already reviewed the issue. If you wish to add a \n  translation, opening an issue is not required. \n* Fork the repository on GitHub.\n* Create a topic branch from where you want to base your work (usually master branch).\n  * To quickly create a topic branch based on master, run `git checkout -b\n    fix/master/my_contribution master`. \n  *\tPlease avoid working directly on the `master` branch.\n* Make commits of logical units in english language.\n* Make sure your commit messages are in the proper format. If the commit\n  addresses an issue filed in the Github repository, start the first line \n  of the commit with a hash followed by the issue number (e.g. #42).\n* Make sure you have added the necessary tests for your changes.\n* Run all available tests to assure nothing else was accidentally broken.\n\n### Unwanted Changes\n\nThe Privacy Friendly Apps are a group of Android apps that are optimized regarding\nthe user's privacy. Therefore, Pull Requests that contain the following functionality\nwill be rejected:\n* Analytics or advertisement frameworks\n* User tracking (e.g. sending of data to a third party)\n* Any that use of libraries that do not comply the license of the corresponding Privacy\n  Friendly App (GPLv3 or Apache2).  \n* Unnecessary use of Android permissions. If new functionality is added that requires\n  the usage of an Android permission you should clearly explain the Pull Request why\n  this permission is required.\n* New translations/languages  \n\n## Submitting Changes\n\n* Push your changes to a topic branch in your fork of the repository.\n* Submit a Pull Request to the repository of the corresponding Privacy Friendly App.\n* Indicate that you have read this policy by writing the second word of the section \"unwanted changes\"\n* Our team looks at Pull Requests on a regular basis and assigns a reviewer.  \n* After feedback has been given we expect responses within one month. After one\n  month we might close the pull request if no activity is shown.\n   \n"
  },
  {
    "path": "LICENSE.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "[![Twitter](https://img.shields.io/badge/twitter-@SECUSOResearch-%231DA1F2.svg?&style=flat-square&logo=twitter&logoColor=1DA1F2)][Twitter]\n[![Mastodon](https://img.shields.io/badge/mastodon-@SECUSO__Research@baw%C3%BC.social-%233088D4.svg?&style=flat-square&logo=mastodon&logoColor=3088D4)][Mastodon]\n\n[Mastodon]: https://xn--baw-joa.social/@SECUSO_Research\n[Twitter]: https://twitter.com/SECUSOResearch\n\n<img src=\"https://github.com/SecUSo/privacy-friendly-netmonitor/raw/master/fastlane/metadata/android/en-US/images/icon.png\"\n     alt=\"Privacy Friendly Netmonitor Icon\"\n     width=\"120px\"\n     align=\"right\"\n     style=\"float: right; margin-right: 10px;\" />\n# Privacy Friendly Net Monitor #\n\n> :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.\nIf someone is interested in taking over the maintenance of this app, please do not hesitate to contact us: pfa@secuso.org\n\nThis 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.\n\nThis 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.\n\n## Motivation ##\nThis 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.\n\n## Building ##\n\n### API Reference ###\nMininum SDK: 22 Target SDK: 26 \n\n### Setup ###\n* Android Studio 3.0.1\n\n### Future Enhancements ###\npossible additional features\n- raw socket inspection\n- ip locating feature\n- export of identified information\n- display of additional remote host information (SSLLabs)\n- long term goal: addtitional active service, perfoming (deep) packet inspection with VPN-Capture implementation\n\n### License ###\n\nPrivacy Friendly Net Monitor is licensed under the GPLv3. Copyright (C) 2015 - 2018 Felix Tsala Schiller\n\nThis 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.\n\nThis 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.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.\n\nThe 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).\n\nThis 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)\n\nPrivacy Friendly Net Monitor is a non-root variant of TLSMetric android app (https://bitbucket.org/schillef/tlsmetric/overview) by Felix Tsala Schiller.\n\n### Contributors ###\n\nApp Icon:</br>\nMarkus Hau\n\nDevelopers:</br>\nFelix Tsala Schiller</br>\nTobias Burger</br>\nMarco Egermaier\n\nContributors (Github):</br>\nYonjuni </br>\nKamuno</br>\ndi72nn</br>\nstevesoltys</br>\nFroggieFrog \n\n\n\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'org.greenrobot.greendao'\n\nandroid {\n    compileSdkVersion 29\n    defaultConfig {\n        applicationId 'org.secuso.privacyfriendlynetmonitor'\n        minSdkVersion 17\n        targetSdkVersion 29\n        versionCode 9\n        versionName \"2.1\"\n        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'\n        vectorDrawables.useSupportLibrary = true\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    productFlavors {\n    }\n\n}\n\nandroid {\n    lintOptions {\n        disable 'MissingTranslation'\n    }\n}\n\n//added by TB (needed for Studio 3.0.0) and for the charts\nallprojects {\n    repositories {\n        jcenter()\n        google()\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\ndependencies {\n    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'\n    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'\n    implementation fileTree(include: ['*.jar'], dir: 'libs')\n    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {\n        exclude group: 'com.android.support', module: 'support-annotations'\n    })\n    implementation 'androidx.appcompat:appcompat:1.0.0'\n    implementation 'com.google.android.material:material:1.2.1'\n    implementation 'androidx.legacy:legacy-support-v4:1.0.0'\n    implementation 'org.greenrobot:greendao:3.3.0'\n    implementation 'net.zetetic:android-database-sqlcipher:3.5.9'\n\n    implementation fileTree(include: ['*.jar'], dir: 'libs')\n    implementation 'androidx.appcompat:appcompat:1.0.0'\n    implementation 'com.google.android.material:material:1.2.1'\n    implementation 'androidx.legacy:legacy-support-v4:1.0.0'\n    implementation 'androidx.cardview:cardview:1.0.0'\n    implementation 'androidx.recyclerview:recyclerview:1.1.0'\n    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'\n\n    testImplementation 'junit:junit:4.12'\n    testImplementation 'org.json:json:20180813'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:\\Users\\fs\\AppData\\Local\\Android\\Sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.secuso.privacyfriendlynetmonitor\">\n\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\"/>\n\n    <uses-sdk\n        android:maxSdkVersion=\"28\" />\n\n    <application\n        android:name=\".DatabaseUtil.DBApp\"\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/Theme.AppCompat.Light.NoActionBar\">\n        <activity\n            android:name=\".Activities.SplashActivity\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/SplashTheme\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity\n            android:name=\".Activities.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/AppTheme.NoActionBar\" />\n        <activity\n            android:name=\".Activities.ReportDetailActivity\"\n            android:label=\"@string/headline_report_detail\"\n            android:parentActivityName=\".Activities.MainActivity\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.AboutActivity\"\n            android:label=\"@string/about\"\n            android:parentActivityName=\".Activities.MainActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.HelpActivity\"\n            android:label=\"@string/help\"\n            android:parentActivityName=\".Activities.MainActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.SettingsActivity\"\n            android:label=\"@string/title_activity_settings\"\n            android:parentActivityName=\".Activities.MainActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.TutorialActivity\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n\n        <service\n            android:name=\".ConnectionAnalysis.PassiveService\"\n            android:enabled=\"true\"\n            android:label=\"org.secuso.privacyfriendlynetmonitor.NetMonitorPassiveService\"\n            android:permission=\"android.permission.BIND_SERVICE\" />\n\n        <activity\n            android:name=\".Activities.HistoryActivity\"\n            android:label=\"@string/title_activity_history\"\n            android:parentActivityName=\".Activities.MainActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.HistoryDetailActivity\"\n            android:label=\"@string/title_activity_history_detail\"\n            android:parentActivityName=\".Activities.HistoryActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme.NoActionBar\">\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.HistoryActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.SelectHistoryAppsActivity\"\n            android:configChanges=\"orientation\"\n            android:label=\"@string/title_activity_select_history_apps\"\n            android:parentActivityName=\".Activities.HistoryDetailActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme\"\n            android:windowSoftInputMode=\"stateHidden\">\n\n            <!-- android:launchMode=\"singleTask\" -->\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:resource=\"@xml/searchable\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity\" />\n        </activity>\n        <activity\n            android:name=\".Activities.AppConnections_Chart\"\n            android:configChanges=\"orientation\"\n            android:label=\"@string/title_activity_app_report__detail\"\n            android:parentActivityName=\".Activities.HistoryDetailActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme\">\n\n            <!-- android:launchMode=\"singleTask\" -->\n            <meta-data\n                android:name=\"android.support.PARENT_ACTIVITY\"\n                android:value=\"org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity\" />\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/Api.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage de.bjoernr.ssllabs;\n\nimport org.json.JSONObject;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URL;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Java-SSLLabs-API\n * <p>\n * This Java library provides basic access to the SSL Labs API\n * and is build upon the official API documentation at\n * https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md\n *\n * @author Björn Roland <https://github.com/bjoernr-de>\n * @license GNU GENERAL PUBLIC LICENSE v3\n */\npublic class Api {\n    private static final String API_URL = \"https://api.ssllabs.com/api/v2\";\n    private static final String VERSION = \"0.0.1-SNAPSHOT\";\n\n    /**\n     * Fetch API information\n     * API Call: info\n     *\n     * @return JSONObject\n     */\n    public JSONObject fetchApiInfo() {\n        String jsonString;\n        JSONObject json = new JSONObject();\n\n        try {\n            jsonString = sendApiRequest(\"info\", null);\n            json = new JSONObject(jsonString);\n        } catch (Exception ignored) {\n        }\n\n        return (json);\n    }\n\n    /**\n     * Fetch host information\n     * API Call: analyze\n     *\n     * @param    host\n     * @param    publish\n     * @param    startNew\n     * @param    fromCache\n     * @param    maxAge\n     * @param    all\n     * @param    ignoreMismatch\n     * @return JSONObject\n     */\n    public JSONObject fetchHostInformation(String host, boolean publish, boolean startNew, boolean fromCache, String maxAge, String all, boolean ignoreMismatch) {\n        String jsonString;\n        JSONObject json = new JSONObject();\n\n        try {\n            Map<String, String> parameters = new HashMap<String, String>();\n\n            parameters.put(\"host\", host);\n            parameters.put(\"publish\", booleanToOnOffString(publish));\n            parameters.put(\"startNew\", booleanToOnOffString(startNew));\n            parameters.put(\"fromCache\", booleanToOnOffString(fromCache));\n            parameters.put(\"maxAge\", maxAge);\n            parameters.put(\"all\", all);\n            parameters.put(\"ignoreMismatch\", booleanToOnOffString(ignoreMismatch));\n\n            jsonString = sendApiRequest(\"analyze\", parameters);\n            json = new JSONObject(jsonString);\n        } catch (Exception ignored) {\n        }\n\n        return (json);\n    }\n\n    /**\n     * Same as fetchHostInformation() but prefer caching\n     * fetchHostInformation() with proper parameters can also be used\n     * API Call: analyze\n     *\n     * @param    host\n     * @param    maxAge\n     * @param    publish\n     * @param    ignoreMismatch\n     * @return JSONObject\n     */\n    public JSONObject fetchHostInformationCached(String host, String maxAge, boolean publish, boolean ignoreMismatch) {\n        return (fetchHostInformation(host, publish, false, true, maxAge, \"done\", ignoreMismatch));\n    }\n\n    /**\n     * Fetch endpoint data\n     * API Call: getEndpointData\n     *\n     * @param    host\n     * @param    s\n     * @param    fromCache\n     * @return JSONObject\n     */\n    public JSONObject fetchEndpointData(String host, String s, boolean fromCache) {\n        String jsonString;\n        JSONObject json = new JSONObject();\n\n        try {\n            Map<String, String> parameters = new HashMap<String, String>();\n\n            parameters.put(\"host\", host);\n            parameters.put(\"s\", s);\n            parameters.put(\"fromCache\", booleanToOnOffString(fromCache));\n\n            jsonString = sendApiRequest(\"getEndpointData\", parameters);\n            json = new JSONObject(jsonString);\n        } catch (Exception ignored) {\n        }\n\n        return (json);\n    }\n\n    /**\n     * Fetch status codes\n     * API Call: getStatusCodes\n     *\n     * @return JSONObject\n     */\n    public JSONObject fetchStatusCodes() {\n        String jsonString;\n        JSONObject json = new JSONObject();\n\n        try {\n            jsonString = sendApiRequest(\"getStatusCodes\", null);\n            json = new JSONObject(jsonString);\n        } catch (Exception ignored) {\n        }\n\n        return (json);\n    }\n\n    /**\n     * Send custom API request and return API response\n     *\n     * @param    apiCall\n     * @param    parameters\n     * @return String\n     */\n    public String sendCustomApiRequest(String apiCall, Map<String, String> parameters) {\n        String jsonString = \"\";\n\n        try {\n            jsonString = sendApiRequest(apiCall, parameters);\n        } catch (Exception ignored) {\n        }\n\n        return (jsonString);\n    }\n\n    /**\n     * Sends an api request and return api response\n     *\n     * @param    apiCall\n     * @param    parameters\n     * @return String\n     * @throws IOException\n     */\n    private String sendApiRequest(String apiCall, Map<String, String> parameters) throws IOException {\n        URL url = new URL(API_URL + \"/\" + apiCall);\n\n        if (parameters != null) {\n            url = new URL(url.toString() + buildGetParameterString(parameters));\n        }\n\n        InputStream is = url.openStream();\n        int nextByteOfData = 0;\n\n        StringBuffer apiResponseBuffer = new StringBuffer();\n\n        while ((nextByteOfData = is.read()) != -1) {\n            apiResponseBuffer.append((char) nextByteOfData);\n        }\n\n        is.close();\n\n        return (apiResponseBuffer.toString());\n    }\n\n    /**\n     * Helper function to build GET parameter string\n     *\n     * @param    parameters\n     * @return String\n     */\n    private String buildGetParameterString(Map<String, String> parameters) {\n        String getParameterString = \"\";\n\n        for (Map.Entry<String, String> param : parameters.entrySet()) {\n            if (param.getValue() == null) {\n                continue;\n            }\n\n            getParameterString += (getParameterString.length() < 1) ? (\"?\") : (\"&\");\n\n            getParameterString += param.getKey() + \"=\" + param.getValue();\n        }\n\n        return (getParameterString);\n    }\n\n    /**\n     * Helper function to cast boolean to on/off string\n     *\n     * @param b\n     * @return\n     */\n    private String booleanToOnOffString(boolean b) {\n        return (b == true) ? \"on\" : \"off\";\n    }\n\n    /**\n     * Getter for API_URL\n     *\n     * @return String\n     */\n    public static String getApiUrl() {\n        return API_URL;\n    }\n\n    /**\n     * Getter for VERSION\n     *\n     * @return String\n     */\n    public static String getVersion() {\n        return VERSION;\n    }\n}"
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/Console.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage de.bjoernr.ssllabs;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.util.Map;\n\n/**\n * Command line interface class\n *\n * @author Björn Roland <https://github.com/bjoernr-de>\n */\npublic class Console {\n\n    public static void main(String[] args) {\n        printHeader();\n\n        if (args.length == 1 && (args[0].equals(\"--info\") || args[0].equals(\"-i\"))) {\n            handleInfo();\n        } else if ((args.length > 0 && args.length <= 6) && (args[0].equals(\"--host-information\") || args[0].equals(\"-hi\"))) {\n            handleHostInformation(args);\n        } else {\n            printUsage();\n        }\n    }\n\n    public static void handleInfo() {\n        Api ssllabsApi = new Api();\n\n        JSONObject apiInfo = ssllabsApi.fetchApiInfo();\n        Map<String, Object> map = null;\n        try {\n            map = ConsoleUtilities.jsonToMap(apiInfo);\n        } catch (JSONException ignore) {\n\n        }\n        System.out.println(\"API information\");\n        System.out.println(\"\");\n        System.out.println(ConsoleUtilities.mapToConsoleOutput(map));\n    }\n\n    public static void handleHostInformation(String[] args) {\n        //API parameters\n        String host = ConsoleUtilities.arrayValueMatchRegex(args, \"-h=(.+)\");\n        boolean publish = false;\n        boolean startNew = false;\n        boolean fromCache = false;\n        String maxAge = null;\n        String all = null;\n        boolean ignoreMismatch = false;\n\n        if (host == null) {\n            //host not found in arguments\n            printUsage();\n            return;\n        }\n\n        String[] possibleArguments = {\"-p\", \"-c\", \"-m\", \"-a\", \"-i\"};\n\n        for (String arg : possibleArguments) {\n            if (ConsoleUtilities.arrayValueMatchRegex(args, arg) == null) {\n                //if argument is not in args array, continue with next possible argument\n                continue;\n            }\n\n            switch (arg) {\n                case \"-p\":\n                    publish = true;\n                    break;\n                case \"-c\":\n                    fromCache = true;\n                    break;\n                case \"-m\":\n                    maxAge = ConsoleUtilities.arrayValueMatchRegex(args, \"-m=(.+)\");\n                    break;\n                case \"-a\":\n                    all = ConsoleUtilities.arrayValueMatchRegex(args, \"-a=(.+)\");\n                    break;\n                case \"-i\":\n                    ignoreMismatch = true;\n                    break;\n            }\n        }\n\n        Api ssllabsApi = new Api();\n\n        JSONObject hostInformation = ssllabsApi.fetchHostInformation(host, publish, startNew, fromCache, maxAge, all, ignoreMismatch);\n\n        Map<String, Object> map = null;\n        try {\n            map = ConsoleUtilities.jsonToMap(hostInformation);\n        } catch (JSONException ignore) {\n        }\n\n        System.out.println(\"Host information\");\n        System.out.println(\"\");\n        System.out.println(ConsoleUtilities.mapToConsoleOutput(map));\n    }\n\n    public static void printHeader() {\n        System.out.println(\"\");\n        System.out.println(\"   ___                    _____ _____ _      _           _            ___  ______ _____ \");\n        System.out.println(\"  |_  |                  /  ___/  ___| |    | |         | |          / _ \\\\ | ___ \\\\_   _|\");\n        System.out.println(\"    | | __ ___   ____ _  \\\\ `--.\\\\ `--.| |    | |     __ _| |__  ___  / /_\\\\ \\\\| |_/ / | |  \");\n        System.out.println(\"    | |/ _` \\\\ \\\\ / / _` |  `--. \\\\`--. \\\\ |    | |    / _` | '_ \\\\/ __| |  _  ||  __/  | |  \");\n        System.out.println(\"/\\\\__/ / (_| |\\\\ V / (_| | /\\\\__/ /\\\\__/ / |____| |___| (_| | |_) \\\\__ \\\\ | | | || |    _| |_ \");\n        System.out.println(\"\\\\____/ \\\\__,_| \\\\_/ \\\\__,_| \\\\____/\\\\____/\\\\_____/\\\\_____/\\\\__,_|_.__/|___/ \\\\_| |_/\\\\_|    \\\\___/ \");\n        System.out.println(\"by Bjoern Roland <https://github.com/bjoernr-de>\");\n        System.out.println(\"and contributors (https://github.com/bjoernr-de/java-ssllabs-api/graphs/contributors)\");\n        System.out.println(\"-------------------------------------------------\");\n        System.out.println(\"\");\n    }\n\n    public static void printUsage() {\n        String jarName = \"java-ssllabs-api-\" + Api.getVersion() + \".jar\";\n        String jarExecution = \"java -jar \" + jarName;\n\n        System.out.println(\"Help\");\n        System.out.println(jarExecution);\n        System.out.println(\"\");\n\n        System.out.println(\"-i, --info\");\n        System.out.println(\"\tFetch API information\");\n        System.out.println(\"\");\n        System.out.println(\"-hi, --host-information\");\n        System.out.println(\"\tMandatory parameter:\");\n        System.out.println(\"\t-h, --host (String)\");\n        System.out.println(\"\");\n        System.out.println(\"\tAdditional parameter:\");\n        System.out.println(\"\t-p, --publish (boolean) - default value is false\");\n        System.out.println(\"\t-c, --fromCache (boolean) - default value is false\");\n        System.out.println(\"\t-m, --maxAge (String)\");\n        System.out.println(\"\t-a, --all (String)\");\n        System.out.println(\"\t-i, --ignoreMismatch (boolean) - default value is false\");\n        System.out.println(\"\");\n        System.out.println(\"\tExample:\");\n        System.out.println(\"\t\" + jarExecution + \" -hi -h=https://ssllabs.com -p -c -m=\\\"1\\\"\");\n    }\n}"
  },
  {
    "path": "app/src/main/java/de/bjoernr/ssllabs/ConsoleUtilities.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage de.bjoernr.ssllabs;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class ConsoleUtilities {\n    private static String newLine = \"\\n\";\n\n    /*\n     * Special thanks to Vikas Gupta (http://stackoverflow.com/users/2915208/vikas-gupta)\n     * http://stackoverflow.com/questions/21720759/convert-a-json-string-to-a-hashmap\n     *\n     * START code of Vikas Gupta from stackoverflow\n     */\n    public static Map<String, Object> jsonToMap(JSONObject json) throws JSONException {\n        Map<String, Object> retMap = new HashMap<String, Object>();\n\n        if (json != JSONObject.NULL) {\n            retMap = toMap(json);\n        }\n        return retMap;\n    }\n\n    public static Map<String, Object> toMap(JSONObject object) throws JSONException {\n        Map<String, Object> map = new HashMap<String, Object>();\n\n        Iterator<String> keysItr = object.keys();\n        while (keysItr.hasNext()) {\n            String key = keysItr.next();\n            Object value = object.get(key);\n\n            if (value instanceof JSONArray) {\n                value = toList((JSONArray) value);\n            } else if (value instanceof JSONObject) {\n                value = toMap((JSONObject) value);\n            }\n            map.put(key, value);\n        }\n        return map;\n    }\n\n    public static List<Object> toList(JSONArray array) throws JSONException {\n        List<Object> list = new ArrayList<Object>();\n        for (int i = 0; i < array.length(); i++) {\n            Object value = array.get(i);\n            if (value instanceof JSONArray) {\n                value = toList((JSONArray) value);\n            } else if (value instanceof JSONObject) {\n                value = toMap((JSONObject) value);\n            }\n            list.add(value);\n        }\n        return list;\n    }\n    // END code of Vikas Gupta from stackoverflow\n\n    public static String mapToConsoleOutput(Map<String, Object> map) {\n        String consoleOutput = \"\";\n\n        for (Map.Entry<String, Object> entry : map.entrySet()) {\n            consoleOutput += entry.getKey() + \" = \" + entry.getValue().toString();\n            consoleOutput += newLine;\n        }\n\n        return (consoleOutput);\n    }\n\n    public static String arrayValueMatchRegex(String[] array, String regex) {\n        Pattern p = Pattern.compile(regex);\n\n        for (int i = 0; i < array.length; i++) {\n            Matcher m = p.matcher(array[i]);\n\n            while (m.find()) {\n                try {\n                    return (m.group(1));\n                } catch (Exception ignored) {\n                    //possible IndexOutOfBoundsException\n                }\n            }\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AboutActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.os.Bundle;\nimport androidx.appcompat.app.ActionBar;\nimport androidx.appcompat.app.AppCompatActivity;\nimport android.text.method.LinkMovementMethod;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.BuildConfig;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * Activity displaying information about Privacy Friendly Net Monitor App\n */\npublic class AboutActivity extends AppCompatActivity {\n\n    /**\n     *\n     * @param savedInstanceState\n     */\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_about);\n        RunStore.setContext(this);\n\n        ActionBar ab = getSupportActionBar();\n        if (ab != null) {\n            ab.setDisplayHomeAsUpEnabled(true);\n        }\n\n        View mainContent = findViewById(R.id.main_content);\n        if (mainContent != null) {\n            mainContent.setAlpha(0);\n            mainContent.animate().alpha(1).setDuration(BaseActivity.MAIN_CONTENT_FADEIN_DURATION);\n        }\n\n        overridePendingTransition(0, 0);\n\n        ((TextView) findViewById(R.id.javaAPIURL)).setMovementMethod(LinkMovementMethod.getInstance());\n        ((TextView) findViewById(R.id.APIURL)).setMovementMethod(LinkMovementMethod.getInstance());\n        ((TextView) findViewById(R.id.secusoWebsite)).setMovementMethod(LinkMovementMethod.getInstance());\n        ((TextView) findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance());\n        ((TextView) findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME);\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/AppListRecyclerAdapter.java",
    "content": "package org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport androidx.appcompat.widget.SwitchCompat;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.CompoundButton;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.sql.Date;\nimport java.text.SimpleDateFormat;\nimport java.util.List;\n\n/**\n * Created by tobias on 09.03.18.\n */\n\npublic class AppListRecyclerAdapter extends RecyclerView.Adapter<AppListRecyclerAdapter.ViewHolder>{\n\n    private List<String> app_list_name;\n\n    private Context context;\n\n\n    private SharedPreferences selectedAppsPreferences;\n    private SharedPreferences.Editor editor;\n\n    public static class ViewHolder extends RecyclerView.ViewHolder {\n        // each data item is just a string in this case\n        public TextView appGroupTitle;\n        public TextView appInstallDate;\n        public ImageView appIcon;\n        public SwitchCompat appSwitch;\n\n        public String appFullName;\n\n\n        public ViewHolder(View view) {\n            super(view);\n            this.appGroupTitle = (TextView) view.findViewById(R.id.appGroupTitle);\n            this.appInstallDate = (TextView) view.findViewById(R.id.appInstalledOn);\n            this.appIcon = (ImageView) view.findViewById(R.id.appGroupIcon);\n            this.appSwitch = (SwitchCompat) view.findViewById(R.id.switchAppOnOffHistory);\n            this.appFullName = \"\";\n\n        }\n    }\n\n    public AppListRecyclerAdapter(List<String> app_list_name, Context context) {\n        this.app_list_name = app_list_name;\n        this.context = context;\n\n        selectedAppsPreferences = context.getSharedPreferences(\"SELECTEDAPPS\", 0);\n        editor = selectedAppsPreferences.edit();\n\n    }\n\n    @Override\n    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n        // create a new view\n        View itemView = LayoutInflater.from(parent.getContext())\n                .inflate(R.layout.app_list_group, parent, false);\n        return new ViewHolder(itemView);\n\n    }\n\n    @Override\n    public void onBindViewHolder(final ViewHolder holder, final int position) {\n          String appName = app_list_name.get(position);\n          holder.appFullName = appName;\n\n        if (Collector.getAppsToIncludeInScan().contains(holder.appFullName)) {\n            holder.appSwitch.setChecked(true);\n        } else {\n            holder.appSwitch.setChecked(false);\n        }\n\n        PackageManager packageManager = context.getPackageManager();\n\n        try {\n            holder.appGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));\n\n            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd. MMM yyyy, HH:mm\");\n            Date date = new Date(packageManager.getPackageInfo(appName, 0).firstInstallTime);\n            holder.appInstallDate.setText(\"Installed:  \" + simpleDateFormat.format(date));\n\n            holder.appIcon.setImageDrawable(packageManager.getApplicationIcon(appName));\n        } catch (PackageManager.NameNotFoundException e) {\n\n        }\n\n        holder.appSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n            @Override\n            public void onCheckedChanged(CompoundButton compoundButton, boolean bChecked) {\n\n                String appName = holder.appFullName;\n                if (bChecked) {\n                    if (!Collector.getAppsToIncludeInScan().contains(appName)) {\n                        Collector.addAppToIncludeInScan(appName);\n                        editor.putString(appName, appName);\n                        editor.commit();\n                        holder.appSwitch.setChecked(true);\n                    }\n                } else {\n                    if (Collector.getAppsToIncludeInScan().contains(appName)) {\n                        Collector.deleteAppFromIncludeInScan(appName);\n                        editor.remove(appName);\n                        editor.commit();\n                        holder.appSwitch.setChecked(false);\n                    }\n                }\n            }\n        });\n\n    }\n\n    @Override\n    public int getItemCount() {\n        return app_list_name.size();\n    }\n\n\n}\n\n\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableHistoryListAdapter.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.content.pm.PackageManager;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseExpandableListAdapter;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Created by m4rc0 on 04.12.2017.\n * Adapter to display the Apps in the history\n */\n\npublic class ExpandableHistoryListAdapter extends BaseExpandableListAdapter {\n\n    private Context context;\n    private List<String> uidList;\n    private HashMap<String, List<ReportEntity>> reportListDetail;\n\n    /**\n     *\n     * @param context\n     * @param uidList\n     * @param reportListDetail\n     */\n    public ExpandableHistoryListAdapter(Context context, List<String> uidList,\n                                        HashMap<String, List<ReportEntity>> reportListDetail) {\n        this.context = context;\n        this.uidList = uidList;\n        this.reportListDetail = reportListDetail;\n\n    }\n\n    /**\n     * @param groupPosition\n     * @param childPosititon\n     * @return child\n     */\n    @Override\n    public Object getChild(int groupPosition, int childPosititon) {\n        return this.reportListDetail.get(this.uidList.get(groupPosition))\n                .get(childPosititon);\n    }\n\n    /**\n     * @param groupPosition\n     * @param childPosition\n     * @return child id\n     */\n    @Override\n    public long getChildId(int groupPosition, int childPosition) {\n        return childPosition;\n    }\n\n    /**\n     * @param groupPosition\n     * @param childPosition\n     * @param isLastChild\n     * @param convertView\n     * @param parent\n     * @return chield view\n     */\n    @Override\n    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {\n\n        ReportEntity reportEntity = ((ReportEntity) getChild(groupPosition, childPosition));\n        final String dnsHostName = reportEntity.getRemoteHost();\n\n        if (convertView == null) {\n            LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = layoutInflater.inflate(R.layout.history_list_item, null);\n        }\n\n        TextView txtListChild = (TextView) convertView.findViewById(R.id.history_item_1);\n        txtListChild.setText(dnsHostName);\n\n        TextView history_item_2_type = (TextView) convertView.findViewById(R.id.history_item_2_type);\n        history_item_2_type.setText(R.string.expandable_history_list_adapter_time_stamp);\n\n        TextView history_item_2_val = (TextView) convertView.findViewById(R.id.history_item_2_val);\n        history_item_2_val.setText(reportEntity.getTimeStamp());\n\n        return convertView;\n    }\n\n    /**\n     * @param groupPosition\n     * @return children count\n     */\n    @Override\n    public int getChildrenCount(int groupPosition) {\n        return this.reportListDetail.get(this.uidList.get(groupPosition)).size();\n    }\n\n    /**\n     * @param groupPosition\n     * @return group\n     */\n    @Override\n    public Object getGroup(int groupPosition) {\n        return this.reportListDetail.get(groupPosition);\n    }\n\n\n    /**\n     * @return group count\n     */\n    @Override\n    public int getGroupCount() {\n        return this.reportListDetail.size();\n    }\n\n    /**\n     * @param groupPosition\n     * @return group Position as ID\n     */\n    @Override\n    public long getGroupId(int groupPosition) {\n        return groupPosition;\n    }\n\n    /**\n     * @param groupPosition\n     * @param isExpanded\n     * @param convertView\n     * @param parent\n     * @return group View\n     */\n    @Override\n    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {\n\n        LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n        convertView = layoutInflater.inflate(R.layout.history_list_group, null);\n        String appName = \"\";\n        PackageManager packageManager = context.getPackageManager();\n\n        try {\n            appName = reportListDetail.get(uidList.get(groupPosition)).get(0).getAppName();\n        } catch (IndexOutOfBoundsException e) {\n            if (Collector.getKnownUIDs().containsKey(uidList.get(groupPosition))) {\n                appName = Collector.getKnownUIDs().get(uidList.get(groupPosition));\n            } else {\n                appName = packageManager.getNameForUid((new Integer(uidList.get(groupPosition))));\n            }\n        }\n\n        TextView historyGroupTitle = (TextView) convertView.findViewById(R.id.historyGroupTitle);\n        TextView historyGroupSubtitle = (TextView) convertView.findViewById(R.id.historyGroupSubtitle);\n\n        try {\n//            if(reportListDetail == null || reportListDetail.isEmpty() || reportListDetail.get(appName) == null || reportListDetail.get(appName).isEmpty()){\n            if(getChildrenCount(groupPosition) != 0){\n                historyGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));\n            } else {\n                historyGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)) + \" \" + context.getString(R.string.history_no_data_collected));\n            }\n        } catch (PackageManager.NameNotFoundException e) {\n            historyGroupTitle.setText(appName);\n        }\n\n        historyGroupSubtitle.setText(appName);\n\n        ImageView imgView = (ImageView) convertView.findViewById(R.id.historyGroupIcon);\n\n        try {\n            imgView.setImageDrawable(packageManager.getApplicationIcon(appName));\n        } catch (PackageManager.NameNotFoundException e) {\n            e.printStackTrace();\n        }\n\n        return convertView;\n    }\n\n    @Override\n    public boolean hasStableIds() {\n        return false;\n    }\n\n    @Override\n    public boolean isChildSelectable(int groupPosition, int childPosition) {\n        return true;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableListAdapter.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.graphics.Typeface;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseExpandableListAdapter;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Adapter displaying contents in the help activity\n * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial\n * last access 27th October 2016\n */\n\npublic class ExpandableListAdapter extends BaseExpandableListAdapter {\n\n    private Context context;\n    private List<String> expandableListTitle;\n    private HashMap<String, List<String>> expandableListDetail;\n\n    /**\n     *\n     * @param context\n     * @param expandableListTitle\n     * @param expandableListDetail\n     */\n    public ExpandableListAdapter(Context context, List<String> expandableListTitle,\n                                 HashMap<String, List<String>> expandableListDetail) {\n        this.context = context;\n        this.expandableListTitle = expandableListTitle;\n        this.expandableListDetail = expandableListDetail;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return child\n     */\n    @Override\n    public Object getChild(int listPosition, int expandedListPosition) {\n        return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))\n                .get(expandedListPosition);\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return child id\n     */\n    @Override\n    public long getChildId(int listPosition, int expandedListPosition) {\n        return expandedListPosition;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @param isLastChild\n     * @param convertView\n     * @param parent\n     * @return child view\n     */\n    @Override\n    public View getChildView(int listPosition, final int expandedListPosition,\n                             boolean isLastChild, View convertView, ViewGroup parent) {\n        final String expandedListText = (String) getChild(listPosition, expandedListPosition);\n        if (convertView == null) {\n            LayoutInflater layoutInflater = (LayoutInflater) this.context\n                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = layoutInflater.inflate(R.layout.help_list_item, null);\n        }\n        TextView expandedListTextView = (TextView) convertView\n                .findViewById(R.id.expandedListItem);\n        expandedListTextView.setText(expandedListText);\n        return convertView;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return children count\n     */\n    @Override\n    public int getChildrenCount(int listPosition) {\n        return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))\n                .size();\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return group\n     */\n    @Override\n    public Object getGroup(int listPosition) {\n        return this.expandableListTitle.get(listPosition);\n    }\n\n    /**\n     * group count\n     * @return\n     */\n    @Override\n    public int getGroupCount() {\n        return this.expandableListTitle.size();\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return group id\n     */\n    @Override\n    public long getGroupId(int listPosition) {\n        return listPosition;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param isExpanded\n     * @param convertView\n     * @param parent\n     * @return group view\n     */\n    @Override\n    public View getGroupView(int listPosition, boolean isExpanded,\n                             View convertView, ViewGroup parent) {\n        String listTitle = (String) getGroup(listPosition);\n        if (convertView == null) {\n            LayoutInflater layoutInflater = (LayoutInflater) this.context.\n                    getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = layoutInflater.inflate(R.layout.help_list_group, null);\n        }\n        TextView listTitleTextView = (TextView) convertView\n                .findViewById(R.id.listTitle);\n        listTitleTextView.setTypeface(null, Typeface.BOLD);\n        listTitleTextView.setText(listTitle);\n        return convertView;\n    }\n\n    /**\n     *\n     * @return false\n     */\n    @Override\n    public boolean hasStableIds() {\n        return false;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return true\n     */\n    @Override\n    public boolean isChildSelectable(int listPosition, int expandedListPosition) {\n        return true;\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/ExpandableReportAdapter.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.graphics.Typeface;\nimport android.preference.PreferenceManager;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseExpandableListAdapter;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.KnownPorts;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Adapter displaying information in the ReportActivity\n */\npublic class ExpandableReportAdapter extends BaseExpandableListAdapter {\n\n    private Context context;\n    private List<Integer> uidList;\n    private HashMap<Integer, List<Report>> reportListDetail;\n\n    /**\n     *\n     * @param context\n     * @param expandableListTitle\n     * @param expandableListDetail\n     */\n    public ExpandableReportAdapter(Context context, List<Integer> expandableListTitle,\n                                   HashMap<Integer, List<Report>> expandableListDetail) {\n        this.context = context;\n        this.uidList = expandableListTitle;\n        this.reportListDetail = expandableListDetail;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return child\n     */\n    @Override\n    public Object getChild(int listPosition, int expandedListPosition) {\n        return this.reportListDetail.get(this.uidList.get(listPosition))\n                .get(expandedListPosition);\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return child id\n     */\n    @Override\n    public long getChildId(int listPosition, int expandedListPosition) {\n        return expandedListPosition;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @param isLastChild\n     * @param convertView\n     * @param parent\n     * @return child view\n     */\n    @Override\n    public View getChildView(int listPosition, final int expandedListPosition, boolean isLastChild,\n                             View convertView, ViewGroup parent) {\n\n        //Build information from reports of one App (UID)\n        Report r = (Report) getChild(listPosition, expandedListPosition);\n        final String item1;\n        final String item2_type;\n        final String item2_value;\n\n        //Set hostname if resolved by AsyncDNS class\n        if (Collector.hasHostName(r.remoteAdd.getHostAddress())) {\n            item1 = Collector.getDnsHostName(r.remoteAdd.getHostAddress());\n        } else {\n            item1 = \"\" + r.remoteAdd.getHostAddress();\n        }\n        //Set connection info or server rating\n        if (Collector.isCertVal && KnownPorts.isTlsPort(r.remotePort) && Collector.hasHostName(r.remoteAdd.getHostAddress())) {\n            if (item1.equals(Collector.getCertHost(item1))) {\n                item2_type = \"SSL Server Rating:\";\n                item2_value = Collector.getMetric(item1);\n            } else {\n                item2_type = \"SSL Server Rating:\";\n                if (item1.equals(Collector.getCertHost(item1))) {\n                    item2_value = Collector.getMetric(item1);\n                } else {\n                    item2_value = Collector.getMetric(item1) + \" (\" + Collector.getCertHost(item1)\n                            + \")\";\n                }\n            }\n        } else {\n            item2_type = \"Connection Info:\";\n            item2_value = KnownPorts.CompileConnectionInfo(r.remotePort, r.type);\n        }\n\n        if (convertView == null) {\n            LayoutInflater layoutInflater = (LayoutInflater) this.context\n                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = layoutInflater.inflate(R.layout.report_list_item, null);\n        }\n\n        //Fill textviews\n        TextView textView = (TextView) convertView.findViewById(R.id.report_item_1);\n        //final int height = textView.getHeight();\n        textView.setText(item1);\n        textView = (TextView) convertView.findViewById(R.id.report_item_2_type);\n        textView.setText(item2_type);\n        textView = (TextView) convertView.findViewById(R.id.report_item_2_val);\n        textView.setText(item2_value);\n\n        //Set warning colour if settings are set\n        SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n        textView.setTextColor(context.getResources().getColor(getWarningColor(item2_value)));\n        if (!mSharedPreferences.getBoolean(Const.IS_HIGHLIGHTED, true)) {\n            textView.setTextColor((int) R.color.text_dark);\n        }\n\n        return convertView;\n    }\n\n    /**\n     * Get the warning color of a connection.\n     * @param value\n     * @return warning color as int\n     */\n    private int getWarningColor(String value) {\n        if (value.contains(Const.STATUS_TLS) || value.substring(0, 1).equals(\"A\")) {\n            return (R.color.green);\n        } else if (value.contains(Const.STATUS_INCONCLUSIVE) || value.substring(0, 1).equals(\"B\") || value.substring(0, 1).equals(\"C\")) {\n            return (R.color.orange);\n        } else if (value.contains(Const.STATUS_UNSECURE) || value.substring(0, 1).equals(\"T\") ||\n                value.substring(0, 1).equals(\"F\") || value.substring(0, 1).equals(\"D\") ||\n                value.substring(0, 1).equals(\"E\")) {\n            return R.color.red;\n        } else {\n            return R.color.text_dark;\n        }\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return children count\n     */\n    @Override\n    public int getChildrenCount(int listPosition) {\n        return this.reportListDetail.get(this.uidList.get(listPosition))\n                .size();\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return group\n     */\n    @Override\n    public Object getGroup(int listPosition) {\n        return this.uidList.get(listPosition);\n    }\n\n    /**\n     *\n     * @return group count\n     */\n    @Override\n    public int getGroupCount() {\n        return this.uidList.size();\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @return group id\n     */\n    @Override\n    public long getGroupId(int listPosition) {\n        return listPosition;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param isExpanded\n     * @param convertView\n     * @param parent\n     * @return group view\n     */\n    @Override\n    public View getGroupView(int listPosition, boolean isExpanded,\n                             View convertView, ViewGroup parent) {\n        int uid = (int) getGroup(listPosition);\n        if (convertView == null) {\n            LayoutInflater layoutInflater = (LayoutInflater) this.context.\n                    getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = layoutInflater.inflate(R.layout.report_list_group, null);\n        }\n        TextView textViewTitle = (TextView) convertView.findViewById(R.id.reportGroupTitle);\n        textViewTitle.setTypeface(null, Typeface.BOLD);\n        TextView textViewSubtitle = (TextView) convertView.findViewById(R.id.reportGroupSubtitle);\n        ImageView imgView = (ImageView) convertView.findViewById(R.id.reportGroupIcon);\n\n        //add system app tag\n        if (uid <= 10000) {\n            textViewTitle.setText(Collector.getLabel(uid) +\n                    \" (\" + reportListDetail.get(uid).size() + \")\" + \" [System]\");\n        } else {\n            textViewTitle.setText(Collector.getLabel(uid) +\n                    \" (\" + reportListDetail.get(uid).size() + \")\");\n        }\n        textViewSubtitle.setText(Collector.getPackage(uid));\n        imgView.setImageDrawable(Collector.getIcon(uid));\n\n        return convertView;\n    }\n\n    /**\n     *\n     * @return false\n     */\n    @Override\n    public boolean hasStableIds() {\n        return false;\n    }\n\n    /**\n     *\n     * @param listPosition\n     * @param expandedListPosition\n     * @return true\n     */\n    @Override\n    public boolean isChildSelectable(int listPosition, int expandedListPosition) {\n        return true;\n    }\n\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/FragmentDayListAdapter.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.RelativeLayout;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.HistoryDetailActivity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.sql.Date;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by m4rc0 on 14.01.2018.\n * Adapter adds reports to day, week and month fragments.\n */\npublic class FragmentDayListAdapter extends RecyclerView.Adapter<FragmentDayListAdapter.ViewHolder> {\n\n    List<ReportEntity> reportEntities;\n    Context context;\n\n    /**\n     *\n     * @param reportEntities\n     * @param context\n     */\n    public FragmentDayListAdapter(List<ReportEntity> reportEntities, Context context) {\n        this.reportEntities = reportEntities;\n        this.context = context;\n    }\n\n    /**\n     * View Holder for items.\n     */\n    public static class ViewHolder extends RecyclerView.ViewHolder {\n\n        public RelativeLayout relativeLayout;\n\n        public ViewHolder(RelativeLayout itemView) {\n            super(itemView);\n            relativeLayout = itemView;\n        }\n    }\n\n    /**\n     *\n     * @param parent\n     * @param viewType\n     * @return ViewHolder\n     */\n    @Override\n    public FragmentDayListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n        RelativeLayout relativeLayout = (RelativeLayout) LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_list_item, parent, false);\n\n        ViewHolder vh = new ViewHolder(relativeLayout);\n        return vh;\n    }\n\n    /**\n     *\n     * @param holder\n     * @param position\n     */\n    @Override\n    public void onBindViewHolder(FragmentDayListAdapter.ViewHolder holder, int position) {\n\n        final ReportEntity reportEntity = reportEntities.get(position);\n\n        TextView textViewAppName = holder.relativeLayout.findViewById(R.id.fragment_appname);\n        TextView textViewTimestamp = holder.relativeLayout.findViewById(R.id.fragment_timestamp_value);\n        TextView textViewConnectionInfo = holder.relativeLayout.findViewById(R.id.fragment_conncection_info_value);\n\n        textViewAppName.setText(reportEntity.getRemoteAddress());\n        textViewTimestamp.setText(reportEntity.getTimeStamp());\n        textViewConnectionInfo.setText(reportEntity.getConnectionInfo());\n\n        holder.relativeLayout.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                List<String> detailsList = prepareData(reportEntity);\n                Intent intent = new Intent(context, HistoryDetailActivity.class);\n                intent.putExtra(\"Details\", (ArrayList) detailsList);\n                context.startActivity(intent);\n\n            }\n        });\n    }\n\n    /**\n     *\n     * @return item count\n     */\n    @Override\n    public int getItemCount() {\n        return reportEntities.size();\n    }\n\n    /**\n     *\n     * @param reportEntity\n     * @return list with prepared data\n     */\n    private List<String> prepareData(ReportEntity reportEntity) {\n\n        PackageManager packageManager = context.getPackageManager();\n\n        String details = \"\";\n        List<String> detailsList = new ArrayList<String>();\n\n        String appName = reportEntity.getAppName();\n        detailsList.add(appName);\n\n        String uid = reportEntity.getUserID();\n        detailsList.add(uid);\n\n        PackageInfo packageInfo = null;\n\n        try {\n            packageInfo = packageManager.getPackageInfo(appName, 0);\n        } catch (PackageManager.NameNotFoundException e) {\n            System.out.println(\"Could not find package info for \" + appName + \".\");\n        }\n\n        details = packageInfo.versionName;\n        detailsList.add(details);\n\n        details = new Date(packageInfo.firstInstallTime).toString();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteAddress();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteHex();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteHost();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalAddress();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalHex();\n        detailsList.add(details);\n\n        details = reportEntity.getServicePort();\n        detailsList.add(details);\n\n        details = reportEntity.getPayloadProtocol();\n        detailsList.add(details);\n\n        details = reportEntity.getTransportProtocol();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalPort();\n        detailsList.add(details);\n\n        details = reportEntity.getTimeStamp();\n        detailsList.add(details);\n\n        details = reportEntity.getConnectionInfo();\n        detailsList.add(details);\n\n        return detailsList;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/PagerAdapter.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities.Adapter;\n\nimport android.os.Bundle;\nimport androidx.fragment.app.Fragment;\nimport androidx.fragment.app.FragmentManager;\nimport androidx.fragment.app.FragmentStatePagerAdapter;\n\nimport org.secuso.privacyfriendlynetmonitor.fragment.Fragment_day;\nimport org.secuso.privacyfriendlynetmonitor.fragment.Fragment_month;\nimport org.secuso.privacyfriendlynetmonitor.fragment.Fragment_week;\n\n/**\n * Created by tobias on 04.01.18.\n * Adapter for fragment pager.\n */\npublic class PagerAdapter extends FragmentStatePagerAdapter {\n    int mNumOfTabs;\n    Bundle data;\n\n    /**\n     *\n     * @param fm\n     * @param NumOfTabs\n     * @param appSubName\n     */\n    public PagerAdapter(FragmentManager fm, int NumOfTabs, String appSubName) {\n        super(fm);\n        this.mNumOfTabs = NumOfTabs;\n        data = new Bundle();\n        data.putString(\"AppName\", appSubName);\n    }\n\n    /**\n     *\n     * @param position\n     * @return item\n     */\n    @Override\n    public Fragment getItem(int position) {\n        switch (position) {\n            case 0:\n                Fragment_day tab_day = new Fragment_day();\n                tab_day.setArguments(data);\n                return tab_day;\n            case 1:\n                Fragment_week tab_week = new Fragment_week();\n                tab_week.setArguments(data);\n                return tab_week;\n            case 2:\n                Fragment_month tab_month = new Fragment_month();\n                tab_month.setArguments(data);\n                return tab_month;\n            default:\n                return null;\n        }\n    }\n\n    /**\n     *\n     * @return number of tabs\n     */\n    @Override\n    public int getCount() {\n        return mNumOfTabs;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AppConnections_Chart.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.os.Bundle;\nimport com.google.android.material.tabs.TabLayout;\nimport androidx.viewpager.widget.ViewPager;\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.PagerAdapter;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * Created by tobias on 04.01.18.\n * App Connection chart class to visualize reports in different time intervals.\n */\npublic class AppConnections_Chart extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        String appName = getIntent().getStringExtra((\"AppName\"));\n        setTitle(appName);\n        String appSubName = getIntent().getStringExtra((\"AppSubName\"));\n\n\n        setContentView(R.layout.app_report_detail_layout);\n\n        TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);\n        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_day));\n        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_week));\n        tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_month));\n        tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n\n        final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);\n        final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(),\n                appSubName);\n        viewPager.setAdapter(adapter);\n        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));\n        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n\n            @Override\n            public void onTabSelected(TabLayout.Tab tab) {\n                viewPager.setCurrentItem(tab.getPosition());\n            }\n\n            @Override\n            public void onTabUnselected(TabLayout.Tab tab) {\n\n            }\n\n            @Override\n            public void onTabReselected(TabLayout.Tab tab) {\n\n            }\n        });\n\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/BaseActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.preference.PreferenceActivity;\nimport android.preference.PreferenceManager;\nimport com.google.android.material.navigation.NavigationView;\nimport com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener;\nimport androidx.core.app.TaskStackBuilder;\nimport androidx.core.view.GravityCompat;\nimport androidx.drawerlayout.widget.DrawerLayout;\nimport androidx.appcompat.app.ActionBarDrawerToggle;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.appcompat.widget.Toolbar;\nimport android.view.MenuItem;\nimport android.view.View;\n\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * Base activity for other activities\n */\npublic class BaseActivity extends AppCompatActivity implements OnNavigationItemSelectedListener {\n\n    // delay to launch nav drawer item, to allow close animation to play\n    static final int NAVDRAWER_LAUNCH_DELAY = 250;\n    // fade in and fade out durations for the main content when switching between\n    // different Activities of the app through the Nav Drawer\n    static final int MAIN_CONTENT_FADEOUT_DURATION = 150;\n    static final int MAIN_CONTENT_FADEIN_DURATION = 250;\n\n    // Navigation drawer:\n    DrawerLayout mDrawerLayout;\n    NavigationView mNavigationView;\n\n    // Helper\n    private Handler mHandler;\n    protected SharedPreferences mSharedPreferences;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        //setContentView(R.layout.activity_main);\n\n        mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n        mHandler = new Handler();\n\n        //ActionBar ab = getSupportActionBar();\n        //if (ab != null) {\n        //    mActionBar = ab;\n        //    ab.setDisplayHomeAsUpEnabled(true);\n        //}\n\n        overridePendingTransition(0, 0);\n    }\n\n    @Override\n    public void onBackPressed() {\n        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n        if (drawer.isDrawerOpen(GravityCompat.START)) {\n            drawer.closeDrawer(GravityCompat.START);\n        } else {\n            super.onBackPressed();\n        }\n    }\n\n    protected int getNavigationDrawerID() {\n        return 0;\n    }\n\n    @Override\n    public boolean onNavigationItemSelected(MenuItem item) {\n        final int itemId = item.getItemId();\n\n        return goToNavigationItem(itemId);\n    }\n\n    protected boolean goToNavigationItem(final int itemId) {\n\n        if (itemId == getNavigationDrawerID()) {\n            // just close drawer because we are already in this activity\n            mDrawerLayout.closeDrawer(GravityCompat.START);\n            return true;\n        }\n\n        // delay transition so the drawer can close\n        mHandler.postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                callDrawerItem(itemId);\n            }\n        }, NAVDRAWER_LAUNCH_DELAY);\n\n        mDrawerLayout.closeDrawer(GravityCompat.START);\n\n        selectNavigationItem(itemId);\n\n        // fade out the active activity\n        View mainContent = findViewById(R.id.main_content);\n        if (mainContent != null) {\n            mainContent.animate().alpha(0).setDuration(MAIN_CONTENT_FADEOUT_DURATION);\n        }\n        return true;\n    }\n\n    // set active navigation item\n    void selectNavigationItem(int itemId) {\n        for (int i = 0; i < mNavigationView.getMenu().size(); i++) {\n            boolean b = itemId == mNavigationView.getMenu().getItem(i).getItemId();\n            mNavigationView.getMenu().getItem(i).setChecked(b);\n        }\n    }\n\n    /**\n     * Enables back navigation for activities that are launched from the NavBar. See\n     * {@code AndroidManifest.xml} to find out the parent activity names for each activity.\n     *\n     * @param intent\n     */\n    private void createBackStack(Intent intent) {\n        TaskStackBuilder builder = TaskStackBuilder.create(this);\n        builder.addNextIntentWithParentStack(intent);\n        builder.startActivities();\n    }\n\n    private void callDrawerItem(final int itemId) {\n\n        Intent intent;\n\n        switch (itemId) {\n            case R.id.nav_main:\n                intent = new Intent(this, MainActivity.class);\n                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n                startActivity(intent);\n                break;\n            case R.id.nav_history:\n                intent = new Intent(this, HistoryActivity.class);\n                createBackStack(intent);\n                break;\n            case R.id.nav_about:\n                intent = new Intent(this, AboutActivity.class);\n                createBackStack(intent);\n                break;\n            case R.id.nav_help:\n                intent = new Intent(this, HelpActivity.class);\n                createBackStack(intent);\n                break;\n            case R.id.nav_settings:\n                intent = new Intent(this, SettingsActivity.class);\n                intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName());\n                intent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true);\n                createBackStack(intent);\n                break;\n            case R.id.nav_tutorial:\n                TutorialActivity.setTutorial_click(true);\n                intent = new Intent(this, TutorialActivity.class);\n                createBackStack(intent);\n                break;\n            default:\n        }\n    }\n\n    @Override\n    protected void onPostCreate(Bundle savedInstanceState) {\n        super.onPostCreate(savedInstanceState);\n        setToolbar();\n    }\n\n    public void setToolbar() {\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        if (getSupportActionBar() == null) {\n            setSupportActionBar(toolbar);\n        }\n\n        mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(\n                this, mDrawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);\n        mDrawerLayout.addDrawerListener(toggle);\n        toggle.syncState();\n\n        mNavigationView = (NavigationView) findViewById(R.id.nav_view);\n        mNavigationView.setNavigationItemSelectedListener(this);\n\n        selectNavigationItem(getNavigationDrawerID());\n\n        View mainContent = findViewById(R.id.main_content);\n        if (mainContent != null) {\n            mainContent.setAlpha(0);\n            mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);\n        }\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.os.Bundle;\nimport android.widget.ExpandableListView;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableListAdapter;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Activity for help contents\n * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial\n */\n\npublic class HelpActivity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_help);\n        RunStore.setContext(this);\n\n        ExpandableListAdapter expandableListAdapter;\n        HelpDataDump helpDataDump = new HelpDataDump(this);\n\n        ExpandableListView generalExpandableListView = (ExpandableListView) findViewById(R.id.generalExpandableListView);\n\n        HashMap<String, List<String>> expandableListDetail = helpDataDump.getDataGeneral();\n        List<String> expandableListTitleGeneral = new ArrayList<>(expandableListDetail.keySet());\n        expandableListAdapter = new ExpandableListAdapter(this, expandableListTitleGeneral, expandableListDetail);\n        generalExpandableListView.setAdapter(expandableListAdapter);\n\n        overridePendingTransition(0, 0);\n    }\n\n    protected int getNavigationDrawerID() {\n        return R.id.nav_help;\n    }\n\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpDataDump.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Context;\n\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.LinkedHashMap;\nimport java.util.List;\n\n/**\n * Activity for displaying help content.\n * <p>\n * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial\n * last access 27th October 2016\n */\n\nclass HelpDataDump {\n\n    private Context context;\n\n    HelpDataDump(Context context) {\n        this.context = context;\n    }\n\n    HashMap<String, List<String>> getDataGeneral() {\n        HashMap<String, List<String>> expandableListDetail = new LinkedHashMap<>();\n\n        List<String> general = new ArrayList<>();\n        general.add(context.getResources().getString(R.string.help_whatis_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_whatis), general);\n\n        List<String> features1 = new ArrayList<>();\n        features1.add(context.getResources().getString(R.string.help_feature_one_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_feature_one), features1);\n\n        List<String> features2 = new ArrayList<>();\n        features2.add(context.getResources().getString(R.string.help_feature_two_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_feature_two), features2);\n\n        List<String> features3 = new ArrayList<>();\n        features3.add(context.getResources().getString(R.string.help_feature_three_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_feature_three), features3);\n\n        List<String> features4 = new ArrayList<>();\n        features4.add(context.getResources().getString(R.string.help_feature_four_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_feature_four), features4);\n\n        List<String> features5 = new ArrayList<>();\n        features5.add(context.getResources().getString(R.string.help_feature_five_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_feature_five), features5);\n\n        List<String> privacy = new ArrayList<>();\n        privacy.add(context.getResources().getString(R.string.help_privacy_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_privacy), privacy);\n\n        List<String> permissions = new ArrayList<>();\n        permissions.add(context.getResources().getString(R.string.help_permission_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_permission), permissions);\n\n        List<String> sysuser = new ArrayList<>();\n        sysuser.add(context.getResources().getString(R.string.help_sysuser_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_sysuser), sysuser);\n\n        List<String> un_encrypted_ports = new ArrayList<>();\n        un_encrypted_ports.add(context.getResources().getString(R.string.help_un_encrypted_ports_answer));\n        expandableListDetail.put(context.getResources().getString(R.string.help_un_encrypted_ports), un_encrypted_ports);\n\n        return expandableListDetail;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.app.AlertDialog;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\nimport androidx.appcompat.widget.Toolbar;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.Button;\nimport android.widget.ExpandableListView;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableHistoryListAdapter;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.sql.Date;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.LinkedHashSet;\nimport java.util.List;\n\n/**\n * Acitivity for handling the history. All the selected Apps are tracked and shown as a history\n */\n\npublic class HistoryActivity extends BaseActivity {\n\n    private ExpandableListView expListView;\n    private ExpandableHistoryListAdapter historyReportAdapter;\n\n    private ReportEntityDao reportEntityDao;\n    private HashMap<String, List<ReportEntity>> historyReportMap;\n    private List<String> keys;\n\n    private SharedPreferences selectedAppsPreferences;\n    private SharedPreferences.Editor editor;\n    private ProgressBar progressBar;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.activity_history);\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        setSupportActionBar(toolbar);\n\n        progressBar = findViewById(R.id.selectHistoryProgressBar);\n        progressBar.setVisibility(View.GONE);\n\n        // load DB\n        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n\n        selectedAppsPreferences = getSharedPreferences(\"SELECTEDAPPS\", 0);\n        editor = selectedAppsPreferences.edit();\n\n        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);\n        fab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                progressBar.setVisibility(View.VISIBLE);\n                startActivity(new Intent(HistoryActivity.this, SelectHistoryAppsActivity.class));\n            }\n        });\n\n        // delete DB\n        Button deleteDB = (Button) findViewById(R.id.deleteDB);\n        deleteDB.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                deleteConfirmation();\n            }\n        });\n\n        activateHistoryView();\n    }\n\n    @Override\n    public void onPostResume() {\n        super.onPostResume();\n        progressBar.setVisibility(View.GONE);\n    }\n\n    private void activateHistoryView() {\n        expListView = (ExpandableListView) findViewById(R.id.list_history);\n        final HashMap<String, List<ReportEntity>> historyReports = provideHistoryReports();\n\n        TextView textView = (TextView) findViewById(R.id.noData);\n        if (historyReports.isEmpty()) {\n            if (textView.getVisibility() == View.INVISIBLE) {\n                textView.setVisibility(View.VISIBLE);\n            }\n        } else {\n\n            if (textView.getVisibility() == View.VISIBLE) {\n                textView.setVisibility(View.INVISIBLE);\n            }\n        }\n\n        historyReportAdapter = new ExpandableHistoryListAdapter(this, new ArrayList<>(historyReports.keySet()), historyReports);\n\n        expListView.setAdapter(historyReportAdapter);\n\n        expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {\n            @Override\n            public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {\n                ReportEntity reportEntity = historyReports.get(keys.get(groupPosition)).get(childPosition);\n                List<String> detailsList = prepareData(reportEntity);\n                Intent intent = new Intent(getBaseContext(), HistoryDetailActivity.class);\n                intent.putExtra(\"Details\", (ArrayList) detailsList);\n                startActivity(intent);\n                return false;\n            }\n        });\n\n        expListView.setOnItemLongClickListener(new ExpandableListView.OnItemLongClickListener() {\n            @Override\n            public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {\n                TextView tx1 = (TextView) view.findViewById(R.id.historyGroupTitle);\n                String appName = tx1.getText().toString();\n                TextView tx2 = (TextView) view.findViewById(R.id.historyGroupSubtitle);\n                String appSubName = tx2.getText().toString();\n                Intent myIntent = new Intent(HistoryActivity.this, AppConnections_Chart.class);\n                myIntent.putExtra(\"AppName\", appName);\n                myIntent.putExtra(\"AppSubName\", appSubName);\n                startActivity(myIntent);\n\n                return false;\n            }\n        });\n    }\n\n    /**\n     * Get details from db entities an save in List\n     *\n     * @param reportEntity\n     * @return details list\n     */\n    private List<String> prepareData(ReportEntity reportEntity) {\n\n        PackageManager packageManager = getPackageManager();\n\n        String details = \"\";\n        List<String> detailsList = new ArrayList<String>();\n\n        String appName = reportEntity.getAppName();\n        detailsList.add(appName);\n\n        String uid = reportEntity.getUserID();\n        detailsList.add(uid);\n\n        PackageInfo packageInfo = null;\n\n        try {\n            packageInfo = packageManager.getPackageInfo(appName, 0);\n        } catch (PackageManager.NameNotFoundException e) {\n            System.out.println(\"Could not find package info for \" + appName + \".\");\n        }\n\n        details = packageInfo.versionName;\n        detailsList.add(details);\n\n        details = new Date(packageInfo.firstInstallTime).toString();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteAddress();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteHex();\n        detailsList.add(details);\n\n        details = reportEntity.getRemoteHost();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalAddress();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalHex();\n        detailsList.add(details);\n\n        details = reportEntity.getServicePort();\n        detailsList.add(details);\n\n        details = reportEntity.getPayloadProtocol();\n        detailsList.add(details);\n\n        details = reportEntity.getTransportProtocol();\n        detailsList.add(details);\n\n        details = reportEntity.getLocalPort();\n        detailsList.add(details);\n\n        details = reportEntity.getTimeStamp();\n        detailsList.add(details);\n\n        details = reportEntity.getConnectionInfo();\n        detailsList.add(details);\n\n        return detailsList;\n    }\n\n    /**\n     * @return HashMap with saved Reports\n     */\n    private HashMap<String, List<ReportEntity>> provideHistoryReports() {\n\n        historyReportMap = new HashMap<String, List<ReportEntity>>();\n        List<String> appendedApps = new ArrayList<String>();\n\n        List<String> userIDs = new ArrayList<String>();\n        List<ReportEntity> allReportEntities = reportEntityDao.loadAll();\n\n        for (ReportEntity reportEntity : allReportEntities) {\n            String userID = reportEntity.getUserID();\n            if (!userIDs.contains(userID)) {\n                userIDs.add(userID);\n                List<ReportEntity> tempReportList = new ArrayList<ReportEntity>();\n                tempReportList.add(reportEntity);\n\n                if (!appendedApps.contains(reportEntity.getAppName())) {\n                    appendedApps.add(reportEntity.getAppName());\n                }\n\n                historyReportMap.put(userID, tempReportList);\n            } else {\n                historyReportMap.get(userID).add(reportEntity);\n            }\n        }\n\n        List<String> appsToInclude = Collector.getAppsToIncludeInScan();\n        if (!appsToInclude.isEmpty()) {\n            appsToInclude = new ArrayList<String>(new LinkedHashSet<String>(appsToInclude));\n            appsToInclude.removeAll(appendedApps);\n            if (!appsToInclude.isEmpty()) {\n                for (String appName : appsToInclude) {\n                    try {\n                        int uid = getPackageManager().getApplicationInfo(appName, 0).uid;\n                        if (!Collector.getKnownUIDs().containsKey(uid)) {\n                            Collector.addKnownUIDs((new String()).valueOf(uid), appName);\n                        }\n                        historyReportMap.put((new String()).valueOf(uid), new ArrayList<ReportEntity>());\n                    } catch (PackageManager.NameNotFoundException e) {\n                    }\n                }\n                appsToInclude.clear();\n            }\n        }\n\n        keys = new ArrayList<>(historyReportMap.keySet());\n\n        for (String key : keys) {\n            Collections.reverse(historyReportMap.get(key));\n        }\n\n        return historyReportMap;\n    }\n\n    @Override\n    public void onResume() {\n        super.onResume();\n        activateHistoryView();\n    }\n\n    protected int getNavigationDrawerID() {\n        return R.id.nav_history;\n    }\n\n\n    /**\n     * show confirmation after deletion.\n     */\n    private void deleteConfirmation() {\n\n        AlertDialog.Builder builder = new AlertDialog.Builder(this);\n        builder.setTitle(R.string.dialogTitle);\n        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n            @Override\n            public void onClick(DialogInterface dialog, int which) {\n\n                reportEntityDao.deleteAll();\n                activateHistoryView();\n                Toast.makeText(getApplicationContext(), \"All reports have been deleted.\", Toast.LENGTH_SHORT).show();\n\n            }\n        });\n        builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {\n            @Override\n            public void onClick(DialogInterface dialog, int which) {\n                Toast.makeText(getApplicationContext(), \"Deletion canceled.\", Toast.LENGTH_SHORT).show();\n            }\n        });\n        System.out.println(\"Building complete\");\n        AlertDialog dialog = builder.create();\n        dialog.show();\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HistoryDetailActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Context;\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport androidx.drawerlayout.widget.DrawerLayout;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.ImageView;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by m4rc0 on 06.12.2017.\n * This actitivty shows the details of on history report.\n */\n\npublic class HistoryDetailActivity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_report_detail);\n        RunStore.setContext(this);\n\n        //Get saved data from report entity\n        List<String> details = getIntent().getStringArrayListExtra(\"Details\");\n        List<String[]> detailList = prepareData(details);\n\n\n        final HistoryDetailActivity.DetailAdapter adapter = new HistoryDetailActivity.DetailAdapter(this, R.layout.report_detail_item, detailList);\n        final ListView listview = (ListView) findViewById(R.id.report_detail_list_view);\n        listview.setAdapter(adapter);\n\n        View view_header = getLayoutInflater().inflate(R.layout.report_list_group_header, null);\n        PackageManager packageManager = this.getPackageManager();\n        String appName = details.get(0);\n\n        ImageView imgView = (ImageView) view_header.findViewById(R.id.reportGroupIcon_header);\n        TextView textView1 = (TextView) view_header.findViewById(R.id.reportGroupTitle_header);\n        TextView textView2 = (TextView) view_header.findViewById(R.id.reportGroupSubtitle_header);\n\n        try {\n            imgView.setImageDrawable(packageManager.getApplicationIcon(appName));\n            textView1.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA)));\n        } catch (PackageManager.NameNotFoundException e) {\n        }\n\n        textView2.setText(appName);\n\n        listview.addHeaderView(view_header);\n    }\n\n    /**\n     * @param unpreparedDetails\n     * @return prepared data as list.\n     */\n    public List<String[]> prepareData(List<String> unpreparedDetails) {\n\n\n        List<String[]> detailsList = new ArrayList<String[]>();\n\n        String[] details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_uid));\n        details[1] = unpreparedDetails.get(1);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_app_version));\n        details[1] = unpreparedDetails.get(2);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_installed_on));\n        details[1] = unpreparedDetails.get(3);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = \"\";\n        details[1] = \"\";\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_remote_address));\n        details[1] = unpreparedDetails.get(4);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_remote_hex));\n        details[1] = unpreparedDetails.get(5);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_remote_host));\n        details[1] = unpreparedDetails.get(6);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_local_address));\n        details[1] = unpreparedDetails.get(7);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_local_hex));\n        details[1] = unpreparedDetails.get(8);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = \"\";\n        details[1] = \"\";\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_service_port));\n        details[1] = unpreparedDetails.get(9);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_payload_protocol));\n        details[1] = unpreparedDetails.get(10);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_transport_protocol));\n        details[1] = unpreparedDetails.get(11);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_local_port));\n        details[1] = unpreparedDetails.get(12);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = \"\";\n        details[1] = \"\";\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_timestamp));\n        details[1] = unpreparedDetails.get(13);\n        detailsList.add(details);\n\n        details = new String[2];\n        details[0] = (getString(R.string.history_detail_activity_connection_info));\n        details[1] = unpreparedDetails.get(14);\n        detailsList.add(details);\n\n        return detailsList;\n    }\n\n    /**\n     * Detail Adapter sets relevant information.\n     */\n    public class DetailAdapter extends ArrayAdapter<String[]> {\n\n        DetailAdapter(Context context, int resource, List<String[]> detailList) {\n            super(context, resource, detailList);\n        }\n\n        @Override\n        public View getView(int position, View convertView, ViewGroup parent) {\n\n            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n            View v = convertView;\n            if (v == null) {\n                LayoutInflater vi;\n                vi = LayoutInflater.from(getContext());\n                v = vi.inflate(R.layout.report_detail_item, null);\n            }\n\n\n            //Get string array and set it to text fields\n\n            String[] detail = getItem(position);\n\n            TextView type = (TextView) v.findViewById(R.id.report_detail_item_type);\n            TextView value = (TextView) v.findViewById(R.id.report_detail_item_value);\n\n            if (detail[0] != null && detail[1] != null) {\n                type.setText(detail[0]);\n                value.setText(detail[1]);\n            } else {\n                type.setText(\"\");\n                value.setText(\"\");\n            }\n            return v;\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/MainActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\n\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\nimport androidx.swiperefreshlayout.widget.SwipeRefreshLayout;\nimport android.util.Log;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.widget.ExpandableListView;\nimport android.widget.ImageView;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableReportAdapter;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.PassiveService;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\n\n/**\n * Activity providing main service controls and reports inspection\n */\npublic class MainActivity extends BaseActivity implements SwipeRefreshLayout.OnRefreshListener {\n\n    private SwipeRefreshLayout swipeRefreshLayout;\n    private ExpandableListView expListView;\n    private HashMap<Integer, List<Report>> reportMap;\n\n    private static ReportEntityDao reportEntityDao;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        RunStore.setContext(this);\n        RunStore.setAppContext(getApplicationContext());\n        //Save context state\n\n        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n\n        // Uncomment to generate Dummy Database Entries\n//        GenerateReportEntities.generateReportEntities(this, reportEntityDao);\n\n        // Load apps to include in scan\n        SharedPreferences selectedAppsPreferences = getSharedPreferences(\"SELECTEDAPPS\", 0);\n        Map<String, String> selectedAppsMap = (Map<String, String>) selectedAppsPreferences.getAll();\n        Collection<String> selectedAppsList = selectedAppsMap.values();\n        for (String appName : selectedAppsList) {\n            if (!Collector.getAppsToIncludeInScan().contains(appName)) {\n                Collector.addAppToIncludeInScan(appName);\n            }\n        }\n\n        Collector.addAppToExcludeFromScan(\"app.android.unknown\");\n        Collector.addAppToExcludeFromScan(\"app.unknown\");\n        Collector.addAppToExcludeFromScan(\"unknown\");\n        //This is an App that is used as an example for the History. In the first start only this is\n        //APP is shown in the list, then selection are possible\n\n        if (!RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {\n            activateMainView();\n        } else {\n            activateReportView();\n        }\n\n        overridePendingTransition(0, 0);\n    }\n\n    // On start button press activate second view (report)\n    private void setButtonListener() {\n        final FloatingActionButton startStop = findViewById(R.id.mainFAB);\n        startStop.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                ProgressBar progressBar = findViewById(R.id.mainProgressBar);\n                progressBar.setVisibility(View.VISIBLE);\n\n                startStopTrigger();\n            }\n        });\n    }\n\n    //Trigger switches between activity, based service running indicator\n    private void startStopTrigger() {\n        if (!RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {\n            if (Const.IS_DEBUG)\n                Log.d(Const.LOG_TAG, getResources().getString(R.string.passive_service_start));\n            RunStore.getServiceHandler().startPassiveService();\n            Intent intent = new Intent(RunStore.getContext(), MainActivity.class);\n            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n            startActivity(intent);\n        } else {\n            if (Const.IS_DEBUG)\n                Log.d(Const.LOG_TAG, getResources().getString(R.string.passive_service_stop));\n            RunStore.getServiceHandler().stopPassiveService();\n            Intent intent = new Intent(RunStore.getContext(), MainActivity.class);\n            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n            startActivity(intent);\n        }\n    }\n\n    //Activate the main layout\n    private void activateMainView() {\n        setContentView(R.layout.activity_main);\n        super.setToolbar();\n\n        final FloatingActionButton startStop = findViewById(R.id.mainFAB);\n        TextView textView = (TextView) findViewById(R.id.main_text_startstop);\n        textView.setText(R.string.main_text_stopped);\n        setButtonListener();\n        getNavigationDrawerID();\n    }\n\n\n    //activate the report layout\n    private void activateReportView() {\n        setContentView(R.layout.activity_report);\n        super.setToolbar();\n        getNavigationDrawerID();\n\n        //Initiate ListView functionality\n        swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);\n        reportMap = Collector.provideSimpleReports(reportEntityDao);\n        expListView = (ExpandableListView) findViewById(R.id.list);\n        final ExpandableReportAdapter reportAdapter = new ExpandableReportAdapter(this, new ArrayList<>(reportMap.keySet()), reportMap);\n        expListView.setAdapter(reportAdapter);\n        swipeRefreshLayout.setOnRefreshListener(this);\n\n        //Showing Swipe Refresh animation on activity create\n        swipeRefreshLayout.post(new Runnable() {\n                                    @Override\n                                    public void run() {\n                                        swipeRefreshLayout.setRefreshing(true);\n                                        refreshAdapter();\n                                    }\n                                }\n        );\n\n        expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {\n            @Override\n            public boolean onChildClick(ExpandableListView expandableListView, View view, final int i, final int i1, final long l) {\n                expListView = (ExpandableListView) findViewById(R.id.list);\n                ExpandableReportAdapter adapter = (ExpandableReportAdapter) expListView.getExpandableListAdapter();\n                final Report r = (Report) adapter.getChild(i, i1);\n\n                if (mSharedPreferences.getBoolean(Const.IS_DETAIL_MODE, false)) {\n                    view.animate().setDuration(500).alpha((float) 0.5)\n                            .withEndAction(new Runnable() {\n                                @Override\n                                public void run() {\n\n                                    Collector.provideDetail(r.uid, r.remoteAddHex);\n                                    Intent intent = new Intent(getApplicationContext(), ReportDetailActivity.class);\n                                    startActivity(intent);\n                                }\n                            });\n                    return true;\n                    // if no detail mode and server analysis is complete, goto SSL Labs\n                } else if (mSharedPreferences.getBoolean(Const.IS_CERTVAL, false) &&\n                        Collector.hasHostName(r.remoteAdd.getHostAddress()) &&\n                        Collector.hasGrade(Collector.getDnsHostName(r.remoteAdd.getHostAddress()))) {\n                    String url = Const.SSLLABS_URL +\n                            Collector.getCertHost(Collector.getDnsHostName(r.remoteAdd.getHostAddress()));\n                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n                    startActivity(browserIntent);\n                    return false;\n                } else {\n                    try{\n                        view.animate().setDuration(500).alpha((float) 0.5)\n                                .withEndAction(new Runnable() {\n                                    @Override\n                                    public void run() {\n\n                                        Collector.provideDetail(r.uid, r.remoteAddHex);\n                                        Intent intent = new Intent(getApplicationContext(), ReportDetailActivity.class);\n                                        startActivity(intent);\n                                    }\n                                });\n                    } catch (Exception e){\n                        return false;\n                    }\n                    return false;\n                }\n            }\n        });\n\n        FloatingActionButton fab = findViewById(R.id.reportFAB);\n        fab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                Collector.saveReports(reportEntityDao);\n                startStopTrigger();\n            }\n        });\n    }\n\n    @Override\n    protected int getNavigationDrawerID() {\n        return R.id.nav_main;\n    }\n\n\n    @Override\n    public void onDestroy() {\n        super.onDestroy();\n    }\n\n    //refresh the adapter-list\n    public void refreshAdapter() {\n        swipeRefreshLayout.setRefreshing(true);\n\n        reportMap = Collector.provideSimpleReports(reportEntityDao);\n        final ExpandableReportAdapter reportAdapter = new ExpandableReportAdapter(this, new ArrayList<>(reportMap.keySet()), reportMap);\n        expListView.setAdapter(reportAdapter);\n\n        //Set swipe text and icon visible, if connections are empty\n        setSwipeInfo((reportAdapter.getGroupCount() > 0));\n        swipeRefreshLayout.setRefreshing(false);\n    }\n\n    //Set information to refresh view, when adapter is empty (no connections scanned yet)\n    private void setSwipeInfo(boolean b) {\n        final ImageView icon = (ImageView) findViewById(R.id.report_empty_icon);\n        final TextView text = (TextView) findViewById(R.id.report_empty_text);\n        if (b) {\n            icon.setVisibility(View.GONE);\n            text.setVisibility(View.GONE);\n        } else {\n            icon.setVisibility(View.VISIBLE);\n            text.setVisibility(View.VISIBLE);\n        }\n    }\n\n    //Refresh the adapter when swipe triggers\n    @Override\n    public void onRefresh() {\n        refreshAdapter();\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        return super.onCreateOptionsMenu(menu);\n    }\n\n    //listener of the toolbar buttons\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n\n        switch (item.getItemId()) {\n            case R.id.action_refresh:\n                refreshAdapter();\n                break;\n            default:\n                break;\n        }\n        return super.onOptionsItemSelected(item);\n    }\n\n    //refresh menu on layout change\n    public boolean onPrepareOptionsMenu(Menu menu) {\n        menu.clear();\n        if (RunStore.getServiceHandler().isServiceRunning(PassiveService.class)) {\n            getMenuInflater().inflate(R.menu.toolbar_menu, menu);\n        }\n        return super.onPrepareOptionsMenu(menu);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/ReportDetailActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport androidx.drawerlayout.widget.DrawerLayout;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.ImageView;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Report;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Report Detail Panel. List all reports of a connection, invoked by Report Panel (ReportActivity)\n */\npublic class ReportDetailActivity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_report_detail);\n        RunStore.setContext(this);\n\n        //Get reports from collector class\n        ArrayList<String[]> detailList = Collector.sDetailReportList;\n        final DetailAdapter adapter = new DetailAdapter(this, R.layout.report_detail_item, detailList);\n        final ListView listview = (ListView) findViewById(R.id.report_detail_list_view);\n        listview.setAdapter(adapter);\n\n        View view_header = getLayoutInflater().inflate(R.layout.report_list_group_header, null);\n        listview.addHeaderView(view_header);\n\n        //Ende Löschen\n        final Report report = Collector.sDetailReport;\n        ImageView icon_header = (ImageView) view_header.findViewById(R.id.reportGroupIcon_header);\n        icon_header.setImageDrawable(Collector.getIcon(report.uid));\n        TextView label_header = (TextView) view_header.findViewById(R.id.reportGroupTitle_header);\n        label_header.setText(Collector.getLabel(report.uid));\n        TextView pkg_header = (TextView) view_header.findViewById(R.id.reportGroupSubtitle_header);\n        pkg_header.setText(Collector.getPackage(report.uid));\n\n        //Add certificate information - open link to ssl labs\n        if (mSharedPreferences.getBoolean(Const.IS_CERTVAL, false) && Collector.hasHostName(report.remoteAdd.getHostAddress()) &&\n                Collector.hasGrade(Collector.getDnsHostName(report.remoteAdd.getHostAddress()))) {\n            TextView ssllabs = (TextView) findViewById(R.id.report_detail_ssllabs_result);\n            ssllabs.setVisibility(View.VISIBLE);\n            ssllabs.setOnClickListener(new View.OnClickListener() {\n                @Override\n                public void onClick(View view) {\n                    String url = Const.SSLLABS_URL +\n                            Collector.getCertHost(Collector.getDnsHostName(report.remoteAdd.getHostAddress()));\n                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n                    startActivity(browserIntent);\n                }\n            });\n\n        }\n\n    }\n\n    @Override\n    public void onDestroy() {\n        super.onDestroy();\n    }\n\n    //Implementation of List Adapter\n    class DetailAdapter extends ArrayAdapter<String[]> {\n\n        DetailAdapter(Context context, int resource, List<String[]> detailList) {\n\n            super(context, resource, detailList);\n        }\n\n        //Get detail information from collector class and write to adapter views\n        @Override\n        public View getView(int position, View convertView, ViewGroup parent) {\n\n            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n            View v = convertView;\n            if (v == null) {\n                LayoutInflater vi;\n                vi = LayoutInflater.from(getContext());\n                v = vi.inflate(R.layout.report_detail_item, null);\n            }\n\n            //Get string array and set it to text fields\n            String[] detail = getItem(position);\n            TextView type = (TextView) v.findViewById(R.id.report_detail_item_type);\n            TextView value = (TextView) v.findViewById(R.id.report_detail_item_value);\n            if (detail[0] != null && detail[1] != null) {\n                type.setText(detail[0]);\n                value.setText(detail[1]);\n            } else {\n                type.setText(\"\");\n                value.setText(\"\");\n            }\n            return v;\n        }\n    }\n}\n\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SelectHistoryAppsActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport androidx.core.view.MenuItemCompat;\nimport androidx.appcompat.app.ActionBar;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.recyclerview.widget.DividerItemDecoration;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport androidx.appcompat.widget.SearchView;\nimport android.text.TextUtils;\nimport android.view.Menu;\nimport android.view.MenuItem;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.AppListRecyclerAdapter;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.TreeMap;\n\nimport static org.secuso.privacyfriendlynetmonitor.Assistant.RunStore.getContext;\n\n/**\n * Activity for the list of all installed apps with internet permission.\n * The list can be sorted alphabeic and after installed date.\n * A search function for the list is implemented.\n */\n\npublic class SelectHistoryAppsActivity extends AppCompatActivity {\n\n    private List<String> app_list_name;\n    private ReportEntityDao reportEntityDao;\n    private SharedPreferences selectedAppsPreferences;\n    private SharedPreferences.Editor editor;\n\n    private RecyclerView appListRecyclerView;\n    private RecyclerView.Adapter appListRecyclerAdapter;\n    private RecyclerView.LayoutManager recyclerLayoutManager;\n\n\n    //Variables to sort alphabetic and accodring to installed date\n    //the displayed app names are in the keys of the map, the value is the long Name\n    private Map<String, String> sortMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_select_history_apps);\n\n        // load DB\n        DaoSession daoSession = ((DBApp) getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n\n        ActionBar ab = getSupportActionBar();\n        if (ab != null) {\n            ab.setDisplayShowHomeEnabled(true);\n        }\n\n        selectedAppsPreferences = getSharedPreferences(\"SELECTEDAPPS\", 0);\n        editor = selectedAppsPreferences.edit();\n\n        show_APP_list();\n\n    }\n\n    //method to load all the Apps in the listeview, sorted alphabetic form the start\n    private void show_APP_list() {\n        app_list_name = provideAppList();\n\n        appListRecyclerView = (RecyclerView) findViewById(R.id.list_selection_app_recycler);\n        recyclerLayoutManager = new LinearLayoutManager(this);\n        appListRecyclerView.setLayoutManager(recyclerLayoutManager);\n\n        // specify an adapter\n        appListRecyclerAdapter = new AppListRecyclerAdapter(app_list_name, this);\n        appListRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));\n        appListRecyclerView.setAdapter(appListRecyclerAdapter);\n\n    }\n\n    //method to check for internet permission\n    // 1. returns a list with Strings --> goes into the app_list_name\n    // 2. fills the Map sort_map\n    private List<String> provideAppList() {\n\n        ArrayList<String> packageNames = new ArrayList<>();\n        PackageManager p = this.getPackageManager();\n        final List<PackageInfo> packs = p.getInstalledPackages(0);\n        List<PackageInfo> packs_permission = p.getInstalledPackages(PackageManager.GET_PERMISSIONS);\n\n        //This FOR goes through every app that is installed on the device according to\n        // --> p.getInstalledPackages(0);\n        for (int i = 0; i < packs.size(); i++) {\n            PackageInfo pinfo = packs.get(i); //This Var has the actual Information about an app (not the permission)\n            PackageInfo appPermission = packs_permission.get(i);\n            //If the App has NULL permissions then skip it\n            if (appPermission.requestedPermissions == null) {\n                continue;\n            }\n            //Check if App has Internet Permission\n            for (String permission : appPermission.requestedPermissions) {\n                //Checking for Internet permission\n                if (TextUtils.equals(permission, android.Manifest.permission.INTERNET)) {\n                    sortMap.put(pinfo.applicationInfo.loadLabel(getPackageManager()).toString(), pinfo.packageName);\n                    break;\n                }\n            }\n        }\n\n        //Actual sorting alpabetic and convert into the String List \"packageNames\"\n        Set set2 = sortMap.entrySet();\n        Iterator iterator2 = set2.iterator();\n        while (iterator2.hasNext()) {\n            Map.Entry me2 = (Map.Entry) iterator2.next();\n            packageNames.add(me2.getValue().toString());\n        }\n\n        return packageNames;\n    }\n\n    //enables the menue and provides the search method\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        getMenuInflater().inflate(R.menu.applistseletion_menu, menu);\n        MenuItem searchItem = menu.findItem(R.id.action_search);\n        SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);\n\n        //search method\n        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n            @Override\n            public boolean onQueryTextChange(String searchText) {\n                app_list_name.clear();\n\n                for (Map.Entry<String, String> entry : sortMap.entrySet()) {\n                    if (entry.getKey().toLowerCase().contains(searchText.toLowerCase())) {\n                        app_list_name.add(entry.getValue().toString());\n                    }\n                }\n\n                appListRecyclerView = (RecyclerView) findViewById(R.id.list_selection_app_recycler);\n                recyclerLayoutManager = new LinearLayoutManager(getContext());\n                appListRecyclerView.setLayoutManager(recyclerLayoutManager);\n\n                // specify an adapter\n                appListRecyclerAdapter = new AppListRecyclerAdapter(app_list_name, SelectHistoryAppsActivity.this);\n                appListRecyclerView.addItemDecoration(new DividerItemDecoration(SelectHistoryAppsActivity.this, LinearLayoutManager.VERTICAL));\n                appListRecyclerView.setAdapter(appListRecyclerAdapter);\n\n                return false;\n            }\n\n            @Override\n            public boolean onQueryTextSubmit(String query) {\n                return false;\n            }\n        });\n\n//        MenuItem deleteItem = menu.findItem(R.id.deleteButton);\n//        deleteItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {\n//            @Override\n//            public boolean onMenuItemClick(MenuItem item) {\n//\n//                List<Integer> appsToDelete = appAdapter.getAppsToDelete();\n//                Toast toast;\n//\n//                List<ReportEntity> reportEntities = reportEntityDao.loadAll();\n//\n//                if (!appsToDelete.isEmpty()) {\n//\n//                    for (Integer i : appsToDelete) {\n//                        String appName = (String) appAdapter.getItem(i);\n//                        for (ReportEntity reportEntity : reportEntities) {\n//                            if (reportEntity.getAppName().equals(appName)) {\n//                                reportEntityDao.delete(reportEntity);\n//                                editor.remove(appName);\n//                                editor.commit();\n//                            }\n//                        }\n//                        Collector.deleteAppFromIncludeInScan(appName);\n//                    }\n//\n//                    toast = Toast.makeText(getApplicationContext(), \"Reports have been deleted\", Toast.LENGTH_SHORT);\n//                    toast.show();\n//                } else {\n//                    toast = Toast.makeText(getApplicationContext(), \"No reports available to delete.\", Toast.LENGTH_SHORT);\n//                    toast.show();\n//                }\n//\n//                return false;\n//            }\n//        });\n\n        return true;\n    }\n\n    //inspection for sort selection\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        // [See PFA Note APP]\n        int id = item.getItemId();\n\n        //noinspection SimplifiableIfStatement\n        if (id == R.id.action_sort_alphabetical_asc) {\n            item.setChecked(true);\n            sortAlphabetic_asc();\n        } else if (id == R.id.action_sort_alphabetical_desc) {\n            item.setChecked(true);\n            sortAlphabetic_desc();\n        } else if (id == R.id.action_sort_installdate_asc) {\n            item.setChecked(true);\n            sortInstalledDate_asc();\n        } else if (id == R.id.action_sort_installdate_desc) {\n            item.setChecked(true);\n            sortInstalledDate_desc();\n        }\n\n        appListRecyclerView = (RecyclerView) findViewById(R.id.list_selection_app_recycler);\n        recyclerLayoutManager = new LinearLayoutManager(getContext());\n        appListRecyclerView.setLayoutManager(recyclerLayoutManager);\n\n        // specify an adapter\n        appListRecyclerAdapter = new AppListRecyclerAdapter(app_list_name, SelectHistoryAppsActivity.this);\n        appListRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));\n        appListRecyclerView.setAdapter(appListRecyclerAdapter);\n\n        return super.onOptionsItemSelected(item);\n    }\n\n    private void sortAlphabetic_asc() {\n        app_list_name.clear();\n        AscComparator comp = new AscComparator(sortMap);\n        Map<String, String> newMap = new TreeMap(comp);\n        newMap.putAll(sortMap);\n        sortMap = newMap;\n\n        for (Map.Entry<String, String> entry : sortMap.entrySet()) {\n            app_list_name.add(entry.getValue().toString());\n        }\n    }\n\n    private void sortAlphabetic_desc() {\n        app_list_name.clear();\n        DescComparator comp = new DescComparator(sortMap);\n        Map<String, String> newMap = new TreeMap(comp);\n        newMap.putAll(sortMap);\n        sortMap = newMap;\n\n        for (Map.Entry<String, String> entry : sortMap.entrySet()) {\n            app_list_name.add(entry.getValue().toString());\n        }\n    }\n\n    private void sortInstalledDate_asc() {\n        Map<Long, List<String>> appdates = new TreeMap<>();\n        PackageManager packageManager = this.getPackageManager();\n        for (int i = 0; i < app_list_name.size(); i++) {\n            PackageInfo packageInfo = null;\n            try {\n                packageInfo = packageManager.getPackageInfo(app_list_name.get(i), 0);\n            } catch (PackageManager.NameNotFoundException e) {\n                e.printStackTrace();\n            }\n            long installTimeInMilliseconds = packageInfo.firstInstallTime;\n            if (appdates.containsKey(installTimeInMilliseconds)) {\n                appdates.get(installTimeInMilliseconds).add(app_list_name.get(i));\n            } else {\n                ArrayList<String> temp = new ArrayList<String>();\n                temp.add(app_list_name.get(i));\n                appdates.put(installTimeInMilliseconds, temp);\n            }\n        }\n        AscComparator comp = new AscComparator(appdates);\n        Map<Long, List<String>> newMap = new TreeMap(comp);\n        newMap.putAll(appdates);\n        appdates = newMap;\n        app_list_name.clear();\n\n        for (Long key : appdates.keySet()) {\n            for (String s : appdates.get(key)) {\n                app_list_name.add(s);\n            }\n        }\n    }\n\n    private void sortInstalledDate_desc() {\n        Map<Long, List<String>> appdates = new TreeMap<>();\n        PackageManager packageManager = this.getPackageManager();\n        for (int i = 0; i < app_list_name.size(); i++) {\n            PackageInfo packageInfo = null;\n            try {\n                packageInfo = packageManager.getPackageInfo(app_list_name.get(i), 0);\n            } catch (PackageManager.NameNotFoundException e) {\n                e.printStackTrace();\n            }\n            long installTimeInMilliseconds = packageInfo.firstInstallTime;\n            if (appdates.containsKey(installTimeInMilliseconds)) {\n                appdates.get(installTimeInMilliseconds).add(app_list_name.get(i));\n            } else {\n                ArrayList<String> temp = new ArrayList<String>();\n                temp.add(app_list_name.get(i));\n                appdates.put(installTimeInMilliseconds, temp);\n            }\n        }\n        DescComparator comp = new DescComparator(appdates);\n        Map<Long, List<String>> newMap = new TreeMap(comp);\n        newMap.putAll(appdates);\n        appdates = newMap;\n        app_list_name.clear();\n\n        for (Long key : appdates.keySet()) {\n            for (String s : appdates.get(key)) {\n                app_list_name.add(s);\n            }\n        }\n    }\n\n    class AscComparator implements Comparator {\n        Map map;\n\n        public AscComparator(Map map) {\n            this.map = map;\n        }\n\n        @Override\n        public int compare(Object o1, Object o2) {\n            return (o1.toString()).compareToIgnoreCase(o2.toString());\n        }\n    }\n\n    class DescComparator implements Comparator {\n        Map map;\n\n        public DescComparator(Map map) {\n            this.map = map;\n        }\n\n        @Override\n        public int compare(Object o1, Object o2) {\n            return (o2.toString()).compareToIgnoreCase(o1.toString());\n        }\n    }\n\n    @Override\n    public void onBackPressed() {\n        /*\n        if (appAdapter.getAppsToDelete() != null && !appAdapter.getAppsToDelete().isEmpty()) {\n            List<Integer> appsToDelete = appAdapter.getAppsToDelete();\n            for (int i : appsToDelete) {\n                String appName = (String) appAdapter.getItem(i);\n                ((RelativeLayout) userInstalledAppsView.getChildAt(i)).setBackgroundColor(Color.WHITE);\n            }\n            appAdapter.getAppsToDelete().clear();\n        } else {\n            super.onBackPressed();\n        }\n        */\n        super.onBackPressed();\n    }\n\n//    private void deleteConfirmation() {\n//\n//        AlertDialog.Builder builder = new AlertDialog.Builder(this);\n//        builder.setTitle(R.string.dialogTitle);\n//        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n//            @Override\n//            public void onClick(DialogInterface dialog, int which) {\n//\n//                //...\n//                //insert unselect function\n//                //...\n//\n//                Toast.makeText(getApplicationContext(), \"All Apps have been unselected.\", Toast.LENGTH_SHORT).show();\n//\n//            }\n//        });\n//        builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {\n//            @Override\n//            public void onClick(DialogInterface dialog, int which) {\n//                Toast.makeText(getApplicationContext(), \"Deletion canceled.\", Toast.LENGTH_SHORT).show();\n//            }\n//        });\n//        System.out.println(\"Building complete\");\n//        AlertDialog dialog = builder.create();\n//        dialog.show();\n//\n//    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SettingsActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.res.Configuration;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.preference.ListPreference;\nimport android.preference.Preference;\nimport android.preference.PreferenceFragment;\nimport android.preference.PreferenceManager;\nimport android.util.Log;\nimport android.view.MenuItem;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * Activity providing app settings\n */\npublic class SettingsActivity extends BaseActivity {\n    /**\n     * A preference value change listener that updates the preference's summary\n     * to reflect its new value.\n     */\n    private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {\n        @Override\n        public boolean onPreferenceChange(Preference preference, Object value) {\n            String stringValue = value.toString();\n            Log.d(Const.LOG_TAG, stringValue);\n            if (preference instanceof ListPreference) {\n                // For list preferences, look up the correct display value in\n                // the preference's 'entries' list.\n                ListPreference listPreference = (ListPreference) preference;\n                int index = listPreference.findIndexOfValue(stringValue);\n\n                // Set the summary to reflect the new value.\n                preference.setSummary(\n                        index >= 0\n                                ? listPreference.getEntries()[index]\n                                : null);\n            } else {\n                // For all other preferences, set the summary to the value's\n                // simple string representation.\n                preference.setSummary(stringValue);\n            }\n            return true;\n\n\n        }\n    };\n\n    /**\n     * Helper method to determine if the device has an extra-large screen. For\n     * example, 10\" tablets are extra-large.\n     */\n    private static boolean isXLargeTablet(Context context) {\n        return (context.getResources().getConfiguration().screenLayout\n                & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;\n    }\n\n    /**\n     * Binds a preference's summary to its value. More specifically, when the\n     * preference's value is changed, its summary (line of text below the\n     * preference title) is updated to reflect the value. The summary is also\n     * immediately updated upon calling this method. The exact display format is\n     * dependent on the type of preference.\n     *\n     * @see #sBindPreferenceSummaryToValueListener\n     */\n    private static void bindPreferenceSummaryToValue(Preference preference) {\n        // Set the listener to watch for value changes.\n        preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);\n\n        // Trigger the listener immediately with the preference's\n        // current value.\n        sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,\n                PreferenceManager\n                        .getDefaultSharedPreferences(preference.getContext())\n                        .getString(preference.getKey(), \"\"));\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        RunStore.setContext(this);\n\n        setContentView(R.layout.activity_settings);\n        //setupActionBar();\n        overridePendingTransition(0, 0);\n    }\n\n    @Override\n    protected int getNavigationDrawerID() {\n        return R.id.nav_settings;\n    }\n\n    /**\n     * This method stops fragment injection in malicious applications.\n     * Make sure to deny any unknown fragments here.\n     */\n    protected boolean isValidFragment(String fragmentName) {\n        return PreferenceFragment.class.getName().equals(fragmentName)\n                || GeneralPreferenceFragment.class.getName().equals(fragmentName);\n    }\n\n    /**\n     * This fragment shows general preferences only. It is used when the\n     * activity is showing a two-pane settings UI.\n     */\n    @TargetApi(Build.VERSION_CODES.HONEYCOMB)\n    public static class GeneralPreferenceFragment extends PreferenceFragment {\n        @Override\n        public void onCreate(Bundle savedInstanceState) {\n            super.onCreate(savedInstanceState);\n            addPreferencesFromResource(R.xml.preferences);\n            //setHasOptionsMenu(true);\n\n            // Bind the summaries of EditText/List/Dialog/Ringtone preferences\n            // to their values. When their values change, their summaries are\n            // updated to reflect the new value, per the Android Design\n            // guidelines.\n            //bindPreferenceSummaryToValue(findPreference(\"example_text\"));\n            //bindPreferenceSummaryToValue(findPreference(\"example_list\"));\n        }\n\n        @Override\n        public boolean onOptionsItemSelected(MenuItem item) {\n            int id = item.getItemId();\n            if (id == android.R.id.home) {\n                //getAppContext().finish();\n                startActivity(new Intent(getActivity(), SettingsActivity.class));\n                return true;\n            }\n            return super.onOptionsItemSelected(item);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SplashActivity.java",
    "content": "/**\n * This file is part of Privacy Friendly Password Generator.\n * Privacy Friendly Password Generator is free software:\n * you can redistribute it and/or modify it under the terms of the\n * GNU General Public License as published by the Free Software Foundation,\n * either version 3 of the License, or any later version.\n * Privacy Friendly Password Generator is distributed in the hope\n * that it will be useful, but WITHOUT ANY WARRANTY; without even\n * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with Privacy Friendly Password Generator. If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Intent;\nimport android.os.Build;\nimport android.os.Bundle;\nimport androidx.appcompat.app.AppCompatActivity;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.PrefManager;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * @author Karola Marky\n * @version 20161022\n */\n\npublic class SplashActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        Intent mainIntent = null;\n        PrefManager prefManager = new PrefManager(this);\n        if(prefManager.isFirstTimeLaunch()) {\n            mainIntent = new Intent(this, TutorialActivity.class);\n            prefManager.setFirstTimeLaunch(false);\n        } else {\n            mainIntent = new Intent(this, MainActivity.class);\n            mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n        }\n\n\n        setContentView(R.layout.activity_splash);\n        TextView compatibilityInfo = findViewById(R.id.compatibility_text);\n\n        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P){\n            compatibilityInfo.setVisibility(View.VISIBLE);\n        } else {\n            compatibilityInfo.setVisibility(View.INVISIBLE);\n\n            //Intent mainIntent = new Intent(SplashActivity.this, TutorialActivity.class);\n            SplashActivity.this.startActivity(mainIntent);\n            SplashActivity.this.finish();\n        }\n\n\n\n    }\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/TutorialActivity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Activities;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.Color;\nimport android.os.Build;\nimport android.os.Bundle;\nimport androidx.viewpager.widget.PagerAdapter;\nimport androidx.viewpager.widget.ViewPager;\nimport androidx.appcompat.app.AppCompatActivity;\nimport android.text.Html;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.view.WindowManager;\nimport android.widget.Button;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.PrefManager;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * Welcome tutorial for basic understanding of app features\n * Class structure taken from tutorial at http://www.androidhive.info/2016/05/android-build-intro-slider-app/\n * The tutorial is accessible from the navigation drawer\n */\n\npublic class TutorialActivity extends AppCompatActivity {\n\n    private ViewPager viewPager;\n    private MyViewPagerAdapter myViewPagerAdapter;\n    private LinearLayout dotsLayout;\n    private TextView[] dots;\n    private int[] layouts;\n    private Button btnSkip, btnNext;\n    private PrefManager prefManager;\n    private static boolean tutorial_click = false;\n\n    public static void setTutorial_click(boolean tutorial_click) {\n        TutorialActivity.tutorial_click = tutorial_click;\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        // Checking for first time launch - before calling setContentView()\n        //prefManager = new PrefManager(this);\n        //if (!prefManager.isFirstTimeLaunch()) {\n         //   if (tutorial_click == false) {\n         //       launchHomeScreen();\n         //       finish();\n         //   }\n        //}\n        //tutorial_click = false;\n\n        // Making notification bar transparent\n        if (Build.VERSION.SDK_INT >= 21) {\n            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n        }\n\n        setContentView(R.layout.activity_tutorial);\n\n        viewPager = findViewById(R.id.view_pager);\n        dotsLayout = findViewById(R.id.layoutDots);\n        btnSkip = findViewById(R.id.btn_skip);\n        btnNext = findViewById(R.id.btn_next);\n\n\n        // layouts of all welcome sliders\n        // add few more layouts if you want\n        layouts = new int[]{\n                R.layout.tutorial_slide1,\n                R.layout.tutorial_slide2,\n                R.layout.tutorial_slide3,};\n\n        // adding bottom dots\n        addBottomDots(0);\n\n        // making notification bar transparent\n        changeStatusBarColor();\n\n        myViewPagerAdapter = new MyViewPagerAdapter();\n        viewPager.setAdapter(myViewPagerAdapter);\n        viewPager.addOnPageChangeListener(viewPagerPageChangeListener);\n\n        btnSkip.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                // checking for last page\n                // if last page home screen will be launched\n                int current = getItem(+1);\n                if (current < layouts.length) {\n                    launchHomeScreen();\n                } else {\n                    launchHelp();\n                }\n            }\n        });\n\n\n\n        btnNext.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                // checking for last page\n                // if last page home screen will be launched\n                int current = getItem(+1);\n                if (current < layouts.length) {\n                    // move to next screen\n                    viewPager.setCurrentItem(current);\n                } else {\n                    launchHomeScreen();\n                }\n            }\n        });\n    }\n\n\n    private void addBottomDots(int currentPage) {\n        dots = new TextView[layouts.length];\n\n        int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);\n        int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);\n\n        dotsLayout.removeAllViews();\n        for (int i = 0; i < dots.length; i++) {\n            dots[i] = new TextView(this);\n            dots[i].setText(Html.fromHtml(\"&#8226;\"));\n            dots[i].setTextSize(35);\n            dots[i].setTextColor(colorsInactive[currentPage]);\n            dotsLayout.addView(dots[i]);\n        }\n\n        if (dots.length > 0)\n            dots[currentPage].setTextColor(colorsActive[currentPage]);\n    }\n\n    private int getItem(int i) {\n        return viewPager.getCurrentItem() + i;\n    }\n\n    private void launchHomeScreen() {\n        Intent intent = new Intent(this, MainActivity.class);\n        //intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n        prefManager.setFirstTimeLaunch(false);\n        startActivity(intent);\n        finish();\n    }\n\n    private void launchHelp() {\n        Intent intent = new Intent(this, HelpActivity.class);\n        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n        prefManager.setFirstTimeLaunch(false);\n        startActivity(intent);\n        finish();\n    }\n\n    //  viewpager change listener\n    ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {\n\n        @Override\n        public void onPageSelected(int position) {\n            addBottomDots(position);\n\n            // changing the next button text 'NEXT' / 'GOT IT'\n            if (position == layouts.length - 1) {\n                // last page. make button text to GOT IT\n                btnNext.setText(getString(R.string.okay));\n                //btnSkip.setVisibility(View.GONE);\n                btnSkip.setText(getString(R.string.help_button));\n            } else {\n                // still pages are left\n                btnNext.setText(getString(R.string.next));\n                btnSkip.setText(getString(R.string.skip));\n                btnSkip.setVisibility(View.VISIBLE);\n            }\n        }\n\n        @Override\n        public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n        }\n\n        @Override\n        public void onPageScrollStateChanged(int arg0) {\n\n        }\n    };\n\n    //Making notification bar transparent\n    private void changeStatusBarColor() {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n            Window window = getWindow();\n            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n            window.setStatusBarColor(Color.TRANSPARENT);\n        }\n    }\n\n    //View pager adapter\n    public class MyViewPagerAdapter extends PagerAdapter {\n        private LayoutInflater layoutInflater;\n\n        public MyViewPagerAdapter() {\n        }\n\n        @Override\n        public Object instantiateItem(ViewGroup container, int position) {\n            layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n            View view = layoutInflater.inflate(layouts[position], container, false);\n            container.addView(view);\n\n            return view;\n        }\n\n        @Override\n        public int getCount() {\n            return layouts.length;\n        }\n\n        @Override\n        public boolean isViewFromObject(View view, Object obj) {\n            return view == obj;\n        }\n\n\n        @Override\n        public void destroyItem(ViewGroup container, int position, Object object) {\n            View view = (View) object;\n            container.removeView(view);\n        }\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncCertVal.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport android.os.AsyncTask;\nimport android.util.Log;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport de.bjoernr.ssllabs.Api;\nimport de.bjoernr.ssllabs.ConsoleUtilities;\n\n/**\n * Class for performing asynchronous requests of JSON Objects via SSL-Labs API\n * <p>\n * Qualis SSL Labs API: https://www.ssllabs.com/projects/ssllabs-apis\n * Java-SSLLabs-API Björn Roland and Qualis SSL Labs: https://github.com/bjoernr-de\n */\n\npublic class AsyncCertVal extends AsyncTask<Void, Void, Void> {\n\n    private Api mSSLLabsApi;\n\n    public AsyncCertVal() {\n        mSSLLabsApi = new Api();\n    }\n\n    @Override\n    public Void doInBackground(Void... voids) {\n        if (Collector.sCertValList.size() > 0) {\n            fetchHostInfo(Collector.sCertValList);\n        }\n        return null;\n    }\n\n    //Fetch cached information from SSL Labs using list of hostnames\n    private void fetchHostInfo(List<String> urls) {\n        int count = getMaxAssessments();\n        JSONObject hostInfo;\n        String host;\n        ArrayList<String> pendingList = new ArrayList<>();\n        while (count > 0 && urls.size() > 0) {\n            host = urls.get(0);\n            hostInfo = mSSLLabsApi.fetchHostInformationCached(host, null, false, false);\n\n            // add to map if not empty\n            Map<String, Object> map = null;\n            try {\n                map = ConsoleUtilities.jsonToMap(hostInfo);\n            } catch (JSONException ignore) {\n            }\n            if (map != null && map.size() > 0) {\n                Collector.mCertValMap.put(host, map);\n            }\n            //continue to resolve if request not ready\n            if (map != null && map.size() > 0 && !Collector.analyseReady(map)) {\n                pendingList.add(host);\n            }\n            urls.remove(0);\n            count--;\n\n            if (Const.IS_DEBUG) {\n                Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map));\n            }\n        }\n        // manage pending lists\n        Collector.sCertValList.addAll(pendingList);\n        Collector.updateCertHostHandler();\n    }\n\n    // Get number off allowed request at the time\n    private int getMaxAssessments() {\n        final String max = \"maxAssessments\";\n        JSONObject hostInfo = mSSLLabsApi.fetchApiInfo();\n\n        Map<String, Object> map = null;\n        try {\n            map = ConsoleUtilities.jsonToMap(hostInfo);\n        } catch (JSONException ignore) {\n        }\n        if (Const.IS_DEBUG) {\n            Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map));\n        }\n        if (map.containsKey(max)) {\n            return (Integer) map.get(max);\n        } else {\n            return 0;\n        }\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncDNS.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport android.os.AsyncTask;\n\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector;\n\n/**\n * Helper class, executes asynchronous DNS requests.\n */\npublic class AsyncDNS extends AsyncTask<String, Void, String> {\n\n    //execute reverse hostname resolving in Collector class\n    @Override\n    protected String doInBackground(String... params) {\n        Collector.resolveHosts();\n        return \"Executed!\";\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/Const.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * Storing constant values for various usages within the app\n */\n\npublic interface Const {\n\n    //App constants\n    boolean IS_DEBUG = false;\n    String LOG_TAG = \"NetMonitor\";\n    String FILE_IF_LIST = \"iflist\";\n\n    //SSL LABS CONSTANTS\n    String SSLLABS_URL = \"https://www.ssllabs.com/ssltest/analyze.html?d=\";\n\n    //Detector constants\n    long REPORT_TTL_DEFAULT = 10000;\n    Integer[] TLS_PORT_VALUES = new Integer[]{993, 443, 995, 995, 614, 465, 587, 22};\n    Set<Integer> TLS_PORTS = new HashSet<>(Arrays.asList(TLS_PORT_VALUES));\n    Integer[] INCONCLUSIVE_PORT_VALUES = new Integer[]{25, 110, 143};\n    Set<Integer> INCONCUSIVE_PORTS = new HashSet<>(Arrays.asList(INCONCLUSIVE_PORT_VALUES));\n    Integer[] UNSECURE_PORT_VALUES = new Integer[]{21, 23, 80, 109, 137, 138, 139, 161, 992};\n    Set<Integer> UNSECURE_PORTS = new HashSet<>(Arrays.asList(UNSECURE_PORT_VALUES));\n\n    //String Builder Constants\n    String STATUS_TLS = \"Encrypted\";\n    String STATUS_UNSECURE = \"Unencrypted\";\n    String STATUS_INCONCLUSIVE = \"Inconclusive\";\n    String STATUS_UNKNOWN = \"Unknown\";\n\n    //SharedPrefs identifiers\n    String REPORT_TTL = \"REPORT_TTL\";\n    String IS_DETAIL_MODE = \"IS_DETAIL_MODE\";\n    String IS_FIRST_START = \"IS_FIRST_START\";\n    String IS_LOG = \"IS_LOG\";\n    String IS_CERTVAL = \"IS_CERTVAL\";\n    String PREF_NAME = \"PREF_NAME\";\n    String IS_HIGHLIGHTED = \"IS_HIGHLIGHTED\";\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ExecCom.java",
    "content": "\n/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport android.util.Log;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.Closeable;\nimport java.io.DataOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Handles the execution of shell commands.\n */\npublic class ExecCom extends Thread {\n\n    //Execute user commands on shell\n    static void user(String string) {\n        if (Const.IS_DEBUG) Log.d(Const.LOG_TAG, \"Executing as user: \" + string);\n        try {\n            Process user = Runtime.getRuntime().exec(string);\n            try {\n                user.waitFor();\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n            }\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n    }\n\n    //Execute user commands and get the result.\n    public static String userForResult(String string) {\n        if (Const.IS_DEBUG) Log.d(Const.LOG_TAG, \"Executing for result as user: \" + string);\n        String res = \"\";\n        DataOutputStream outputStream = null;\n        InputStream response = null;\n        try {\n            Process user = Runtime.getRuntime().exec(string);\n\n            outputStream = new DataOutputStream(user.getOutputStream());\n            response = user.getInputStream();\n\n            outputStream.writeBytes(\"exit\\n\");\n            outputStream.flush();\n            try {\n                user.waitFor();\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n            }\n            res = readFully(response);\n        } catch (IOException e) {\n            if (Const.IS_DEBUG) {\n                Log.i(Const.LOG_TAG, \"IO operation unsuccessful. Pipe Broken?\"\n                        + string);\n            }\n        } finally {\n            closeSilently(outputStream, response);\n        }\n        return res;\n    }\n\n    //Read the command output and return an utf8 string.\n    public static String readFully(InputStream is) throws IOException {\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        byte[] buffer = new byte[1024];\n        int length = 0;\n        while ((length = is.read(buffer)) != -1) {\n            baos.write(buffer, 0, length);\n        }\n        return baos.toString(\"UTF-8\");\n    }\n\n    //Closes a variety of closable objects.\n    public static void closeSilently(Object... xs) {\n        // Note: on Android API levels prior to 19 Socket does not implement Closeable\n        for (Object x : xs) {\n            if (x != null) {\n                try {\n                    if (x instanceof Closeable) {\n                        ((Closeable) x).close();\n                    } else {\n                        Log.d(Const.LOG_TAG, \"cannot close: \" + x);\n                        throw new RuntimeException(\"cannot close \" + x);\n                    }\n                } catch (Throwable e) {\n                    e.printStackTrace();\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/KnownPorts.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport java.util.HashMap;\n\n/**\n * Assistant class to resolve well-known (reserved) ports\n */\npublic class KnownPorts {\n\n\n    private static HashMap<Integer, String> m;\n\n    //get protocol desc based on port number\n    public static String resolvePort(int port) {\n        if (m.containsKey(port)) {\n            return m.get(port);\n        } else {\n            return \"unknown\";\n        }\n    }\n\n    public static String CompileConnectionInfo(int remotePort, TLType type) {\n        String info;\n        if (isTlsPort(remotePort)) {\n            info = Const.STATUS_TLS;\n        } else if (isUnsecurePort(remotePort)) {\n            info = Const.STATUS_UNSECURE;\n        } else if (isInconclusivePort(remotePort)) {\n            info = Const.STATUS_INCONCLUSIVE;\n        } else {\n            info = Const.STATUS_UNKNOWN;\n        }\n\n        return info + \" (\" + resolvePort(remotePort) + \", \" + type + \")\";\n    }\n\n    //Test if port number is well known for TLS connection\n    public static boolean isTlsPort(int i) {\n        return Const.TLS_PORTS.contains(i);\n    }\n\n    //Test if port number is inconclusive (e.g. STARTTLS)\n    public static boolean isInconclusivePort(int i) {\n        return Const.INCONCUSIVE_PORTS.contains(i);\n    }\n\n    //Test if port number is well known for unencrypted connection\n    public static boolean isUnsecurePort(int i) {\n        return Const.UNSECURE_PORTS.contains(i);\n    }\n\n\n    //init hash map with reserved ports (1-1024) and protocol identifiers\n    //based on: http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml\n    public static void initPortMap() {\n        m = new HashMap<>();\n\n        m.put(1, \"tcpmux\");\n        m.put(2, \"compressnet\");\n        m.put(3, \"compressnet\");\n        m.put(5, \"rje\");\n        m.put(7, \"echo\");\n        m.put(9, \"discard\");\n        m.put(11, \"systat\");\n        m.put(13, \"daytime\");\n        m.put(17, \"qotd\");\n        m.put(18, \"msp\");\n        m.put(19, \"chargen\");\n        m.put(20, \"ftp-data\");\n        m.put(21, \"ftp\");\n        m.put(22, \"ssh\");\n        m.put(23, \"telnet\");\n        m.put(25, \"smtp\");\n        m.put(27, \"nsw-fe\");\n        m.put(29, \"msg-icp\");\n        m.put(31, \"msg-auth\");\n        m.put(33, \"dsp\");\n        m.put(37, \"time\");\n        m.put(38, \"rap\");\n        m.put(39, \"rlp\");\n        m.put(41, \"graphics\");\n        m.put(42, \"name\");\n        m.put(43, \"nicname\");\n        m.put(44, \"mpm-flags\");\n        m.put(45, \"mpm\");\n        m.put(46, \"mpm-snd\");\n        m.put(47, \"ni-ftp\");\n        m.put(48, \"auditd\");\n        m.put(49, \"tacacs\");\n        m.put(50, \"re-mail-ck\");\n        m.put(52, \"xns-time\");\n        m.put(53, \"domain\");\n        m.put(54, \"xns-ch\");\n        m.put(55, \"isi-gl\");\n        m.put(56, \"xns-auth\");\n        m.put(58, \"xns-mail\");\n        m.put(61, \"ni-mail\");\n        m.put(62, \"acas\");\n        m.put(63, \"whoispp\");\n        m.put(64, \"covia\");\n        m.put(65, \"tacacs-ds\");\n        m.put(66, \"sql-net\");\n        m.put(67, \"bootps\");\n        m.put(68, \"bootpc\");\n        m.put(69, \"tftp\");\n        m.put(70, \"gopher\");\n        m.put(71, \"netrjs-1\");\n        m.put(72, \"netrjs-2\");\n        m.put(73, \"netrjs-3\");\n        m.put(74, \"netrjs-4\");\n        m.put(76, \"deos\");\n        m.put(78, \"vettcp\");\n        m.put(79, \"finger\");\n        m.put(80, \"http\");\n        m.put(82, \"xfer\");\n        m.put(83, \"mit-ml-dev\");\n        m.put(84, \"ctf\");\n        m.put(85, \"mit-ml-dev\");\n        m.put(86, \"mfcobol\");\n        m.put(88, \"kerberos\");\n        m.put(89, \"su-mit-tg\");\n        m.put(90, \"dnsix\");\n        m.put(91, \"mit-dov\");\n        m.put(92, \"npp\");\n        m.put(93, \"dcp\");\n        m.put(94, \"objcall\");\n        m.put(95, \"supdup\");\n        m.put(96, \"dixie\");\n        m.put(97, \"swift-rvf\");\n        m.put(98, \"tacnews\");\n        m.put(99, \"metagram\");\n        m.put(101, \"hostname\");\n        m.put(102, \"iso-tsap\");\n        m.put(103, \"gppitnp\");\n        m.put(104, \"acr-nema\");\n        m.put(105, \"cso\");\n        m.put(106, \"3com-tsmux\");\n        m.put(107, \"rtelnet\");\n        m.put(108, \"snagas\");\n        m.put(109, \"pop2\");\n        m.put(110, \"pop3\");\n        m.put(111, \"sunrpc\");\n        m.put(112, \"mcidas\");\n        m.put(113, \"ident\");\n        m.put(115, \"sftp\");\n        m.put(116, \"ansanotify\");\n        m.put(117, \"uucp-path\");\n        m.put(118, \"sqlserv\");\n        m.put(119, \"nntp\");\n        m.put(120, \"cfdptkt\");\n        m.put(121, \"erpc\");\n        m.put(122, \"smakynet\");\n        m.put(123, \"ntp\");\n        m.put(124, \"ansatrader\");\n        m.put(125, \"locus-map\");\n        m.put(126, \"nxedit\");\n        m.put(127, \"locus-con\");\n        m.put(128, \"gss-xlicen\");\n        m.put(129, \"pwdgen\");\n        m.put(130, \"cisco-fna\");\n        m.put(131, \"cisco-tna\");\n        m.put(132, \"cisco-sys\");\n        m.put(133, \"statsrv\");\n        m.put(134, \"ingres-net\");\n        m.put(135, \"epmap\");\n        m.put(136, \"profile\");\n        m.put(137, \"netbios-ns\");\n        m.put(138, \"netbios-dgm\");\n        m.put(139, \"netbios-ssn\");\n        m.put(140, \"emfis-data\");\n        m.put(141, \"emfis-cntl\");\n        m.put(142, \"bl-idm\");\n        m.put(143, \"imap\");\n        m.put(144, \"uma\");\n        m.put(145, \"uaac\");\n        m.put(146, \"iso-tp0\");\n        m.put(147, \"iso-ip\");\n        m.put(148, \"jargon\");\n        m.put(149, \"aed-512\");\n        m.put(150, \"sql-net\");\n        m.put(151, \"hems\");\n        m.put(152, \"bftp\");\n        m.put(153, \"sgmp\");\n        m.put(154, \"netsc-prod\");\n        m.put(155, \"netsc-dev\");\n        m.put(156, \"sqlsrv\");\n        m.put(157, \"knet-cmp\");\n        m.put(158, \"pcmail-srv\");\n        m.put(159, \"nss-routing\");\n        m.put(160, \"sgmp-traps\");\n        m.put(161, \"snmp\");\n        m.put(162, \"snmptrap\");\n        m.put(163, \"cmip-man\");\n        m.put(164, \"cmip-agent\");\n        m.put(165, \"xns-courier\");\n        m.put(166, \"s-net\");\n        m.put(167, \"namp\");\n        m.put(168, \"rsvd\");\n        m.put(169, \"send\");\n        m.put(170, \"print-srv\");\n        m.put(171, \"multiplex\");\n        m.put(172, \"cl-1\");\n        m.put(173, \"xyplex-mux\");\n        m.put(174, \"mailq\");\n        m.put(175, \"vmnet\");\n        m.put(176, \"genrad-mux\");\n        m.put(177, \"xdmcp\");\n        m.put(178, \"nextstep\");\n        m.put(179, \"bgp\");\n        m.put(180, \"ris\");\n        m.put(181, \"unify\");\n        m.put(182, \"audit\");\n        m.put(183, \"ocbinder\");\n        m.put(184, \"ocserver\");\n        m.put(185, \"remote-kis\");\n        m.put(186, \"kis\");\n        m.put(187, \"aci\");\n        m.put(188, \"mumps\");\n        m.put(189, \"qft\");\n        m.put(190, \"gacp\");\n        m.put(191, \"prospero\");\n        m.put(192, \"osu-nms\");\n        m.put(193, \"srmp\");\n        m.put(194, \"irc\");\n        m.put(195, \"dn6-nlm-aud\");\n        m.put(196, \"dn6-smm-red\");\n        m.put(197, \"dls\");\n        m.put(198, \"dls-mon\");\n        m.put(199, \"smux\");\n        m.put(200, \"src\");\n        m.put(201, \"at-rtmp\");\n        m.put(202, \"at-nbp\");\n        m.put(203, \"at-3\");\n        m.put(204, \"at-echo\");\n        m.put(205, \"at-5\");\n        m.put(206, \"at-zis\");\n        m.put(207, \"at-7\");\n        m.put(208, \"at-8\");\n        m.put(209, \"qmtp\");\n        m.put(210, \"z39-50\");\n        m.put(211, \"914c-g\");\n        m.put(212, \"anet\");\n        m.put(213, \"ipx\");\n        m.put(214, \"vmpwscs\");\n        m.put(215, \"softpc\");\n        m.put(216, \"CAIlic\");\n        m.put(217, \"dbase\");\n        m.put(218, \"mpp\");\n        m.put(219, \"uarps\");\n        m.put(220, \"imap3\");\n        m.put(221, \"fln-spx\");\n        m.put(222, \"rsh-spx\");\n        m.put(223, \"cdc\");\n        m.put(224, \"masqdialer\");\n        m.put(242, \"direct\");\n        m.put(243, \"sur-meas\");\n        m.put(244, \"inbusiness\");\n        m.put(245, \"link\");\n        m.put(246, \"dsp3270\");\n        m.put(247, \"subntbcst-tftp\");\n        m.put(248, \"bhfhs\");\n        m.put(256, \"rap\");\n        m.put(257, \"set\");\n        m.put(259, \"esro-gen\");\n        m.put(260, \"openport\");\n        m.put(261, \"nsiiops\");\n        m.put(262, \"arcisdms\");\n        m.put(263, \"hdap\");\n        m.put(264, \"bgmp\");\n        m.put(265, \"x-bone-ctl\");\n        m.put(266, \"sst\");\n        m.put(267, \"td-service\");\n        m.put(268, \"td-replica\");\n        m.put(269, \"manet\");\n        m.put(270, \"gist\");\n        m.put(271, \"pt-tls\");\n        m.put(280, \"http-mgmt\");\n        m.put(281, \"personal-link\");\n        m.put(282, \"cableport-ax\");\n        m.put(283, \"rescap\");\n        m.put(284, \"corerjd\");\n        m.put(286, \"fxp\");\n        m.put(287, \"k-block\");\n        m.put(308, \"novastorbakcup\");\n        m.put(309, \"entrusttime\");\n        m.put(310, \"bhmds\");\n        m.put(311, \"asip-webadmin\");\n        m.put(312, \"vslmp\");\n        m.put(313, \"magenta-logic\");\n        m.put(314, \"opalis-robot\");\n        m.put(315, \"dpsi\");\n        m.put(316, \"decauth\");\n        m.put(317, \"zannet\");\n        m.put(318, \"pkix-timestamp\");\n        m.put(319, \"ptp-event\");\n        m.put(320, \"ptp-general\");\n        m.put(321, \"pip\");\n        m.put(322, \"rtsps\");\n        m.put(323, \"rpki-rtr\");\n        m.put(324, \"rpki-rtr-tls\");\n        m.put(333, \"texar\");\n        m.put(344, \"pdap\");\n        m.put(345, \"pawserv\");\n        m.put(346, \"zserv\");\n        m.put(347, \"fatserv\");\n        m.put(348, \"csi-sgwp\");\n        m.put(349, \"mftp\");\n        m.put(350, \"matip-type-a\");\n        m.put(351, \"matip-type-b\");\n        m.put(352, \"dtag-ste-sb\");\n        m.put(353, \"ndsauth\");\n        m.put(354, \"bh611\");\n        m.put(355, \"datex-asn\");\n        m.put(356, \"cloanto-net-1\");\n        m.put(357, \"bhevent\");\n        m.put(358, \"shrinkwrap\");\n        m.put(359, \"nsrmp\");\n        m.put(360, \"scoi2odialog\");\n        m.put(361, \"semantix\");\n        m.put(362, \"srssend\");\n        m.put(363, \"rsvp-tunnel\");\n        m.put(364, \"aurora-cmgr\");\n        m.put(365, \"dtk\");\n        m.put(366, \"odmr\");\n        m.put(367, \"mortgageware\");\n        m.put(368, \"qbikgdp\");\n        m.put(369, \"rpc2portmap\");\n        m.put(370, \"codaauth2\");\n        m.put(371, \"clearcase\");\n        m.put(372, \"ulistproc\");\n        m.put(373, \"legent-1\");\n        m.put(374, \"legent-2\");\n        m.put(375, \"hassle\");\n        m.put(376, \"nip\");\n        m.put(377, \"tnETOS\");\n        m.put(378, \"dsETOS\");\n        m.put(379, \"is99c\");\n        m.put(380, \"is99s\");\n        m.put(381, \"hp-collector\");\n        m.put(382, \"hp-managed-node\");\n        m.put(383, \"hp-alarm-mgr\");\n        m.put(384, \"arns\");\n        m.put(385, \"ibm-app\");\n        m.put(386, \"asa\");\n        m.put(387, \"aurp\");\n        m.put(388, \"unidata-ldm\");\n        m.put(389, \"ldap\");\n        m.put(390, \"uis\");\n        m.put(391, \"synotics-relay\");\n        m.put(392, \"synotics-broker\");\n        m.put(393, \"meta5\");\n        m.put(394, \"embl-ndt\");\n        m.put(395, \"netcp\");\n        m.put(396, \"netware-ip\");\n        m.put(397, \"mptn\");\n        m.put(398, \"kryptolan\");\n        m.put(399, \"iso-tsap-c2\");\n        m.put(400, \"osb-sd\");\n        m.put(401, \"ups\");\n        m.put(402, \"genie\");\n        m.put(403, \"decap\");\n        m.put(404, \"nced\");\n        m.put(405, \"ncld\");\n        m.put(406, \"imsp\");\n        m.put(407, \"timbuktu\");\n        m.put(408, \"prm-sm\");\n        m.put(409, \"prm-nm\");\n        m.put(410, \"decladebug\");\n        m.put(411, \"rmt\");\n        m.put(412, \"synoptics-trap\");\n        m.put(413, \"smsp\");\n        m.put(414, \"infoseek\");\n        m.put(415, \"bnet\");\n        m.put(416, \"silverplatter\");\n        m.put(417, \"onmux\");\n        m.put(418, \"hyper-g\");\n        m.put(419, \"ariel1\");\n        m.put(420, \"smpte\");\n        m.put(421, \"ariel2\");\n        m.put(422, \"ariel3\");\n        m.put(423, \"opc-job-start\");\n        m.put(424, \"opc-job-track\");\n        m.put(425, \"icad-el\");\n        m.put(426, \"smartsdp\");\n        m.put(427, \"svrloc\");\n        m.put(428, \"ocs-cmu\");\n        m.put(429, \"ocs-amu\");\n        m.put(430, \"utmpsd\");\n        m.put(431, \"utmpcd\");\n        m.put(432, \"iasd\");\n        m.put(433, \"nnsp\");\n        m.put(434, \"mobileip-agent\");\n        m.put(435, \"mobilip-mn\");\n        m.put(436, \"dna-cml\");\n        m.put(437, \"comscm\");\n        m.put(438, \"dsfgw\");\n        m.put(439, \"dasp\");\n        m.put(440, \"sgcp\");\n        m.put(441, \"decvms-sysmgt\");\n        m.put(442, \"cvc-hostd\");\n        m.put(443, \"https\");\n        m.put(444, \"snpp\");\n        m.put(445, \"microsoft-ds\");\n        m.put(446, \"ddm-rdb\");\n        m.put(447, \"ddm-dfm\");\n        m.put(448, \"ddm-ssl\");\n        m.put(449, \"as-servermap\");\n        m.put(450, \"tserver\");\n        m.put(451, \"sfs-smp-net\");\n        m.put(452, \"sfs-config\");\n        m.put(453, \"creativeserver\");\n        m.put(454, \"contentserver\");\n        m.put(455, \"creativepartnr\");\n        m.put(456, \"macon-tcp\");\n        m.put(457, \"scohelp\");\n        m.put(458, \"appleqtc\");\n        m.put(459, \"ampr-rcmd\");\n        m.put(460, \"skronk\");\n        m.put(461, \"datasurfsrv\");\n        m.put(462, \"datasurfsrvsec\");\n        m.put(463, \"alpes\");\n        m.put(464, \"kpasswd\");\n        m.put(465, \"urd\");\n        m.put(466, \"digital-vrc\");\n        m.put(467, \"mylex-mapd\");\n        m.put(468, \"photuris\");\n        m.put(469, \"rcp\");\n        m.put(470, \"scx-proxy\");\n        m.put(471, \"mondex\");\n        m.put(472, \"ljk-login\");\n        m.put(473, \"hybrid-pop\");\n        m.put(474, \"tn-tl-w1\");\n        m.put(475, \"tcpnethaspsrv\");\n        m.put(476, \"tn-tl-fd1\");\n        m.put(477, \"ss7ns\");\n        m.put(478, \"spsc\");\n        m.put(479, \"iafserver\");\n        m.put(480, \"iafdbase\");\n        m.put(481, \"ph\");\n        m.put(482, \"bgs-nsi\");\n        m.put(483, \"ulpnet\");\n        m.put(484, \"integra-sme\");\n        m.put(485, \"powerburst\");\n        m.put(486, \"avian\");\n        m.put(487, \"saft\");\n        m.put(488, \"gss-http\");\n        m.put(489, \"nest-protocol\");\n        m.put(490, \"micom-pfs\");\n        m.put(491, \"go-login\");\n        m.put(492, \"ticf-1\");\n        m.put(493, \"ticf-2\");\n        m.put(494, \"pov-ray\");\n        m.put(495, \"intecourier\");\n        m.put(496, \"pim-rp-disc\");\n        m.put(497, \"retrospect\");\n        m.put(498, \"siam\");\n        m.put(499, \"iso-ill\");\n        m.put(500, \"isakmp\");\n        m.put(501, \"stmf\");\n        m.put(502, \"mbap\");\n        m.put(503, \"intrinsa\");\n        m.put(504, \"citadel\");\n        m.put(505, \"mailbox-lm\");\n        m.put(506, \"ohimsrv\");\n        m.put(507, \"crs\");\n        m.put(508, \"xvttp\");\n        m.put(509, \"snare\");\n        m.put(510, \"fcp\");\n        m.put(511, \"passgo\");\n        m.put(512, \"exec\");\n        m.put(513, \"login\");\n        m.put(514, \"shell\");\n        m.put(515, \"printer\");\n        m.put(516, \"videotex\");\n        m.put(517, \"talk\");\n        m.put(518, \"ntalk\");\n        m.put(519, \"utime\");\n        m.put(520, \"efs\");\n        m.put(521, \"ripng\");\n        m.put(522, \"ulp\");\n        m.put(523, \"ibm-db2\");\n        m.put(524, \"ncp\");\n        m.put(525, \"timed\");\n        m.put(526, \"tempo\");\n        m.put(527, \"stx\");\n        m.put(528, \"custix\");\n        m.put(529, \"irc-serv\");\n        m.put(530, \"courier\");\n        m.put(531, \"conference\");\n        m.put(532, \"netnews\");\n        m.put(533, \"netwall\");\n        m.put(534, \"windream\");\n        m.put(535, \"iiop\");\n        m.put(536, \"opalis-rdv\");\n        m.put(537, \"nmsp\");\n        m.put(538, \"gdomap\");\n        m.put(539, \"apertus-ldp\");\n        m.put(540, \"uucp\");\n        m.put(541, \"uucp-rlogin\");\n        m.put(542, \"commerce\");\n        m.put(543, \"klogin\");\n        m.put(544, \"kshell\");\n        m.put(545, \"appleqtcsrvr\");\n        m.put(546, \"dhcpv6-client\");\n        m.put(547, \"dhcpv6-server\");\n        m.put(548, \"afpovertcp\");\n        m.put(549, \"idfp\");\n        m.put(550, \"new-rwho\");\n        m.put(551, \"cybercash\");\n        m.put(552, \"devshr-nts\");\n        m.put(553, \"pirp\");\n        m.put(554, \"rtsp\");\n        m.put(555, \"dsf\");\n        m.put(556, \"remotefs\");\n        m.put(557, \"openvms-sysipc\");\n        m.put(558, \"sdnskmp\");\n        m.put(559, \"teedtap\");\n        m.put(560, \"rmonitor\");\n        m.put(561, \"monitor\");\n        m.put(562, \"chshell\");\n        m.put(563, \"nntps\");\n        m.put(564, \"9pfs\");\n        m.put(565, \"whoami\");\n        m.put(566, \"streettalk\");\n        m.put(567, \"banyan-rpc\");\n        m.put(568, \"ms-shuttle\");\n        m.put(569, \"ms-rome\");\n        m.put(570, \"meter\");\n        m.put(571, \"meter\");\n        m.put(572, \"sonar\");\n        m.put(573, \"banyan-vip\");\n        m.put(574, \"ftp-agent\");\n        m.put(575, \"vemmi\");\n        m.put(576, \"ipcd\");\n        m.put(577, \"vnas\");\n        m.put(578, \"ipdd\");\n        m.put(579, \"decbsrv\");\n        m.put(580, \"sntp-heartbeat\");\n        m.put(581, \"bdp\");\n        m.put(582, \"scc-security\");\n        m.put(583, \"philips-vc\");\n        m.put(584, \"keyserver\");\n        m.put(586, \"password-chg\");\n        m.put(587, \"submission\");\n        m.put(588, \"cal\");\n        m.put(589, \"eyelink\");\n        m.put(590, \"tns-cml\");\n        m.put(591, \"http-alt\");\n        m.put(592, \"eudora-set\");\n        m.put(593, \"http-rpc-epmap\");\n        m.put(594, \"tpip\");\n        m.put(595, \"cab-protocol\");\n        m.put(596, \"smsd\");\n        m.put(597, \"ptcnameservice\");\n        m.put(598, \"sco-websrvrmg3\");\n        m.put(599, \"acp\");\n        m.put(600, \"ipcserver\");\n        m.put(601, \"syslog-conn\");\n        m.put(602, \"xmlrpc-beep\");\n        m.put(603, \"idxp\");\n        m.put(604, \"tunnel\");\n        m.put(605, \"soap-beep\");\n        m.put(606, \"urm\");\n        m.put(607, \"nqs\");\n        m.put(608, \"sift-uft\");\n        m.put(609, \"npmp-trap\");\n        m.put(610, \"npmp-local\");\n        m.put(611, \"npmp-gui\");\n        m.put(612, \"hmmp-ind\");\n        m.put(613, \"hmmp-op\");\n        m.put(614, \"sshell\");\n        m.put(615, \"sco-inetmgr\");\n        m.put(616, \"sco-sysmgr\");\n        m.put(617, \"sco-dtmgr\");\n        m.put(618, \"dei-icda\");\n        m.put(619, \"compaq-evm\");\n        m.put(620, \"sco-websrvrmgr\");\n        m.put(621, \"escp-ip\");\n        m.put(622, \"collaborator\");\n        m.put(623, \"oob-ws-http\");\n        m.put(624, \"cryptoadmin\");\n        m.put(625, \"dec-dlm\");\n        m.put(626, \"asia\");\n        m.put(627, \"passgo-tivoli\");\n        m.put(628, \"qmqp\");\n        m.put(629, \"3com-amp3\");\n        m.put(630, \"rda\");\n        m.put(631, \"ipp\");\n        m.put(632, \"bmpp\");\n        m.put(633, \"servstat\");\n        m.put(634, \"ginad\");\n        m.put(635, \"rlzdbase\");\n        m.put(636, \"ldaps\");\n        m.put(637, \"lanserver\");\n        m.put(638, \"mcns-sec\");\n        m.put(639, \"msdp\");\n        m.put(640, \"entrust-sps\");\n        m.put(641, \"repcmd\");\n        m.put(642, \"esro-emsdp\");\n        m.put(643, \"sanity\");\n        m.put(644, \"dwr\");\n        m.put(645, \"pssc\");\n        m.put(646, \"ldp\");\n        m.put(647, \"dhcp-failover\");\n        m.put(648, \"rrp\");\n        m.put(649, \"cadview-3d\");\n        m.put(650, \"obex\");\n        m.put(651, \"ieee-mms\");\n        m.put(652, \"hello-port\");\n        m.put(653, \"repscmd\");\n        m.put(654, \"aodv\");\n        m.put(655, \"tinc\");\n        m.put(656, \"spmp\");\n        m.put(657, \"rmc\");\n        m.put(658, \"tenfold\");\n        m.put(660, \"mac-srvr-admin\");\n        m.put(661, \"hap\");\n        m.put(662, \"pftp\");\n        m.put(663, \"purenoise\");\n        m.put(664, \"oob-ws-https\");\n        m.put(665, \"sun-dr\");\n        m.put(666, \"mdqs\");\n        m.put(667, \"disclose\");\n        m.put(668, \"mecomm\");\n        m.put(669, \"meregister\");\n        m.put(670, \"vacdsm-sws\");\n        m.put(671, \"vacdsm-app\");\n        m.put(672, \"vpps-qua\");\n        m.put(673, \"cimplex\");\n        m.put(674, \"acap\");\n        m.put(675, \"dctp\");\n        m.put(676, \"vpps-via\");\n        m.put(677, \"vpp\");\n        m.put(678, \"ggf-ncp\");\n        m.put(679, \"mrm\");\n        m.put(680, \"entrust-aaas\");\n        m.put(681, \"entrust-aams\");\n        m.put(682, \"xfr\");\n        m.put(683, \"corba-iiop\");\n        m.put(684, \"corba-iiop-ssl\");\n        m.put(685, \"mdc-portmapper\");\n        m.put(686, \"hcp-wismar\");\n        m.put(687, \"asipregistry\");\n        m.put(688, \"realm-rusd\");\n        m.put(689, \"nmap\");\n        m.put(690, \"vatp\");\n        m.put(691, \"msexch-routing\");\n        m.put(692, \"hyperwave-isp\");\n        m.put(693, \"connendp\");\n        m.put(694, \"ha-cluster\");\n        m.put(695, \"ieee-mms-ssl\");\n        m.put(696, \"rushd\");\n        m.put(697, \"uuidgen\");\n        m.put(698, \"olsr\");\n        m.put(699, \"accessnetwork\");\n        m.put(700, \"epp\");\n        m.put(701, \"lmp\");\n        m.put(702, \"iris-beep\");\n        m.put(704, \"elcsd\");\n        m.put(705, \"agentx\");\n        m.put(706, \"silc\");\n        m.put(707, \"borland-dsj\");\n        m.put(709, \"entrust-kmsh\");\n        m.put(710, \"entrust-ash\");\n        m.put(711, \"cisco-tdp\");\n        m.put(712, \"tbrpf\");\n        m.put(713, \"iris-xpc\");\n        m.put(714, \"iris-xpcs\");\n        m.put(715, \"iris-lwz\");\n        m.put(716, \"pana\");\n        m.put(729, \"netviewdm1\");\n        m.put(730, \"netviewdm2\");\n        m.put(731, \"netviewdm3\");\n        m.put(741, \"netgw\");\n        m.put(742, \"netrcs\");\n        m.put(744, \"flexlm\");\n        m.put(747, \"fujitsu-dev\");\n        m.put(748, \"ris-cm\");\n        m.put(749, \"kerberos-adm\");\n        m.put(750, \"rfile\");\n        m.put(751, \"pump\");\n        m.put(752, \"qrh\");\n        m.put(753, \"rrh\");\n        m.put(754, \"tell\");\n        m.put(758, \"nlogin\");\n        m.put(759, \"con\");\n        m.put(760, \"ns\");\n        m.put(761, \"rxe\");\n        m.put(762, \"quotad\");\n        m.put(763, \"cycleserv\");\n        m.put(764, \"omserv\");\n        m.put(765, \"webster\");\n        m.put(767, \"phonebook\");\n        m.put(769, \"vid\");\n        m.put(770, \"cadlock\");\n        m.put(771, \"rtip\");\n        m.put(772, \"cycleserv2\");\n        m.put(773, \"submit\");\n        m.put(774, \"rpasswd\");\n        m.put(775, \"entomb\");\n        m.put(776, \"wpages\");\n        m.put(777, \"multiling-http\");\n        m.put(780, \"wpgs\");\n        m.put(800, \"mdbs-daemon\");\n        m.put(801, \"device\");\n        m.put(802, \"mbap-s\");\n        m.put(810, \"fcp-udp\");\n        m.put(828, \"itm-mcell-s\");\n        m.put(829, \"pkix-3-ca-ra\");\n        m.put(830, \"netconf-ssh\");\n        m.put(831, \"netconf-beep\");\n        m.put(832, \"netconfsoaphttp\");\n        m.put(833, \"netconfsoapbeep\");\n        m.put(847, \"dhcp-failover2\");\n        m.put(848, \"gdoi\");\n        m.put(853, \"domain-s\");\n        m.put(860, \"iscsi\");\n        m.put(861, \"owamp-control\");\n        m.put(862, \"twamp-control\");\n        m.put(873, \"rsync\");\n        m.put(886, \"iclcnet-locate\");\n        m.put(887, \"iclcnet-svinfo\");\n        m.put(888, \"accessbuilder\");\n        m.put(900, \"omginitialrefs\");\n        m.put(901, \"smpnameres\");\n        m.put(902, \"ideafarm-door\");\n        m.put(903, \"ideafarm-panic\");\n        m.put(910, \"kink\");\n        m.put(911, \"xact-backup\");\n        m.put(912, \"apex-mesh\");\n        m.put(913, \"apex-edge\");\n        m.put(989, \"ftps-data\");\n        m.put(990, \"ftps\");\n        m.put(991, \"nas\");\n        m.put(992, \"telnets\");\n        m.put(993, \"imaps\");\n        m.put(995, \"pop3s\");\n        m.put(996, \"vsinet\");\n        m.put(997, \"maitrd\");\n        m.put(998, \"busboy\");\n        m.put(999, \"garcon\");\n        m.put(1000, \"cadlock2\");\n        m.put(1001, \"webpush\");\n        m.put(1010, \"surf\");\n        m.put(1021, \"exp1\");\n        m.put(1022, \"exp2\");\n    }\n\n\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/PrefManager.java",
    "content": "/**\n * This file is part of Privacy Friendly Password Generator.\n * Privacy Friendly Password Generator is free software:\n * you can redistribute it and/or modify it under the terms of the\n * GNU General Public License as published by the Free Software Foundation,\n * either version 3 of the License, or any later version.\n * Privacy Friendly Password Generator is distributed in the hope\n * that it will be useful, but WITHOUT ANY WARRANTY; without even\n * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with Privacy Friendly Password Generator. If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\n\n/**\n * Class structure taken from tutorial at http://www.androidhive.info/2016/05/android-build-intro-slider-app/\n * @author Karola Marky\n * @version 20170112\n */\npublic class PrefManager {\n    private static SharedPreferences pref;\n\n    private static final String IS_FIRST_TIME_LAUNCH = \"IsFirstTimeLaunch\";\n\n    public PrefManager(Context context) {\n        pref = PreferenceManager.getDefaultSharedPreferences(context);\n    }\n\n    public static void setFirstTimeLaunch(boolean isFirstTime) {\n        pref.edit().putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime).apply();\n    }\n\n    public static boolean isFirstTimeLaunch() {\n        return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);\n    }\n\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/RunStore.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\n\nimport android.app.Activity;\nimport android.content.Context;\n\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.ServiceHandler;\n\n/**\n * Singleton-Like implementation which holds App-Context information and ServiceHandlers\n */\npublic class RunStore {\n\n    private static Activity gContext;\n    private static Context gAppContext;\n    private static ServiceHandler gService;\n\n    public static void setContext(Activity activity) {\n        gContext = activity;\n    }\n\n    public static Context getContext() {\n        if(gContext == null) return gAppContext;\n        return gContext;\n    }\n\n    public static ServiceHandler getServiceHandler() {\n        if (gService == null) {\n            gService = new ServiceHandler();\n        }\n        return gService;\n    }\n\n    public static void setAppContext(Context appContext) {\n        RunStore.gAppContext = appContext;\n    }\n\n    public static Context getAppContext() {\n        return gAppContext;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/TLType.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\n/**\n * Enum indication transport layer protocol\n */\npublic enum TLType {\n    tcp,\n    tcp6,\n    udp,\n    udp6\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ToolBox.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.Assistant;\n\nimport android.app.ActivityManager;\nimport android.content.Context;\nimport android.util.Log;\n\nimport org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.PassiveService;\n\nimport java.io.File;\nimport java.net.InetAddress;\nimport java.net.NetworkInterface;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayDeque;\nimport java.util.Arrays;\nimport java.util.Deque;\nimport java.util.Enumeration;\n\n/**\n * Class for all the litte helpers, used by more than one layer\n */\npublic class ToolBox {\n\n    private static final char[] hexCode = \"0123456789ABCDEF\".toCharArray();\n\n    //Convert byte[] to HexString\n    public static String printHexBinary(byte[] data) {\n        StringBuilder r = new StringBuilder(data.length * 2);\n        for (byte b : data) {\n            r.append(hexCode[(b >> 4) & 0xF]);\n            r.append(hexCode[(b & 0xF)]);\n        }\n        return r.toString();\n    }\n\n    //Convert HexString to byte[]\n    public static byte[] hexStringToByteArray(String s) {\n        byte[] b = new byte[s.length() / 2];\n        for (int i = 0; i < b.length; i++) {\n            int index = i * 2;\n            int v = Integer.parseInt(s.substring(index, index + 2), 16);\n            b[i] = (byte) v;\n        }\n        return b;\n    }\n\n    //Convert byte[] to wireshark import-string.\n    public static String printExportHexString(byte[] data) {\n        String hexString = printHexBinary(data);\n        String export = \"000000 \";\n        for (int i = 0; i + 1 < hexString.length(); i += 2) {\n            export += \" \" + hexString.substring(i, i + 2);\n        }\n        export += \" ......\";\n        return export;\n    }\n\n    //Returns active network interfaces\n    public String getIfs(Context context) {\n        //read from command: netcfg | grep UP\n\n        String filePath = context.getFilesDir().getAbsolutePath() + File.separator + Const.FILE_IF_LIST;\n        if (Const.IS_DEBUG) Log.d(Const.LOG_TAG, \"Try to get active interfaces to\" + filePath);\n        ExecCom.user(\"rm \" + filePath);\n        ExecCom.user(\"netcfg | grep UP -> \" + filePath);\n        String result = ExecCom.userForResult(\"cat \" + filePath);\n        return result;\n    }\n\n    //Char to value\n    private int hexToBin(char ch) {\n        if ('0' <= ch && ch <= '9') return ch - '0';\n        if ('A' <= ch && ch <= 'F') return ch - 'A' + 10;\n        if ('a' <= ch && ch <= 'f') return ch - 'a' + 10;\n        return -1;\n    }\n\n    //Lookup local IP address\n    public static InetAddress getLocalAddress() {\n        try {\n            for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n                 en.hasMoreElements(); ) {\n                NetworkInterface intf = en.nextElement();\n                for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {\n                    InetAddress inetAddress = enumIpAddr.nextElement();\n                    if (!inetAddress.isLoopbackAddress()) {\n                        return inetAddress;\n                    }\n                }\n            }\n        } catch (Exception e) {\n            Log.e(Const.LOG_TAG, \"Error while obtaining local address\");\n            e.printStackTrace();\n        }\n        return null;\n    }\n\n    //Test if service is active.\n    public static boolean isAnalyzerServiceRunning() {\n        ActivityManager manager = (ActivityManager) RunStore.getContext().getSystemService(Context.ACTIVITY_SERVICE);\n        for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n            if (PassiveService.class.getName().equals(service.service.getClassName())) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n\n    //Search for byte array in given byte array.\n    public static int searchByteArray(byte[] input, byte[] searchedFor) {\n        //convert byte[] to Byte[]\n        Byte[] searchedForB = new Byte[searchedFor.length];\n        for (int x = 0; x < searchedFor.length; x++) {\n            searchedForB[x] = searchedFor[x];\n        }\n\n        int idx = -1;\n        //search:\n        Deque<Byte> q = new ArrayDeque<>(input.length);\n        for (int i = 0; i < input.length; i++) {\n            if (q.size() == searchedForB.length) {\n                //here I can check\n                Byte[] cur = q.toArray(new Byte[]{});\n                if (Arrays.equals(cur, searchedForB)) {\n                    //found!\n                    idx = i - searchedForB.length;\n                    break;\n                } else {\n                    //not found\n                    q.pop();\n                    q.addLast(input[i]);\n                }\n            } else {\n                q.addLast(input[i]);\n            }\n        }\n        if (Const.IS_DEBUG && idx != -1)\n            Log.d(Const.LOG_TAG, ToolBox.printHexBinary(searchedFor) + \" found at position \" + idx);\n        return idx;\n    }\n\n    //Convert a Java long to a four byte array\n    public static byte[] longToFourBytes(long l) {\n        ByteBuffer bb = ByteBuffer.allocate(8);\n        byte[] b = new byte[4];\n        bb.putLong(l);\n        bb.position(4);\n        bb.get(b);\n        return b;\n\n    }\n\n    //Convert a Java int to a two byte array\n    public static byte[] intToTwoBytes(int i) {\n        ByteBuffer bb = ByteBuffer.allocate(4);\n        byte[] b = new byte[2];\n        bb.putInt(i);\n        bb.position(2);\n        bb.get(b);\n        return b;\n    }\n\n    //Convert four bytes to a Java Long\n    public static long fourBytesToLong(byte[] b) {\n        ByteBuffer bb = ByteBuffer.allocate(8);\n        bb.position(4);\n        bb.put(b);\n        bb.position(0);\n        return bb.getLong();\n    }\n\n    //Convert two bytes to a Java int\n    public static int twoBytesToInt(byte[] b) {\n        ByteBuffer bb = ByteBuffer.allocate(4);\n        bb.position(2);\n        bb.put(b);\n        bb.position(0);\n        return bb.getInt();\n    }\n\n    //Reverse the order in a Byte array\n    public static byte[] reverseByteArray(byte[] b) {\n        byte[] b0 = new byte[b.length];\n        int j = 0;\n        for (int i = b.length - 1; i >= 0; i--) {\n            b0[j] = b[i];\n            j++;\n        }\n        return b0;\n    }\n\n    //ipv6 Hex to address String calculator\n    //e.g.: B80D01200000000067452301EFCDAB89 -> 2001:0db8:0000:0000:0123:4567:89ab:cdef\n    public static String hexToIp6(String hexaIP) {\n        StringBuilder result = new StringBuilder();\n        for (int i = 0; i < hexaIP.length(); i = i + 8) {\n            String word = hexaIP.substring(i, i + 8);\n            for (int j = word.length() - 1; j >= 0; j = j - 2) {\n                result.append(word.substring(j - 1, j + 1));\n                result.append((j == 5) ? \":\" : \"\");//in the middle\n            }\n            result.append(\":\");\n        }\n        return result.substring(0, result.length() - 1).toString();\n    }\n\n    //ipv4 Hex to address String calculator\n    //e.g.: 0100A8C0 -> 192.168.0.1*/\n    public static String hexToIp4(String hexa) {\n        StringBuilder result = new StringBuilder();\n        //reverse Little to Big\n        for (int i = hexa.length() - 1; i >= 0; i = i - 2) {\n            String wtf = hexa.substring(i - 1, i + 1);\n            result.append(Integer.parseInt(wtf, 16));\n            result.append(\".\");\n        }\n        //remove last \".\";\n        return result.substring(0, result.length() - 1).toString();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Collector.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n    ###################################################################\n    This file is part of Net Monitor.\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n    Diese Datei ist Teil von Net Monitor.\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n    ###################################################################\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.pm.ApplicationInfo;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.preference.PreferenceManager;\nimport android.util.Log;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.AsyncCertVal;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.AsyncDNS;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.KnownPorts;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.TLType;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.ToolBox;\nimport org.secuso.privacyfriendlynetmonitor.BuildConfig;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.ObjectInputStream;\nimport java.io.ObjectOutputStream;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedHashMap;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\nimport de.bjoernr.ssllabs.ConsoleUtilities;\n\n/**\n * Collector class collects data from the services and processes it for usage with the UI.\n * It handles asynchronous calls to DNS and SSL-Labs services and holds run-time caches for\n * compiled information.\n */\npublic class Collector {\n\n    //application caches\n    private static HashMap<Integer, List<PackageInfo>> sCachePackage = new HashMap<>();\n    private static HashMap<Integer, Drawable> sCacheIcon = new HashMap<>();\n    private static HashMap<Integer, String> sCacheLabel = new HashMap<>();\n    private static HashMap<String, String> sCacheDNS = new HashMap<>();\n\n    //ReportDetail information\n    public static Boolean isCertVal = false;\n    public static HashMap<String, Map<String, Object>> mCertValMap = new HashMap<>();\n    public static List<String> sCertValList = new ArrayList<>();\n    public static ArrayList<String[]> sDetailReportList = new ArrayList<>();\n    public static Report sDetailReport;\n\n    //Data processing maps\n    private static ArrayList<Report> sReportList = new ArrayList<>();\n    private static HashMap<Integer, List<Report>> mUidReportMap = new HashMap<>();\n    private static HashMap<Integer, List<Report>> mFilteredUidReportMap = new HashMap<>();\n\n    //Apps to scan/not scan\n    private static List<String> appsToIncludeInScan = new ArrayList<String>();\n    private static List<String> appsToExcludeFromScan = new ArrayList<String>();\n\n    //UID Table\n    private static HashMap<String, String> knownUIDs = new HashMap<>();\n\n    //Pushed the newest available information as deep copy.\n    public static HashMap<Integer, List<Report>> provideSimpleReports(ReportEntityDao reportEntityDao) {\n        updateReports(reportEntityDao);\n        mFilteredUidReportMap = filterReports();\n        mFilteredUidReportMap = sortMapByLabels();\n        return mFilteredUidReportMap;\n    }\n\n    //Sort the filtered report map by app labels and app type (system/third-party)\n    private static LinkedHashMap<Integer, List<Report>> sortMapByLabels() {\n        LinkedHashMap<Integer, List<Report>> sortedMap = new LinkedHashMap<>();\n        ArrayList<ArrayList<Report>> reportsApp = new ArrayList<>();\n        ArrayList<ArrayList<Report>> reportsSysApp = new ArrayList<>();\n        //Sort in sub lists by app-type (System/User)\n        Set<Integer> keys = mFilteredUidReportMap.keySet();\n        for (int key : keys) {\n            ArrayList<Report> appReports = (ArrayList<Report>) mFilteredUidReportMap.get(key);\n            if (appReports.get(0).uid > 10000) {\n                reportsApp.add(appReports);\n            } else {\n                reportsSysApp.add(appReports);\n            }\n        }\n        //sort the sub list and append to liked HashMap\n        sortListByName(reportsApp);\n        sortListByName(reportsSysApp);\n        reportsApp.addAll(reportsSysApp);\n\n        //Add to original filter map\n        for (int i = 0; i < reportsApp.size(); i++) {\n            sortedMap.put(reportsApp.get(i).get(0).uid, reportsApp.get(i));\n        }\n        return sortedMap;\n    }\n\n    //Do da bubble sort!\n    private static void sortListByName(ArrayList<ArrayList<Report>> list) {\n        for (int j = list.size(); j > 1; j--) {\n            for (int i = 0; i < j - 1; i++) {\n                if (getLabel(list.get(i).get(0).uid).compareTo(getLabel(list.get(i + 1).get(0).uid)) > 0) {\n                    ArrayList<Report> tmpList = list.get(i);\n                    list.set(i, list.get(i + 1));\n                    list.set(i + 1, tmpList);\n                }\n            }\n        }\n    }\n\n    //Generate an overview List, with only one report per remote address per app\n    private static HashMap<Integer, List<Report>> filterReports() {\n        HashMap<Integer, List<Report>> filteredReportsByApp = new HashMap<>();\n        HashSet<String> filterMap = new HashSet<>();\n        String address;\n        ArrayList<Report> list;\n        ArrayList<Report> filteredList;\n        for (int key : mUidReportMap.keySet()) {\n            filteredReportsByApp.put(key, new ArrayList<Report>());\n            list = (ArrayList<Report>) mUidReportMap.get(key);\n            filteredList = (ArrayList<Report>) filteredReportsByApp.get(key);\n            filterMap.clear();\n            for (int i = 0; i < list.size(); i++) {\n                address = list.get(i).remoteAdd.getHostAddress();\n                if (!filterMap.contains(address)) {\n                    filteredList.add(list.get(i));\n                    filterMap.add(address);\n                }\n            }\n        }\n        return filteredReportsByApp;\n    }\n\n    //gets momentual settings from pref manager\n    static void updateSettings() {\n        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(RunStore.getContext());\n        Collector.isCertVal = prefs.getBoolean(Const.IS_CERTVAL, false);\n    }\n\n    // save reports to db\n    public static void saveReports(ReportEntityDao reportEntityDao) {\n        // Remove duplicates\n        appsToIncludeInScan = new ArrayList<String>(new LinkedHashSet<String>(appsToIncludeInScan));\n        appsToExcludeFromScan = new ArrayList<String>(new LinkedHashSet<String>(appsToExcludeFromScan));\n\n        // add reports to db\n        if (!sReportList.isEmpty()) {\n            for (Report report : sReportList) {\n\n                ReportEntity reportEntity = new ReportEntity();\n\n                String appName = getPackage(report.uid);\n\n                // check for apps to append to db\n                if (!appsToExcludeFromScan.contains(appName)) {\n                    if (appsToIncludeInScan.contains(appName)) {\n\n                        if (appName != null) {\n                            reportEntity.setAppName(appName);\n                        } else {\n                            reportEntity.setAppName(\"Unknown\");\n                        }\n\n                        String userID = \"\" + report.uid;\n                        reportEntity.setUserID(userID);\n\n                        String remoteAddr = \"\";\n                        if (report.type == TLType.tcp6 || report.type == TLType.udp6) {\n                            remoteAddr = report.remoteAdd.getHostAddress() + \" (IPv6)\";\n                        } else {\n                            remoteAddr = report.remoteAdd.getHostAddress();\n                        }\n                        reportEntity.setRemoteAddress(remoteAddr);\n\n                        String remoteHex = ToolBox.printHexBinary(report.remoteAddHex);\n                        reportEntity.setRemoteHex(remoteHex);\n\n                        String remoteHost = \"\";\n                        if (hasHostName(report.remoteAdd.getHostAddress())) {\n                            remoteHost = getDnsHostName(report.remoteAdd.getHostAddress());\n                        } else {\n                            remoteHost = \"name not resolved\";\n                        }\n                        reportEntity.setRemoteHost(remoteHost);\n\n                        String localAddress = \"\";\n                        if (report.type == TLType.tcp6 || report.type == TLType.udp6) {\n                            localAddress = report.localAdd.getHostAddress() + \" (IPv6)\";\n                        } else {\n                            localAddress = report.localAdd.getHostAddress();\n                        }\n                        reportEntity.setLocalAddress(localAddress);\n\n                        String localHex = ToolBox.printHexBinary(report.localAddHex);\n                        reportEntity.setLocalHex(localHex);\n\n                        String servicePort = \"\" + report.remotePort;\n                        reportEntity.setServicePort(servicePort);\n                        String payloadProt = \"\" + KnownPorts.resolvePort(report.remotePort);\n                        reportEntity.setPayloadProtocol(payloadProt);\n                        String transportProtocol = \"\" + report.type;\n                        reportEntity.setTransportProtocol(transportProtocol);\n                        String lastSeen = report.timestamp.toString();\n                        reportEntity.setTimeStamp(lastSeen);\n                        String localPort = \"\" + report.localPort;\n                        reportEntity.setLocalPort(localPort);\n\n                        String connectionInfo = KnownPorts.CompileConnectionInfo(report.remotePort, report.type);\n                        reportEntity.setConnectionInfo(connectionInfo);\n\n                        reportEntityDao.insertOrReplace(reportEntity);\n\n                    }\n                }\n            }\n        }\n    }\n\n    //Sequence to collect reports from detector\n    public static void updateReports(ReportEntityDao reportEntityDao) {\n\n        //update reports\n        pull();\n        //process reports (passive mode)\n        fillPackageInformation();\n        //resolve remote hosts (in cache or permission.INTERNET required)\n        new AsyncDNS().execute(\"\");\n        //sorting\n        sortReportsToMap();\n        //Generate ssl analyze requests\n        if (isCertVal) {\n            fillCertRequests();\n        }\n\n        saveReports(reportEntityDao);\n    }\n\n    //Search for resolved hostnames and add them to the resolved list\n    private static void fillCertRequests() {\n        Set<Integer> keySet = mFilteredUidReportMap.keySet();\n        ArrayList<Report> list;\n        Report r;\n        String ip;\n        for (int i : keySet) {\n            list = (ArrayList<Report>) mFilteredUidReportMap.get(i);\n            for (int j = 0; j < list.size(); j++) {\n                r = list.get(j);\n                //Add to certificate validation, if port 443 (TLS), resolved hostname and not yet\n                //analyzed\n                ip = r.remoteAdd.getHostAddress();\n                if (KnownPorts.isTlsPort(r.remotePort) && hasHostName(ip) &&\n                        !mCertValMap.containsKey(getDnsHostName(ip)) &&\n                        !sCertValList.contains(getDnsHostName(ip))) {\n                    sCertValList.add(getDnsHostName(ip));\n                }\n            }\n        }\n    }\n\n    //Sorts the reports by app package name to a HashMap\n    private static void sortReportsToMap() {\n        mUidReportMap = new HashMap<>();\n        for (int i = 0; i < sReportList.size(); i++) {\n            Report r = sReportList.get(i);\n            if (!mUidReportMap.containsKey(r.uid)) {\n                mUidReportMap.put(r.uid, new ArrayList<Report>());\n            }\n            mUidReportMap.get(r.uid).add(r);\n        }\n    }\n\n    // true if default\n    public static boolean hasGrade(String hostname) {\n        String grade = getMetric(hostname);\n        switch (grade) {\n            case \"RESOLVING CERTIFICATE HOSTS\":\n                return false;\n            case \"PENDING\":\n                return false;\n            default:\n                return true;\n        }\n    }\n\n\n    //pull records from detector and make a deep copy for frontend - usage\n    private static void pull() {\n        ArrayList<Report> reportList = new ArrayList<>();\n        Set<Integer> keySet = Detector.sReportMap.keySet();\n        for (int i : keySet) {\n            reportList.add(Detector.sReportMap.get(i));\n        }\n        sReportList = deepCopyReportList(reportList);\n    }\n\n    //Make an async reverse DNS request\n    public static void resolveHosts() {\n        for (int i = 0; i < sReportList.size(); i++) {\n            Report r = sReportList.get(i);\n            if (!hasHostName(r.remoteAdd.getHostAddress())) {\n                try {\n                    String hostName = r.remoteAdd.getHostName();\n                    sCacheDNS.put(r.remoteAdd.getHostAddress(), hostName);\n                    if (Const.IS_DEBUG) {\n                        Log.d(\"ReverseDNS\", \"Reverse DNS for \" + r.remoteAdd.getHostAddress()\n                                + hostName);\n                    }\n                } catch (RuntimeException e) {\n                    if (Const.IS_DEBUG) {\n                        Log.e(Const.LOG_TAG, \"Attempt to resolve host name failed\");\n                        e.printStackTrace();\n                    }\n                }\n            }\n        }\n    }\n\n    //Make an async request to get host information from sslLabs\n    static void updateCertVal() {\n        if (sCertValList.size() > 0) {\n            new AsyncCertVal().execute();\n        }\n    }\n\n    // fill reports with app data from Package Information Cache\n    private static void fillPackageInformation() {\n        for (int i = 0; i < sReportList.size(); i++) {\n            Report r = sReportList.get(i);\n            if (!sCachePackage.containsKey(r.uid)) {\n                updatePackageCache();\n            }\n            if (sCachePackage.containsKey(r.uid) && sCachePackage.get(r.uid).size() == 1) {\n                PackageInfo pi = sCachePackage.get(r.uid).get(0);\n                r.appName = pi.applicationInfo.name;\n                r.packageName = pi.packageName;\n            } else if (sCachePackage.containsKey(r.uid) && sCachePackage.get(r.uid).size() > 1) {\n                r.appName = \"UID \" + r.uid;\n                r.appName = \"app.unknown\";\n            } else {\n                r.appName = \"Unknown App\";\n                r.appName = \"app.unknown\";\n            }\n        }\n    }\n\n    //Make a deep copy of the report list\n    private static ArrayList<Report> deepCopyReportList(ArrayList<Report> reportList) {\n        ArrayList<Report> cloneList = new ArrayList<>();\n        try {\n            for (int i = 0; i < reportList.size(); i++) {\n                ByteArrayOutputStream byteOut = new ByteArrayOutputStream();\n                ObjectOutputStream out = new ObjectOutputStream(byteOut);\n                out.writeObject(reportList.get(i));\n                out.flush();\n                ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));\n                cloneList.add(Report.class.cast(in.readObject()));\n            }\n        } catch (IOException | ClassNotFoundException e) {\n            e.printStackTrace();\n        }\n        return cloneList;\n    }\n\n    //Updates the PkgInfo hash map with new entries.\n    private static void updatePackageCache() {\n        sCachePackage = new HashMap<>();\n        if (Const.IS_DEBUG) {\n            printAllPackages();\n        }\n        ArrayList<PackageInfo> infoList = (ArrayList<PackageInfo>) getPackages(RunStore.getContext());\n        for (PackageInfo i : infoList) {\n            if (i != null) {\n                if (!sCachePackage.containsKey(i.applicationInfo.uid)) {\n                    sCachePackage.put(i.applicationInfo.uid, new ArrayList<PackageInfo>());\n                }\n\n                sCachePackage.get(i.applicationInfo.uid).add(i);\n            }\n        }\n        addSysPackage();\n    }\n\n    //Generate a system user dummy for UID 0\n    private static void addSysPackage() {\n        // Add root\n        PackageInfo root = new PackageInfo();\n        root.packageName = \"com.android.system\";\n        root.versionCode = BuildConfig.VERSION_CODE;\n        root.versionName = BuildConfig.VERSION_NAME;\n        root.applicationInfo = new ApplicationInfo();\n        root.applicationInfo.name = \"System\";\n        root.applicationInfo.uid = 0;\n        root.applicationInfo.icon = 0;\n\n        if (!sCachePackage.containsKey(root.applicationInfo.uid)) {\n            sCachePackage.put(root.applicationInfo.uid, new ArrayList<PackageInfo>());\n        }\n        sCachePackage.get(root.applicationInfo.uid).add(root);\n    }\n\n    //Get a list with all currently installed packages\n    private static List<PackageInfo> getPackages(Context context) {\n        synchronized (context.getApplicationContext()) {\n            PackageManager pm = context.getPackageManager();\n            return new ArrayList<>(pm.getInstalledPackages(0));\n        }\n    }\n\n    //debug print: Print all reachable active processes\n    private static void printAllPackages() {\n        ArrayList<PackageInfo> infoList = (ArrayList<PackageInfo>) getPackages(RunStore.getContext());\n        for (PackageInfo i : infoList) {\n            Log.d(Const.LOG_TAG, i.packageName + \" uid_\" + i.applicationInfo.uid);\n        }\n    }\n\n    //Provides app icon for activities\n    public static Drawable getIcon(int uid) {\n        try {\n            if (!sCacheIcon.containsKey(uid)) {\n                if (sCachePackage.containsKey(uid) && sCachePackage.get(uid).size() == 1) {\n                    sCacheIcon.put(uid, sCachePackage.get(uid).get(0).applicationInfo.\n                            loadIcon(RunStore.getContext().getPackageManager()));\n                } else {\n                    return getDefaultIcon();\n                }\n            }\n            return sCacheIcon.get(uid);\n        } catch (NullPointerException e) {\n            Log.e(Const.LOG_TAG, \"Could not load icon of: \" + sCachePackage.get(uid).get(0).packageName);\n            return getDefaultIcon();\n        }\n    }\n\n    // get default icon\n    private static Drawable getDefaultIcon() {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n            return getIconNew(android.R.drawable.sym_def_app_icon);\n        } else {\n            return getIconOld(android.R.drawable.sym_def_app_icon);\n        }\n    }\n\n    @TargetApi(Build.VERSION_CODES.GINGERBREAD)\n    private static Drawable getIconOld(int id) {\n        return RunStore.getContext().getResources().getDrawable(id);\n    }\n\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    private static Drawable getIconNew(int id) {\n        return RunStore.getContext().getDrawable(id);\n    }\n\n    //Provides App names for activities\n    public static String getLabel(int uid) {\n        if (!sCacheLabel.containsKey(uid)) {\n            if (sCachePackage.containsKey(uid) && sCachePackage.get(uid).size() == 1) {\n                sCacheLabel.put(uid, (String) sCachePackage.get(uid).get(0).applicationInfo.\n                        loadLabel(RunStore.getContext().getPackageManager()));\n            } else if (sCachePackage.containsKey(uid) && sCachePackage.get(uid).size() > 1) {\n                return \"UID \" + uid;\n\n            } else {\n                return RunStore.getContext().getString(R.string.unknown_app);\n            }\n        }\n        return sCacheLabel.get(uid);\n    }\n\n    //Provides full app package name\n    public static String getPackage(int uid) {\n        if (sCachePackage.containsKey(uid) && sCachePackage.get(uid).size() == 1) {\n            return sCachePackage.get(uid).get(0).packageName;\n        } else {\n            return RunStore.getContext().getString(R.string.unknown_package);\n        }\n    }\n\n    //Provides resolved hostname if available\n    public static String getDnsHostName(String hostAdd) {\n        if (sCacheDNS.containsKey(hostAdd)) {\n            return sCacheDNS.get(hostAdd);\n        } else {\n            return hostAdd;\n        }\n    }\n\n    //Test if hostname of connection is resolved\n    public static Boolean hasHostName(String hostAdd) {\n        return sCacheDNS.containsKey(hostAdd);\n    }\n\n    //Get linked hostname from certificate information package (SSL Labs API)\n    public static String getCertHost(String hostname) {\n        if (mCertValMap.containsKey(hostname)) {\n            Map<String, Object> map = mCertValMap.get(hostname);\n            if (Const.IS_DEBUG) {\n                Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map));\n            }\n            if (analyseReady(map)) {\n                if (map.containsKey(\"host\")) {\n                    return (String) map.get(\"host\");\n                } else {\n                    return hostname;\n                }\n            }\n        }\n        return hostname;\n    }\n\n    //Get grade information of an resolved SSL Labs request\n    public static String getMetric(String hostname) {\n        String grade;\n        if (mCertValMap.containsKey(hostname)) {\n            Map<String, Object> map = mCertValMap.get(hostname);\n            if (Const.IS_DEBUG) {\n                Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map));\n            }\n            if (analyseReady(map)) {\n                grade = readEndpoints(map);\n                if (grade.equals(\"no_grade\")) {\n                    return \"no_grade\";\n                } else if (grade.equals(\"Certificate not valid for domain name\")) {\n                    handleInvalidDomainName(map);\n                    return \"RESOLVING CERTIFICATE HOSTS\";\n                } else if (grade.equals(\"no_endpoints\")) {\n                    return \"no_endpoints\";\n                } else {\n                    return grade;\n                }\n            } else {\n                return \"PENDING\";\n            }\n\n        } else {\n            return \"PENDING\";\n        }\n    }\n\n    //Read endpoint-date from a SSL Labs request\n    private static String readEndpoints(Map<String, Object> map) {\n        final String result;\n        if (map.containsKey(\"endpoints\")) {\n            ArrayList endpointsList = (ArrayList) map.get(\"endpoints\");\n            HashMap endpoints = (HashMap) endpointsList.get(0);\n            if (endpoints.containsKey(\"grade\")) {\n                result = (String) endpoints.get(\"grade\");\n            } else if (endpoints.containsKey(\"statusMessage\")) {\n                result = (String) endpoints.get(\"statusMessage\");\n            } else {\n                result = \"no_status\";\n            }\n        } else {\n            result = \"no_endpoints\";\n        }\n        return result;\n    }\n\n    //Handle \"Certificate not valid for domain name\" Error (e.g. google services)\n    private static void handleInvalidDomainName(Map<String, Object> map) {\n        if (map.containsKey(\"certHostnames\") && map.containsKey(\"host\")) {\n            ArrayList certNames = (ArrayList) map.get(\"certHostnames\");\n            String oldHost = (String) map.get(\"host\");\n            String certHost = (String) certNames.get(0);\n            certHost = certHost.replace(\"*.\", \"\");\n            if (mCertValMap.containsKey(certHost) && mCertValMap.containsKey(oldHost)) {\n                mCertValMap.put(oldHost, mCertValMap.get(certHost));\n                if (sCertValList.contains(oldHost)) {\n                    sCertValList.remove(oldHost);\n                }\n            } else {\n                if (!sCertValList.contains(certHost)) {\n                    sCertValList.add(certHost);\n                }\n            }\n        }\n    }\n\n    // Update pending hostnames for certificate validation by SSL Labs API\n    public static void updateCertHostHandler() {\n        Set<String> keySet = Collector.mCertValMap.keySet();\n        Map map;\n        for (String key : keySet) {\n            map = (HashMap) Collector.mCertValMap.get(key);\n            if (map.containsKey(\"host\")) {\n                String certHost = (String) map.get(\"host\");\n                if (!key.equals(map.get(key)) && !Collector.analyseReady(map)) {\n                    Collector.mCertValMap.put(key, Collector.mCertValMap.get(certHost));\n                }\n            }\n        }\n    }\n\n    //Checks if ssl analysis has been completed\n    public static boolean analyseReady(Map<String, Object> map) {\n        String status = (String) map.get(\"status\");\n        return status != null && status.equals(\"READY\");\n    }\n\n    //provide a detail report of a connection\n    public static void provideDetail(int uid, byte[] remoteAddHex) {\n        ArrayList<Report> filterList = filterReportsByAdd(uid, remoteAddHex);\n        sDetailReport = filterList.get(0);\n        buildDetailStrings(filterList);\n    }\n\n    //filter a report list so that each remote ip is unique\n    private static ArrayList<Report> filterReportsByAdd(int uid, byte[] remoteAddHex) {\n        List<Report> reportList = mUidReportMap.get(uid);\n        ArrayList<Report> filterList = new ArrayList<>();\n        for (int i = 0; i < reportList.size(); i++) {\n            if (Arrays.equals(reportList.get(i).remoteAddHex, remoteAddHex)) {\n                filterList.add(reportList.get(i));\n            }\n        }\n        return filterList;\n    }\n\n    //Build report detail information for ReportDetailActivity list adapter\n    private static void buildDetailStrings(ArrayList<Report> filterList) {\n        ArrayList<String[]> l = new ArrayList<>();\n        Report r = filterList.get(0);\n        try {\n            PackageInfo info = sCachePackage.get(r.uid).get(0);\n\n            //App info\n            l.add(new String[]{\"User ID\", \"\" + r.uid});\n            l.add(new String[]{\"App Version\", \"\" + info.versionName});\n            if (r.uid > 10000) {\n                l.add(new String[]{\"Installed On\", \"\" + new Date(info.firstInstallTime).toString()});\n            } else {\n                l.add(new String[]{\"Installed On\", \"System App\"});\n            }\n            l.add(new String[]{\"\", \"\"});\n\n            //Connection info\n            if (r.type == TLType.tcp6 || r.type == TLType.udp6) {\n                l.add(new String[]{\"Remote Address\", r.remoteAdd.getHostAddress()\n                        + \"\\n(IPv6 translated)\"});\n            } else {\n                l.add(new String[]{\"Remote Address\", r.remoteAdd.getHostAddress()});\n            }\n            l.add(new String[]{\"Remote HEX\", ToolBox.printHexBinary(r.remoteAddHex)});\n            if (hasHostName(r.remoteAdd.getHostAddress())) {\n                l.add(new String[]{\"Remote Host\", getDnsHostName(r.remoteAdd.getHostAddress())});\n            } else {\n                l.add(new String[]{\"Remote Host\", \"name not resolved\"});\n            }\n            if (r.type == TLType.tcp6 || r.type == TLType.udp6) {\n                l.add(new String[]{\"Local Address\", r.localAdd.getHostAddress()\n                        + \"\\n(IPv6 translated)\"});\n            } else {\n                l.add(new String[]{\"Local Address\", r.localAdd.getHostAddress()});\n            }\n            l.add(new String[]{\"Local HEX\", ToolBox.printHexBinary(r.localAddHex)});\n            l.add(new String[]{\"\", \"\"});\n            l.add(new String[]{\"Service Port\", \"\" + r.remotePort});\n            l.add(new String[]{\"Payload Protocol\", \"\" + KnownPorts.resolvePort(r.remotePort)});\n            l.add(new String[]{\"Transport Protocol\", \"\" + r.type});\n            l.add(new String[]{\"Last Seen\", r.timestamp.toString()});\n            l.add(new String[]{\"\", \"\"});\n\n            //List open sockets\n            l.add(new String[]{\"Simultaneous Connections\", \"\" + filterList.size()});\n            for (int i = 0; i < filterList.size(); i++) {\n                Report r2 = filterList.get(i);\n                l.add(new String[]{\"(\" + (i + 1) + \")src port > dst port\",\n                        r2.localPort + \" > \" + r2.remotePort});\n                l.add(new String[]{\"    last socket-state \", getTransportState(r.state)});\n            }\n            l.add(new String[]{\"\", \"\"});\n\n            sDetailReportList = l;\n        } catch (NullPointerException e) {\n\n        }\n    }\n\n\n    //Resolves the socket state of an identified connection\n    private static String getTransportState(byte[] state) {\n        String status;\n        String stateHex = ToolBox.printHexBinary(state);\n        switch (stateHex) {\n            case \"01\":\n                status = \"ESTABLISHED\";\n                break;\n            case \"02\":\n                status = \"SYN_SENT\";\n                break;\n            case \"03\":\n                status = \"SYN_RECV\";\n                break;\n            case \"04\":\n                status = \"FIN_WAIT1\";\n                break;\n            case \"05\":\n                status = \"FIN_WAIT2\";\n                break;\n            case \"06\":\n                status = \"TIME_WAIT\";\n                break;\n            case \"07\":\n                status = \"CLOSE\";\n                break;\n            case \"08\":\n                status = \"CLOSE_WAIT\";\n                break;\n            case \"09\":\n                status = \"LAST_ACK\";\n                break;\n            case \"0A\":\n                status = \"LISTEN\";\n                break;\n            case \"0B\":\n                status = \"CLOSING\";\n                break;\n            case \"0C\":\n                status = \"NEW_SYN_RECV\";\n                break;\n            default:\n                status = \"UNKNOWN\";\n                break;\n        }\n        return status;\n    }\n\n    // get scan whitelist\n    public static List<String> getAppsToIncludeInScan() {\n        return appsToIncludeInScan;\n    }\n\n    // add apps to scan whitelist\n    public static void addAppToIncludeInScan(String appToInclude) {\n        Collector.appsToIncludeInScan.add(appToInclude);\n    }\n\n    // delete an app from scan whitelist\n    public static void deleteAppFromIncludeInScan(String appName) {\n        Collector.appsToIncludeInScan.remove(appName);\n    }\n\n    // get scan blacklist\n    public static List<String> getAppsToExcludeFromScan() {\n        return appsToExcludeFromScan;\n    }\n\n    // add app to scan blacklist\n    public static void addAppToExcludeFromScan(String appToExclude) {\n        Collector.appsToExcludeFromScan.add(appToExclude);\n    }\n\n    // delete app from scan blacklist\n    public static void deleteAppToExcludeFromScan(String appToExclude) {\n        Collector.appsToExcludeFromScan.remove(appToExclude);\n    }\n\n    // get known uids\n    public static HashMap<String, String> getKnownUIDs() {\n        return knownUIDs;\n    }\n\n    // add know uids\n    public static void addKnownUIDs(String key, String value) {\n        Collector.knownUIDs.put(key, value);\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Detector.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis;\n\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.ExecCom;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.TLType;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.ToolBox;\n\nimport java.nio.ByteBuffer;\nimport java.sql.Timestamp;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedList;\nimport java.util.List;\n\n/**\n * Detects active connections on the device and identifies port-uid-pid realation. Corresponding\n * Apps are identified.\n */\n\nclass Detector {\n\n    //Members\n    //Get commands for shell readin\n    private static final String commandTcp = \"cat /proc/net/tcp\";\n    private static final String commandTcp6 = \"cat /proc/net/tcp6\";\n    private static final String commandUdp = \"cat /proc/net/udp\";\n    private static final String commandUdp6 = \"cat /proc/net/udp6\";\n\n    static HashMap<Integer, Report> sReportMap = new HashMap<>();\n\n    //Update the report HashMap with currently scanned connections\n    static void updateReportMap() {\n        updateOrAdd(getCurrentConnections());\n        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(RunStore.getAppContext());\n        boolean isLog = prefs.getBoolean(Const.IS_LOG, false);\n        boolean isCertVal = prefs.getBoolean(Const.IS_CERTVAL, false);\n        if (!isLog && !isCertVal) {\n            removeOldReports();\n        }\n    }\n\n    //Update existing or add new reports\n    private static void updateOrAdd(ArrayList<Report> reportList) {\n        for (int i = 0; i < reportList.size(); i++) {\n            //Key = source-Port\n            int key = reportList.get(i).localPort;\n            if (sReportMap.containsKey(key)) {\n                Report r = sReportMap.get(key);\n                r.touch();\n                r.state = reportList.get(i).state;\n            } else {\n                sReportMap.put(key, reportList.get(i));\n            }\n        }\n    }\n\n    //Remove timed-out connection-reports\n    private static void removeOldReports() {\n        Timestamp thresh = new Timestamp(System.currentTimeMillis() - Const.REPORT_TTL_DEFAULT);\n\n        HashSet<Integer> keySet = new HashSet<>(sReportMap.keySet());\n        for (int key : keySet) {\n            if (sReportMap.get(key).timestamp.compareTo(thresh) < 0) {\n                sReportMap.remove(key);\n            }\n        }\n    }\n\n    // read the current connections off the designated files\n    private static ArrayList<Report> getCurrentConnections() {\n        ArrayList<Report> fullReportList = new ArrayList<>();\n\n        //generate full report of all tcp/udp connections\n        fullReportList.addAll(parseNetOutput(ExecCom.userForResult(commandTcp), TLType.tcp));\n        fullReportList.addAll(parseNetOutput(ExecCom.userForResult(commandTcp6), TLType.tcp6));\n        fullReportList.addAll(parseNetOutput(ExecCom.userForResult(commandUdp), TLType.udp));\n        fullReportList.addAll(parseNetOutput(ExecCom.userForResult(commandUdp6), TLType.udp6));\n\n        return fullReportList;\n    }\n\n    //Parse output from /proc/net/tcp and udp files (ip4/6)\n    private static List<Report> parseNetOutput(String readIn, TLType type) {\n        String[] splitLines;\n        LinkedList<Report> reportList = new LinkedList<>();\n\n        splitLines = readIn.split(\"\\\\n\");\n        for (int i = 1; i < splitLines.length; i++) {\n            splitLines[i] = splitLines[i].trim();\n            reportList.add(initReport(splitLines[i], type));\n        }\n        return reportList;\n    }\n\n    //Initiate a reports from a read in line\n    private static Report initReport(String splitLine, TLType type) {\n        String splitTabs[];\n        while (splitLine.contains(\"  \")) {\n            splitLine = splitLine.replace(\"  \", \" \");\n        }\n        splitTabs = splitLine.split(\"\\\\s\");\n\n        if (type == TLType.tcp || type == TLType.udp) {\n            //Init IPv4 values\n            return initReport4(splitTabs, type);\n        } else {\n            //Init IPv6 values\n            return initReport6(splitTabs, type);\n        }\n    }\n\n    //Init parsed data to IPv4 connection report\n    private static Report initReport4(String[] splitTabs, TLType type) {\n        int pos;\n        pos = 0;\n        //Allocating buffer for 4 Bytes add and 2 bytes port each + 4 bytes UID\n        ByteBuffer bb = ByteBuffer.allocate(17);\n        bb.position(0);\n\n        //local address\n        String hexStr = splitTabs[1].substring(pos, pos + 8);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //local port\n        pos = splitTabs[1].indexOf(\":\");\n        hexStr = splitTabs[1].substring(pos + 1, pos + 5);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //remote address\n        pos = 0;\n        hexStr = splitTabs[2].substring(pos, pos + 8);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //local port\n        pos = splitTabs[2].indexOf(\":\");\n        hexStr = splitTabs[2].substring(pos + 1, pos + 5);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //UID\n        bb.putInt(Integer.parseInt(splitTabs[7]));\n\n        //state\n        bb.put(ToolBox.hexStringToByteArray(splitTabs[3]));\n\n        return new Report(bb, type);\n    }\n\n    //Init parsed data to IPv6 connection report\n    private static Report initReport6(String[] splitTabs, TLType type) {\n        int pos;\n        pos = 0;\n        //Allocating buffer for 16 Bytes add and 2 bytes port each + 4 bytes UID\n        ByteBuffer bb = ByteBuffer.allocate(41);\n        bb.position(0);\n\n        //local address\n        String hexStr = splitTabs[1].substring(pos, pos + 32);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //local port\n        pos = splitTabs[1].indexOf(\":\");\n        hexStr = splitTabs[1].substring(pos + 1, pos + 5);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //remote address\n        pos = 0;\n        hexStr = splitTabs[2].substring(pos, pos + 32);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //local port\n        pos = splitTabs[2].indexOf(\":\");\n        hexStr = splitTabs[2].substring(pos + 1, pos + 5);\n        bb.put(ToolBox.hexStringToByteArray(hexStr));\n\n        //UID\n        bb.putInt(Integer.parseInt(splitTabs[7]));\n\n        //state\n        bb.put(ToolBox.hexStringToByteArray(splitTabs[3]));\n\n        return new Report(bb, type);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/PassiveService.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\n\npackage org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis;\n\nimport android.annotation.TargetApi;\nimport android.app.NotificationChannel;\nimport android.app.NotificationManager;\nimport android.app.PendingIntent;\nimport android.app.Service;\nimport android.app.TaskStackBuilder;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.os.Binder;\nimport android.os.Build;\nimport android.os.IBinder;\nimport androidx.core.app.NotificationCompat;\nimport android.util.Log;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.MainActivity;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.KnownPorts;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport static java.lang.Thread.sleep;\n\n\n/**\n * Report Analyzer Service. Identifies active connections on the device and invokes data\n * gathering and report compilation procedures.\n */\npublic class PassiveService extends Service {\n\n    private static final int SERVICE_IDENTIFIER = 1;\n\n    public static boolean mInterrupt;\n    private Thread mThread;\n    private final IBinder mBinder = new AnalyzerBinder();\n    private Bitmap mIcon;\n    private static final String ID =  \"Netmonitoring\";\n\n    NotificationCompat.Builder mBuilder =\n            new NotificationCompat.Builder(this, ID)\n                    .setSmallIcon(R.drawable.ic_notification)\n                    .setContentTitle(getVersionString(R.string.app_name))\n                    .setContentText(getVersionString(R.string.bg_desc));\n\n    private String getVersionString(int id) {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n            return getStringNew(id);\n        } else {\n            return getStringOld(id);\n        }\n    }\n\n    @TargetApi(Build.VERSION_CODES.GINGERBREAD)\n    private static String getStringNew(int id) {\n        return RunStore.getContext().getResources().getString(id);\n    }\n\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    private static String getStringOld(int id) {\n        return RunStore.getContext().getString(id);\n    }\n\n    private void createNotificationChannel() {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n            NotificationChannel serviceChannel = new NotificationChannel(\n                    ID,\n                    \"Service Notification Channel\",\n                    NotificationManager.IMPORTANCE_DEFAULT\n            );\n            NotificationManager manager = getSystemService(NotificationManager.class);\n            manager.createNotificationChannel(serviceChannel);\n        }\n    }\n\n    @Override\n    public void onCreate() {\n        mInterrupt = false;\n        loadNotificationBitmaps();\n        showAppNotification();\n        //init reserved-ports\n        KnownPorts.initPortMap();\n    }\n\n    //Icons for notification manager. Must be converted to bitmaps.\n    private void loadNotificationBitmaps() {\n        mIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_drawer);\n    }\n\n\n    public void startThread() {\n        Log.i(Const.LOG_TAG, \"PassiveService - Thread started\");\n        // Stop the previous session by interrupting the thread.\n        if (mThread != null) {\n            mThread.interrupt();\n        }\n        //Report analyzer working thread\n        mThread = new Thread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    while (!mInterrupt) {\n                        //detect connections\n                        Detector.updateReportMap();\n                        //check certificate validation state when feature is active\n                        Collector.updateSettings();\n                        if (Collector.isCertVal) {\n                            Collector.updateCertVal();\n                        }\n                        //sleep\n                        sleep(1000);\n                    }\n                } catch (InterruptedException e) {\n                    e.printStackTrace();\n                }\n                if (mInterrupt) mThread.interrupt();\n                stopSelf();\n            }\n        }, \"AnalyzerThreadRunnable\");\n\n        //start the service\n        mThread.start();\n    }\n\n    //Call to stop service and notification\n    private void interrupt() {\n        mInterrupt = true;\n        stopSelf();\n    }\n\n\n    @Override\n    public IBinder onBind(Intent intent) {\n        startThread();\n        return mBinder;\n    }\n\n    @Override\n    public boolean onUnbind(Intent intent) {\n        interrupt();\n        return super.onUnbind(intent);\n    }\n\n\n    @Override\n    public int onStartCommand(Intent intent, int flags, int startId) {\n        startThread();\n        return Service.START_STICKY;\n    }\n\n    @Override\n    public void onDestroy() {\n        interrupt();\n        super.onDestroy();\n    }\n\n    @Override\n    public void onTaskRemoved(Intent rootIntent) {\n        stopSelf();\n    }\n\n    //Class for Binder\n    public class AnalyzerBinder extends Binder {\n        PassiveService getService() {\n            return PassiveService.this;\n        }\n    }\n\n    //Check for new notification information. Currently inactive due to insignificance\n    /*private void checkForNotifications(){\n        if(Evidence.newWarnings != mNotificationCount) {\n            mNotificationCount = Evidence.newWarnings;\n            if (mNotificationCount > 0) {\n                showWarningNotification();\n            } else {\n                showAppNotification();\n            }\n        }\n    }*/\n\n    //BG notification. Standard Android version.\n    private void showAppNotification() {\n        mBuilder.setSmallIcon(R.drawable.ic_notification);\n        mBuilder.setLargeIcon(mIcon);\n        Intent resultIntent = new Intent(this, MainActivity.class);\n\n        // The stack builder object will contain an artificial back stack for the\n        // started Activity.\n        // This ensures that navigating backward from the Activity leads out of\n        // your application to the Home screen.\n        TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n\n        // Adds the back stack for the Intent (but not the Intent itself)\n        stackBuilder.addParentStack(MainActivity.class);\n\n        // Adds the Intent that starts the Activity to the top of the stack\n        stackBuilder.addNextIntent(resultIntent);\n        PendingIntent resultPendingIntent =\n                stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n        createNotificationChannel();\n        mBuilder.setContentIntent(resultPendingIntent);\n\n        startForeground(SERVICE_IDENTIFIER, mBuilder.build());\n    }\n\n    //Computes the need and severity of a notification. Currently unused.\n    private void showWarningNotification() {\n        //Set corresponding icon\n        //if(Evidence.getMaxSeverity() > 2){\n        //    mBuilder.setSmallIcon(R.mipmap.icon_warn_red);\n        //    mBuilder.setLargeIcon(mWarnRed);\n        //} else {\n        //    mBuilder.setSmallIcon(R.mipmap.icon_warn_orange);\n        //    mBuilder.setLargeIcon(mWarnOrange);\n        //}\n        //mBuilder.setContentText(mNotificationCount + \" new warnings encountered.\");\n\n        // Creates an explicit intent for an Activity in your app\n        Intent resultIntent = new Intent(this, MainActivity.class);\n\n        TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n\n        // Adds the back stack for the Intent (but not the Intent itself)\n        stackBuilder.addParentStack(MainActivity.class);\n\n        // Adds the Intent that starts the Activity to the top of the stack\n        stackBuilder.addNextIntent(resultIntent);\n        PendingIntent resultPendingIntent =\n                stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n        createNotificationChannel();\n        mBuilder.setContentIntent(resultPendingIntent);\n        NotificationManager mNotificationManager =\n                (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n        // mId allows you to update the notification later on.\n        mNotificationManager.notify(Const.LOG_TAG, 1, mBuilder.build());\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/Report.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis;\n\nimport android.graphics.drawable.Drawable;\nimport android.util.Log;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.Const;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.TLType;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.ToolBox;\n\nimport java.io.Serializable;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.nio.ByteBuffer;\nimport java.sql.Timestamp;\n\nimport static java.lang.Math.abs;\n\n/**\n * Information class for acquired connection data. Full report on available information from device.\n */\npublic class Report implements Serializable {\n\n    //Constructor parses HEX-data from /proc/net/*type* scan\n    Report(ByteBuffer bb, TLType type) {\n        touch();\n        this.type = type;\n        // Fill with bytebuffer data\n        if (type == TLType.tcp || type == TLType.udp) {\n            initIP4(bb);\n        } else {\n            initIP6(bb);\n        }\n\n        //Init InetAddresses\n        try {\n            if (type == TLType.tcp || type == TLType.udp) {\n                localAdd = InetAddress.getByName(\n                        ToolBox.hexToIp4(ToolBox.printHexBinary(localAddHex)));\n                remoteAdd = InetAddress.getByName(\n                        ToolBox.hexToIp4(ToolBox.printHexBinary(remoteAddHex)));\n            } else {\n                localAdd = InetAddress.getByName(\n                        ToolBox.hexToIp6(ToolBox.printHexBinary(localAddHex)));\n                remoteAdd = InetAddress.getByName(\n                        ToolBox.hexToIp6(ToolBox.printHexBinary(remoteAddHex)));\n            }\n        } catch (UnknownHostException e) {\n            e.printStackTrace();\n        }\n        if (Const.IS_DEBUG) {\n            Log.d(Const.LOG_TAG, \"Report (\" + type + \"):\" + localAdd.getHostAddress() + \":\"\n                    + localPort + \" \" + remoteAdd.getHostAddress() + \":\" + remotePort + \" - UID: \" + uid);\n        }\n    }\n\n    //Members\n    public TLType type;\n    public Timestamp timestamp;\n\n    public byte[] localAddHex;\n    public InetAddress localAdd;\n    public int localPort;\n    public byte[] state;\n\n    public byte[] remoteAddHex;\n    public InetAddress remoteAdd;\n\n    public int remotePort;\n\n    public int pid;\n    public int uid;\n\n    public Drawable icon;\n    public String appName;\n\n    public String packageName;\n\n    //Set current timestamp\n    public void touch() {\n        timestamp = new Timestamp(System.currentTimeMillis());\n    }\n\n    // -----------------------\n    // Init Methods\n    // -----------------------\n\n    //Fill report with Ip4 - tcp/udp connection data from bytebuffer readin\n    private void initIP4(ByteBuffer bb) {\n        bb.position(0);\n        byte[] b = new byte[2];\n        localAddHex = new byte[4];\n        bb.get(localAddHex);\n        bb.get(b);\n        localPort = ToolBox.twoBytesToInt(b);\n        remoteAddHex = new byte[4];\n        bb.get(remoteAddHex);\n        bb.get(b);\n        remotePort = ToolBox.twoBytesToInt(b);\n        uid = abs(bb.getInt());\n        state = new byte[1];\n        bb.get(state);\n    }\n\n    //Fill report with Ip6 - tcp/udp connection data from bytebuffer readin\n    private void initIP6(ByteBuffer bb) {\n        bb.position(0);\n        byte[] b = new byte[2];\n        localAddHex = new byte[16];\n        bb.get(localAddHex);\n        bb.get(b);\n        localPort = ToolBox.twoBytesToInt(b);\n        remoteAddHex = new byte[16];\n        bb.get(remoteAddHex);\n        bb.get(b);\n        remotePort = ToolBox.twoBytesToInt(b);\n        uid = abs((bb.getInt()));\n        state = new byte[1];\n        bb.get(state);\n    }\n}"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/ServiceHandler.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n */\npackage org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis;\n\nimport android.app.ActivityManager;\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.ServiceConnection;\nimport android.os.IBinder;\nimport android.widget.Toast;\n\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\n/**\n * This class handles commands and access to the services of the app\n * Currently Handles Services: Passive Service\n */\npublic class ServiceHandler {\n\n    private PassiveService mPassiveService;\n\n    private boolean mIsBound;\n\n    //Get information of running services\n    public boolean isServiceRunning(Class<?> serviceClass) {\n        ActivityManager manager = (ActivityManager) RunStore.getAppContext().getSystemService(Context.ACTIVITY_SERVICE);\n        for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n            if (serviceClass.getName().equals(service.service.getClassName())) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private ServiceConnection mPassiveServiceConnection = new ServiceConnection() {\n        public void onServiceConnected(ComponentName className, IBinder service) {\n            // This is called when the connection with the service has been\n            // established, giving us the service object we can use to\n            // interact with the service.  Because we have bound to a explicit\n            // service that we know is running in our own process, we can\n            // cast its IBinder to a concrete class and directly access it.\n            mPassiveService = ((PassiveService.AnalyzerBinder) service).getService();\n            Toast.makeText(RunStore.getContext(), R.string.passive_service_start,\n                    Toast.LENGTH_SHORT).show();\n        }\n\n        public void onServiceDisconnected(ComponentName className) {\n            // This is called when the connection with the service has been\n            // unexpectedly disconnected -- that is, its process crashed.\n            // Because it is running in our same process, we should never\n            // see this happen.\n            mPassiveService = null;\n            Toast.makeText(RunStore.getContext(), R.string.passive_service_stop,\n                    Toast.LENGTH_SHORT).show();\n        }\n    };\n\n    //start the service manually\n    public void startPassiveService() {\n        // Establish a connection with the service.\n        Intent intent = new Intent(RunStore.getAppContext(), PassiveService.class);\n        RunStore.getContext().startService(intent);\n    }\n\n    //stop the passive service\n    public void stopPassiveService() {\n        if (isServiceRunning(PassiveService.class)) {\n            RunStore.getContext().stopService(new Intent(RunStore.getAppContext(), PassiveService.class));\n        }\n    }\n\n    //Bind the passive service to the assigned context\n    public void bindPassiveService(Context context) {\n        Intent intent = new Intent(RunStore.getAppContext(), PassiveService.class);\n        context.bindService(intent, mPassiveServiceConnection, Context.BIND_AUTO_CREATE);\n        mIsBound = true;\n    }\n\n    //Unbind the passive service to app  context\n    public void unbindPassiveService(Context context) {\n        if (mIsBound) {\n            context.unbindService(mPassiveServiceConnection);\n            mIsBound = false;\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/DBApp.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.DatabaseUtil;\n\nimport android.app.Application;\nimport android.content.SharedPreferences;\nimport android.os.AsyncTask;\n\nimport org.greenrobot.greendao.database.Database;\nimport org.secuso.privacyfriendlynetmonitor.Assistant.RunStore;\n\nimport java.util.Map;\n\n\n/**\n * Created by m4rc0 on 12.11.2017.\n * DB class to store all apps and track the connections of the app. Implemented with greenDao.\n */\n\npublic class DBApp extends Application {\n\n    public static final boolean ENCRYPTED = false;\n\n    private static DaoSession daoSession;\n    private static DBApp mContext;\n\n    private static final String dbVersion = \"1\";\n\n    private static SharedPreferences selectedAppsPreferences;\n    private static SharedPreferences.Editor editor;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        mContext = this;\n        new DBAppAsyncTask().execute(\"\");\n\n        RunStore.setAppContext(getApplicationContext());\n\n        selectedAppsPreferences = getSharedPreferences(\"DBINFO\", 0);\n        editor = selectedAppsPreferences.edit();\n    }\n\n    public DaoSession getDaoSession() {\n        return daoSession;\n    }\n\n    static class DBAppAsyncTask extends AsyncTask {\n\n        @Override\n        protected Object doInBackground(Object[] objects) {\n            System.out.println(\"Starting Database Async Task\");\n            DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(mContext, ENCRYPTED ? \"reports-db-encrypted\" : \"reports-db\");\n            Database db = ENCRYPTED ? helper.getEncryptedWritableDb(\"super-secret\") : helper.getWritableDb();\n\n            Map map = selectedAppsPreferences.getAll();\n            if (!map.isEmpty() && map.get(\"Version\") != null && !map.get(\"Version\").equals(\"\")) {\n                if (!map.get(\"Version\").equals(dbVersion) && Integer.parseInt((String) map.get(\"Version\")) < Integer.parseInt(dbVersion)) {\n                    helper.onUpgrade(db, Integer.parseInt((String) map.get(\"Version\")), Integer.parseInt(dbVersion));\n                    editor.putString(\"Version\", dbVersion);\n                    editor.commit();\n                }\n            } else {\n                helper.onUpgrade(db, 0, Integer.parseInt(dbVersion));\n                editor.putString(\"Version\", dbVersion);\n                editor.commit();\n            }\n\n            daoSession = new DaoMaster(db).newSession();\n            return \"\";\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/GenerateReportEntities.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.DatabaseUtil;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Random;\nimport java.util.Set;\n\n/**\n * Created by m4rc0 on 13.01.2018.\n * Class to generate dummy test values for the database. Can be started with the following call:\n * GenerateReportEntities.generateReportEntities(this, reportEntityDao);\n * e.g. in MainActivity.onCreate()\n */\n\npublic class GenerateReportEntities {\n\n    public static void generateReportEntities(Context context, ReportEntityDao reportEntityDao) {\n\n        System.out.println(\"Start with entity generation\");\n\n        List<String> appNames = new ArrayList<>();\n        List<ReportEntity> reportEntities = new ArrayList<>();\n        appNames.add(\"com.android.chrome\");\n        appNames.add(\"com.android.vending\");\n        appNames.add(\"com.google.android.youtube\");\n\n        SharedPreferences selectedAppsPreferences = context.getSharedPreferences(\"SELECTEDAPPS\", 0);\n        SharedPreferences.Editor editor = selectedAppsPreferences.edit();\n\n        PackageManager packageManager = context.getPackageManager();\n\n        Set<String> set = selectedAppsPreferences.getAll().keySet();\n        for (String appName : appNames) {\n            if (!selectedAppsPreferences.contains(appName)) {\n                editor.putString(appName, appName);\n                editor.commit();\n            }\n        }\n\n        int count = 1;\n        long before = System.currentTimeMillis();\n        for (int i = 0; i < 1; i++) {\n\n            for (int year = 2018; year <= 2018; year++) {\n\n                System.out.println(\"New year: \" + year);\n\n                for (int month = 1; month <= 1; month++) {\n\n                    System.out.println(\"New Month: \" + month);\n\n                    for (int day = 1; day <= 30; day++) {\n\n                        System.out.println(\"New Day: \" + day);\n\n                        for (int hour = 0; hour < 24; hour++) {\n\n\n                            for (String appName : appNames) {\n\n                                ReportEntity reportEntity = new ReportEntity();\n                                PackageInfo packageInfo = null;\n                                try {\n                                    packageInfo = packageManager.getPackageInfo(appName, 0);\n                                } catch (PackageManager.NameNotFoundException e) {\n                                    e.printStackTrace();\n                                }\n\n                                reportEntity.setUserID((new String()).valueOf(packageInfo.applicationInfo.uid));\n                                reportEntity.setAppName(appName);\n                                reportEntity.setRemoteAddress(getRandomString());\n                                reportEntity.setRemoteHex(getRandomString());\n                                reportEntity.setRemoteHost(getRandomString());\n                                reportEntity.setLocalAddress(getRandomString());\n                                reportEntity.setLocalHex(getRandomString());\n                                reportEntity.setServicePort(getRandomString());\n                                reportEntity.setPayloadProtocol(getRandomString());\n                                reportEntity.setTransportProtocol(getRandomString());\n                                reportEntity.setLocalPort(getRandomString());\n\n                                double random = Math.random();\n                                if (random < 0.5) {\n                                    reportEntity.setConnectionInfo(\"Encrypted()\");\n                                } else {\n                                    reportEntity.setConnectionInfo(\"Unencrypted()\");\n                                }\n\n                                String monthString = \"\";\n                                if (month < 10) {\n                                    monthString = \"0\" + (new String()).valueOf(month);\n                                } else {\n                                    monthString = (new String()).valueOf(month);\n                                }\n                                String dayString = \"\";\n                                if (day < 10) {\n                                    dayString = \"0\" + (new String()).valueOf(day);\n                                } else {\n                                    dayString = (new String()).valueOf(day);\n                                }\n                                String hourString = \"\";\n                                if (hour < 10) {\n                                    hourString = \"0\" + (new String()).valueOf(hour);\n                                } else {\n                                    hourString = (new String()).valueOf(hour);\n                                }\n\n                                String date = (new String()).valueOf(year) + \"-\" + monthString + \"-\" + dayString + \" \" + hourString + \":04:20.420\";\n\n                                reportEntity.setTimeStamp(date);\n\n                                reportEntityDao.insertOrReplace(reportEntity);\n                                count++;\n                            }\n\n                        }\n\n                    }\n\n                }\n\n            }\n\n        }\n        long after = System.currentTimeMillis();\n        System.out.println(\"Generation needed \" + (after - before) / 1000 + \" seconds, for the generation of \" + (count - 1) + \" reports\");\n    }\n\n    private static String getRandomString() {\n\n        String SALTCHARS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n        StringBuilder stringBuilder = new StringBuilder();\n        Random rnd = new Random();\n\n        while (stringBuilder.length() < 18) {\n            int index = (int) (rnd.nextFloat() * SALTCHARS.length());\n            stringBuilder.append(SALTCHARS.charAt(index));\n        }\n        String randomString = stringBuilder.toString();\n        return randomString;\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/ReportEntity.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage org.secuso.privacyfriendlynetmonitor.DatabaseUtil;\n\nimport org.greenrobot.greendao.annotation.Entity;\nimport org.greenrobot.greendao.annotation.Generated;\nimport org.greenrobot.greendao.annotation.Id;\nimport org.greenrobot.greendao.annotation.Index;\nimport org.greenrobot.greendao.annotation.NotNull;\n\n/**\n * Created by m4rc0 on 08.11.2017.\n * Report entity to safe in database. Similar to regular report. Implemented with greenDao.\n */\n\n@Entity(\n        nameInDb = \"REPORTS\",\n        indexes = {\n                @Index(value = \"id DESC\", unique = true)\n        })\npublic class ReportEntity {\n\n    @Id(autoincrement = true)\n    private Long id;\n\n    @NotNull\n    private String appName;\n\n    @NotNull\n    private String userID;\n\n    @NotNull\n    private String timeStamp;\n    @NotNull\n    private String remoteAddress;\n    @NotNull\n    private String remoteHex;\n    @NotNull\n    private String remoteHost;\n    @NotNull\n    private String localAddress;\n\n    @NotNull\n    private String localHex;\n    @NotNull\n    private String servicePort;\n    @NotNull\n    private String payloadProtocol;\n    @NotNull\n    private String transportProtocol;\n    @NotNull\n    private String localPort;\n    @NotNull\n    private String connectionInfo;\n\n    @Generated(hash = 15093572)\n    public ReportEntity(Long id, @NotNull String appName, @NotNull String userID,\n                        @NotNull String timeStamp, @NotNull String remoteAddress, @NotNull String remoteHex,\n                        @NotNull String remoteHost, @NotNull String localAddress, @NotNull String localHex,\n                        @NotNull String servicePort, @NotNull String payloadProtocol,\n                        @NotNull String transportProtocol, @NotNull String localPort,\n                        @NotNull String connectionInfo) {\n        this.id = id;\n        this.appName = appName;\n        this.userID = userID;\n        this.timeStamp = timeStamp;\n        this.remoteAddress = remoteAddress;\n        this.remoteHex = remoteHex;\n        this.remoteHost = remoteHost;\n        this.localAddress = localAddress;\n        this.localHex = localHex;\n        this.servicePort = servicePort;\n        this.payloadProtocol = payloadProtocol;\n        this.transportProtocol = transportProtocol;\n        this.localPort = localPort;\n        this.connectionInfo = connectionInfo;\n    }\n\n    @Generated(hash = 683167796)\n    public ReportEntity() {\n    }\n\n    public Long getId() {\n        return this.id;\n    }\n\n    public void setId(Long id) {\n        this.id = id;\n    }\n\n    public String getAppName() {\n        return this.appName;\n    }\n\n    public void setAppName(String appName) {\n        this.appName = appName;\n    }\n\n    public String getUserID() {\n        return this.userID;\n    }\n\n    public void setUserID(String userID) {\n        this.userID = userID;\n    }\n\n    public String getTimeStamp() {\n        return this.timeStamp;\n    }\n\n    public void setTimeStamp(String timeStamp) {\n        this.timeStamp = timeStamp;\n    }\n\n    public String getRemoteAddress() {\n        return this.remoteAddress;\n    }\n\n    public void setRemoteAddress(String remoteAddress) {\n        this.remoteAddress = remoteAddress;\n    }\n\n    public String getRemoteHex() {\n        return this.remoteHex;\n    }\n\n    public void setRemoteHex(String remoteHex) {\n        this.remoteHex = remoteHex;\n    }\n\n    public String getRemoteHost() {\n        return this.remoteHost;\n    }\n\n    public void setRemoteHost(String remoteHost) {\n        this.remoteHost = remoteHost;\n    }\n\n    public String getLocalAddress() {\n        return this.localAddress;\n    }\n\n    public void setLocalAddress(String localAddress) {\n        this.localAddress = localAddress;\n    }\n\n    public String getLocalHex() {\n        return this.localHex;\n    }\n\n    public void setLocalHex(String localHex) {\n        this.localHex = localHex;\n    }\n\n    public String getServicePort() {\n        return this.servicePort;\n    }\n\n    public void setServicePort(String servicePort) {\n        this.servicePort = servicePort;\n    }\n\n    public String getPayloadProtocol() {\n        return this.payloadProtocol;\n    }\n\n    public void setPayloadProtocol(String payloadProtocol) {\n        this.payloadProtocol = payloadProtocol;\n    }\n\n    public String getTransportProtocol() {\n        return this.transportProtocol;\n    }\n\n    public void setTransportProtocol(String transportProtocol) {\n        this.transportProtocol = transportProtocol;\n    }\n\n    public String getLocalPort() {\n        return this.localPort;\n    }\n\n    public void setLocalPort(String localPort) {\n        this.localPort = localPort;\n    }\n\n    public String getConnectionInfo() {\n        return this.connectionInfo;\n    }\n\n    public void setConnectionInfo(String connectionInfo) {\n        this.connectionInfo = connectionInfo;\n    }\n\n    @Override\n    public String toString() {\n        return \"ReportEntity{\" +\n                \"id=\" + id +\n                \", appName='\" + appName + '\\'' +\n                \", userID='\" + userID + '\\'' +\n                \", timeStamp='\" + timeStamp + '\\'' +\n                \", remoteAddress='\" + remoteAddress + '\\'' +\n                \", remoteHex='\" + remoteHex + '\\'' +\n                \", remoteHost='\" + remoteHost + '\\'' +\n                \", localAddress='\" + localAddress + '\\'' +\n                \", localHex='\" + localHex + '\\'' +\n                \", servicePort='\" + servicePort + '\\'' +\n                \", payloadProtocol='\" + payloadProtocol + '\\'' +\n                \", transportProtocol='\" + transportProtocol + '\\'' +\n                \", localPort='\" + localPort + '\\'' +\n                \", connectionInfo='\" + connectionInfo + '\\'' +\n                '}';\n    }\n\n    public String toStringWithoutTimestamp() {\n        return \"\" + id + appName + userID + remoteAddress + remoteHex + remoteHost + localAddress + localHex + servicePort + payloadProtocol + transportProtocol + localPort + connectionInfo;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_day.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.fragment;\n\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport androidx.fragment.app.Fragment;\nimport androidx.core.content.ContextCompat;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.ScrollView;\nimport android.widget.TextView;\n\nimport com.github.mikephil.charting.charts.BarChart;\nimport com.github.mikephil.charting.components.AxisBase;\nimport com.github.mikephil.charting.components.Description;\nimport com.github.mikephil.charting.components.XAxis;\nimport com.github.mikephil.charting.components.YAxis;\nimport com.github.mikephil.charting.data.BarData;\nimport com.github.mikephil.charting.data.BarDataSet;\nimport com.github.mikephil.charting.data.BarEntry;\nimport com.github.mikephil.charting.data.Entry;\nimport com.github.mikephil.charting.formatter.IAxisValueFormatter;\nimport com.github.mikephil.charting.highlight.Highlight;\nimport com.github.mikephil.charting.listener.OnChartValueSelectedListener;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.FragmentDayListAdapter;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.ArrayList;\nimport java.util.Calendar;\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by tobias on 04.01.18.\n * https://github.com/PhilJay/MPAndroidChart/wiki/Setting-Data\n * Fragment which represent one day.\n */\n\npublic class Fragment_day extends Fragment {\n\n    // ReportEntity Table and ReportEntities List\n    private static ReportEntityDao reportEntityDao;\n    private static List<ReportEntity> reportEntities;\n    private static List<ReportEntity> filtered_Entities = new ArrayList<>();\n    private static List<String> entitiesString = new ArrayList<>();\n\n    private RecyclerView mRecyclerView;\n    private RecyclerView.Adapter mAdapter;\n    private RecyclerView.LayoutManager mLayoutManager;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        final View view = inflater.inflate(R.layout.fragment_charts, container, false);\n        ScrollView scrollview = view.findViewById(R.id.scrollViewChart);\n        scrollview.setSmoothScrollingEnabled(true);\n\n        //Fill Icon, AppGroupTitle, AppName\n        PackageManager packageManager = getActivity().getPackageManager();\n\n        TextView tx_appName = view.findViewById(R.id.historyGroupSubtitle);\n        final String appName = getArguments().getString(\"AppName\");\n        tx_appName.setText(appName);\n\n        try {\n            ImageView appIcon = (ImageView) view.findViewById(R.id.historyGroupIcon);\n            String appGroupTitle = (String) packageManager.getApplicationLabel(\n                    packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA));\n            TextView tx_appGroupTitle = view.findViewById(R.id.historyGroupTitle);\n            tx_appGroupTitle.setText(appGroupTitle);\n            appIcon.setImageDrawable(packageManager.getApplicationIcon(appName));\n        } catch (PackageManager.NameNotFoundException e) {\n            e.printStackTrace();\n        }\n        //END Fill Icon, AppGroupTitle, AppName\n\n        //Build the Barchart\n        final BarChart chart = (BarChart) view.findViewById(R.id.chart);\n        loadFilteredList(appName); //method to get all connection from the app \"appName\"\n        fillChart(view, chart); //method to fill the chart with the filteredList\n        fillRecyclerList(view, filtered_Entities); //method to show all connection\n\n        //Listener for Value Selection\n        chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {\n            @Override\n            public void onValueSelected(Entry e, Highlight h) {\n                //Handling the current time in Hour\n                SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n                Date currentTime = null;\n                try {\n                    currentTime = dateFormat.parse(dateFormat.format(new Date()));\n                } catch (ParseException ex) {\n                    ex.printStackTrace();\n                }\n                //End current time handling\n                int currentHour = currentTime.getHours();\n                int shift = 23 - currentHour; //the shift that is needed to get the correct connections\n                //extra cacheList to only show the reports to the selected value in the chart\n                List<ReportEntity> cacheList = new ArrayList<ReportEntity>();\n                if (e.getY() != 0) {\n                    for (ReportEntity cacheEntity : filtered_Entities) {\n                        int cacheEntityHour = (getEntityHour(cacheEntity) + shift) % 24;\n                        if (cacheEntityHour == e.getX()) {\n                            if (h.getStackIndex() == 0 && cacheEntity.getConnectionInfo().contains(\"Unknown\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 1 && cacheEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 2 && cacheEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                        }\n                    }\n                    fillRecyclerList(view, cacheList); //method to show conn. according to the value\n                }\n            }\n\n            @Override\n            public void onNothingSelected() {\n                fillRecyclerList(view, filtered_Entities);\n            }\n        });\n\n        return view;\n    }\n\n    private void fillChart(View view, BarChart chart) {\n\n        //Handling the current time in Hour\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        Date currentTime = null;\n        try {\n            currentTime = dateFormat.parse(dateFormat.format(new Date()));\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n        int currentHour = currentTime.getHours();\n\n        //Putting reportEntitites into a array for chart\n        List<BarEntry> entry = new ArrayList<BarEntry>();\n\n        int[] last24hours_encrypted = new int[24];\n        int[] last24hours_unencrypted = new int[24];\n        int[] last24hours_unknown = new int[24];\n\n        for (ReportEntity reportEntity : filtered_Entities) {\n            int hourEntity = getEntityHour(reportEntity);\n            if (hourEntity == 24) {\n                hourEntity = 0;\n            }\n            //Increase the field of the array of the entityHour\n            if (reportEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                last24hours_encrypted[hourEntity] = last24hours_encrypted[hourEntity] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                last24hours_unencrypted[hourEntity] = last24hours_unencrypted[hourEntity] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unknown\")) {\n                last24hours_unknown[hourEntity] = last24hours_unknown[hourEntity] + 1;\n            }\n\n        }\n        //adding data to chart\n        int slide = 23 - currentHour;\n        int[] cache24hours_encrypted = new int[24];\n        int[] cache24hours_unencrypted = new int[24];\n        int[] cache24hours_unknown = new int[24];\n        for (int i = 0; i < last24hours_encrypted.length; i++) {\n            int xValueCache = (i + slide) % 24;\n            cache24hours_encrypted[xValueCache] = last24hours_encrypted[i];\n            cache24hours_unencrypted[xValueCache] = last24hours_unencrypted[i];\n            cache24hours_unknown[xValueCache] = last24hours_unknown[i];\n        }\n        //extra \"for-loop\" beause the chart has to be filled from \"0\" to...value\n        for (int i = 0; i < cache24hours_encrypted.length; i++) {\n            entry.add(new BarEntry(i, new float[]{cache24hours_unknown[i],\n                    cache24hours_encrypted[i], cache24hours_unencrypted[i]}));\n        }\n\n        BarDataSet barset = new BarDataSet(entry, Fragment_day.this.getResources().getString(R.string.hours));\n        barset.setStackLabels(new String[]{Fragment_day.this.getResources().getString(R.string.unknown), Fragment_day.this.getResources().getString(R.string.encrypted), Fragment_day.this.getResources().getString(R.string.unencrypted)});\n        barset.setColors(new int[]{ContextCompat.getColor(getContext(), R.color.text_dark),\n                ContextCompat.getColor(getContext(), R.color.green),\n                ContextCompat.getColor(getContext(), R.color.red)});\n\n        //X Achse Formatter--------------------------------------------------------\n\n        // the labels that should be drawn on the XAxis\n        final String[] hours = new String[last24hours_encrypted.length];\n\n        for (int i = 0; i < hours.length; i++) {\n            if (i == hours.length - 1) {\n                hours[i] = currentHour + Fragment_day.this.getResources().getString(R.string.oclock);\n            } else {\n                hours[i] = \"- \" + Integer.toString(23 - i) + Fragment_day.this.getResources().getString(R.string.hr);\n            }\n        }\n\n        IAxisValueFormatter formatter = new IAxisValueFormatter() {\n            @Override\n            public String getFormattedValue(float value, AxisBase axis) {\n                return hours[(int) value];\n            }\n        };\n\n        XAxis xAxis = chart.getXAxis();\n        xAxis.setGranularity(1f); // minimum axis-step (interval) is 1\n        xAxis.setValueFormatter(formatter);\n        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n\n        //Y Achse Formatter----------------------------------------------------------\n        YAxis yAxis_left = chart.getAxisLeft();\n        yAxis_left.setAxisMinimum(0f);\n        YAxis yAxis_right = chart.getAxisRight();\n        yAxis_right.setAxisMinimum(0f);\n\n        BarData barData = new BarData(barset);\n        barData.setBarWidth(0.5f);\n        chart.setData(barData);\n        chart.setFitBars(true);\n        //Sets the desc label at the bottom to \" \"\n        Description description = new Description();\n        description.setText(\"\");\n        chart.setDescription(description);\n        chart.invalidate();\n\n    }\n\n    private void loadFilteredList(String appName) {\n        filtered_Entities.clear();\n        entitiesString.clear();\n\n        // load DB\n        DaoSession daoSession = ((DBApp) getActivity().getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n        reportEntities = reportEntityDao.loadAll(); //END load DB\n\n        boolean isIncluded = false; //variable to check if conn. is already included\n\n        for (ReportEntity reportEntity : reportEntities) {\n            //Only entities from the AppName\n            if (reportEntity.getAppName().equals(appName)) {\n                String stringWithoutTimeStamp = reportEntity.toStringWithoutTimestamp();\n                //search if it is included allready\n                for (String s : entitiesString) {\n                    if (s.equals(stringWithoutTimeStamp)) {\n                        isIncluded = true;\n                    }\n                }\n                //if it is NOT included do....\n                if (isIncluded == false) {\n                    //Only entities 24 hours ago\n                    SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n                    try {\n                        Date currentTime = dateFormat.parse(dateFormat.format(new Date()));\n                        Calendar cal = Calendar.getInstance();\n                        cal.setTime(currentTime);\n                        cal.add(Calendar.DATE, -1);\n\n                        //This is the date one day ago == 24 hours ago\n                        Date dateBefore1Days = cal.getTime();\n\n                        String string_date = reportEntity.getTimeStamp();\n                        SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\n                        // sdf.parse(string_date) --> this is the Entity date\n                        if (!sdf.parse(string_date).after(dateBefore1Days)) {\n\n                        } else {\n                            filtered_Entities.add(reportEntity); // add only that report from that app and 24hours ago\n                            entitiesString.add(stringWithoutTimeStamp);\n                        }\n                    } catch (ParseException e) {\n                        e.printStackTrace();\n                    }\n                }\n                isIncluded = false; //reset to false\n            }\n        }\n    }\n\n    private void fillRecyclerList(View view, List<ReportEntity> reportEntityList) {\n\n        mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view);\n        mRecyclerView.setFocusable(false);\n        mRecyclerView.setNestedScrollingEnabled(false);\n        mRecyclerView.setHasFixedSize(true);\n        mLayoutManager = new LinearLayoutManager(getContext());\n        mRecyclerView.setLayoutManager(mLayoutManager);\n        mAdapter = new FragmentDayListAdapter(reportEntityList, getContext());\n        mRecyclerView.setAdapter(mAdapter);\n    }\n\n    private int getEntityHour(ReportEntity reportEntity) {\n        String string_timestamp = reportEntity.getTimeStamp();\n        SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        Date entity_date = null;\n        try {\n            entity_date = sdf.parse(string_timestamp);\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n\n        return entity_date.getHours();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_month.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.fragment;\n\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport androidx.fragment.app.Fragment;\nimport androidx.core.content.ContextCompat;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.github.mikephil.charting.charts.BarChart;\nimport com.github.mikephil.charting.components.AxisBase;\nimport com.github.mikephil.charting.components.Description;\nimport com.github.mikephil.charting.components.XAxis;\nimport com.github.mikephil.charting.components.YAxis;\nimport com.github.mikephil.charting.data.BarData;\nimport com.github.mikephil.charting.data.BarDataSet;\nimport com.github.mikephil.charting.data.BarEntry;\nimport com.github.mikephil.charting.data.Entry;\nimport com.github.mikephil.charting.formatter.IAxisValueFormatter;\nimport com.github.mikephil.charting.highlight.Highlight;\nimport com.github.mikephil.charting.listener.OnChartValueSelectedListener;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.FragmentDayListAdapter;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.ArrayList;\nimport java.util.Calendar;\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by tobias on 04.01.18.\n * Fragment which represent one month.\n */\n\npublic class Fragment_month extends Fragment {\n\n    // ReportEntity Table and ReportEntities List\n    private static ReportEntityDao reportEntityDao;\n    private static List<ReportEntity> reportEntities;\n    private static List<ReportEntity> filtered_Entities = new ArrayList<>();\n    private static List<String> entitiesString = new ArrayList<>();\n    private static Date dateBefore1month = null;\n    private static Date currentDate = null;\n\n    private RecyclerView mRecyclerView;\n    private RecyclerView.Adapter mAdapter;\n    private RecyclerView.LayoutManager mLayoutManager;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        final View view = inflater.inflate(R.layout.fragment_charts, container, false);\n\n        //Fill Icon, AppGroupTitle, AppName\n        PackageManager packageManager = getActivity().getPackageManager();\n\n        TextView tx_appName = view.findViewById(R.id.historyGroupSubtitle);\n        final String appName = getArguments().getString(\"AppName\");\n        tx_appName.setText(appName);\n\n        try {\n            ImageView appIcon = (ImageView) view.findViewById(R.id.historyGroupIcon);\n            String appGroupTitle = (String) packageManager.getApplicationLabel(\n                    packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA));\n            TextView tx_appGroupTitle = view.findViewById(R.id.historyGroupTitle);\n            tx_appGroupTitle.setText(appGroupTitle);\n            appIcon.setImageDrawable(packageManager.getApplicationIcon(appName));\n        } catch (PackageManager.NameNotFoundException e) {\n            e.printStackTrace();\n        }\n        //END Fill Icon, AppGroupTitle, AppName\n\n        //calc dateBefore1week\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        try {\n            currentDate = dateFormat.parse(dateFormat.format(new Date()));\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n        Calendar cal = Calendar.getInstance();\n        cal.setTime(currentDate);\n        cal.add(Calendar.DATE, -29);\n\n        //This is the date 7 days ago == 1 month\n        dateBefore1month = cal.getTime();\n\n        //Build the Barchart\n        final BarChart chart = (BarChart) view.findViewById(R.id.chart);\n        loadFilteredList(appName); //method to get all connection from the app \"appName\"\n        fillChart(view, chart); //method to fill the chart with the filteredList\n        fillRecyclerList(view, filtered_Entities); //method to show all connection\n\n        //Listener for Value Selection\n        chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {\n            @Override\n            public void onValueSelected(Entry e, Highlight h) {\n                //extra cacheList to only show the reports to the selected value in the chart\n                List<ReportEntity> cacheList = new ArrayList<ReportEntity>();\n                if (e.getY() != 0) {\n                    for (ReportEntity cacheEntity : filtered_Entities) {\n                        int daysBetween = getDaysBetween(dateBefore1month, getEntityDate(cacheEntity));\n                        if (daysBetween == e.getX()) {\n                            if (h.getStackIndex() == 0 && cacheEntity.getConnectionInfo().contains(\"Unknown\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 1 && cacheEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 2 && cacheEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                        }\n                    }\n                    fillRecyclerList(view, cacheList); //method to show conn. according to the value\n                }\n            }\n\n            @Override\n            public void onNothingSelected() {\n                fillRecyclerList(view, filtered_Entities);\n            }\n        });\n\n        return view;\n    }\n\n    private void fillChart(View view, BarChart chart) {\n        int currentDay = currentDate.getDate();\n\n        //Putting reportEntitites into a array for chart\n        List<BarEntry> entry = new ArrayList<BarEntry>();\n\n        int[] lastMonth_encrypted = new int[30];\n        int[] lastMonth_unencrypted = new int[30];\n        int[] lastMonth_unknown = new int[30];\n\n        for (ReportEntity reportEntity : filtered_Entities) {\n            int daysBetween = getDaysBetween(dateBefore1month, getEntityDate(reportEntity));\n            //Increase the field of the array of the entityDay\n            if (reportEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                lastMonth_encrypted[daysBetween] = lastMonth_encrypted[daysBetween] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                lastMonth_unencrypted[daysBetween] = lastMonth_unencrypted[daysBetween] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unknown\")) {\n                lastMonth_unknown[daysBetween] = lastMonth_unknown[daysBetween] + 1;\n            }\n\n        }\n        //adding data to chart\n        for (int i = 0; i < lastMonth_encrypted.length; i++) {\n            entry.add(new BarEntry(i, new float[]{lastMonth_unknown[i],\n                    lastMonth_encrypted[i], lastMonth_unencrypted[i]}));\n        }\n\n        BarDataSet barset = new BarDataSet(entry, Fragment_month.this.getResources().getString(R.string.days));\n        barset.setStackLabels(new String[]{Fragment_month.this.getResources().getString(R.string.unknown), Fragment_month.this.getResources().getString(R.string.encrypted), Fragment_month.this.getResources().getString(R.string.unencrypted)});\n        barset.setColors(new int[]{ContextCompat.getColor(getContext(), R.color.text_dark),\n                ContextCompat.getColor(getContext(), R.color.green),\n                ContextCompat.getColor(getContext(), R.color.red)});\n\n        //X Achse Formatter--------------------------------------------------------\n\n        // the labels that should be drawn on the XAxis\n        final String[] days = new String[lastMonth_encrypted.length];\n\n        for (int i = 0; i < days.length; i++) {\n            if (i == days.length - 1) {\n                days[i] = currentDay + \" .\";\n            } else {\n                days[i] = \"- \" + Integer.toString(29 - i) + Fragment_month.this.getResources().getString(R.string.d);\n            }\n        }\n\n        IAxisValueFormatter formatter = new IAxisValueFormatter() {\n            @Override\n            public String getFormattedValue(float value, AxisBase axis) {\n                return days[(int) value];\n            }\n        };\n\n        XAxis xAxis = chart.getXAxis();\n        xAxis.setGranularity(1f); // minimum axis-step (interval) is 1\n        xAxis.setValueFormatter(formatter);\n        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n\n        //Y Achse Formatter----------------------------------------------------------\n        YAxis yAxis_left = chart.getAxisLeft();\n        yAxis_left.setAxisMinimum(0f);\n        YAxis yAxis_right = chart.getAxisRight();\n        yAxis_right.setAxisMinimum(0f);\n\n        BarData barData = new BarData(barset);\n        barData.setBarWidth(0.5f);\n        chart.setData(barData);\n        chart.setFitBars(true);\n        //Sets the desc label at the bottom to \" \"\n        Description description = new Description();\n        description.setText(\"\");\n        chart.setDescription(description);\n        chart.invalidate();\n\n    }\n\n    private void loadFilteredList(String appName) {\n        filtered_Entities.clear();\n        entitiesString.clear();\n\n        // load DB\n        DaoSession daoSession = ((DBApp) getActivity().getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n        reportEntities = reportEntityDao.loadAll(); //END load DB\n\n        boolean isIncluded = false; //variable to check if conn. is already included\n\n        for (ReportEntity reportEntity : reportEntities) {\n            //Only entities from the AppName\n            if (reportEntity.getAppName().equals(appName)) {\n                String stringWithoutTimeStamp = reportEntity.toStringWithoutTimestamp();\n                //search if it is included allready\n                for (String s : entitiesString) {\n                    if (s.equals(stringWithoutTimeStamp)) {\n                        isIncluded = true;\n                    }\n                }\n                //if it is NOT included do....\n                if (isIncluded == false) {\n                    //Only entities 24 hours ago\n\n                    String string_date = reportEntity.getTimeStamp();\n                    SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\n                    // sdf.parse(string_date) --> this is the Entity date\n                    try {\n                        if (!sdf.parse(string_date).after(dateBefore1month)) {\n\n                        } else {\n                            filtered_Entities.add(reportEntity); // add only that report from that app and 24hours ago\n                            entitiesString.add(stringWithoutTimeStamp);\n                        }\n                    } catch (ParseException e) {\n                        e.printStackTrace();\n                    }\n                }\n                isIncluded = false; //reset to false\n            }\n        }\n    }\n\n    private void fillRecyclerList(View view, List<ReportEntity> reportEntityList) {\n\n        mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view);\n        mRecyclerView.setFocusable(false);\n        mRecyclerView.setNestedScrollingEnabled(false);\n        mRecyclerView.setHasFixedSize(true);\n        mLayoutManager = new LinearLayoutManager(getContext());\n        mRecyclerView.setLayoutManager(mLayoutManager);\n        mAdapter = new FragmentDayListAdapter(reportEntityList, getContext());\n        mRecyclerView.setAdapter(mAdapter);\n    }\n\n    private Date getEntityDate(ReportEntity reportEntity) {\n        String string_timestamp = reportEntity.getTimeStamp();\n        SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        Date entity_date = null;\n        try {\n            entity_date = sdf.parse(string_timestamp);\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n\n        return entity_date;\n    }\n\n    //https://www.java-forum.org/thema/datum-differenz-in-tagen-berechen.41934/\n    static final long ONE_HOUR = 60 * 60 * 1000L;\n\n    public int getDaysBetween(Date d1, Date d2) {\n        return (int) ((d2.getTime() - d1.getTime() + ONE_HOUR) / (ONE_HOUR * 24));\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/org/secuso/privacyfriendlynetmonitor/fragment/Fragment_week.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\n\npackage org.secuso.privacyfriendlynetmonitor.fragment;\n\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport androidx.fragment.app.Fragment;\nimport androidx.core.content.ContextCompat;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.github.mikephil.charting.charts.BarChart;\nimport com.github.mikephil.charting.components.AxisBase;\nimport com.github.mikephil.charting.components.Description;\nimport com.github.mikephil.charting.components.XAxis;\nimport com.github.mikephil.charting.components.YAxis;\nimport com.github.mikephil.charting.data.BarData;\nimport com.github.mikephil.charting.data.BarDataSet;\nimport com.github.mikephil.charting.data.BarEntry;\nimport com.github.mikephil.charting.data.Entry;\nimport com.github.mikephil.charting.formatter.IAxisValueFormatter;\nimport com.github.mikephil.charting.highlight.Highlight;\nimport com.github.mikephil.charting.listener.OnChartValueSelectedListener;\n\nimport org.secuso.privacyfriendlynetmonitor.Activities.Adapter.FragmentDayListAdapter;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DBApp;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.DaoSession;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntity;\nimport org.secuso.privacyfriendlynetmonitor.DatabaseUtil.ReportEntityDao;\nimport org.secuso.privacyfriendlynetmonitor.R;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.ArrayList;\nimport java.util.Calendar;\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * Created by tobias on 04.01.18.\n * Fragment which represent one week.\n */\n\npublic class Fragment_week extends Fragment {\n\n    // ReportEntity Table and ReportEntities List\n    private static ReportEntityDao reportEntityDao;\n    private static List<ReportEntity> reportEntities;\n    private static List<ReportEntity> filtered_Entities = new ArrayList<>();\n    private static List<String> entitiesString = new ArrayList<>();\n    private static Date dateBefore1week = null;\n    private static Date currentDate = null;\n\n    private RecyclerView mRecyclerView;\n    private RecyclerView.Adapter mAdapter;\n    private RecyclerView.LayoutManager mLayoutManager;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        final View view = inflater.inflate(R.layout.fragment_charts, container, false);\n\n        //Fill Icon, AppGroupTitle, AppName\n        PackageManager packageManager = getActivity().getPackageManager();\n\n        TextView tx_appName = view.findViewById(R.id.historyGroupSubtitle);\n        final String appName = getArguments().getString(\"AppName\");\n        tx_appName.setText(appName);\n\n        try {\n            ImageView appIcon = (ImageView) view.findViewById(R.id.historyGroupIcon);\n            String appGroupTitle = (String) packageManager.getApplicationLabel(\n                    packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA));\n            TextView tx_appGroupTitle = view.findViewById(R.id.historyGroupTitle);\n            tx_appGroupTitle.setText(appGroupTitle);\n            appIcon.setImageDrawable(packageManager.getApplicationIcon(appName));\n        } catch (PackageManager.NameNotFoundException e) {\n            e.printStackTrace();\n        }\n        //END Fill Icon, AppGroupTitle, AppName\n\n        //calc dateBefore1week\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        try {\n            currentDate = dateFormat.parse(dateFormat.format(new Date()));\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n        Calendar cal = Calendar.getInstance();\n        cal.setTime(currentDate);\n        cal.add(Calendar.DATE, -6);\n\n        //This is the date 7 days ago == 1 week\n        dateBefore1week = cal.getTime();\n\n        //Build the Barchart\n        final BarChart chart = (BarChart) view.findViewById(R.id.chart);\n        loadFilteredList(appName); //method to get all connection from the app \"appName\"\n        fillChart(view, chart); //method to fill the chart with the filteredList\n        fillRecyclerList(view, filtered_Entities); //method to show all connection\n\n        //Listener for Value Selection\n        chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {\n            @Override\n            public void onValueSelected(Entry e, Highlight h) {\n                //Handling the current time in Hour\n                int currentDay = currentDate.getDate();\n                int shift = currentDay - 6; //the shift that is needed to get the correct connections\n                //extra cacheList to only show the reports to the selected value in the chart\n                List<ReportEntity> cacheList = new ArrayList<ReportEntity>();\n                if (e.getY() != 0) {\n                    for (ReportEntity cacheEntity : filtered_Entities) {\n                        int daysBetween = getDaysBetween(dateBefore1week, getEntityDate(cacheEntity));\n                        if (daysBetween == e.getX()) {\n                            if (h.getStackIndex() == 0 && cacheEntity.getConnectionInfo().contains(\"Unknown\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 1 && cacheEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                            if (h.getStackIndex() == 2 && cacheEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                                cacheList.add(cacheEntity);\n                            }\n                        }\n                    }\n                    fillRecyclerList(view, cacheList); //method to show conn. according to the value\n                }\n            }\n\n            @Override\n            public void onNothingSelected() {\n                fillRecyclerList(view, filtered_Entities);\n            }\n        });\n\n        return view;\n    }\n\n    private void fillChart(View view, BarChart chart) {\n        int currentDay = currentDate.getDate();\n\n        //Putting reportEntitites into a array for chart\n        List<BarEntry> entry = new ArrayList<BarEntry>();\n\n        int[] lastWeek_encrypted = new int[7];\n        int[] lastWeek_unencrypted = new int[7];\n        int[] lastWeek_unknown = new int[7];\n\n        for (ReportEntity reportEntity : filtered_Entities) {\n            int daysBetween = getDaysBetween(dateBefore1week, getEntityDate(reportEntity));\n            //Increase the field of the array of the entityDay\n            if (reportEntity.getConnectionInfo().contains(\"Encrypted\")) {\n                lastWeek_encrypted[daysBetween] = lastWeek_encrypted[daysBetween] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unencrypted\")) {\n                lastWeek_unencrypted[daysBetween] = lastWeek_unencrypted[daysBetween] + 1;\n            } else if (reportEntity.getConnectionInfo().contains(\"Unknown\")) {\n                lastWeek_unknown[daysBetween] = lastWeek_unknown[daysBetween] + 1;\n            }\n\n        }\n        //adding data to chart\n        for (int i = 0; i < lastWeek_encrypted.length; i++) {\n            entry.add(new BarEntry(i, new float[]{lastWeek_unknown[i],\n                    lastWeek_encrypted[i], lastWeek_unencrypted[i]}));\n        }\n\n        BarDataSet barset = new BarDataSet(entry, Fragment_week.this.getResources().getString(R.string.days));\n        barset.setStackLabels(new String[]{Fragment_week.this.getResources().getString(R.string.unknown), Fragment_week.this.getResources().getString(R.string.encrypted), Fragment_week.this.getResources().getString(R.string.unencrypted)});\n        barset.setColors(new int[]{ContextCompat.getColor(getContext(), R.color.text_dark),\n                ContextCompat.getColor(getContext(), R.color.green),\n                ContextCompat.getColor(getContext(), R.color.red)});\n\n        //X Achse Formatter--------------------------------------------------------\n\n        // the labels that should be drawn on the XAxis\n        final String[] days = new String[lastWeek_encrypted.length];\n\n        for (int i = 0; i < days.length; i++) {\n            if (i == days.length - 1) {\n                days[i] = currentDay + \" .\";\n            } else {\n                days[i] = \"- \" + Integer.toString(6 - i) + Fragment_week.this.getResources().getString(R.string.d);\n            }\n        }\n\n        IAxisValueFormatter formatter = new IAxisValueFormatter() {\n            @Override\n            public String getFormattedValue(float value, AxisBase axis) {\n                return days[(int) value];\n            }\n        };\n\n        XAxis xAxis = chart.getXAxis();\n        xAxis.setGranularity(1f); // minimum axis-step (interval) is 1\n        xAxis.setValueFormatter(formatter);\n        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n\n        //Y Achse Formatter----------------------------------------------------------\n        YAxis yAxis_left = chart.getAxisLeft();\n        yAxis_left.setAxisMinimum(0f);\n        YAxis yAxis_right = chart.getAxisRight();\n        yAxis_right.setAxisMinimum(0f);\n\n        BarData barData = new BarData(barset);\n        barData.setBarWidth(0.5f);\n        chart.setData(barData);\n        chart.setFitBars(true);\n        //Sets the desc label at the bottom to \" \"\n        Description description = new Description();\n        description.setText(\"\");\n        chart.setDescription(description);\n        chart.invalidate();\n\n    }\n\n    private void loadFilteredList(String appName) {\n        filtered_Entities.clear();\n        entitiesString.clear();\n\n        // load DB\n        DaoSession daoSession = ((DBApp) getActivity().getApplication()).getDaoSession();\n        reportEntityDao = daoSession.getReportEntityDao();\n        reportEntities = reportEntityDao.loadAll(); //END load DB\n\n        boolean isIncluded = false; //variable to check if conn. is already included\n\n        for (ReportEntity reportEntity : reportEntities) {\n            //Only entities from the AppName\n            if (reportEntity.getAppName().equals(appName)) {\n                String stringWithoutTimeStamp = reportEntity.toStringWithoutTimestamp();\n                //search if it is included allready\n                for (String s : entitiesString) {\n                    if (s.equals(stringWithoutTimeStamp)) {\n                        isIncluded = true;\n                    }\n                }\n                //if it is NOT included do....\n                if (isIncluded == false) {\n                    //Only entities 24 hours ago\n\n                    String string_date = reportEntity.getTimeStamp();\n                    SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\n                    // sdf.parse(string_date) --> this is the Entity date\n                    try {\n                        if (!sdf.parse(string_date).after(dateBefore1week)) {\n\n                        } else {\n                            filtered_Entities.add(reportEntity); // add only that report from that app and 24hours ago\n                            entitiesString.add(stringWithoutTimeStamp);\n                        }\n                    } catch (ParseException e) {\n                        e.printStackTrace();\n                    }\n                }\n                isIncluded = false; //reset to false\n            }\n        }\n    }\n\n    private void fillRecyclerList(View view, List<ReportEntity> reportEntityList) {\n\n        mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view);\n        mRecyclerView.setFocusable(false);\n        mRecyclerView.setNestedScrollingEnabled(false);\n        mRecyclerView.setHasFixedSize(true);\n        mLayoutManager = new LinearLayoutManager(getContext());\n        mRecyclerView.setLayoutManager(mLayoutManager);\n        mAdapter = new FragmentDayListAdapter(reportEntityList, getContext());\n        mRecyclerView.setAdapter(mAdapter);\n    }\n\n    private Date getEntityDate(ReportEntity reportEntity) {\n        String string_timestamp = reportEntity.getTimeStamp();\n        SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n        Date entity_date = null;\n        try {\n            entity_date = sdf.parse(string_timestamp);\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n\n        return entity_date;\n    }\n\n    //https://www.java-forum.org/thema/datum-differenz-in-tagen-berechen.41934/\n    static final long ONE_HOUR = 60 * 60 * 1000L;\n\n    public int getDaysBetween(Date d1, Date d2) {\n        return (int) ((d2.getTime() - d1.getTime() + ONE_HOUR) / (ONE_HOUR * 24));\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/res/drawable/background_border.xml",
    "content": "<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\" >\n    <stroke android:width=\"1px\"\n        android:color=\"@color/middlegrey\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/button_fullwidth.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item>\n        <shape>\n            <solid android:color=\"@color/colorPrimaryDark\" />\n            <corners android:radius=\"6dp\"/>\n        </shape>\n    </item>\n</selector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_clear.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24.0\"\n    android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_delete.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24.0\"\n    android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"@android:color/white\"\n        android:pathData=\"M6 19c0 1.1 0.9 2 2 2h8c1.1 0 2-0.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\" />\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_help.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24.0\"\n    android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_history.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_menu_info.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24.0\"\n    android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_play_arrow.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M8,5v14l11,-7z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_refresh.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n    android:viewportWidth=\"24.0\"\n    android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M12,5V1L7,6l5,5V7c3.31,0 6,2.69 6,6s-2.69,6 -6,6 -6,-2.69 -6,-6H4c0,4.42 3.58,8 8,8s8,-3.58 8,-8 -3.58,-8 -8,-8z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_search_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFF\"\n        android:pathData=\"M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_settings.xml",
    "content": "<vector android:alpha=\"0.60\" android:height=\"24dp\"\n    android:viewportHeight=\"24.0\" android:viewportWidth=\"24.0\"\n    android:width=\"24dp\" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path android:fillColor=\"#FF000000\" android:pathData=\"M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z\"/>\n</vector>"
  },
  {
    "path": "app/src/main/res/drawable/ic_sort_white_24dp.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFF\"\n        android:pathData=\"M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_stop.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M6,6h12v12H6z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_tutorial.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FF000000\"\n        android:pathData=\"M5,13.18v4L12,21l7,-3.82v-4L12,17l-7,-3.82zM12,3L1,9l11,6 9,-4.91V17h2V9L12,3z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_tutorial_inverted.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"24dp\"\n        android:height=\"24dp\"\n        android:viewportWidth=\"24.0\"\n        android:viewportHeight=\"24.0\">\n    <path\n        android:fillColor=\"#FFFFFFFF\"\n        android:pathData=\"M5,13.18v4L12,21l7,-3.82v-4L12,17l-7,-3.82zM12,3L1,9l11,6 9,-4.91V17h2V9L12,3z\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/splash_screen.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:drawable=\"@color/colorAccent\"/>\n\n    <item>\n        <bitmap xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            android:src=\"@mipmap/splash_icon\"\n            android:gravity=\"center\"\n            />\n    </item>\n</layer-list>"
  },
  {
    "path": "app/src/main/res/layout/activity_about.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/main_content\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#FFFFFF\">\n\n    <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"#FFFFFF\"\n        android:fitsSystemWindows=\"true\"\n        android:orientation=\"vertical\"\n        android:paddingBottom=\"@dimen/activity_vertical_margin\"\n        android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n        android:paddingRight=\"@dimen/activity_horizontal_margin\"\n        android:paddingTop=\"@dimen/activity_vertical_margin\"\n        android:weightSum=\"1\"\n        tools:context=\".AboutActivity\">\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"0.36\">\n\n            <ImageView\n                android:id=\"@+id/barcodeLogo\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:adjustViewBounds=\"true\"\n                android:src=\"@drawable/privacyfriendlyappslogo\" />\n\n        </LinearLayout>\n\n        <TextView\n            android:id=\"@+id/appName\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"15dp\"\n            android:text=\"@string/app_name_long\" />\n\n        <RelativeLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"5dp\"\n            android:gravity=\"center\">\n\n            <TextView\n                android:id=\"@+id/textFieldVersion\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"5dp\"\n                android:text=\"@string/version_number\" />\n\n            <TextView\n                android:id=\"@+id/textFieldVersionName\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginStart=\"4dp\"\n                android:layout_marginTop=\"5dp\"\n                android:layout_toEndOf=\"@+id/textFieldVersion\" />\n\n        </RelativeLayout>\n\n        <TextView\n            android:id=\"@+id/textFieldAuthor\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"5dp\"\n            android:text=\"@string/about_author\" />\n\n        <RelativeLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"5dp\"\n            android:gravity=\"center\">\n\n            <TextView\n                android:id=\"@+id/textFieldAuthorNames\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/about_author_names\" />\n\n            <TextView\n                android:id=\"@+id/textFieldContributors\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"4dp\"\n                android:layout_toEndOf=\"@+id/textFieldAuthorNames\"\n                android:text=\"@string/about_author_contributors\" />\n\n        </RelativeLayout>\n\n        <TextView\n            android:id=\"@+id/textFieldAffiliation\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"30dp\"\n            android:text=\"@string/about_affiliation\"\n            android:textStyle=\"bold\" />\n\n        <ImageView\n            android:id=\"@+id/imageView1\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:adjustViewBounds=\"true\"\n            android:src=\"@drawable/secuso_logo_blau_blau\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"10dp\"\n            android:gravity=\"center_horizontal\"\n            android:text=\"@string/privacy_friendly\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"15dp\"\n            android:layout_marginBottom=\"5dp\"\n            android:gravity=\"center\"\n            android:text=\"@string/more_info\" />\n\n        <TextView\n            android:id=\"@+id/secusoWebsite\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:text=\"@string/url\"\n            android:textStyle=\"bold\" />\n\n        <TextView\n            android:id=\"@+id/githubURL\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:gravity=\"center_horizontal\"\n            android:textStyle=\"bold\"\n            android:text=\"@string/github\" />\n\n        <TextView\n            android:id=\"@+id/textAPI\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:gravity=\"center_horizontal\"\n            android:layout_marginTop=\"15dp\"\n            android:layout_marginBottom=\"5dp\"\n            android:text=\"@string/about_API\" />\n\n        <TextView\n            android:id=\"@+id/javaAPIURL\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:gravity=\"center_horizontal\"\n            android:textStyle=\"bold\"\n            android:text=\"@string/url_API\" />\n\n        <TextView\n            android:id=\"@+id/APIURL\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:gravity=\"center_horizontal\"\n            android:textStyle=\"bold\"\n            android:text=\"@string/url_SSLLabs\" />\n\n    </LinearLayout>\n\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/layout/activity_help.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\".Activities.MainActivity\">\n\n        <include layout=\"@layout/toolbar\" />\n\n        <include layout=\"@layout/activity_help_content\" />\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_help_content.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/scrollojt\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    tools:context=\".Activities.HelpActivity\">\n\n    <ExpandableListView\n\n        android:id=\"@+id/generalExpandableListView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:divider=\"@android:color/darker_gray\"\n        android:dividerHeight=\"0.5dp\"\n        android:indicatorLeft=\"?android:attr/expandableListPreferredItemIndicatorLeft\" />\n\n</RelativeLayout>\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_history.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\".Activities.MainActivity\">\n\n\n        <com.google.android.material.appbar.AppBarLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n            android:theme=\"@style/AppTheme.AppBarOverlay\"\n            xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n            <androidx.appcompat.widget.Toolbar\n                android:id=\"@+id/toolbar\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"?attr/actionBarSize\"\n                android:background=\"?attr/colorPrimary\"\n                app:popupTheme=\"@style/AppTheme.PopupOverlay\" >\n\n                <RelativeLayout\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\">\n\n                    <TextView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"@string/layout_activity_history_history\"\n                        android:gravity=\"center_vertical\"\n                        android:textSize=\"22dp\"\n                        android:textColor=\"@color/white\"\n                        android:paddingTop=\"@dimen/padding_small\"/>\n\n                    <Button\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:id=\"@+id/deleteDB\"\n                        android:textSize=\"12sp\"\n                        android:background=\"@null\"\n                        android:layout_alignParentEnd=\"true\"\n                        android:layout_alignParentRight=\"true\"\n                        android:gravity=\"center\"\n                        android:textColor=\"@color/white\"\n                        android:text=\"@string/layout_activity_history_delete_database\"\n                        android:clickable=\"true\"/>\n\n                </RelativeLayout>\n\n\n            </androidx.appcompat.widget.Toolbar>\n\n\n        </com.google.android.material.appbar.AppBarLayout>\n\n        <include\n            android:id=\"@+id/include\"\n            layout=\"@layout/content_history\" />\n\n        <com.google.android.material.floatingactionbutton.FloatingActionButton\n            android:id=\"@+id/fab\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"bottom|end\"\n            android:layout_margin=\"@dimen/fab_margin\"\n            app:layout_anchor=\"@+id/include\"\n            app:layout_anchorGravity=\"right|bottom\"\n            android:src=\"@drawable/ic_edit_list\" />\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <include\n        layout=\"@layout/activity_main_app_bar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main_app_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:fitsSystemWindows=\"true\"\n    tools:context=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\">\n\n    <include layout=\"@layout/toolbar\"/>\n    <include layout=\"@layout/activity_main_content\" />\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"horizontal\"\n        android:layout_gravity=\"bottom\"\n        android:gravity=\"center\"\n        android:layout_marginBottom=\"@dimen/activity_horizontal_margin\">\n\n    </LinearLayout>\n\n    <com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:id=\"@+id/mainFAB\"\n        android:layout_height=\"wrap_content\"\n        android:layout_width=\"wrap_content\"\n        android:layout_margin=\"16dp\"\n        app:srcCompat=\"@drawable/ic_play_arrow\"\n        app:layout_anchor=\"@+id/main_content\"\n        app:layout_anchorGravity=\"bottom|end\"\n        />\n\n\n</androidx.coordinatorlayout.widget.CoordinatorLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main_content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    android:id=\"@+id/main_content\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    tools:context=\".Activities.MainActivity\"\n    tools:showIn=\"@layout/activity_main_app_bar\"\n    android:orientation=\"vertical\"\n    style=\"@style/AlertDialog.AppCompat\">\n\n    <TextView\n        android:id=\"@+id/main_text_normalbutton_desc\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:text=\"@string/main_text_normalbutton_desc\"\n        android:textColor=\"@color/black\" />\n\n\n    <ImageView\n        android:id=\"@+id/main_image_startstopp\"\n        android:layout_width=\"96dp\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_monitor_off\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_gravity=\"center\" />\n\n    <TextView\n        android:id=\"@+id/main_text_startstop\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/main_text_stopped\"\n        android:layout_below=\"@+id/main_image_startstopp\"\n        android:layout_centerHorizontal=\"true\" />\n\n    <ProgressBar\n        android:id=\"@+id/mainProgressBar\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:visibility=\"gone\">\n\n    </ProgressBar>\n\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_report.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\".Activities.MainActivity\">\n\n        <include layout=\"@layout/activity_report_app_bar\" />\n\n\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_report_app_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:fitsSystemWindows=\"true\"\n    tools:context=\"org.secuso.privacyfriendlynetmonitor.Activities.MainActivity\">\n\n    <include layout=\"@layout/toolbar\"/>\n    <include layout=\"@layout/activity_report_content\" />\n\n</androidx.coordinatorlayout.widget.CoordinatorLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_report_content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    android:id=\"@+id/report_content_layout\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    tools:context=\".Activities.MainActivity\"\n    tools:showIn=\"@layout/activity_report_app_bar\"\n    style=\"@style/AlertDialog.AppCompat\">\n\n    <ImageView\n        android:id=\"@+id/report_empty_icon\"\n        android:layout_width=\"96dp\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/ic_drawer\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_gravity=\"center\" />\n\n    <TextView\n        android:id=\"@+id/report_empty_text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n        android:text=\"@string/report_swipe_refresh\"\n        android:layout_below=\"@+id/report_empty_icon\"\n        android:layout_centerHorizontal=\"true\" />\n\n    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:id=\"@+id/swipe_refresh_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\">\n\n        <ExpandableListView\n            android:id=\"@+id/list\"\n            android:divider=\"@android:color/darker_gray\"\n            android:dividerHeight=\"0.5dp\"\n            android:indicatorLeft=\"?android:attr/expandableListPreferredItemIndicatorLeft\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:paddingBottom=\"28dp\" />\n\n    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>\n\n    <com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:id=\"@+id/reportFAB\"\n        android:layout_height=\"wrap_content\"\n        android:layout_width=\"wrap_content\"\n        android:layout_margin=\"16dp\"\n        app:srcCompat=\"@drawable/ic_stop\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\" />\n\n</RelativeLayout>\n\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_report_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\".Activities.MainActivity\">\n\n        <include layout=\"@layout/toolbar\" />\n\n        <include layout=\"@layout/activity_report_detail_content\" />\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_report_detail_content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    tools:context=\".Activities.MainActivity\">\n\n    <TextView\n        android:id=\"@+id/report_detail_ssllabs_result\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginStart=\"16dp\"\n        android:layout_marginBottom=\"8dp\"\n        android:text=\"@string/report_detail_ssllabs\"\n        android:visibility=\"gone\"\n        />\n\n    <ListView\n        android:id=\"@+id/report_detail_list_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:divider=\"@android:color/darker_gray\"\n        android:dividerHeight=\"0.5dp\"/>\n\n\n\n</LinearLayout>\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_select_history_apps.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\".Activities.MainActivity\">\n\n        <include\n            android:id=\"@+id/include\"\n            layout=\"@layout/content_select_history_apps\" />\n\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_settings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.drawerlayout.widget.DrawerLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawer_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    tools:openDrawer=\"start\">\n\n    <androidx.coordinatorlayout.widget.CoordinatorLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"true\"\n        tools:context=\"org.secuso.privacyfriendlyexample.SettingsActivity\">\n\n        <include layout=\"@layout/toolbar\"/>\n\n        <LinearLayout\n            android:id=\"@+id/main_content\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:background=\"#FFFFFF\"\n            android:fitsSystemWindows=\"true\"\n            android:orientation=\"vertical\"\n            tools:context=\".SettingsActivity\"\n            android:layout_marginTop=\"?attr/actionBarSize\"\n            android:weightSum=\"1\">\n\n        <fragment android:name=\"org.secuso.privacyfriendlynetmonitor.Activities.SettingsActivity$GeneralPreferenceFragment\"\n            android:id=\"@+id/settings_fragment\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"/>\n\n        </LinearLayout>\n\n    </androidx.coordinatorlayout.widget.CoordinatorLayout>\n\n    <com.google.android.material.navigation.NavigationView\n        android:id=\"@+id/nav_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:fitsSystemWindows=\"true\"\n        app:headerLayout=\"@layout/main_nav_header\"\n        app:menu=\"@menu/main_drawer\" />\n\n</androidx.drawerlayout.widget.DrawerLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_splash.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:fitsSystemWindows=\"true\"\n    android:gravity=\"center\"\n    android:paddingBottom=\"200dp\"\n    android:orientation=\"vertical\">\n\n    <TextView\n        android:id=\"@+id/compatibility_text\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\n        android:gravity=\"center\"\n        android:textSize=\"20sp\"\n        android:textColor=\"@color/white\"\n        android:textStyle=\"bold\"\n        android:text=\"@string/not_compatible_info\" />\n\n</LinearLayout>\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_tutorial.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:showIn=\"@layout/activity_tutorial\">\n\n    <androidx.viewpager.widget.ViewPager\n        android:id=\"@+id/view_pager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" />\n\n    <LinearLayout\n        android:id=\"@+id/layoutDots\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"@dimen/dots_height\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_marginBottom=\"@dimen/dots_margin_bottom\"\n        android:gravity=\"center\"\n        android:orientation=\"horizontal\" />\n\n    <View\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\"\n        android:layout_above=\"@id/layoutDots\"\n        android:alpha=\".5\"\n        android:background=\"@android:color/white\" />\n\n    <Button\n        android:id=\"@+id/btn_next\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        android:background=\"@null\"\n        android:text=\"@string/next\"\n        android:textColor=\"@android:color/white\" />\n\n    <Button\n        android:id=\"@+id/btn_skip\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentStart=\"true\"\n        android:background=\"@null\"\n        android:text=\"@string/skip\"\n        android:textColor=\"@android:color/white\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/app_list_group.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/selectionApp\"\n    android:background=\"@color/white\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?android:attr/listPreferredItemHeight\"\n    android:clickable=\"true\"\n    >\n\n    <TextView\n        android:id=\"@+id/appGroupTitle\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"32dp\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_toEndOf=\"@+id/appGroupIcon\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:text=\"App Name\"\n        android:textStyle=\"bold\"\n        android:gravity=\"center_vertical\"\n        />\n\n    <TextView\n        android:id=\"@+id/appInstalledOn\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"32dp\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_below=\"@id/appGroupTitle\"\n        android:layout_toEndOf=\"@+id/appGroupIcon\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:text=\"Date\"\n        android:gravity=\"center_vertical\"\n        />\n\n\n    <ImageView\n        android:paddingLeft=\"?android:attr/expandableListPreferredItemPaddingLeft\"\n        android:id=\"@+id/appGroupIcon\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"wrap_content\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"false\"\n        android:foregroundGravity=\"center_vertical\"\n        android:src=\"@mipmap/ic_launcher\"\n        android:paddingTop=\"8dp\"\n        android:paddingBottom=\"8dp\"\n        android:paddingStart=\"32dp\" />\n\n    <androidx.appcompat.widget.SwitchCompat\n        android:id=\"@+id/switchAppOnOffHistory\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:checked=\"false\"\n        android:paddingRight=\"10dp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/app_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/app_item_1\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingTop=\"10dp\"\n        android:textStyle=\"bold\"\n        android:text=\"example.hostname.net\"/>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/app_report_detail_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:fitsSystemWindows=\"true\">\n\n    <com.google.android.material.tabs.TabLayout\n        android:id=\"@+id/tab_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/app_report_detail_toolbar\"\n        android:background=\"?attr/colorPrimary\"\n        android:elevation=\"6dp\"\n        android:minHeight=\"?attr/actionBarSize\"\n        android:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\"\n        app:tabSelectedTextColor=\"@color/orange\"/>\n\n    <androidx.viewpager.widget.ViewPager\n        android:id=\"@+id/pager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"fill_parent\"\n        android:layout_below=\"@id/tab_layout\"/>\n\n</androidx.coordinatorlayout.widget.CoordinatorLayout>"
  },
  {
    "path": "app/src/main/res/layout/content_history.xml",
    "content": "<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\">\n\n    <TextView\n        android:id=\"@+id/noData\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:gravity=\"center\"\n        android:text=\"@string/nodata\"\n        android:visibility=\"invisible\"/>\n\n        <ExpandableListView\n            android:id=\"@+id/list_history\"\n            android:divider=\"@android:color/darker_gray\"\n            android:dividerHeight=\"0.5dp\"\n            android:indicatorLeft=\"?android:attr/expandableListPreferredItemIndicatorLeft\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:paddingTop=\"64dp\"\n            />\n\n    <ProgressBar\n        android:id=\"@+id/selectHistoryProgressBar\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:visibility=\"gone\">\n\n    </ProgressBar>\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/content_select_history_apps.xml",
    "content": "<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    tools:context=\".Activities.MainActivity\">\n\n        <androidx.recyclerview.widget.RecyclerView\n            android:id=\"@+id/list_selection_app_recycler\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:scrollbars=\"vertical\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/fragment_charts.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/scrollViewChart\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\">\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n\n    <RelativeLayout\n        android:id=\"@+id/holderLayouit1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\">\n\n\n        <androidx.cardview.widget.CardView xmlns:card_view=\"http://schemas.android.com/apk/res-auto\"\n            android:id=\"@+id/card_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:layout_marginBottom=\"@dimen/cardview_default_margin\"\n            android:layout_marginLeft=\"@dimen/cardview_default_margin\"\n            android:layout_marginRight=\"@dimen/cardview_default_margin\"\n            card_view:cardCornerRadius=\"4dp\">\n\n            <LinearLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:orientation=\"vertical\">\n\n                <RelativeLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"match_parent\">\n\n                    <TextView\n                        android:id=\"@+id/period\"\n                        style=\"@style/CardViewPrimaryTitle\" />\n\n                </RelativeLayout>\n\n                <include\n                    android:id=\"@+id/include\"\n                    layout=\"@layout/history_list_group\" />\n\n                <com.github.mikephil.charting.charts.BarChart\n                    android:id=\"@+id/chart\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"240dp\"\n                    android:layout_marginBottom=\"24dp\" />\n\n            </LinearLayout>\n        </androidx.cardview.widget.CardView>\n\n    </RelativeLayout>\n\n    <RelativeLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/holderLayouit1\"\n        android:background=\"@drawable/background_border\">\n\n        <androidx.recyclerview.widget.RecyclerView\n            android:id=\"@+id/my_recycler_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:scrollbars=\"vertical\" />\n    </RelativeLayout>\n\n\n</RelativeLayout>\n\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/layout/fragment_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/background_border\"\n    android:orientation=\"vertical\">\n\n    <TextView\n        android:id=\"@+id/fragment_appname\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:text=\"example.hostname.net\"\n        android:textSize=\"12dp\"\n        android:textStyle=\"bold\" />\n\n    <TextView\n        android:id=\"@+id/fragment_timestamp_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/fragment_appname\"\n        android:paddingEnd=\"@dimen/activity_vertical_margin\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:text=\"@string/layout_fragment_list_item_timestamp\"\n        android:textSize=\"10dp\"\n        android:textStyle=\"bold\" />\n\n    <TextView\n        android:id=\"@+id/fragment_timestamp_value\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/fragment_appname\"\n        android:layout_toEndOf=\"@+id/fragment_timestamp_title\"\n        android:text=\"@string/layout_fragment_list_item_status\"\n        android:textSize=\"10dp\" />\n\n    <TextView\n        android:id=\"@+id/fragment_conncection_info_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/fragment_timestamp_title\"\n        android:paddingEnd=\"@dimen/activity_vertical_margin\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:text=\"@string/layout_fragment_list_item_connection\"\n        android:textSize=\"10dp\"\n        android:textStyle=\"bold\" />\n\n    <TextView\n        android:id=\"@+id/fragment_conncection_info_value\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/fragment_timestamp_value\"\n        android:layout_toEndOf=\"@+id/fragment_conncection_info_title\"\n        android:text=\"@string/layout_fragment_list_item_status\"\n        android:textSize=\"10dp\" />\n\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/help_list_group.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <TextView\n        android:id=\"@+id/listTitle\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"?android:attr/expandableListPreferredItemPaddingLeft\"\n        android:textColor=\"@android:color/black\"\n        android:paddingTop=\"10dp\"\n        android:paddingBottom=\"10dp\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/help_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n    <TextView\n        android:id=\"@+id/expandedListItem\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingTop=\"10dp\"\n        android:paddingRight=\"10dp\"\n        android:paddingBottom=\"10dp\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/history_list_group.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?android:attr/listPreferredItemHeight\"\n    >\n\n    <TextView\n        android:id=\"@+id/historyGroupTitle\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:textColor=\"@android:color/black\"\n        android:layout_toEndOf=\"@+id/historyGroupIcon\"\n        android:text=\"App Name\"\n        android:paddingTop=\"12dp\"\n        android:layout_alignParentTop=\"true\" />\n\n    <TextView\n        android:id=\"@+id/historyGroupSubtitle\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"26dip\"\n        android:ellipsize=\"marquee\"\n        android:text=\"full.package.name\"\n        android:textSize=\"12sp\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_toEndOf=\"@+id/historyGroupIcon\"\n        android:layout_below=\"@+id/historyGroupTitle\" />\n\n    <ImageView\n        android:paddingLeft=\"?android:attr/expandableListPreferredItemPaddingLeft\"\n        android:id=\"@+id/historyGroupIcon\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"wrap_content\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"false\"\n        android:foregroundGravity=\"center_vertical\"\n        android:src=\"@mipmap/ic_launcher\"\n        android:paddingTop=\"8dp\"\n        android:paddingBottom=\"8dp\"\n        android:paddingStart=\"32dp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/history_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/history_item_1\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingTop=\"10dp\"\n        android:textStyle=\"bold\"\n        android:text=\"example.hostname.net\"/>\n\n    <TextView\n        android:id=\"@+id/history_item_2_type\"\n        android:layout_below=\"@+id/history_item_1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingEnd=\"@dimen/activity_vertical_margin\"\n        android:paddingTop=\"5dp\"\n        android:textStyle=\"bold\"\n        android:text=\"connection info:\"\n        />\n\n    <TextView\n        android:layout_below=\"@+id/history_item_1\"\n        android:layout_toEndOf=\"@+id/history_item_2_type\"\n        android:id=\"@+id/history_item_2_val\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"5dp\"\n        android:paddingBottom=\"5dp\"\n        android:text=\"-status-\"/>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/main_nav_header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"@dimen/nav_header_height\"\n    android:background=\"@color/colorAccent\"\n    android:gravity=\"bottom\"\n    android:orientation=\"vertical\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:theme=\"@style/ThemeOverlay.AppCompat.Dark\">\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"#ffffff\"\n        android:orientation=\"horizontal\"\n        android:paddingBottom=\"7dp\"\n        android:paddingTop=\"7dp\">\n\n        <ImageView\n            android:id=\"@+id/imageView\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:paddingEnd=\"@dimen/activity_horizontal_margin\"\n            android:paddingStart=\"@dimen/activity_horizontal_margin\"\n            android:src=\"@mipmap/ic_drawer\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerVertical=\"true\"\n            android:layout_toEndOf=\"@+id/imageView\"\n            android:text=\"@string/app_name\"\n            android:textAppearance=\"@style/TextAppearance.AppCompat.Body1\"\n            android:textColor=\"@color/colorPrimary\"\n            android:textSize=\"18sp\" />\n\n    </RelativeLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/report_detail_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/report_detail_item_type\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"16dp\"\n        android:paddingEnd=\"@dimen/activity_horizontal_margin\"\n        android:text=\"Type:\"\n        android:textAppearance=\"@style/TextAppearance.AppCompat.Button\" />\n\n    <TextView\n        android:id=\"@+id/report_detail_item_value\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingEnd=\"@dimen/activity_horizontal_margin\"\n        android:text=\"value\"\n        android:textAlignment=\"textEnd\"\n        android:layout_toEndOf=\"@+id/report_detail_item_type\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/report_list_group.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?android:attr/listPreferredItemHeight\"\n    >\n\n    <TextView\n        android:id=\"@+id/reportGroupTitle\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:textColor=\"@android:color/black\"\n        android:layout_toEndOf=\"@+id/reportGroupIcon\"\n        android:text=\"App Name\"\n        android:paddingTop=\"12dp\"\n        android:layout_alignParentTop=\"true\" />\n\n    <TextView\n        android:id=\"@+id/reportGroupSubtitle\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"26dip\"\n        android:ellipsize=\"marquee\"\n        android:text=\"full.package.name\"\n        android:textSize=\"12sp\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_toEndOf=\"@+id/reportGroupIcon\"\n        android:layout_below=\"@+id/reportGroupTitle\" />\n\n    <ImageView\n        android:paddingLeft=\"?android:attr/expandableListPreferredItemPaddingLeft\"\n        android:id=\"@+id/reportGroupIcon\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"wrap_content\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"false\"\n        android:foregroundGravity=\"center_vertical\"\n        android:src=\"@mipmap/ic_launcher\"\n        android:paddingTop=\"8dp\"\n        android:paddingBottom=\"8dp\"\n        android:paddingStart=\"32dp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/report_list_group_header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?android:attr/listPreferredItemHeight\"\n    >\n\n    <TextView\n        android:id=\"@+id/reportGroupTitle_header\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:textColor=\"@android:color/black\"\n        android:layout_toEndOf=\"@+id/reportGroupIcon_header\"\n        android:text=\"App Name\"\n        android:paddingTop=\"12dp\"\n        android:layout_alignParentTop=\"true\" />\n\n    <TextView\n        android:id=\"@+id/reportGroupSubtitle_header\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"26dip\"\n        android:ellipsize=\"marquee\"\n        android:text=\"full.package.name\"\n        android:textSize=\"12sp\"\n        android:paddingLeft=\"@dimen/nav_header_vertical_spacing\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_toEndOf=\"@+id/reportGroupIcon_header\"\n        android:layout_below=\"@+id/reportGroupTitle_header\" />\n\n    <ImageView\n        android:paddingLeft=\"?android:attr/expandableListPreferredItemPaddingLeft\"\n        android:id=\"@+id/reportGroupIcon_header\"\n        android:layout_width=\"60dp\"\n        android:layout_height=\"60dp\"\n        android:adjustViewBounds=\"true\"\n        android:cropToPadding=\"false\"\n        android:foregroundGravity=\"center_vertical\"\n        android:paddingTop=\"8dp\"\n        android:paddingStart=\"@dimen/activity_vertical_margin\"\n        android:paddingBottom=\"8dp\"\n        android:src=\"@mipmap/ic_launcher\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/report_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <TextView\n        android:id=\"@+id/report_item_1\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingTop=\"10dp\"\n        android:textStyle=\"bold\"\n        android:text=\"example.hostname.net\"/>\n\n    <TextView\n        android:id=\"@+id/report_item_2_type\"\n        android:layout_below=\"@+id/report_item_1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:paddingStart=\"?android:attr/expandableListPreferredChildPaddingLeft\"\n        android:paddingEnd=\"@dimen/activity_vertical_margin\"\n        android:paddingTop=\"5dp\"\n        android:textStyle=\"bold\"\n        android:text=\"connection info:\"\n        />\n\n    <TextView\n        android:layout_below=\"@+id/report_item_1\"\n        android:layout_toEndOf=\"@+id/report_item_2_type\"\n        android:id=\"@+id/report_item_2_val\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:paddingTop=\"5dp\"\n        android:paddingBottom=\"5dp\"\n        android:text=\"-status-\"/>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/toolbar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.google.android.material.appbar.AppBarLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:theme=\"@style/AppTheme.AppBarOverlay\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n    <androidx.appcompat.widget.Toolbar\n        android:id=\"@+id/toolbar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"?attr/actionBarSize\"\n        android:background=\"?attr/colorPrimary\"\n        app:popupTheme=\"@style/AppTheme.PopupOverlay\" />\n\n</com.google.android.material.appbar.AppBarLayout>"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorAccent\">\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center_horizontal\"\n        android:layout_centerVertical=\"true\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/slide1_heading\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_title\"\n            android:textStyle=\"bold\" />\n\n        <ImageView\n            android:layout_width=\"@dimen/img_width_height\"\n            android:layout_height=\"@dimen/img_width_height\"\n            android:background=\"@mipmap/splash_icon\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"10dp\"\n            android:paddingLeft=\"@dimen/desc_padding\"\n            android:paddingRight=\"@dimen/desc_padding\"\n            android:text=\"@string/slide1_text\"\n            android:textAlignment=\"center\"\n            android:gravity=\"center\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_desc\" />\n\n    </LinearLayout>\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorAccent\">\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:gravity=\"center_horizontal\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/slide2_heading\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_title\"\n            android:textStyle=\"bold\" />\n\n        <ImageView\n            android:layout_width=\"@dimen/img_width_height\"\n            android:layout_height=\"@dimen/img_width_height\"\n            android:background=\"@mipmap/splash_icon\"\n            />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"10dp\"\n            android:gravity=\"center\"\n            android:paddingLeft=\"@dimen/desc_padding\"\n            android:paddingRight=\"@dimen/desc_padding\"\n            android:text=\"@string/slide2_text\"\n            android:textAlignment=\"center\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_desc\" />\n\n    </LinearLayout>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/tutorial_slide3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorAccent\">\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:gravity=\"center_horizontal\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/slide3_heading\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_title\"\n            android:textStyle=\"bold\" />\n\n        <ImageView\n            android:layout_width=\"@dimen/img_width_height\"\n            android:layout_height=\"@dimen/img_width_height\"\n            android:background=\"@mipmap/splash_icon\"\n            />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"10dp\"\n            android:gravity=\"center\"\n            android:paddingLeft=\"@dimen/desc_padding\"\n            android:paddingRight=\"@dimen/desc_padding\"\n            android:text=\"@string/slide3_text\"\n            android:textAlignment=\"center\"\n            android:textColor=\"@android:color/white\"\n            android:textSize=\"@dimen/slide_desc\" />\n\n    </LinearLayout>\n\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/menu/applistseletion_menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n\n\n    <item\n        android:id=\"@+id/action_search\"\n        android:icon=\"@drawable/ic_search_white_24dp\"\n        android:orderInCategory=\"1\"\n        android:title=\"@string/action_search\"\n        app:actionViewClass=\"androidx.appcompat.widget.SearchView\"\n        app:showAsAction=\"always|collapseActionView\" />\n\n\n    <item\n        android:id=\"@+id/action_sort\"\n        android:icon=\"@drawable/ic_sort_white_24dp\"\n        android:orderInCategory=\"2\"\n        android:title=\"@string/sort_alpha_desc\"\n        app:showAsAction=\"always\">\n        <menu>\n            <group android:checkableBehavior=\"single\">\n                <item\n                    android:id=\"@+id/action_sort_alphabetical_asc\"\n                    android:orderInCategory=\"1\"\n                    android:title=\"@string/sort_alpha_asc\" />\n\n                <item\n                    android:id=\"@+id/action_sort_alphabetical_desc\"\n                    android:orderInCategory=\"2\"\n                    android:title=\"@string/sort_alpha_desc\" />\n\n                <item\n                    android:id=\"@+id/action_sort_installdate_asc\"\n                    android:orderInCategory=\"3\"\n                    android:title=\"@string/sort_install_asc\" />\n\n                <item\n                    android:id=\"@+id/action_sort_installdate_desc\"\n                    android:orderInCategory=\"4\"\n                    android:title=\"@string/sort_install_desc\" />\n            </group>\n        </menu>\n    </item>\n\n    <!--<item-->\n        <!--android:id=\"@+id/deleteButton\"-->\n        <!--android:icon=\"@drawable/ic_delete\"-->\n        <!--android:orderInCategory=\"3\"-->\n        <!--android:title=\"@string/deleteButton\"-->\n        <!--app:showAsAction=\"always|collapseActionView\"/>-->\n\n</menu>"
  },
  {
    "path": "app/src/main/res/menu/main_drawer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <group android:id=\"@+id/nav_group_main\"\n        android:checkableBehavior=\"all\">\n        <item\n            android:id=\"@+id/nav_main\"\n            android:icon=\"@drawable/ic_notification\"\n            android:title=\"@string/drawer_main\" />\n        <item\n            android:id=\"@+id/nav_history\"\n            android:icon=\"@drawable/ic_history\"\n            android:title=\"@string/drawer_history\" />\n        <item\n            android:id=\"@+id/nav_tutorial\"\n            android:icon=\"@drawable/ic_tutorial\"\n            android:title=\"@string/drawer_tutorial\"/>\n    </group>\n\n    <group android:id=\"@+id/nav_group_add\"\n        android:checkableBehavior=\"all\">\n        <item\n            android:id=\"@+id/nav_settings\"\n            android:icon=\"@drawable/ic_settings\"\n            android:title=\"@string/drawer_settings\" />\n        <item\n            android:id=\"@+id/nav_help\"\n            android:icon=\"@drawable/ic_help\"\n            android:title=\"@string/drawer_help\" />\n        <item\n            android:id=\"@+id/nav_about\"\n            android:icon=\"@drawable/ic_menu_info\"\n            android:title=\"@string/drawer_about\" />\n    </group>\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/toolbar_menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n    <!--<item-->\n        <!--android:id=\"@+id/action_startstop\"-->\n        <!--android:icon=\"@drawable/ic_clear\"-->\n        <!--android:title=\"@string/action_startstop_start\"-->\n        <!--app:showAsAction=\"ifRoom\" />-->\n    <item\n        android:id=\"@+id/action_refresh\"\n        android:icon=\"@drawable/ic_refresh\"\n        android:title=\"@string/action_refresh_title\"\n        app:showAsAction=\"ifRoom\" />\n\n</menu>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#024265</color>\n    <color name=\"colorPrimaryDark\">#00314c</color>\n    <color name=\"colorAccent\">#0274B2</color>\n    <color name=\"white\">#ffffff</color>\n    <color name=\"black\">#000000</color>\n    <color name=\"orange\">#f18736</color>\n    <color name=\"red\">#B71C1C</color>\n    <color name=\"green\">#388E3C</color>\n    <color name=\"text_dark\">#757575</color>\n    <color name=\"middlegrey\">#A8A8A8</color>\n\n    <!-- dots inactive colors -->\n    <color name=\"dot_dark_screen\">#026499</color>\n\n    <!-- dots active colors -->\n    <color name=\"dot_light_screen\">#448bb2</color>\n\n    <array name=\"array_dot_active\">\n        <item>@color/dot_light_screen</item>\n        <item>@color/dot_light_screen</item>\n        <item>@color/dot_light_screen</item>\n    </array>\n\n    <array name=\"array_dot_inactive\">\n        <item>@color/dot_dark_screen</item>\n        <item>@color/dot_dark_screen</item>\n        <item>@color/dot_dark_screen</item>\n    </array>\n\n    <color name=\"black_overlay\">#66000000</color>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"nav_header_vertical_spacing\">16dp</dimen>\n    <dimen name=\"nav_header_height\">160dp</dimen>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n    <dimen name=\"dots_height\">26dp</dimen>\n    <dimen name=\"dots_margin_bottom\">20dp</dimen>\n    <dimen name=\"img_width_height\">120dp</dimen>\n    <dimen name=\"slide_title\">26dp</dimen>\n    <dimen name=\"slide_desc\">16dp</dimen>\n    <dimen name=\"desc_padding\">40dp</dimen>\n    <dimen name=\"fab_margin\">16dp</dimen>\n\n    <dimen name=\"cardview_default_margin\">8dp</dimen>\n\n\n\n    <dimen name=\"widget_margin\">8dp</dimen>\n    <dimen name=\"padding_small\">8dp</dimen>\n    <dimen name=\"large\">400</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <!-- APP GLOBAL -->\n    <string name=\"app_name\" translatable=\"false\">Net Monitor</string>\n    <string name=\"app_name_long\" translatable=\"false\">Privacy Friendly Net Monitor</string>\n    <string name=\"about_author_names\" translatable=\"false\">Felix Tsala Schiller</string>\n\n    <!-- MAIN -->\n    <string name=\"main_button_text_off\">Start Net Monitor</string>\n    <string name=\"main_text_normalbutton_desc\">By touching the start button, Net Monitor starts a passive service which detects all active network connections. A background notification will inform you of the ongoing monitoring.</string>\n    <string name=\"main_text_stopped\">Net Monitor inactive</string>\n\n    <!-- SERVICE HANDLER -->\n    <string name=\"passive_service_start\">Net Monitor service has been started in passive mode.</string>\n    <string name=\"passive_service_stop\">Net Monitor service has been stopped. Was in passive mode.</string>\n\n    <!-- REPORT -->\n    <string name=\"unknown_app\">Unknown App</string>\n    <string name=\"unknown_package\">app.android.unknown</string>\n    <string name=\"report_swipe_refresh\">Swipe down to refresh.</string>\n    <string name=\"report_detail_ssllabs\"><u>Open SSL Labs Server Test Results</u></string>\n\n    <!-- REPORT DETAIL -->\n    <string name=\"headline_report_detail\">Detail View</string>\n    <string name=\"report_detail_heading\">Detailed Technical Information</string>\n\n    <!-- MENU DRAWER -->\n    <string name=\"drawer_main\">Main</string>\n    <string name=\"drawer_settings\">Settings</string>\n    <string name=\"drawer_help\">Help</string>\n    <string name=\"drawer_about\">About</string>\n    <string name=\"drawer_tutorial\">Tutorial</string>\n    <string name=\"drawer_history\">History</string>\n    <string name=\"navigation_drawer_open\">navigation_drawer_open</string>\n    <string name=\"navigation_drawer_close\">navigation_drawer_close</string>\n\n    <!-- ABOUT -->\n    <string name=\"about\">About</string>\n    <string name=\"version_number\">Version</string>\n    <string name=\"about_author\">Author</string>\n    <string name=\"about_author_contributors\">and contributors.</string>\n    <string name=\"about_affiliation\">In affiliation with</string>\n    <string name=\"privacy_friendly\">This app belongs to the group of Privacy Friendly Apps developed by the research group SECUSO. Sourcecode licensed under GPLv3. Images Copyright SECUSO und Google Inc.</string>\n    <string name=\"more_info\">More information can be found on:</string>\n    <string name=\"github\"><a href=\"https://github.com/SecUSo/privacy-friendly-netmonitor/\">Github-Repo</a></string>\n    <string name=\"url\"><a href=\"https://www.secuso.org/pfa\">SECUSO-Website</a></string>\n    <string name=\"about_API\">This app uses Java-SSLLabs-API by Björn Roland and Qualys SSL Labs.</string>\n    <string name=\"url_API\"><a href=\"https://github.com/bjoernr-de\">Java-SSL Labs-API</a></string>\n    <string name=\"url_SSLLabs\"><a href=\"https://www.ssllabs.com/projects/ssllabs-apis\">Qualys SSL Labs API</a></string>\n\n    <!-- HELP -->\n    <string name=\"help\">Help</string>\n\n    <string name=\"help_whatis\">What is Privacy Friendly Net Monitor?</string>\n    <string name=\"help_whatis_answer\">Privacy Friendly Net Monitor monitors\n        network traffic from installed apps. It scans active network connections with a background\n        service and also displays additional network encryption information.</string>\n\n    <string name=\"help_feature_one\">How does connection monitoring work?</string>\n    <string name=\"help_feature_one_answer\">Net Monitor deploys an background service, which scans for\n        active connections every second. Apps invoking the detected connections are identified and\n        listed with remote addresses they are communicating with.</string>\n\n    <string name=\"help_feature_two\">What is protocol and encryption detection?</string>\n    <string name=\"help_feature_two_answer\">Based on a connection\\'s remote port, the transport protocol\n        can be identified by \"Well Known Port\" tables. Based on the known ports, a warning is given\n        in case a connection is known for not being encrypted. Note, that this is no grantee\n        that the connection uses this protocol, since assignment of port numbers is not enforced by the system.</string>\n\n    <string name=\"help_feature_three\">What is hostname resolution?</string>\n    <string name=\"help_feature_three_answer\">The remote host name assigned is requested by\n        reverse name resolution. This is done asynchronously in background and thus may take some seconds.\n        Remark: The resolved hostname may not be the actual domain name requested by e.g. a browser app.</string>\n\n    <string name=\"help_feature_four\">What are detailed reports?</string>\n    <string name=\"help_feature_four_answer\">A detailed mode can be switched on in the settings.\n        After activation additional technical information of scanned connections is displayed after a\n        connection has been touched in the overview.</string>\n\n    <string name=\"help_feature_five\">What is certificate validation?</string>\n    <string name=\"help_feature_five_answer\">An automatic analysis of the remote servers TLS\n        implementation can be activated in the settings. When active, remote servers with a resolved\n        hostname are tested automatically when the connection protocol is known for using TLS\n        encryption. The analysis is performed by SSL Labs API and the associated service. The remote\n        server\\'s implementation quality is shown in grades A+ (best) to F (worst), or is displayed\n        as T (trust issues). For further information on SSL Lab API see the About.</string>\n\n    <string name=\"help_privacy\">What makes the app privacy-friendly?</string>\n    <string name=\"help_privacy_answer\">Privacy Friendly Net Monitor does not include any tracking mechanisms\n        or advertisement and comes free of charge. It is published under\n        GPLv3 license and is free to distribute. The information on network connections is not stored.</string>\n\n    <string name=\"help_permission\">Which permissions requires the app?</string>\n    <string name=\"help_permission_answer\">Privacy Friendly Net Monitor does not require any permission\n        for scanning active connections. The Certificate Validation feature requires\n        the Internet permission to request server test results from Qualys SSL Labs.\n        Running a service in the foreground also requires a permission from Android 9 forward.</string>\n\n    <string name=\"help_sysuser\">What does the [System] tag mean?</string>\n    <string name=\"help_sysuser_answer\">The [System] tag identifies an app pre-installed on the\n        android system by the original equipment manufacturer (OEM). If the app is named \\'System\n        [System]\\', an android system component itself has invoked the connection (root-user).</string>\n\n    <string name=\"help_ssllabs\">What is SSL-Labs</string>\n    <string name=\"help_ssllabs_answer\">SSL-Labs API from Qualys performs a deep analysis of SSL/TLS\n        web server. Net Monitor requests analysis results on demand from SSL Labs. SSL-Labs privacy\n    terms state, that it does not share submitted IP addresses or hostnames with any third party. </string>\n\n    <string name=\"help_un_encrypted_ports\">What are the meanings of unencrypted and encrypted ports in the detail view?</string>\n    <string name=\"help_un_encrypted_ports_answer\">In fact the ports are not unencrypted or encrypted.\n    But a port is handling all the traffic of one service. This services communicates over a\n    unencrypted or encrypted protocol. If an \"port is encrypted\" it means that the service, that communicates\n    over this port, is using an encrypted protocol (vise versa for unencrypted).</string>\n\n    <!-- SETTINGS -->\n    <string name=\"title_activity_settings\">Settings</string>\n    <string name=\"pref_advanced_switch\">Detail Mode</string>\n    <string name=\"pref_advanced_switch_summary\">Show info tab when touching a connection.</string>\n    <string name=\"pref_log_switch\">Log Connections</string>\n    <string name=\"pref_log_switch_summary\">Keep detected information.</string>\n    <string name=\"pref_certval_switch\">Server Validation</string>\n    <string name=\"pref_certval_switch_summary\">Perform analysis with SSL Labs API.</string>\n    <string name=\"pref_connection_highlighting\">Connection Highlighting</string>\n    <string name=\"pref_connection_highlighting_summary\">Highlights the connections in green and red.</string>\n\n    <!-- TOOLBAR -->\n    <string name=\"action_refresh_title\">Refresh</string>\n    <string name=\"action_startstop_start\">Start</string>\n\n    <!-- TUTORIAL -->\n    <string name=\"slide1_heading\">Welcome!</string>\n    <string name=\"slide1_text\">Privacy Friendly Net Monitor shows the network activity of installed apps. Use it to check on all your device\\'s connections.</string>\n    <string name=\"slide2_heading\">Connection Information</string>\n    <string name=\"slide2_text\">Currently active connections and encryption info is listed by app. \\n Logging, detailed technical info, and server validation features can be activated in settings.</string>\n\n    <string name=\"slide3_heading\">History</string>\n    <string name=\"slide3_text\">Privacy Friendly Net Monitor can store a connection history of chosen apps.\n    The connection history is displayed as a list and as a graph (via a long press).</string>\n\n    <string name=\"okay\">Okay</string>\n    <string name=\"next\">Next</string>\n    <string name=\"skip\">Skip</string>\n    <string name=\"help_button\">Help</string>\n    <string name=\"bg_desc\">Connection monitoring is active</string>\n\n    <string name=\"title_activity_tutorial__monitor\">Tutorial_Monitor</string>\n    <string name=\"dummy_button\">Dummy Button</string>\n    <string name=\"dummy_content\">DUMMY\\nCONTENT</string>\n\n    <!--HISTORY-->\n    <string name=\"title_activity_history\">History</string>\n    <string name=\"title_activity_history_detail\">History Detail View</string>\n    <string name=\"history_no_data_collected\">(No data collected)</string>\n\n    <!--SELECT HISTORY APPS-->\n    <string name=\"title_activity_select_history_apps\">App Selection for History</string>\n    <string name=\"sort_alpha_asc\">alphabetical ASC</string>\n    <string name=\"action_search\">action Search</string>\n    <string name=\"sort_alpha_desc\">alphabetical DESC</string>\n    <string name=\"sort_install_asc\">install date ASC </string>\n    <string name=\"sort_install_desc\">install date DESC </string>\n\n    <!--APP REPORT DETAIL-->\n    <string name=\"title_activity_app_report__detail\">App report details</string>\n    <string name=\"nodata\">No reports available.\\nPlease select some apps you\\n want to monitor via the button\\n in the right bottom corner.</string>\n    <string name=\"deleteButton\">Delete History of selected Apps</string>\n    <string name=\"dialogTitle\">Delete all reports?</string>\n    <string name=\"dialogMessage\">Report Deletion</string>\n    <string name=\"yes\">Yes</string>\n    <string name=\"no\">No</string>\n\n    <!-- History Chart Fragments-->\n    <string name=\"hours\">Hours</string>\n    <string name=\"encrypted\">encrypted</string>\n    <string name=\"unencrypted\">unencrypted</string>\n    <string name=\"unknown\">unknown</string>\n    <string name=\"oclock\"> o\\'clock</string>\n    <string name=\"hr\">hr</string>\n    <string name=\"days\">days</string>\n    <string name=\"d\">d></string>\n\n    <!-- AppConnections_Chart.java -->\n    <string name=\"app_connections_chart_day\">Day</string>\n    <string name=\"app_connections_chart_week\">Week</string>\n    <string name=\"app_connections_chart_month\">Month</string>\n\n    <!-- Expandable History List Adapter.java -->\n    <string name=\"expandable_history_list_adapter_time_stamp\">Time Stamp: </string>\n\n    <!-- History Detail Activity.java -->\n    <string name=\"history_detail_activity_uid\">UID</string>\n    <string name=\"history_detail_activity_app_version\">APP VERSION</string>\n    <string name=\"history_detail_activity_installed_on\">INSTALLED ON</string>\n    <string name=\"history_detail_activity_remote_address\">REMOTE ADDRESS</string>\n    <string name=\"history_detail_activity_remote_hex\">REMOTE HEX</string>\n    <string name=\"history_detail_activity_remote_host\">REMOTE HOST</string>\n    <string name=\"history_detail_activity_local_address\">LOCAL ADDRESS</string>\n    <string name=\"history_detail_activity_local_hex\">LOCAL HEX</string>\n    <string name=\"history_detail_activity_service_port\">SERVICE PORT</string>\n    <string name=\"history_detail_activity_payload_protocol\">PAYLOAD PROTOCOL</string>\n    <string name=\"history_detail_activity_transport_protocol\">TRANSPORT PROTOCOL</string>\n    <string name=\"history_detail_activity_local_port\">LOCAL PORT</string>\n    <string name=\"history_detail_activity_timestamp\">TIMESTAMP</string>\n    <string name=\"history_detail_activity_connection_info\">CONNECTION INFO</string>\n\n    <!-- fragment_list_item.xml -->\n    <string name=\"layout_fragment_list_item_timestamp\">TIMESTAMP </string>\n    <string name=\"layout_fragment_list_item_status\">-status-</string>\n    <string name=\"layout_fragment_list_item_connection\">CONNECTION</string>\n\n    <!-- layout_activity_history.xml -->\n    <string name=\"layout_activity_history_history\">History</string>\n    <string name=\"layout_activity_history_delete_database\">Delete\\nDatabase</string>\n    <string name=\"not_compatible_info\">Due to changes in the Android system, this app cannot function on Android 10 or later.</string>\n\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n        <item name=\"android:windowDisablePreview\">true</item>\n    </style>\n\n    <style name=\"SplashTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"android:windowBackground\">@drawable/splash_screen</item>\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"android:windowActionBar\">false</item>\n        <item name=\"android:windowFullscreen\">true</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n    </style>\n\n    <style name=\"AppTheme.AppBarOverlay\" parent=\"ThemeOverlay.AppCompat.Dark.ActionBar\" />\n\n    <style name=\"AppTheme.PopupOverlay\" parent=\"ThemeOverlay.AppCompat.Light\" />\n\n    <style name=\"FullscreenTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"android:actionBarStyle\">@style/FullscreenActionBarStyle</item>\n        <item name=\"android:windowActionBarOverlay\">true</item>\n        <item name=\"android:windowBackground\">@null</item>\n        <!--<item name=\"metaButtonBarStyle\">?android:attr/buttonBarStyle</item>-->\n        <!--<item name=\"metaButtonBarButtonStyle\">?android:attr/buttonBarButtonStyle</item>-->\n    </style>\n\n    <style name=\"FullscreenActionBarStyle\" parent=\"Widget.AppCompat.ActionBar\">\n        <item name=\"android:background\">@color/black_overlay</item>\n    </style>\n\n    <style name=\"AppBarOverlay\" parent=\"ThemeOverlay.AppCompat.Dark.ActionBar\" />\n\n    <style name=\"PopupOverlay\" parent=\"ThemeOverlay.AppCompat.Light\" />\n\n    <style name=\"CardViewPrimaryTitle\" parent=\"@android:style/TextAppearance.Large\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:textColor\">@color/black</item>\n        <item name=\"android:layout_marginTop\">20dp</item>\n        <item name=\"android:layout_marginLeft\">16dp</item>\n        <item name=\"android:layout_marginRight\">16dp</item>\n        <item name=\"android:textSize\">24sp</item>\n    </style>\n\n    <style name=\"CardViewSubTitle\" parent=\"@android:style/TextAppearance.Medium\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:textColor\">@color/middlegrey</item>\n        <item name=\"android:layout_marginTop\">0dp</item>\n        <item name=\"android:layout_marginLeft\">16dp</item>\n        <item name=\"android:layout_marginRight\">16dp</item>\n        <item name=\"android:textSize\">14sp</item>\n    </style>\n\n    <style name=\"CardViewBody\">\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_margin\">16dp</item>\n        <item name=\"android:layout_marginBottom\">24dp</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-de/strings.xml",
    "content": "<resources>\n    <!-- MAIN -->\n    <string name=\"main_button_text_off\">Net Monitor starten</string>\n    <string name=\"main_text_normalbutton_desc\">Bei Aktivierung des Start-Buttons wird ein Dienst\n        ausgeführt, der alle aktiven Netzwerkverbindungen erfasst. Eine Benachrichtigung im\n        Hintergrund zeigt den aktiven Scan an.</string>\n    <string name=\"main_text_stopped\">Net Monitor inaktiv</string>\n\n    <!-- SERVICE HANDLER -->\n    <string name=\"passive_service_start\">Net Monitor Dienst in passivem Modus gestartet.</string>\n    <string name=\"passive_service_stop\">Net Monitor Dienst beendet. War in passivem Modus.</string>\n\n    <!-- REPORT -->\n    <string name=\"unknown_app\">Unbekannte App</string>\n    <string name=\"unknown_package\">app.android.unknown</string>\n    <string name=\"report_swipe_refresh\">Zum Aktualisieren nach unten wischen.</string>\n    <string name=\"report_detail_ssllabs\"><u>SSL Labs Server Test Ergebnis öffnen</u></string>\n\n    <!-- REPORT DETAIL -->\n    <string name=\"headline_report_detail\">Detailansicht</string>\n    <string name=\"report_detail_heading\">Detaillierte technische Info</string>\n\n    <!-- MENU DRAWER -->\n    <string name=\"drawer_main\">Start</string>\n    <string name=\"drawer_settings\">Einstellungen</string>\n    <string name=\"drawer_help\">Hilfe</string>\n    <string name=\"drawer_about\">Über</string>\n    <string name=\"drawer_tutorial\">Anleitung</string>\n    <string name=\"drawer_history\">Historie</string>\n    <string name=\"navigation_drawer_open\">Öffnen</string>\n    <string name=\"navigation_drawer_close\">Schließen</string>\n\n    <!-- ABOUT -->\n    <string name=\"about\">Über</string>\n    <string name=\"version_number\">Version</string>\n    <string name=\"about_author\">Autor</string>\n    <string name=\"about_author_contributors\">und Mitwirkende.</string>\n    <string name=\"about_affiliation\">In Zusammenarbeit mit</string>\n    <string name=\"privacy_friendly\">Diese App gehört zur Gruppe der Privacy Friendly Apps entwickelt von der Forschungsgruppe SECUSO. Quelltext lizenziert unter GPLv3. Bilder Copyright SECUSO und Google Inc.</string>\n    <string name=\"more_info\">Weitere Infos unter:</string>\n    <string name=\"about_API\">Diese App verwendet Java-SSL Labs-API von Björn Roland and Qualis SSL Labs.</string>\n\n    <!-- HELP -->\n    <string name=\"help\">Hilfe</string>\n    <string name=\"help_whatis\">Was ist Privacy Friendly Net Monitor?</string>\n    <string name=\"help_whatis_answer\">Privacy Friendy Net Monitor überwacht den Netzwerkverkehr der\n        auf dem Gerät installierten Apps. Aktive Netzwekverbindungen werden mittels eines Hintergrunddienstes erfasst und mit zusätzlichen Verschlüsselungsinformationen aufgelistet.</string>\n\n    <string name=\"help_feature_one\">Wie funktioniert die Verbindungsüberwachung?</string>\n    <string name=\"help_feature_one_answer\">Net Monitor setzt einen Hintergrunddienst ein, welcher einmal\n        pro Sekunde aktive Netzwerkverbindungen erfasst. Die zu den ermittelten Verbindungen gehörigen Apps werden\n        abgeleitet und mit den Verbindungszielen aufgelistet.</string>\n\n    <string name=\"help_feature_two\">Was bedeutet das Erkennen von Protokoll und Verschlüsselung?</string>\n    <string name=\"help_feature_two_answer\">Basierend auf dem Ziel-Port einer Verbindung wird das zugehörige\n        Protokoll der Transportschicht anhand bekannter Port-Nummern zugeordnet. Anhand der\n        verwendeten Protokolle wird eine Warnung angegeben, falls es sich um eine unverschlüsselte\n        Verbindung handelt. Da die Verwendung bestimmter Ports nicht vom System erzwungen wird, ist diese\n        Information allerdings unter Umständen nicht vollständig korrekt.</string>\n\n    <string name=\"help_feature_three\">Was ist Host-Namensauflösung?</string>\n    <string name=\"help_feature_three_answer\">Der Name des Zielhosts wird über\n        eine umgekehrte Namensauflösung ermittelt. Da dies asynchron im Hintergrund geschieht, kann es ein paar\n        Sekunden dauern bis der Name verfügbar ist. Hinweis: Der Hostname kann sich von der\n        Domain unterscheiden, welche z.B. in einem Browser angewählt wurde.</string>\n\n    <string name=\"help_feature_four\">Was sind detaillierte Berichte?</string>\n    <string name=\"help_feature_four_answer\">Der detallierte Modus kann in den Einstellungen aktiviert\n        werden. Dadurch werden zusätzliche technische Informationen zu einer Verbindung angezeigt, wenn diese in der Liste ausgewählt wird.</string>\n\n    <string name=\"help_feature_five\">Was ist Zertifikats-Überprüfung?</string>\n    <string name=\"help_feature_five_answer\">Eine automatische Analyse der TLS-Implementierung des\n        Zielservers kann in den Einstellungen aktiviert werden. Server mit\n        aufgelöstem Hostnamen und bekanntem TLS-Port werden automatisch analysiert. Die Analyse wird über\n        SSL Labs Schnittstelle und den zugehörigen Dienst durchgeführt. Die Qualität der TLS-\n        Implementierung wird von A+ (am Besten) bis F (am Schlechtesten) oder mit T\n        (Vertrauensprobleme) angegeben. Weitere Informationen über die SSL Labs sind auf der \"Über\"\n        Seite zu finden.</string>\n\n    <string name=\"help_privacy\">Was macht die App privatsphäre-freundlich?</string>\n    <string name=\"help_privacy_answer\">Privacy Friendly Net Monitor verwendet keine Tracking-Mechanismen,\n        ist werbefrei und kostenlos. Außerdem werden die Informationen über die Verbindungen nicht gespeichert. </string>\n\n    <string name=\"help_permission\">Welche Berechtigungen braucht die App?</string>\n    <string name=\"help_permission_answer\">Privacy Friendly Net Monitor benötigt keine zusätzlichen\n        Berechtigungen um Netzwerkverbindungen zu überwachen. Die Zertifikatsüberprüfung benötigt\n        die Internet-Berechtigung um Testergebnisse von Qualys SSL Labs abzufragen.\n        Außerdem benötigt die App eine Berechtigung zum starten von Vordergrund Services ab Android 9.</string>\n\n    <string name=\"help_sysuser\">Was bedeutet die [System] Markierung?</string>\n    <string name=\"help_sysuser_answer\">Die [System] Markierung bedeutet, dass die entsprechende\n        App durch den Hersteller auf dem System vorinstalliert wurde. Wenn die App als\n        \\\"System [System\\\"] bezeichnet ist, dann wurde die Verbindung von einer Android\n        Systemkomponente initialisiert (Root User).</string>\n\n    <string name=\"help_ssllabs\">Was ist SSL-Labs?</string>\n    <string name=\"help_ssllabs_answer\">Die SSL-Labs API von Qualys führt eine Analyse von SSL/TLS-Webservern durch.\n        Privacy Friendly Net Monitor fragt Analyseergebnisse auf Bedarf von SSL Labs an.\n        Die Datenschutzerklärung von SSL-Labs sagt aus, dass keine der erhaltenen IP Addressen oder Hostnamen\n        an Dritte weitergegeben werden. </string>\n\n    <string name=\"help_un_encrypted_ports\">Was ist die Bedeutung von nicht-/ verschlüsselten Ports in\n        der Detailansicht?</string>\n    <string name=\"help_un_encrypted_ports_answer\"> Tatsächlich sind nicht die Ports selbst verschlüsselt,\n        sondern der Service, der an den Port gebunden ist, kommuniziert entweder über ein sicheres\n        Protokoll oder über ein unsicheres Protokoll. Man spricht von einem \"sicherem Port\",\n        wenn der Service ein sicheres Protkoll verwendet (dies gilt ebenfalls für unverschlüsselte Ports).</string>\n\n    <!-- SETTINGS -->\n    <string name=\"title_activity_settings\">Einstellungen</string>\n    <string name=\"pref_advanced_switch\">Detaillierter Modus</string>\n    <string name=\"pref_advanced_switch_summary\">Zeigt zusätzliche technische Informationen der Verbindung.</string>\n    <string name=\"pref_log_switch\">Verbindungen aufzeichnen</string>\n    <string name=\"pref_log_switch_summary\">Verbindungen speichern</string>\n    <string name=\"pref_certval_switch\">Zertifikats-Überprüfung</string>\n    <string name=\"pref_certval_switch_summary\">Serveranalyse mit SSL Labs API.</string>\n    <string name=\"pref_connection_highlighting\">Verbindungen färben</string>\n    <string name=\"pref_connection_highlighting_summary\">Färbt die Verbindungen grün und rot.</string>\n\n    <!-- TOOLBAR -->\n    <string name=\"action_refresh_title\">Aktualisieren</string>\n    <string name=\"action_startstop_start\">Start</string>\n\n    <!-- TUTORIAL -->\n    <string name=\"slide1_heading\">Willkommen!</string>\n    <string name=\"slide1_text\">Privacy Friendly Net Monitor überwacht die Netzwerkaktivität\n        installierter Apps. So können Sie überprüfen, welche Verbindungen durch installierte Apps aufgebaut werden und wann diese aktiv sind.</string>\n\n    <string name=\"slide2_heading\">Verbindungsinformationen</string>\n    <string name=\"slide2_text\">Die App listet Informationen zu aktiven Netzwerkverbindungen und zeigt an,\n        ob diese verschlüsselt sind. Zusätzlich können detaillierte, technische Informationen\n        und eine Zertifikatsprüfung des Zielservers in den Einstellungen aktiviert werden.</string>\n\n    <string name=\"slide3_heading\">Historie</string>\n    <string name=\"slide3_text\">In der Historie können Sie zunächst Apps festlegen, deren Internetverbindungen gespeichert werden.\n    Die gespeicherten Verbindungen der App können Sie in einer grafischen Darstellung (durch langes Drücken) sowie einer Verbindungsliste einsehen.</string>\n\n    <string name=\"okay\">Okay</string>\n    <string name=\"next\">Weiter</string>\n    <string name=\"skip\">Skip</string>\n    <string name=\"help_button\">Hilfe</string>\n\n    <!-- NOTIFICATION -->\n    <string name=\"bg_desc\">Verbindungen werden überwacht</string>\n    <string name=\"title_activity_history_detail\">Historie Detailansicht</string>\n\n    <!--HISTORY-->\n    <string name=\"title_activity_history\">Historie</string>\n\n    <!--SELECT HISTORY APPS-->\n    <string name=\"title_activity_select_history_apps\">App Auswahl für Historie</string>\n    <string name=\"sort_alpha_asc\">Alphabetisch aufsteigend</string>\n    <string name=\"action_search\">action Search</string>\n    <string name=\"sort_alpha_desc\">Alphabetisch absteigend</string>\n    <string name=\"sort_install_asc\">Installationsdatum aufsteigend </string>\n    <string name=\"sort_install_desc\">Installationsdatum absteigend </string>\n\n    <!--APP REPORT DETAIL-->\n    <string name=\"title_activity_app_report__detail\">App-Report Details</string>\n    <string name=\"nodata\">Falls keine Apps angezeigt werden\\neditieren Sie bitte die Liste der Apps\\nwelche Sie überwachen wollen,\\nüber den Button in der linken unteren Ecke.</string>\n    <string name=\"deleteButton\">Delete History of selected Apps</string>\n\n    <!-- History Chart Fragments-->\n    <string name=\"hours\">Stunden</string>\n    <string name=\"encrypted\">verschlüsselt</string>\n    <string name=\"unencrypted\">unverschlüsselt</string>\n    <string name=\"unknown\">unbekannt</string>\n    <string name=\"oclock\"> Uhr</string>\n    <string name=\"hr\">Std</string>\n    <string name=\"days\">Tage</string>\n    <string name=\"d\">t</string>\n    <string name=\"not_compatible_info\">Wegen Systemänderungen in Android funktioniert diese App ab Android 10 nicht mehr.</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-ja/strings.xml",
    "content": "<resources>\n    <!-- APP GLOBAL -->\n\n    <!-- MAIN -->\n    <string name=\"main_button_text_off\">Net Monitor を開始</string>\n    <string name=\"main_text_normalbutton_desc\">スタートボタンをタッチすることにより、Net Monitor はすべてのアクティブなネットワーク接続を検出するパッシブサービスを開始します。 進行中のモニタリングを通知するバックグラウンド通知が表示されます。</string>\n    <string name=\"main_text_stopped\">Net Monitor は非アクティブ</string>\n\n    <!-- SERVICE HANDLER -->\n    <string name=\"passive_service_start\">Net Monitor サービスはパッシブモードで開始されました。</string>\n    <string name=\"passive_service_stop\">Net Monitor サービスは停止しました。 パッシブモードでした。</string>\n\n    <!-- REPORT -->\n    <string name=\"unknown_app\">不明なアプリ</string>\n    <string name=\"unknown_package\">app.android.unknown</string>\n    <string name=\"report_swipe_refresh\">下にスワイプすると更新します。</string>\n    <string name=\"report_detail_ssllabs\"><u>Open SSL Labs サーバーテストの結果</u></string>\n\n    <!-- REPORT DETAIL -->\n    <string name=\"headline_report_detail\">詳細表示</string>\n    <string name=\"report_detail_heading\">詳細な技術情報</string>\n\n    <!-- MENU DRAWER -->\n    <string name=\"drawer_main\">メイン</string>\n    <string name=\"drawer_settings\">設定</string>\n    <string name=\"drawer_help\">ヘルプ</string>\n    <string name=\"drawer_about\">アプリについて</string>\n    <string name=\"navigation_drawer_open\">ナビゲーションドロワーを開く</string>\n    <string name=\"navigation_drawer_close\">ナビゲーションドロワーを閉じる</string>\n\n    <!-- ABOUT -->\n    <string name=\"about\">アプリについて</string>\n    <string name=\"version_number\">バージョン</string>\n    <string name=\"about_author\">作者</string>\n    <string name=\"about_author_contributors\">と貢献者。</string>\n    <string name=\"about_affiliation\">提携</string>\n    <string name=\"privacy_friendly\">このアプリは研究グループSECUSOが開発したPrivacy Friendly Appsのカテゴリに属しています。ソースコードはGPLv3でライセンスされています。画像の著作権はSECUSO und Google Inc.</string>\n    <string name=\"more_info\">さらに詳しい情報は以下でご覧ください:</string>\n    <string name=\"about_API\">このアプリは Java-SSLLabs-API by Björn Roland と Qualis SSL Labs を使用しています。</string>\n\n    <!-- HELP -->\n    <string name=\"help\">ヘルプ</string>\n\n    <string name=\"help_whatis\">プライバシーフレンドリー Net Monitor とは?</string>\n    <string name=\"help_whatis_answer\">プライバシーフレンドリー Net Monitor \n        は、インストールされているアプリからのネットワークトラフィックをモニターします。\n        バックグラウンドサービスでアクティブなネットワーク接続をスキャンし、追加のネットワーク暗号化情報も表示します。</string>\n\n    <string name=\"help_feature_one\">接続モニタリングの仕組みは?</string>\n    <string name=\"help_feature_one_answer\">Net Monitor はバックグラウンドサービスを展開し、\n        1 秒ごとにアクティブな接続をスキャンします。 検出された接続を呼び出すアプリケーションは、\n        通信しているリモートアドレスとともに識別され、リストされます。</string>\n\n    <string name=\"help_feature_two\">プロトコルと暗号化の検出とは?</string>\n    <string name=\"help_feature_two_answer\">接続のリモートポートに基づいて、トランスポートプロトコルは\n        \\\"よく知られているポート\\\" テーブルによって識別できます。 既知のポートに基づいて、\n        接続が暗号化されていないことが分かっている場合に警告が表示されます。 ポート番号の割り当てはシステムによって強制されないので、\n        接続がこのプロトコルを使用していることは保証されていないことに注意してください。</string>\n\n    <string name=\"help_feature_three\">ホスト名解決とは?</string>\n    <string name=\"help_feature_three_answer\">割り当てられたリモートホスト名は、逆引き名前解決によって要求されます。\n        これはバックグラウンドで非同期で行われ、数秒かかる場合があります。\n        解決されたホスト名は、要求された実際のドメイン名ではない可能性があります。 例えば、ブラウザーアプリ。</string>\n\n    <string name=\"help_feature_four\">詳細なレポートとは?</string>\n    <string name=\"help_feature_four_answer\">詳細モードは、設定で有効にすることができます。\n        有効にした後、スキャンされた接続の追加の技術情報は、概要で接続をタッチした後に表示されます。</string>\n\n    <string name=\"help_feature_five\">証明書の検証とは?</string>\n    <string name=\"help_feature_five_answer\">リモートサーバーの TLS 実装の自動分析は、設定で有効にすることができます。\n        有効な場合、解決されたホスト名を持つリモートサーバーは、接続プロトコルが TLS 暗号化を使用することがわかっているときに自動的にテストされます。\n        分析は、SSL Labs API と関連サービスによって実行されます。 リモートサーバーの実装品質は、グレード A+ (最高) 〜 F (最低)、\n        またはT (信頼問題) として表示されます。 SSL Lab API の詳細については、アプリについてを参照してください。</string>\n\n    <string name=\"help_privacy\">アプリをプライバシーフレンドリーにするものは?</string>\n    <string name=\"help_privacy_answer\">プライバシーフレンドリー Net Monitor は、追跡メカニズムや広告は含まれていません。\n        無料です。 プライバシーフレンドリー Net Monitor はGPLv3 ライセンスの下で公開されており、配布または拡張は自由です。</string>\n\n    <string name=\"help_permission\">アプリが必要とするアクセス許可は?</string>\n    <string name=\"help_permission_answer\">プライバシーフレンドリー Net Monitor は、\n        アクティブな接続をスキャンするためにアクセス許可を必要としません。 証明書検証機能は、\n        Qualys SSL Labs のサーバーテスト結果を要求するためのインターネットアクセス許可が必要です。\n        フォアグラウンドでサービスを実行するには、Android 9 フォワードからの許可も必要です。</string>\n\n    <string name=\"help_sysuser\">[システム] タグの意味は?</string>\n    <string name=\"help_sysuser_answer\">[システム]タグは、OEM (相手先ブランド名製造) によって Android\n        システムにプリインストールされているアプリを識別します。 このアプリの名前が \\'System [システム]\\'\n        の場合、Android システムコンポーネント自体が接続を呼び出しています (root-user)。</string>\n\n    <string name=\"help_ssllabs\">SSL-Labs とは</string>\n    <string name=\"help_ssllabs_answer\">Qualys の SSL-Labs APIは、SSL/TLS Web サーバーの詳細な分析を実行します。\n        Net Monitor は、SSL Labs にオンデマンドで分析結果をリクエストします。 SSL-Labs のプライバシー条件では、\n        提出された IP アドレスまたはホスト名を第三者と共有しないことを表示しています。 </string>\n\n    <!-- SETTINGS -->\n    <string name=\"title_activity_settings\">設定</string>\n    <string name=\"pref_advanced_switch\">詳細モード</string>\n    <string name=\"pref_advanced_switch_summary\">接続をタッチすると情報タブを表示します。</string>\n    <string name=\"pref_log_switch\">接続のログ</string>\n    <string name=\"pref_log_switch_summary\">検出された情報を保持します。</string>\n    <string name=\"pref_certval_switch\">サーバー検証</string>\n    <string name=\"pref_certval_switch_summary\">SSL Labs API で分析を実行します。</string>\n\n    <!-- TOOLBAR -->\n    <string name=\"action_refresh_title\">更新</string>\n    <string name=\"action_startstop_start\">開始</string>\n\n    <!-- TUTORIAL -->\n    <string name=\"slide1_heading\">ようこそ!</string>\n    <string name=\"slide1_text\">プライバシーフレンドリー Net Monitor は、インストールされているアプリのネットワーク活動を表示します。 これを使用して、すべてのデバイスの接続をチェックします。</string>\n    <string name=\"slide2_heading\">接続情報</string>\n    <string name=\"slide2_text\">現在、アクティブな接続と暗号化情報は、アプリによってリストされています。 \\n ログ、詳細な技術情報、およびサーバーの検証機能は設定で有効にすることができます。</string>\n\n    <string name=\"slide3_heading\">History</string>\n    <string name=\"slide3_text\">Privacy Friendly Net Monitor can store a connection history of chosen apps.\n    The connection history is displayed as a list and as a graph (via a long press).</string>\n\n    <string name=\"okay\">OK</string>\n    <string name=\"next\">次へ</string>\n    <string name=\"skip\">スキップ</string>\n    <string name=\"bg_desc\">接続モニタリングはアクティブです</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/xml/preferences.xml",
    "content": "<PreferenceScreen\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n        <SwitchPreference\n            android:id=\"@+id/pref_advanced_switch\"\n            android:key=\"IS_DETAIL_MODE\"\n            android:title=\"@string/pref_advanced_switch\"\n            android:summary=\"@string/pref_advanced_switch_summary\"\n            android:defaultValue=\"false\"/>\n\n        <SwitchPreference\n            android:id=\"@+id/pref_log_switch\"\n            android:key=\"IS_LOG\"\n            android:title=\"@string/pref_log_switch\"\n            android:summary=\"@string/pref_log_switch_summary\"\n            android:defaultValue=\"false\"/>\n        <SwitchPreference\n            android:id=\"@+id/pref_certval_switch\"\n            android:key=\"IS_CERTVAL\"\n            android:title=\"@string/pref_certval_switch\"\n            android:summary=\"@string/pref_certval_switch_summary\"\n            android:defaultValue=\"false\"/>\n\n        <SwitchPreference\n            android:id=\"@+id/pref_con_highlighting\"\n            android:key=\"IS_HIGHLIGHTED\"\n            android:title=\"@string/pref_connection_highlighting\"\n            android:summary=\"@string/pref_connection_highlighting_summary\"\n            android:defaultValue=\"true\"/>\n\n    <!-- NOTE: EditTextPreference accepts EditText attributes. -->\n    <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->\n    <!-- <EditTextPreference\n        android:capitalize=\"words\"\n        android:defaultValue=\"@string/pref_default_display_name\"\n        android:inputType=\"textCapWords\"\n        android:key=\"example_text\"\n        android:maxLines=\"1\"\n        android:selectAllOnFocus=\"true\"\n        android:singleLine=\"true\"\n        android:title=\"@string/pref_title_display_name\" />\n\n\n    <ListPreference\n        android:defaultValue=\"-1\"\n        android:entries=\"@array/pref_example_list_titles\"\n        android:entryValues=\"@array/pref_example_list_values\"\n        android:key=\"example_list\"\n        android:negativeButtonText=\"@null\"\n        android:positiveButtonText=\"@null\"\n        android:title=\"@string/pref_title_add_friends_to_messages\" />\n        -->\n\n</PreferenceScreen>\n"
  },
  {
    "path": "app/src/main/res/xml/searchable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<searchable\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:label=\"@string/app_name\"\n    android:hint=\"Search App\">\n</searchable>"
  },
  {
    "path": "app/src/test/java/bjoernr/ssllabs/ApiAssert.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage bjoernr.ssllabs;\n\nimport org.json.JSONObject;\nimport org.junit.Assert;\n\nimport java.net.URL;\n\nimport javax.net.ssl.HttpsURLConnection;\n\npublic class ApiAssert extends Assert {\n    public static void assertApiDataFetched(JSONObject apiData) {\n        Assert.assertTrue(\"Could not fetch data from API\", apiData.toString().length() > 2);\n    }\n\n    public static void assertApiResponseCode(String apiUrl, int expected) {\n        int responseCode = -1;\n\n        try {\n            URL url = new URL(apiUrl);\n            HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();\n            responseCode = conn.getResponseCode();\n\n            conn.disconnect();\n        } catch (Exception ignored) {\n        }\n\n        Assert.assertFalse(\"Failure in assertApiResponseCode method\", responseCode == -1);\n        Assert.assertTrue(\"ResponseCode is not the expected one. (IS: \" + responseCode + \"; SHOULD BE: \" + expected + \")\", responseCode == expected);\n    }\n}\n"
  },
  {
    "path": "app/src/test/java/bjoernr/ssllabs/ApiTest.java",
    "content": "/*\n    Privacy Friendly Net Monitor (Net Monitor)\n    - Copyright (2015 - 2017) Felix Tsala Schiller\n\n    ###################################################################\n\n    This file is part of Net Monitor.\n\n    Net Monitor is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    Net Monitor is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with Net Monitor.  If not, see <http://www.gnu.org/licenses/>.\n\n    Diese Datei ist Teil von Net Monitor.\n\n    Net Monitor ist Freie Software: Sie können es unter den Bedingungen\n    der GNU General Public License, wie von der Free Software Foundation,\n    Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren\n    veröffentlichten Version, weiterverbreiten und/oder modifizieren.\n\n    Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber\n    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite\n    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n    Siehe die GNU General Public License für weitere Details.\n\n    Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n    Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.\n\n    ###################################################################\n\n    This app has been created in affiliation with SecUSo-Department of Technische Universität\n    Darmstadt.\n\n    The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher\n    Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example).\n\n    Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller\n    https://bitbucket.org/schillef/tlsmetric/overview.\n\n */\npackage bjoernr.ssllabs;\n\nimport org.json.JSONObject;\nimport org.junit.Test;\n\nimport de.bjoernr.ssllabs.Api;\n\npublic class ApiTest {\n    @Test\n    public void testFetchApiInformation() {\n        Api api = new Api();\n        JSONObject apiInformation = api.fetchApiInfo();\n\n        ApiAssert.assertNotNull(\"JSONObject is null\", apiInformation);\n        ApiAssert.assertApiDataFetched(apiInformation);\n    }\n\n    @Test\n    public void testFetchHostInformation() {\n        Api api = new Api();\n        JSONObject hostInformation = api.fetchHostInformation(\"https://www.ssllabs.com\", false, false, false, null, null, false);\n\n        ApiAssert.assertApiDataFetched(hostInformation);\n\n    }\n\n    @Test\n    public void testFetchHostInformationCached() {\n        Api api = new Api();\n        JSONObject hostInformationCached = api.fetchHostInformationCached(\"https://www.sslabs.com\", null, false, false);\n\n        ApiAssert.assertApiDataFetched(hostInformationCached);\n    }\n\n    @Test\n    public void testFetchEndpointData() {\n        Api api = new Api();\n        JSONObject endpointData = api.fetchEndpointData(\"https://www.ssllabs.com\", \"64.41.200.100\", false);\n\n        ApiAssert.assertApiDataFetched(endpointData);\n    }\n\n    @Test\n    public void testFetchStatusCodes() {\n        Api api = new Api();\n        JSONObject statusCodes = api.fetchStatusCodes();\n\n        ApiAssert.assertApiDataFetched(statusCodes);\n    }\n\n    @Test\n    public void testFailedCustomApiRequest() {\n        Api api = new Api();\n\n        ApiAssert.assertApiResponseCode(api.getApiUrl() + \"/bjoernr-de-java-ssllabs-api-test\", 404);\n    }\n}"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.5.3'\n        classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n        google()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "fastlane/metadata/android/ar/summary.txt",
    "content": "عرض اتصالات الشبكة المستخدمة من قبل التطبيقات المثبتة\n"
  },
  {
    "path": "fastlane/metadata/android/de/full_description.txt",
    "content": "HINWEIS: Aufgrund von Änderungen der Android APIs von Android 9 auf Android 10, funktioniert diese App nicht in Android 10 oder neuer.\n\nPrivacy Friendly Net Monitor zeigt den Netzwerkverkehr der auf dem Gerät installierten Apps an.\n\nDie Eigenschaften der aufgebauten Verbindungen können in einem detaillierten Modus eingesehen werden. Dabei werden aufgelöste Hostnamen und Protokolle (basierend auf bekannten Portnummern) angezeigt. Abhängig vom Port wird die Verbindung als verschlüsselt oder unverschlüsselt markiert.\n\nDurch Zertifikats-Überprüfung wird eine automatische Analyse der TLS-Implementierung des Zielservers durchgeführt. Server mit aufgelöstem Hostnamen und bekanntem TLS-Port werden automatisch analysiert. Die Analyse wird über SSL Labs Schnittstelle (weitere Infos: https://www.ssllabs.com/projects/ssllabs-apis/) und dem zugehörigen Dienst durchgeführt. Die Qualität der TLS-Implementierung wird von A+ (am Besten) bis F (am Schlechtesten) oder mit T (Vertrauensprobleme) angegeben. Um diese Überprüfung durchzuführen, muss Net Monitor eine Verbindung über das Internet zu Qualys SSL Labs aufbauen. Falls dies nicht gewünscht ist, kann die Zertifikatsüberprüfung in den Einstellungen ausgeschaltet werden.\n\nWie unterscheidet sich Privacy FriendlyNet Monitor von anderen Apps?\n\n1. Minimale Berechtigungen\nPrivacy Friendly Net Monitor benötigt keine zusätzlichen Berechtigungen. Die Zertifikatsüberprüfung benötigt die Internet-Berechtigung aus der Kategorie \"Sonstige\" um Testergebnisse von Qualys SSL Labs anzufordern. Falls Sie diese Verbindung nicht wünschen, deaktivieren Sie bitte die Zertifikatsüberprüfung in den Einstellungen.\n\n\n2. Keine Root-Rechte\nApp mit ähnlichen Funktionen benötigen so genannte Root-Rechte. Dabei werden Zusatzrechte im Gerät freigeschaltet, was einen Garantie-Verlust zur Folge hat. Privacy Friendly Net Monitor benötigt keine Root-Rechte.\n\n3. Keine Werbung und kein Tracking\nPrivacy Friendly Net Monitor verwendet keine Tracking-Mechanismen, ist werbefrei und kostenlos.\n\nDie App gehört zur Gruppe der Privacy Friendly Apps, die von der Forschungsgruppe SECUSO am Karlsruher Institut für Technologie entwickelt werden. Mehr Informationen unter: https://secuso.org/pfa\n\n\nKontaktieren Sie uns gerne über:\nTwitter - @SECUSOResearch https://twitter.com/secusoresearc)\nMastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/\nOffene Stellen - https://secuso.aifb.kit.edu/83_1557.php"
  },
  {
    "path": "fastlane/metadata/android/de/short_description.txt",
    "content": "(SECUSO) Net Monitor zeigt den Netzwerkverkehr der installierten Apps an.\n"
  },
  {
    "path": "fastlane/metadata/android/de/title.txt",
    "content": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/de-DE/full_description.txt",
    "content": "HINWEIS: Aufgrund von Änderungen der Android APIs von Android 9 auf Android 10, funktioniert diese App nicht in Android 10 oder neuer.\n\nPrivacy Friendly Net Monitor zeigt den Netzwerkverkehr der auf dem Gerät installierten Apps an.\n\nDie Eigenschaften der aufgebauten Verbindungen können in einem detaillierten Modus eingesehen werden. Dabei werden aufgelöste Hostnamen und Protokolle (basierend auf bekannten Portnummern) angezeigt. Abhängig vom Port wird die Verbindung als verschlüsselt oder unverschlüsselt markiert.\n\nDurch Zertifikats-Überprüfung wird eine automatische Analyse der TLS-Implementierung des Zielservers durchgeführt. Server mit aufgelöstem Hostnamen und bekanntem TLS-Port werden automatisch analysiert. Die Analyse wird über SSL Labs Schnittstelle (weitere Infos: https://www.ssllabs.com/projects/ssllabs-apis/) und dem zugehörigen Dienst durchgeführt. Die Qualität der TLS-Implementierung wird von A+ (am Besten) bis F (am Schlechtesten) oder mit T (Vertrauensprobleme) angegeben. Um diese Überprüfung durchzuführen, muss Net Monitor eine Verbindung über das Internet zu Qualys SSL Labs aufbauen. Falls dies nicht gewünscht ist, kann die Zertifikatsüberprüfung in den Einstellungen ausgeschaltet werden.\n\nWie unterscheidet sich Privacy FriendlyNet Monitor von anderen Apps?\n\n1. Minimale Berechtigungen\nPrivacy Friendly Net Monitor benötigt keine zusätzlichen Berechtigungen. Die Zertifikatsüberprüfung benötigt die Internet-Berechtigung aus der Kategorie \"Sonstige\" um Testergebnisse von Qualys SSL Labs anzufordern. Falls Sie diese Verbindung nicht wünschen, deaktivieren Sie bitte die Zertifikatsüberprüfung in den Einstellungen.\n\n\n2. Keine Root-Rechte\nApp mit ähnlichen Funktionen benötigen so genannte Root-Rechte. Dabei werden Zusatzrechte im Gerät freigeschaltet, was einen Garantie-Verlust zur Folge hat. Privacy Friendly Net Monitor benötigt keine Root-Rechte.\n\n3. Keine Werbung und kein Tracking\nPrivacy Friendly Net Monitor verwendet keine Tracking-Mechanismen, ist werbefrei und kostenlos.\n\nDie App gehört zur Gruppe der Privacy Friendly Apps, die von der Forschungsgruppe SECUSO am Karlsruher Institut für Technologie entwickelt werden. Mehr Informationen unter: https://secuso.org/pfa\n\n\nKontaktieren Sie uns gerne über:\nTwitter - @SECUSOResearch https://twitter.com/secusoresearc)\nMastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/\nOffene Stellen - https://secuso.aifb.kit.edu/83_1557.php"
  },
  {
    "path": "fastlane/metadata/android/de-DE/short_description.txt",
    "content": "(SECUSO) Net Monitor zeigt den Netzwerkverkehr der installierten Apps an.\n"
  },
  {
    "path": "fastlane/metadata/android/de-DE/title.txt",
    "content": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/en-US/full_description.txt",
    "content": "\nNOTICE: Due to changes in the respective Android APIs from Android 9 to Android 10, this app does not work in Android 10 or newer.\n\nPrivacy Friendly Net Monitor shows active network activity of installed apps. It belongs to the Privacy Friendly Apps group developed by the research group SECUSO at Karlsruhe Institut of Technology. More information can be found an secuso.org/pfa\n\nThe connection information includes local and remote socket information along with resolved hostnames and a protocol evaluation based on well-known ports. Known unencrypted and encrypted protocols are automatically marked. A detailed mode offers additional technical information of the connections.\n\nServer validation is an automatic analysis of the remote servers TLS implementation. Remote servers with a resolved hostname are tested automatically when the connection protocol is known for using TLS encryption. The analysis is performed by SSL Labs API (more info: https://www.ssllabs.com/projects/ssllabs-apis/) and the associated service. The remote server's implementation quality is shown in grades A+ (best) to F (worst), or is displayed as T (trust issues). To perform the validation Net Monitor connects to Qualys SSL Labs via the Internet. If you do not want this connection, please deactivate server validation in the settings.\n\nHow does Privacy Friendly Net Monitor differ from other applications?\n\n1. Minimal Permissions\nPrivacy Friendly Net Monitor does not require any permission for scanning active connections. The Certificate Validation feature requires the Internet permission to request server test results from Qualys SSL Labs API. In case you do not want a connection to Qualys SSL Labs, please deactivate server validation in the settings.\n\n2. No rooted device required\nMost of apps with a similar functionality require a so called \"rooted\" device. This means that extended user rights are activated on the device. This activation results in a loss of warranty. Privacy Friendly Net Monitor does not require a rooted device.\n\n3. No advertisement and no tracking\nPrivacy Friendly Net Monitor does not include any tracking mechanisms or advertisement and comes free of charge.\n\n\nFeel free to contact us via:\nTwitter - @SECUSOResearch https://twitter.com/secusoresearch\nMastodon - @SECUSO_Research@bawü.social https://xn--baw-joa.social/@SECUSO_Research/\nJob opening - https://secuso.aifb.kit.edu/english/Job_Offers_1557.php"
  },
  {
    "path": "fastlane/metadata/android/en-US/short_description.txt",
    "content": "(SECUSO) Shows active network activity of installed apps\n"
  },
  {
    "path": "fastlane/metadata/android/en-US/title.txt",
    "content": "Net Monitor (Privacy Friendly)"
  },
  {
    "path": "fastlane/metadata/android/eo/summary.txt",
    "content": "Listigi interretajn konektojn de instalitaj aplikaĵojhttps://hosted.weblate.org/\n"
  },
  {
    "path": "fastlane/metadata/android/es/summary.txt",
    "content": "Muestra las conexiones de red de las apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/fr/summary.txt",
    "content": "Affiche les connexions réseau des applications installées\n"
  },
  {
    "path": "fastlane/metadata/android/he/summary.txt",
    "content": "מציג חיבוריות רשת של יישומונים מותקנים\n"
  },
  {
    "path": "fastlane/metadata/android/it/summary.txt",
    "content": "Mostra le connessioni di rete delle app installate\n"
  },
  {
    "path": "fastlane/metadata/android/ja/summary.txt",
    "content": "インストール済みアプリのネットワーク接続を表示\n"
  },
  {
    "path": "fastlane/metadata/android/nb/summary.txt",
    "content": "Viser nettverkstilkoblinger for installerte programmer\n"
  },
  {
    "path": "fastlane/metadata/android/nn/summary.txt",
    "content": "Vis nettverks­tilkoplingar for installerte appar\n"
  },
  {
    "path": "fastlane/metadata/android/pl/summary.txt",
    "content": "Pokazuje połączenia sieciowe zainstalowanych aplikacji\n"
  },
  {
    "path": "fastlane/metadata/android/pt/summary.txt",
    "content": "Mostra as conexões de rede das apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/pt-BR/summary.txt",
    "content": "Mostra conexões de rede de aplicativos instalados\n"
  },
  {
    "path": "fastlane/metadata/android/pt-PT/summary.txt",
    "content": "Mostra as conexões de rede das apps instaladas\n"
  },
  {
    "path": "fastlane/metadata/android/ro/summary.txt",
    "content": "Afișează conexiunile de rețea ale aplicațiilor instalate\n"
  },
  {
    "path": "fastlane/metadata/android/ru/summary.txt",
    "content": "Показывает сетевые подключения установленных приложений\n"
  },
  {
    "path": "fastlane/metadata/android/tr/summary.txt",
    "content": "Yüklü uygulamaların ağ bağlantılarını gösterir\n"
  },
  {
    "path": "fastlane/metadata/android/uk/summary.txt",
    "content": "Показує з'єднання встановлених застосунків з мережею\n"
  },
  {
    "path": "fastlane/metadata/android/zh-CN/summary.txt",
    "content": "显示已安装应用的网络连接\n"
  },
  {
    "path": "fastlane/metadata/android/zh-TW/summary.txt",
    "content": "顯示已安裝應用的網絡連接\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Sep 23 12:58:20 CEST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-6.0-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\nandroid.enableJetifier=true\nandroid.useAndroidX=true\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]