├── .github └── workflows │ └── changelog.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING ├── LICENSE.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── ic_history-web.png │ ├── ic_monitor_off-web.png │ ├── java │ │ ├── de │ │ │ └── bjoernr │ │ │ │ └── ssllabs │ │ │ │ ├── Api.java │ │ │ │ ├── Console.java │ │ │ │ └── ConsoleUtilities.java │ │ └── org │ │ │ └── secuso │ │ │ └── privacyfriendlynetmonitor │ │ │ ├── Activities │ │ │ ├── AboutActivity.java │ │ │ ├── Adapter │ │ │ │ ├── AppListRecyclerAdapter.java │ │ │ │ ├── ExpandableHistoryListAdapter.java │ │ │ │ ├── ExpandableListAdapter.java │ │ │ │ ├── ExpandableReportAdapter.java │ │ │ │ ├── FragmentDayListAdapter.java │ │ │ │ └── PagerAdapter.java │ │ │ ├── AppConnections_Chart.java │ │ │ ├── BaseActivity.java │ │ │ ├── HelpActivity.java │ │ │ ├── HelpDataDump.java │ │ │ ├── HistoryActivity.java │ │ │ ├── HistoryDetailActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── ReportDetailActivity.java │ │ │ ├── SelectHistoryAppsActivity.java │ │ │ ├── SettingsActivity.java │ │ │ ├── SplashActivity.java │ │ │ └── TutorialActivity.java │ │ │ ├── Assistant │ │ │ ├── AsyncCertVal.java │ │ │ ├── AsyncDNS.java │ │ │ ├── Const.java │ │ │ ├── ExecCom.java │ │ │ ├── KnownPorts.java │ │ │ ├── PrefManager.java │ │ │ ├── RunStore.java │ │ │ ├── TLType.java │ │ │ └── ToolBox.java │ │ │ ├── ConnectionAnalysis │ │ │ ├── Collector.java │ │ │ ├── Detector.java │ │ │ ├── PassiveService.java │ │ │ ├── Report.java │ │ │ └── ServiceHandler.java │ │ │ ├── DatabaseUtil │ │ │ ├── DBApp.java │ │ │ ├── GenerateReportEntities.java │ │ │ └── ReportEntity.java │ │ │ └── fragment │ │ │ ├── Fragment_day.java │ │ │ ├── Fragment_month.java │ │ │ └── Fragment_week.java │ └── res │ │ ├── drawable-hdpi-v11 │ │ └── ic_notification.png │ │ ├── drawable-hdpi-v9 │ │ └── ic_notification.png │ │ ├── drawable-hdpi │ │ ├── ic_action_name.png │ │ ├── ic_edit_list.png │ │ └── ic_notification.png │ │ ├── drawable-mdpi-v11 │ │ └── ic_notification.png │ │ ├── drawable-mdpi-v9 │ │ └── ic_notification.png │ │ ├── drawable-mdpi │ │ ├── ic_action_name.png │ │ ├── ic_edit_list.png │ │ └── ic_notification.png │ │ ├── drawable-xhdpi-v11 │ │ └── ic_notification.png │ │ ├── drawable-xhdpi-v9 │ │ └── ic_notification.png │ │ ├── drawable-xhdpi │ │ ├── ic_action_name.png │ │ ├── ic_edit_list.png │ │ └── ic_notification.png │ │ ├── drawable-xxhdpi-v11 │ │ └── ic_notification.png │ │ ├── drawable-xxhdpi-v9 │ │ └── ic_notification.png │ │ ├── drawable-xxhdpi │ │ ├── ic_action_name.png │ │ ├── ic_edit_list.png │ │ └── ic_notification.png │ │ ├── drawable │ │ ├── background_border.xml │ │ ├── button_fullwidth.xml │ │ ├── ic_clear.xml │ │ ├── ic_delete.xml │ │ ├── ic_help.xml │ │ ├── ic_history.xml │ │ ├── ic_menu_info.xml │ │ ├── ic_play_arrow.xml │ │ ├── ic_refresh.xml │ │ ├── ic_search_white_24dp.xml │ │ ├── ic_settings.xml │ │ ├── ic_sort_white_24dp.xml │ │ ├── ic_stop.xml │ │ ├── ic_tutorial.xml │ │ ├── ic_tutorial_inverted.xml │ │ ├── privacyfriendlyappslogo.png │ │ ├── secuso_logo_blau_blau.png │ │ └── splash_screen.xml │ │ ├── layout │ │ ├── activity_about.xml │ │ ├── activity_help.xml │ │ ├── activity_help_content.xml │ │ ├── activity_history.xml │ │ ├── activity_main.xml │ │ ├── activity_main_app_bar.xml │ │ ├── activity_main_content.xml │ │ ├── activity_report.xml │ │ ├── activity_report_app_bar.xml │ │ ├── activity_report_content.xml │ │ ├── activity_report_detail.xml │ │ ├── activity_report_detail_content.xml │ │ ├── activity_select_history_apps.xml │ │ ├── activity_settings.xml │ │ ├── activity_splash.xml │ │ ├── activity_tutorial.xml │ │ ├── app_list_group.xml │ │ ├── app_list_item.xml │ │ ├── app_report_detail_layout.xml │ │ ├── content_history.xml │ │ ├── content_select_history_apps.xml │ │ ├── fragment_charts.xml │ │ ├── fragment_list_item.xml │ │ ├── help_list_group.xml │ │ ├── help_list_item.xml │ │ ├── history_list_group.xml │ │ ├── history_list_item.xml │ │ ├── main_nav_header.xml │ │ ├── report_detail_item.xml │ │ ├── report_list_group.xml │ │ ├── report_list_group_header.xml │ │ ├── report_list_item.xml │ │ ├── toolbar.xml │ │ ├── tutorial_slide1.xml │ │ ├── tutorial_slide2.xml │ │ └── tutorial_slide3.xml │ │ ├── menu │ │ ├── applistseletion_menu.xml │ │ ├── main_drawer.xml │ │ └── toolbar_menu.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_monitor_off.png │ │ └── splash_icon.png │ │ ├── mipmap-mdpi │ │ ├── ic_drawer.png │ │ ├── ic_launcher.png │ │ ├── ic_monitor_off.png │ │ └── splash_icon.png │ │ ├── mipmap-xhdpi │ │ ├── ic_drawer.png │ │ ├── ic_launcher.png │ │ ├── ic_monitor_off.png │ │ └── splash_icon.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_drawer.png │ │ ├── ic_launcher.png │ │ ├── ic_monitor_off.png │ │ └── splash_icon.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_drawer.png │ │ ├── ic_launcher.png │ │ ├── ic_monitor_off.png │ │ └── splash_icon.png │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── preferences.xml │ │ └── searchable.xml │ └── test │ └── java │ └── bjoernr │ └── ssllabs │ ├── ApiAssert.java │ └── ApiTest.java ├── build.gradle ├── fastlane └── metadata │ └── android │ ├── ar │ └── summary.txt │ ├── de-DE │ ├── full_description.txt │ ├── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ │ ├── 1.png │ │ │ └── 2.png │ ├── short_description.txt │ └── title.txt │ ├── de │ ├── full_description.txt │ ├── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ │ ├── 1.png │ │ │ └── 2.png │ ├── short_description.txt │ └── title.txt │ ├── en-US │ ├── full_description.txt │ ├── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ │ ├── 1.png │ │ │ └── 2.png │ ├── short_description.txt │ └── title.txt │ ├── eo │ └── summary.txt │ ├── es │ └── summary.txt │ ├── fr │ └── summary.txt │ ├── he │ └── summary.txt │ ├── it │ └── summary.txt │ ├── ja │ └── summary.txt │ ├── nb │ └── summary.txt │ ├── nn │ └── summary.txt │ ├── pl │ └── summary.txt │ ├── pt-BR │ └── summary.txt │ ├── pt-PT │ └── summary.txt │ ├── pt │ └── summary.txt │ ├── ro │ └── summary.txt │ ├── ru │ └── summary.txt │ ├── tr │ └── summary.txt │ ├── uk │ └── summary.txt │ ├── zh-CN │ └── summary.txt │ └── zh-TW │ └── summary.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/workflows/changelog.yml: -------------------------------------------------------------------------------- 1 | name: Changelog Generation 2 | 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | changelog: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | with: 14 | submodules: 'recursive' 15 | ref: master 16 | - uses: rhysd/changelog-from-release/action@v3 17 | with: 18 | file: CHANGELOG.md 19 | pull_request: true 20 | github_token: ${{ secrets.GITHUB_TOKEN }} 21 | commit_summary_template: 'update changelog for %s changes' 22 | args: -l 2 23 | header: | 24 | # Changelog 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | /*/build/ 3 | 4 | # Crashlytics configuations 5 | com_crashlytics_export_strings.xml 6 | 7 | # Local configuration file (sdk path, etc) 8 | local.properties 9 | 10 | # Gradle generated files 11 | .gradle/ 12 | 13 | #build files 14 | build/ 15 | 16 | # Idea configuations 17 | .idea/ 18 | 19 | # Signing files 20 | .signing/ 21 | 22 | # User-specific configurations 23 | .idea/libraries/ 24 | .idea/workspace.xml 25 | .idea/tasks.xml 26 | .idea/.name 27 | .idea/compiler.xml 28 | .idea/copyright/profiles_settings.xml 29 | .idea/encodings.xml 30 | .idea/misc.xml 31 | .idea/modules.xml 32 | .idea/scopes/scope_settings.xml 33 | .idea/vcs.xml 34 | *.iml 35 | 36 | # OS-specific files 37 | .DS_Store 38 | .DS_Store? 39 | ._* 40 | .Spotlight-V100 41 | .Trashes 42 | ehthumbs.db 43 | Thumbs.db 44 | 45 | # Documents 46 | *.pdf 47 | *.doc 48 | *.docx 49 | *.odt 50 | 51 | #APK 52 | *.apk 53 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | 4 | ## [Netmonitor (Privacy Friendly) v2.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.1) - 24 Sep 2020 5 | 6 | - small bugfixes 7 | - upgraded compile and target Android versions 8 | - updated dependencies and libraries 9 | - disabled for Android 10 and later 10 | - updated SECUSO references 11 | - fixed notification for newer Android versions 12 | 13 | [Changes][v2.1] 14 | 15 | 16 | 17 | ## [Privacy Friendly Netmonitor v2.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v2.0) - 29 Mar 2018 18 | 19 | * Improvement history function: Apps with the Internet permission can be chosen and monitored 20 | * Redesign 21 | 22 | [Changes][v2.0] 23 | 24 | 25 | 26 | ## [Privacy Friendly Netmonitor v1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.2) - 12 Oct 2017 27 | 28 | - Bug fixing 29 | - Icon updates 30 | - Better handling of unknown apps 31 | 32 | [Changes][v1.2] 33 | 34 | 35 | 36 | ## [Privacy Friendly Net Monitor v1.1.4](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.4) - 09 Mar 2017 37 | 38 | Blocking of screenshots removed 39 | 40 | [Changes][v1.1.4] 41 | 42 | 43 | 44 | ## [Privacy Friendly Net Monitor v1.1.3](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.3) - 04 Mar 2017 45 | 46 | - Android 4 Support added 47 | - Icons refinements (list icons, splash icons, unloadable icons) 48 | - Help page refinement 49 | - Bug Fixes 50 | 51 | 52 | [Changes][v1.1.3] 53 | 54 | 55 | 56 | ## [Privacy Friendly Net Monitor v1.1.2](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.2) - 28 Feb 2017 57 | 58 | - MinSDK reset to 21 59 | 60 | 61 | [Changes][v1.1.2] 62 | 63 | 64 | 65 | ## [Privacy Friendly Net Monitor v1.1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1.1) - 21 Feb 2017 66 | 67 | - Refinements of translations 68 | - Downgrade to SDK 23 is target 69 | 70 | 71 | [Changes][v1.1.1] 72 | 73 | 74 | 75 | ## [Privacy Friendly Net Monitor v1.1](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.1) - 20 Feb 2017 76 | 77 | Adding of SSL Rating 78 | 79 | 80 | [Changes][v1.1] 81 | 82 | 83 | 84 | ## [Privacy Friendly Net Monitor v1.0](https://github.com/SecUSo/privacy-friendly-netmonitor/releases/tag/v1.0) - 21 Jan 2017 85 | 86 | Privacy Friendly Net Monitor is an Android application that can identify and monitor active network connections of applications that are installed on the mobile device. 87 | It monitors active network sockets and provides information about the scanned connections and apps. The invoking app is identified and listed with it's name, package and icon. The Connection's local and remote socket information (ip/port) is displayed along with a resolved hostname information and protocol evaluation based on well-known ports. Known un-/encrypted protocols are automatically marked. Privacy Friendly Net Monitor does not require a rooted device. 88 | 89 | Privacy Friendly Net Monitor is optimized regarding the user’s privacy. It doesn’t use any tracking mechanisms, neither it displays any advertisement. It belongs to the Privacy Friendly Apps group developed by the SECUSO research group at Technische Universität Darmstadt, Germany. 90 | 91 | 92 | [Changes][v1.0] 93 | 94 | 95 | [v2.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v2.0...v2.1 96 | [v2.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.2...v2.0 97 | [v1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.4...v1.2 98 | [v1.1.4]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.3...v1.1.4 99 | [v1.1.3]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.2...v1.1.3 100 | [v1.1.2]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1.1...v1.1.2 101 | [v1.1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.1...v1.1.1 102 | [v1.1]: https://github.com/SecUSo/privacy-friendly-netmonitor/compare/v1.0...v1.1 103 | [v1.0]: https://github.com/SecUSo/privacy-friendly-netmonitor/tree/v1.0 104 | 105 | 106 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We encourage open source developers to support the Privacy Friendly Apps. 4 | We also wish to keep it as easy as possible to contribute. There are a few 5 | guidelines that we need contributors to follow. 6 | For further questions we refer to the contact details on the [Privacy Friendly Apps website](https://secuso.org/pfa). 7 | 8 | ## Reporting of Issues 9 | 10 | * Make sure you have a [GitHub account](https://github.com/signup/free). 11 | * Open an issue in the corresponding app's repository, assuming one does not already exist. 12 | * Clearly describe the issue including steps to reproduce when it is a bug. 13 | In some cases screenshots can be supportive. 14 | * Make sure you mention the Android version and the device you have used when 15 | you encountered the issue. 16 | * Make your description as precise as possible. 17 | 18 | ## Making Changes 19 | 20 | * Make sure you have a [GitHub account](https://github.com/signup/free). 21 | * Find an issue that you wish to close. If the issue you wish to close is not 22 | present, open it. Make sure that the issue has one of the following labels 23 | which are set by our team: 24 | * Bug 25 | * Enhancement 26 | * Help wanted 27 | * No integration planned 28 | That means that we have already reviewed the issue. If you wish to add a 29 | translation, opening an issue is not required. 30 | * Fork the repository on GitHub. 31 | * Create a topic branch from where you want to base your work (usually master branch). 32 | * To quickly create a topic branch based on master, run `git checkout -b 33 | fix/master/my_contribution master`. 34 | * Please avoid working directly on the `master` branch. 35 | * Make commits of logical units in english language. 36 | * Make sure your commit messages are in the proper format. If the commit 37 | addresses an issue filed in the Github repository, start the first line 38 | of the commit with a hash followed by the issue number (e.g. #42). 39 | * Make sure you have added the necessary tests for your changes. 40 | * Run all available tests to assure nothing else was accidentally broken. 41 | 42 | ### Unwanted Changes 43 | 44 | The Privacy Friendly Apps are a group of Android apps that are optimized regarding 45 | the user's privacy. Therefore, Pull Requests that contain the following functionality 46 | will be rejected: 47 | * Analytics or advertisement frameworks 48 | * User tracking (e.g. sending of data to a third party) 49 | * Any that use of libraries that do not comply the license of the corresponding Privacy 50 | Friendly App (GPLv3 or Apache2). 51 | * Unnecessary use of Android permissions. If new functionality is added that requires 52 | the usage of an Android permission you should clearly explain the Pull Request why 53 | this permission is required. 54 | * New translations/languages 55 | 56 | ## Submitting Changes 57 | 58 | * Push your changes to a topic branch in your fork of the repository. 59 | * Submit a Pull Request to the repository of the corresponding Privacy Friendly App. 60 | * Indicate that you have read this policy by writing the second word of the section "unwanted changes" 61 | * Our team looks at Pull Requests on a regular basis and assigns a reviewer. 62 | * After feedback has been given we expect responses within one month. After one 63 | month we might close the pull request if no activity is shown. 64 | 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Twitter](https://img.shields.io/badge/twitter-@SECUSOResearch-%231DA1F2.svg?&style=flat-square&logo=twitter&logoColor=1DA1F2)][Twitter] 2 | [![Mastodon](https://img.shields.io/badge/mastodon-@SECUSO__Research@baw%C3%BC.social-%233088D4.svg?&style=flat-square&logo=mastodon&logoColor=3088D4)][Mastodon] 3 | 4 | [Mastodon]: https://xn--baw-joa.social/@SECUSO_Research 5 | [Twitter]: https://twitter.com/SECUSOResearch 6 | 7 | Privacy Friendly Netmonitor Icon 12 | # Privacy Friendly Net Monitor # 13 | 14 | > :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. 15 | If someone is interested in taking over the maintenance of this app, please do not hesitate to contact us: pfa@secuso.org 16 | 17 | This app monitors active network sockets and provides information on the scanned connections and apps. The invoking app is identified and listed with it's name, package and icon. The Connection's local and remote socket information (ip/port) is displayed along with a resolved hostname information and protocol evaluation based on well-known ports. Known un-/encrypted protocols are automatically marked. Additional features can be activated in the settings tab. This includes a panel for detailed technical information on connections, a logging functionality to keep scan results, a remote analysis of TLS-Servers via SSL-Labs API, a database connection to save selected reports in a history and charts to visualize the reports in different time intervals. 18 | 19 | This app is optimized regarding the user’s privacy. It doesn’t use any tracking mechanisms, neither it displays any advertisement. It belongs to the Privacy Friendly Apps group developed by the SECUSO research group at Karlsruhe Institute of Technology, Germany. 20 | 21 | ## Motivation ## 22 | This application has been developed to raise user awareness for the constant and unobserved communication behaviour of mobil device application. Additionally a coarse, technical analysis of the connections can help to identify unsecure, privacy-violating or malicious communicating behaviour of installed applications. 23 | 24 | ## Building ## 25 | 26 | ### API Reference ### 27 | Mininum SDK: 22 Target SDK: 26 28 | 29 | ### Setup ### 30 | * Android Studio 3.0.1 31 | 32 | ### Future Enhancements ### 33 | possible additional features 34 | - raw socket inspection 35 | - ip locating feature 36 | - export of identified information 37 | - display of additional remote host information (SSLLabs) 38 | - long term goal: addtitional active service, perfoming (deep) packet inspection with VPN-Capture implementation 39 | 40 | ### License ### 41 | 42 | Privacy Friendly Net Monitor is licensed under the GPLv3. Copyright (C) 2015 - 2018 Felix Tsala Schiller 43 | 44 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 45 | 46 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 47 | 48 | You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. 49 | 50 | The icons used in the nagivation drawer are licensed under the CC BY 2.5. In addition to them the app uses icons from Google Design Material Icons licensed under Apache License Version 2.0. All other images (the logo of Privacy Friendly Apps, the SECUSO logo, the app logos and the spash screen icon) copyright [SECUSO](www.secuso.org) (2019). 51 | 52 | This application uses SSL Labs APIs v1.24.4 by Qualys SSL Labs (Terms of use: https://www.ssllabs.com/downloads/Qualys_SSL_Labs_Terms_of_Use.pdf) and Java SSL Labs API by Björn Roland GLicense: GPLv3, https://github.com/bjoernr-de/java-ssllabs-api) 53 | 54 | Privacy Friendly Net Monitor is a non-root variant of TLSMetric android app (https://bitbucket.org/schillef/tlsmetric/overview) by Felix Tsala Schiller. 55 | 56 | ### Contributors ### 57 | 58 | App Icon:
59 | Markus Hau 60 | 61 | Developers:
62 | Felix Tsala Schiller
63 | Tobias Burger
64 | Marco Egermaier 65 | 66 | Contributors (Github):
67 | Yonjuni
68 | Kamuno
69 | di72nn
70 | stevesoltys
71 | FroggieFrog 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'org.greenrobot.greendao' 3 | 4 | android { 5 | compileSdkVersion 29 6 | defaultConfig { 7 | applicationId 'org.secuso.privacyfriendlynetmonitor' 8 | minSdkVersion 17 9 | targetSdkVersion 29 10 | versionCode 9 11 | versionName "2.1" 12 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 13 | vectorDrawables.useSupportLibrary = true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | productFlavors { 22 | } 23 | 24 | } 25 | 26 | android { 27 | lintOptions { 28 | disable 'MissingTranslation' 29 | } 30 | } 31 | 32 | //added by TB (needed for Studio 3.0.0) and for the charts 33 | allprojects { 34 | repositories { 35 | jcenter() 36 | google() 37 | maven { url "https://jitpack.io" } 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 43 | implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' 44 | implementation fileTree(include: ['*.jar'], dir: 'libs') 45 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 46 | exclude group: 'com.android.support', module: 'support-annotations' 47 | }) 48 | implementation 'androidx.appcompat:appcompat:1.0.0' 49 | implementation 'com.google.android.material:material:1.2.1' 50 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 51 | implementation 'org.greenrobot:greendao:3.3.0' 52 | implementation 'net.zetetic:android-database-sqlcipher:3.5.9' 53 | 54 | implementation fileTree(include: ['*.jar'], dir: 'libs') 55 | implementation 'androidx.appcompat:appcompat:1.0.0' 56 | implementation 'com.google.android.material:material:1.2.1' 57 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 58 | implementation 'androidx.cardview:cardview:1.0.0' 59 | implementation 'androidx.recyclerview:recyclerview:1.1.0' 60 | implementation 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1' 61 | 62 | testImplementation 'junit:junit:4.12' 63 | testImplementation 'org.json:json:20180813' 64 | } 65 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\fs\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/ic_history-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/ic_history-web.png -------------------------------------------------------------------------------- /app/src/main/ic_monitor_off-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/ic_monitor_off-web.png -------------------------------------------------------------------------------- /app/src/main/java/de/bjoernr/ssllabs/ConsoleUtilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | package de.bjoernr.ssllabs; 50 | 51 | import org.json.JSONArray; 52 | import org.json.JSONException; 53 | import org.json.JSONObject; 54 | 55 | import java.util.ArrayList; 56 | import java.util.HashMap; 57 | import java.util.Iterator; 58 | import java.util.List; 59 | import java.util.Map; 60 | import java.util.regex.Matcher; 61 | import java.util.regex.Pattern; 62 | 63 | public class ConsoleUtilities { 64 | private static String newLine = "\n"; 65 | 66 | /* 67 | * Special thanks to Vikas Gupta (http://stackoverflow.com/users/2915208/vikas-gupta) 68 | * http://stackoverflow.com/questions/21720759/convert-a-json-string-to-a-hashmap 69 | * 70 | * START code of Vikas Gupta from stackoverflow 71 | */ 72 | public static Map jsonToMap(JSONObject json) throws JSONException { 73 | Map retMap = new HashMap(); 74 | 75 | if (json != JSONObject.NULL) { 76 | retMap = toMap(json); 77 | } 78 | return retMap; 79 | } 80 | 81 | public static Map toMap(JSONObject object) throws JSONException { 82 | Map map = new HashMap(); 83 | 84 | Iterator keysItr = object.keys(); 85 | while (keysItr.hasNext()) { 86 | String key = keysItr.next(); 87 | Object value = object.get(key); 88 | 89 | if (value instanceof JSONArray) { 90 | value = toList((JSONArray) value); 91 | } else if (value instanceof JSONObject) { 92 | value = toMap((JSONObject) value); 93 | } 94 | map.put(key, value); 95 | } 96 | return map; 97 | } 98 | 99 | public static List toList(JSONArray array) throws JSONException { 100 | List list = new ArrayList(); 101 | for (int i = 0; i < array.length(); i++) { 102 | Object value = array.get(i); 103 | if (value instanceof JSONArray) { 104 | value = toList((JSONArray) value); 105 | } else if (value instanceof JSONObject) { 106 | value = toMap((JSONObject) value); 107 | } 108 | list.add(value); 109 | } 110 | return list; 111 | } 112 | // END code of Vikas Gupta from stackoverflow 113 | 114 | public static String mapToConsoleOutput(Map map) { 115 | String consoleOutput = ""; 116 | 117 | for (Map.Entry entry : map.entrySet()) { 118 | consoleOutput += entry.getKey() + " = " + entry.getValue().toString(); 119 | consoleOutput += newLine; 120 | } 121 | 122 | return (consoleOutput); 123 | } 124 | 125 | public static String arrayValueMatchRegex(String[] array, String regex) { 126 | Pattern p = Pattern.compile(regex); 127 | 128 | for (int i = 0; i < array.length; i++) { 129 | Matcher m = p.matcher(array[i]); 130 | 131 | while (m.find()) { 132 | try { 133 | return (m.group(1)); 134 | } catch (Exception ignored) { 135 | //possible IndexOutOfBoundsException 136 | } 137 | } 138 | } 139 | 140 | return null; 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AboutActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | 50 | package org.secuso.privacyfriendlynetmonitor.Activities; 51 | 52 | import android.os.Bundle; 53 | import androidx.appcompat.app.ActionBar; 54 | import androidx.appcompat.app.AppCompatActivity; 55 | import android.text.method.LinkMovementMethod; 56 | import android.view.View; 57 | import android.widget.TextView; 58 | 59 | import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore; 60 | import org.secuso.privacyfriendlynetmonitor.BuildConfig; 61 | import org.secuso.privacyfriendlynetmonitor.R; 62 | 63 | /** 64 | * Activity displaying information about Privacy Friendly Net Monitor App 65 | */ 66 | public class AboutActivity extends AppCompatActivity { 67 | 68 | /** 69 | * 70 | * @param savedInstanceState 71 | */ 72 | protected void onCreate(Bundle savedInstanceState) { 73 | super.onCreate(savedInstanceState); 74 | setContentView(R.layout.activity_about); 75 | RunStore.setContext(this); 76 | 77 | ActionBar ab = getSupportActionBar(); 78 | if (ab != null) { 79 | ab.setDisplayHomeAsUpEnabled(true); 80 | } 81 | 82 | View mainContent = findViewById(R.id.main_content); 83 | if (mainContent != null) { 84 | mainContent.setAlpha(0); 85 | mainContent.animate().alpha(1).setDuration(BaseActivity.MAIN_CONTENT_FADEIN_DURATION); 86 | } 87 | 88 | overridePendingTransition(0, 0); 89 | 90 | ((TextView) findViewById(R.id.javaAPIURL)).setMovementMethod(LinkMovementMethod.getInstance()); 91 | ((TextView) findViewById(R.id.APIURL)).setMovementMethod(LinkMovementMethod.getInstance()); 92 | ((TextView) findViewById(R.id.secusoWebsite)).setMovementMethod(LinkMovementMethod.getInstance()); 93 | ((TextView) findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance()); 94 | ((TextView) findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME); 95 | } 96 | } -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/AppListRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package org.secuso.privacyfriendlynetmonitor.Activities.Adapter; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.content.pm.PackageManager; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | import androidx.appcompat.widget.SwitchCompat; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.CompoundButton; 12 | import android.widget.ImageView; 13 | import android.widget.TextView; 14 | 15 | import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector; 16 | import org.secuso.privacyfriendlynetmonitor.R; 17 | 18 | import java.sql.Date; 19 | import java.text.SimpleDateFormat; 20 | import java.util.List; 21 | 22 | /** 23 | * Created by tobias on 09.03.18. 24 | */ 25 | 26 | public class AppListRecyclerAdapter extends RecyclerView.Adapter{ 27 | 28 | private List app_list_name; 29 | 30 | private Context context; 31 | 32 | 33 | private SharedPreferences selectedAppsPreferences; 34 | private SharedPreferences.Editor editor; 35 | 36 | public static class ViewHolder extends RecyclerView.ViewHolder { 37 | // each data item is just a string in this case 38 | public TextView appGroupTitle; 39 | public TextView appInstallDate; 40 | public ImageView appIcon; 41 | public SwitchCompat appSwitch; 42 | 43 | public String appFullName; 44 | 45 | 46 | public ViewHolder(View view) { 47 | super(view); 48 | this.appGroupTitle = (TextView) view.findViewById(R.id.appGroupTitle); 49 | this.appInstallDate = (TextView) view.findViewById(R.id.appInstalledOn); 50 | this.appIcon = (ImageView) view.findViewById(R.id.appGroupIcon); 51 | this.appSwitch = (SwitchCompat) view.findViewById(R.id.switchAppOnOffHistory); 52 | this.appFullName = ""; 53 | 54 | } 55 | } 56 | 57 | public AppListRecyclerAdapter(List app_list_name, Context context) { 58 | this.app_list_name = app_list_name; 59 | this.context = context; 60 | 61 | selectedAppsPreferences = context.getSharedPreferences("SELECTEDAPPS", 0); 62 | editor = selectedAppsPreferences.edit(); 63 | 64 | } 65 | 66 | @Override 67 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 68 | // create a new view 69 | View itemView = LayoutInflater.from(parent.getContext()) 70 | .inflate(R.layout.app_list_group, parent, false); 71 | return new ViewHolder(itemView); 72 | 73 | } 74 | 75 | @Override 76 | public void onBindViewHolder(final ViewHolder holder, final int position) { 77 | String appName = app_list_name.get(position); 78 | holder.appFullName = appName; 79 | 80 | if (Collector.getAppsToIncludeInScan().contains(holder.appFullName)) { 81 | holder.appSwitch.setChecked(true); 82 | } else { 83 | holder.appSwitch.setChecked(false); 84 | } 85 | 86 | PackageManager packageManager = context.getPackageManager(); 87 | 88 | try { 89 | holder.appGroupTitle.setText((String) packageManager.getApplicationLabel(packageManager.getApplicationInfo(appName, PackageManager.GET_META_DATA))); 90 | 91 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd. MMM yyyy, HH:mm"); 92 | Date date = new Date(packageManager.getPackageInfo(appName, 0).firstInstallTime); 93 | holder.appInstallDate.setText("Installed: " + simpleDateFormat.format(date)); 94 | 95 | holder.appIcon.setImageDrawable(packageManager.getApplicationIcon(appName)); 96 | } catch (PackageManager.NameNotFoundException e) { 97 | 98 | } 99 | 100 | holder.appSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 101 | @Override 102 | public void onCheckedChanged(CompoundButton compoundButton, boolean bChecked) { 103 | 104 | String appName = holder.appFullName; 105 | if (bChecked) { 106 | if (!Collector.getAppsToIncludeInScan().contains(appName)) { 107 | Collector.addAppToIncludeInScan(appName); 108 | editor.putString(appName, appName); 109 | editor.commit(); 110 | holder.appSwitch.setChecked(true); 111 | } 112 | } else { 113 | if (Collector.getAppsToIncludeInScan().contains(appName)) { 114 | Collector.deleteAppFromIncludeInScan(appName); 115 | editor.remove(appName); 116 | editor.commit(); 117 | holder.appSwitch.setChecked(false); 118 | } 119 | } 120 | } 121 | }); 122 | 123 | } 124 | 125 | @Override 126 | public int getItemCount() { 127 | return app_list_name.size(); 128 | } 129 | 130 | 131 | } 132 | 133 | 134 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/Adapter/PagerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | 50 | package org.secuso.privacyfriendlynetmonitor.Activities.Adapter; 51 | 52 | import android.os.Bundle; 53 | import androidx.fragment.app.Fragment; 54 | import androidx.fragment.app.FragmentManager; 55 | import androidx.fragment.app.FragmentStatePagerAdapter; 56 | 57 | import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_day; 58 | import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_month; 59 | import org.secuso.privacyfriendlynetmonitor.fragment.Fragment_week; 60 | 61 | /** 62 | * Created by tobias on 04.01.18. 63 | * Adapter for fragment pager. 64 | */ 65 | public class PagerAdapter extends FragmentStatePagerAdapter { 66 | int mNumOfTabs; 67 | Bundle data; 68 | 69 | /** 70 | * 71 | * @param fm 72 | * @param NumOfTabs 73 | * @param appSubName 74 | */ 75 | public PagerAdapter(FragmentManager fm, int NumOfTabs, String appSubName) { 76 | super(fm); 77 | this.mNumOfTabs = NumOfTabs; 78 | data = new Bundle(); 79 | data.putString("AppName", appSubName); 80 | } 81 | 82 | /** 83 | * 84 | * @param position 85 | * @return item 86 | */ 87 | @Override 88 | public Fragment getItem(int position) { 89 | switch (position) { 90 | case 0: 91 | Fragment_day tab_day = new Fragment_day(); 92 | tab_day.setArguments(data); 93 | return tab_day; 94 | case 1: 95 | Fragment_week tab_week = new Fragment_week(); 96 | tab_week.setArguments(data); 97 | return tab_week; 98 | case 2: 99 | Fragment_month tab_month = new Fragment_month(); 100 | tab_month.setArguments(data); 101 | return tab_month; 102 | default: 103 | return null; 104 | } 105 | } 106 | 107 | /** 108 | * 109 | * @return number of tabs 110 | */ 111 | @Override 112 | public int getCount() { 113 | return mNumOfTabs; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/AppConnections_Chart.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | 50 | package org.secuso.privacyfriendlynetmonitor.Activities; 51 | 52 | import android.os.Bundle; 53 | import com.google.android.material.tabs.TabLayout; 54 | import androidx.viewpager.widget.ViewPager; 55 | import androidx.appcompat.app.AppCompatActivity; 56 | 57 | import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.PagerAdapter; 58 | import org.secuso.privacyfriendlynetmonitor.R; 59 | 60 | /** 61 | * Created by tobias on 04.01.18. 62 | * App Connection chart class to visualize reports in different time intervals. 63 | */ 64 | public class AppConnections_Chart extends AppCompatActivity { 65 | 66 | @Override 67 | protected void onCreate(Bundle savedInstanceState) { 68 | super.onCreate(savedInstanceState); 69 | 70 | String appName = getIntent().getStringExtra(("AppName")); 71 | setTitle(appName); 72 | String appSubName = getIntent().getStringExtra(("AppSubName")); 73 | 74 | 75 | setContentView(R.layout.app_report_detail_layout); 76 | 77 | TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); 78 | tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_day)); 79 | tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_week)); 80 | tabLayout.addTab(tabLayout.newTab().setText(R.string.app_connections_chart_month)); 81 | tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); 82 | 83 | final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); 84 | final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(), 85 | appSubName); 86 | viewPager.setAdapter(adapter); 87 | viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); 88 | tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { 89 | 90 | @Override 91 | public void onTabSelected(TabLayout.Tab tab) { 92 | viewPager.setCurrentItem(tab.getPosition()); 93 | } 94 | 95 | @Override 96 | public void onTabUnselected(TabLayout.Tab tab) { 97 | 98 | } 99 | 100 | @Override 101 | public void onTabReselected(TabLayout.Tab tab) { 102 | 103 | } 104 | }); 105 | 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | package org.secuso.privacyfriendlynetmonitor.Activities; 50 | 51 | import android.os.Bundle; 52 | import android.widget.ExpandableListView; 53 | 54 | import org.secuso.privacyfriendlynetmonitor.Activities.Adapter.ExpandableListAdapter; 55 | import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore; 56 | import org.secuso.privacyfriendlynetmonitor.R; 57 | 58 | import java.util.ArrayList; 59 | import java.util.HashMap; 60 | import java.util.List; 61 | 62 | /** 63 | * Activity for help contents 64 | * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial 65 | */ 66 | 67 | public class HelpActivity extends BaseActivity { 68 | 69 | @Override 70 | protected void onCreate(Bundle savedInstanceState) { 71 | super.onCreate(savedInstanceState); 72 | setContentView(R.layout.activity_help); 73 | RunStore.setContext(this); 74 | 75 | ExpandableListAdapter expandableListAdapter; 76 | HelpDataDump helpDataDump = new HelpDataDump(this); 77 | 78 | ExpandableListView generalExpandableListView = (ExpandableListView) findViewById(R.id.generalExpandableListView); 79 | 80 | HashMap> expandableListDetail = helpDataDump.getDataGeneral(); 81 | List expandableListTitleGeneral = new ArrayList<>(expandableListDetail.keySet()); 82 | expandableListAdapter = new ExpandableListAdapter(this, expandableListTitleGeneral, expandableListDetail); 83 | generalExpandableListView.setAdapter(expandableListAdapter); 84 | 85 | overridePendingTransition(0, 0); 86 | } 87 | 88 | protected int getNavigationDrawerID() { 89 | return R.id.nav_help; 90 | } 91 | 92 | } -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/HelpDataDump.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | package org.secuso.privacyfriendlynetmonitor.Activities; 50 | 51 | import android.content.Context; 52 | 53 | import org.secuso.privacyfriendlynetmonitor.R; 54 | 55 | import java.util.ArrayList; 56 | import java.util.HashMap; 57 | import java.util.LinkedHashMap; 58 | import java.util.List; 59 | 60 | /** 61 | * Activity for displaying help content. 62 | *

63 | * Class structure taken from tutorial at http://www.journaldev.com/9942/android-expandablelistview-example-tutorial 64 | * last access 27th October 2016 65 | */ 66 | 67 | class HelpDataDump { 68 | 69 | private Context context; 70 | 71 | HelpDataDump(Context context) { 72 | this.context = context; 73 | } 74 | 75 | HashMap> getDataGeneral() { 76 | HashMap> expandableListDetail = new LinkedHashMap<>(); 77 | 78 | List general = new ArrayList<>(); 79 | general.add(context.getResources().getString(R.string.help_whatis_answer)); 80 | expandableListDetail.put(context.getResources().getString(R.string.help_whatis), general); 81 | 82 | List features1 = new ArrayList<>(); 83 | features1.add(context.getResources().getString(R.string.help_feature_one_answer)); 84 | expandableListDetail.put(context.getResources().getString(R.string.help_feature_one), features1); 85 | 86 | List features2 = new ArrayList<>(); 87 | features2.add(context.getResources().getString(R.string.help_feature_two_answer)); 88 | expandableListDetail.put(context.getResources().getString(R.string.help_feature_two), features2); 89 | 90 | List features3 = new ArrayList<>(); 91 | features3.add(context.getResources().getString(R.string.help_feature_three_answer)); 92 | expandableListDetail.put(context.getResources().getString(R.string.help_feature_three), features3); 93 | 94 | List features4 = new ArrayList<>(); 95 | features4.add(context.getResources().getString(R.string.help_feature_four_answer)); 96 | expandableListDetail.put(context.getResources().getString(R.string.help_feature_four), features4); 97 | 98 | List features5 = new ArrayList<>(); 99 | features5.add(context.getResources().getString(R.string.help_feature_five_answer)); 100 | expandableListDetail.put(context.getResources().getString(R.string.help_feature_five), features5); 101 | 102 | List privacy = new ArrayList<>(); 103 | privacy.add(context.getResources().getString(R.string.help_privacy_answer)); 104 | expandableListDetail.put(context.getResources().getString(R.string.help_privacy), privacy); 105 | 106 | List permissions = new ArrayList<>(); 107 | permissions.add(context.getResources().getString(R.string.help_permission_answer)); 108 | expandableListDetail.put(context.getResources().getString(R.string.help_permission), permissions); 109 | 110 | List sysuser = new ArrayList<>(); 111 | sysuser.add(context.getResources().getString(R.string.help_sysuser_answer)); 112 | expandableListDetail.put(context.getResources().getString(R.string.help_sysuser), sysuser); 113 | 114 | List un_encrypted_ports = new ArrayList<>(); 115 | un_encrypted_ports.add(context.getResources().getString(R.string.help_un_encrypted_ports_answer)); 116 | expandableListDetail.put(context.getResources().getString(R.string.help_un_encrypted_ports), un_encrypted_ports); 117 | 118 | return expandableListDetail; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Activities/SplashActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of Privacy Friendly Password Generator. 3 | * Privacy Friendly Password Generator is free software: 4 | * you can redistribute it and/or modify it under the terms of the 5 | * GNU General Public License as published by the Free Software Foundation, 6 | * either version 3 of the License, or any later version. 7 | * Privacy Friendly Password Generator is distributed in the hope 8 | * that it will be useful, but WITHOUT ANY WARRANTY; without even 9 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | * See the GNU General Public License for more details. 11 | * You should have received a copy of the GNU General Public License 12 | * along with Privacy Friendly Password Generator. If not, see . 13 | */ 14 | 15 | package org.secuso.privacyfriendlynetmonitor.Activities; 16 | 17 | import android.content.Intent; 18 | import android.os.Build; 19 | import android.os.Bundle; 20 | import androidx.appcompat.app.AppCompatActivity; 21 | import android.view.View; 22 | import android.widget.TextView; 23 | 24 | import org.secuso.privacyfriendlynetmonitor.Assistant.PrefManager; 25 | import org.secuso.privacyfriendlynetmonitor.R; 26 | 27 | /** 28 | * @author Karola Marky 29 | * @version 20161022 30 | */ 31 | 32 | public class SplashActivity extends AppCompatActivity { 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | 38 | Intent mainIntent = null; 39 | PrefManager prefManager = new PrefManager(this); 40 | if(prefManager.isFirstTimeLaunch()) { 41 | mainIntent = new Intent(this, TutorialActivity.class); 42 | prefManager.setFirstTimeLaunch(false); 43 | } else { 44 | mainIntent = new Intent(this, MainActivity.class); 45 | mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 46 | } 47 | 48 | 49 | setContentView(R.layout.activity_splash); 50 | TextView compatibilityInfo = findViewById(R.id.compatibility_text); 51 | 52 | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P){ 53 | compatibilityInfo.setVisibility(View.VISIBLE); 54 | } else { 55 | compatibilityInfo.setVisibility(View.INVISIBLE); 56 | 57 | //Intent mainIntent = new Intent(SplashActivity.this, TutorialActivity.class); 58 | SplashActivity.this.startActivity(mainIntent); 59 | SplashActivity.this.finish(); 60 | } 61 | 62 | 63 | 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncCertVal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 43 | https://bitbucket.org/schillef/tlsmetric/overview. 44 | */ 45 | package org.secuso.privacyfriendlynetmonitor.Assistant; 46 | 47 | import android.os.AsyncTask; 48 | import android.util.Log; 49 | 50 | import org.json.JSONException; 51 | import org.json.JSONObject; 52 | import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector; 53 | 54 | import java.util.ArrayList; 55 | import java.util.List; 56 | import java.util.Map; 57 | 58 | import de.bjoernr.ssllabs.Api; 59 | import de.bjoernr.ssllabs.ConsoleUtilities; 60 | 61 | /** 62 | * Class for performing asynchronous requests of JSON Objects via SSL-Labs API 63 | *

64 | * Qualis SSL Labs API: https://www.ssllabs.com/projects/ssllabs-apis 65 | * Java-SSLLabs-API Björn Roland and Qualis SSL Labs: https://github.com/bjoernr-de 66 | */ 67 | 68 | public class AsyncCertVal extends AsyncTask { 69 | 70 | private Api mSSLLabsApi; 71 | 72 | public AsyncCertVal() { 73 | mSSLLabsApi = new Api(); 74 | } 75 | 76 | @Override 77 | public Void doInBackground(Void... voids) { 78 | if (Collector.sCertValList.size() > 0) { 79 | fetchHostInfo(Collector.sCertValList); 80 | } 81 | return null; 82 | } 83 | 84 | //Fetch cached information from SSL Labs using list of hostnames 85 | private void fetchHostInfo(List urls) { 86 | int count = getMaxAssessments(); 87 | JSONObject hostInfo; 88 | String host; 89 | ArrayList pendingList = new ArrayList<>(); 90 | while (count > 0 && urls.size() > 0) { 91 | host = urls.get(0); 92 | hostInfo = mSSLLabsApi.fetchHostInformationCached(host, null, false, false); 93 | 94 | // add to map if not empty 95 | Map map = null; 96 | try { 97 | map = ConsoleUtilities.jsonToMap(hostInfo); 98 | } catch (JSONException ignore) { 99 | } 100 | if (map != null && map.size() > 0) { 101 | Collector.mCertValMap.put(host, map); 102 | } 103 | //continue to resolve if request not ready 104 | if (map != null && map.size() > 0 && !Collector.analyseReady(map)) { 105 | pendingList.add(host); 106 | } 107 | urls.remove(0); 108 | count--; 109 | 110 | if (Const.IS_DEBUG) { 111 | Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map)); 112 | } 113 | } 114 | // manage pending lists 115 | Collector.sCertValList.addAll(pendingList); 116 | Collector.updateCertHostHandler(); 117 | } 118 | 119 | // Get number off allowed request at the time 120 | private int getMaxAssessments() { 121 | final String max = "maxAssessments"; 122 | JSONObject hostInfo = mSSLLabsApi.fetchApiInfo(); 123 | 124 | Map map = null; 125 | try { 126 | map = ConsoleUtilities.jsonToMap(hostInfo); 127 | } catch (JSONException ignore) { 128 | } 129 | if (Const.IS_DEBUG) { 130 | Log.d(Const.LOG_TAG, ConsoleUtilities.mapToConsoleOutput(map)); 131 | } 132 | if (map.containsKey(max)) { 133 | return (Integer) map.get(max); 134 | } else { 135 | return 0; 136 | } 137 | 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/AsyncDNS.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 43 | https://bitbucket.org/schillef/tlsmetric/overview. 44 | */ 45 | package org.secuso.privacyfriendlynetmonitor.Assistant; 46 | 47 | import android.os.AsyncTask; 48 | 49 | import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.Collector; 50 | 51 | /** 52 | * Helper class, executes asynchronous DNS requests. 53 | */ 54 | public class AsyncDNS extends AsyncTask { 55 | 56 | //execute reverse hostname resolving in Collector class 57 | @Override 58 | protected String doInBackground(String... params) { 59 | Collector.resolveHosts(); 60 | return "Executed!"; 61 | } 62 | } -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/Const.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 43 | https://bitbucket.org/schillef/tlsmetric/overview. 44 | */ 45 | 46 | package org.secuso.privacyfriendlynetmonitor.Assistant; 47 | 48 | import java.util.Arrays; 49 | import java.util.HashSet; 50 | import java.util.Set; 51 | 52 | /** 53 | * Storing constant values for various usages within the app 54 | */ 55 | 56 | public interface Const { 57 | 58 | //App constants 59 | boolean IS_DEBUG = false; 60 | String LOG_TAG = "NetMonitor"; 61 | String FILE_IF_LIST = "iflist"; 62 | 63 | //SSL LABS CONSTANTS 64 | String SSLLABS_URL = "https://www.ssllabs.com/ssltest/analyze.html?d="; 65 | 66 | //Detector constants 67 | long REPORT_TTL_DEFAULT = 10000; 68 | Integer[] TLS_PORT_VALUES = new Integer[]{993, 443, 995, 995, 614, 465, 587, 22}; 69 | Set TLS_PORTS = new HashSet<>(Arrays.asList(TLS_PORT_VALUES)); 70 | Integer[] INCONCLUSIVE_PORT_VALUES = new Integer[]{25, 110, 143}; 71 | Set INCONCUSIVE_PORTS = new HashSet<>(Arrays.asList(INCONCLUSIVE_PORT_VALUES)); 72 | Integer[] UNSECURE_PORT_VALUES = new Integer[]{21, 23, 80, 109, 137, 138, 139, 161, 992}; 73 | Set UNSECURE_PORTS = new HashSet<>(Arrays.asList(UNSECURE_PORT_VALUES)); 74 | 75 | //String Builder Constants 76 | String STATUS_TLS = "Encrypted"; 77 | String STATUS_UNSECURE = "Unencrypted"; 78 | String STATUS_INCONCLUSIVE = "Inconclusive"; 79 | String STATUS_UNKNOWN = "Unknown"; 80 | 81 | //SharedPrefs identifiers 82 | String REPORT_TTL = "REPORT_TTL"; 83 | String IS_DETAIL_MODE = "IS_DETAIL_MODE"; 84 | String IS_FIRST_START = "IS_FIRST_START"; 85 | String IS_LOG = "IS_LOG"; 86 | String IS_CERTVAL = "IS_CERTVAL"; 87 | String PREF_NAME = "PREF_NAME"; 88 | String IS_HIGHLIGHTED = "IS_HIGHLIGHTED"; 89 | 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/ExecCom.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Privacy Friendly Net Monitor (Net Monitor) 4 | - Copyright (2015 - 2017) Felix Tsala Schiller 5 | 6 | ################################################################### 7 | 8 | This file is part of Net Monitor. 9 | 10 | Net Monitor is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | Net Monitor is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Net Monitor. If not, see . 22 | 23 | Diese Datei ist Teil von Net Monitor. 24 | 25 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 26 | der GNU General Public License, wie von der Free Software Foundation, 27 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 28 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 29 | 30 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 31 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 32 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 33 | Siehe die GNU General Public License für weitere Details. 34 | 35 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 36 | Programm erhalten haben. Wenn nicht, siehe . 37 | 38 | ################################################################### 39 | 40 | This app has been created in affiliation with SecUSo-Department of Technische Universität 41 | Darmstadt. 42 | 43 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 44 | https://bitbucket.org/schillef/tlsmetric/overview. 45 | */ 46 | 47 | package org.secuso.privacyfriendlynetmonitor.Assistant; 48 | 49 | import android.util.Log; 50 | 51 | import java.io.ByteArrayOutputStream; 52 | import java.io.Closeable; 53 | import java.io.DataOutputStream; 54 | import java.io.IOException; 55 | import java.io.InputStream; 56 | 57 | /** 58 | * Handles the execution of shell commands. 59 | */ 60 | public class ExecCom extends Thread { 61 | 62 | //Execute user commands on shell 63 | static void user(String string) { 64 | if (Const.IS_DEBUG) Log.d(Const.LOG_TAG, "Executing as user: " + string); 65 | try { 66 | Process user = Runtime.getRuntime().exec(string); 67 | try { 68 | user.waitFor(); 69 | } catch (InterruptedException e) { 70 | e.printStackTrace(); 71 | } 72 | } catch (IOException e) { 73 | e.printStackTrace(); 74 | } 75 | } 76 | 77 | //Execute user commands and get the result. 78 | public static String userForResult(String string) { 79 | if (Const.IS_DEBUG) Log.d(Const.LOG_TAG, "Executing for result as user: " + string); 80 | String res = ""; 81 | DataOutputStream outputStream = null; 82 | InputStream response = null; 83 | try { 84 | Process user = Runtime.getRuntime().exec(string); 85 | 86 | outputStream = new DataOutputStream(user.getOutputStream()); 87 | response = user.getInputStream(); 88 | 89 | outputStream.writeBytes("exit\n"); 90 | outputStream.flush(); 91 | try { 92 | user.waitFor(); 93 | } catch (InterruptedException e) { 94 | e.printStackTrace(); 95 | } 96 | res = readFully(response); 97 | } catch (IOException e) { 98 | if (Const.IS_DEBUG) { 99 | Log.i(Const.LOG_TAG, "IO operation unsuccessful. Pipe Broken?" 100 | + string); 101 | } 102 | } finally { 103 | closeSilently(outputStream, response); 104 | } 105 | return res; 106 | } 107 | 108 | //Read the command output and return an utf8 string. 109 | public static String readFully(InputStream is) throws IOException { 110 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 111 | byte[] buffer = new byte[1024]; 112 | int length = 0; 113 | while ((length = is.read(buffer)) != -1) { 114 | baos.write(buffer, 0, length); 115 | } 116 | return baos.toString("UTF-8"); 117 | } 118 | 119 | //Closes a variety of closable objects. 120 | public static void closeSilently(Object... xs) { 121 | // Note: on Android API levels prior to 19 Socket does not implement Closeable 122 | for (Object x : xs) { 123 | if (x != null) { 124 | try { 125 | if (x instanceof Closeable) { 126 | ((Closeable) x).close(); 127 | } else { 128 | Log.d(Const.LOG_TAG, "cannot close: " + x); 129 | throw new RuntimeException("cannot close " + x); 130 | } 131 | } catch (Throwable e) { 132 | e.printStackTrace(); 133 | } 134 | } 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/PrefManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of Privacy Friendly Password Generator. 3 | * Privacy Friendly Password Generator is free software: 4 | * you can redistribute it and/or modify it under the terms of the 5 | * GNU General Public License as published by the Free Software Foundation, 6 | * either version 3 of the License, or any later version. 7 | * Privacy Friendly Password Generator is distributed in the hope 8 | * that it will be useful, but WITHOUT ANY WARRANTY; without even 9 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | * See the GNU General Public License for more details. 11 | * You should have received a copy of the GNU General Public License 12 | * along with Privacy Friendly Password Generator. If not, see . 13 | */ 14 | 15 | package org.secuso.privacyfriendlynetmonitor.Assistant; 16 | 17 | import android.content.Context; 18 | import android.content.SharedPreferences; 19 | import android.preference.PreferenceManager; 20 | 21 | /** 22 | * Class structure taken from tutorial at http://www.androidhive.info/2016/05/android-build-intro-slider-app/ 23 | * @author Karola Marky 24 | * @version 20170112 25 | */ 26 | public class PrefManager { 27 | private static SharedPreferences pref; 28 | 29 | private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch"; 30 | 31 | public PrefManager(Context context) { 32 | pref = PreferenceManager.getDefaultSharedPreferences(context); 33 | } 34 | 35 | public static void setFirstTimeLaunch(boolean isFirstTime) { 36 | pref.edit().putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime).apply(); 37 | } 38 | 39 | public static boolean isFirstTimeLaunch() { 40 | return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/RunStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 43 | https://bitbucket.org/schillef/tlsmetric/overview. 44 | */ 45 | package org.secuso.privacyfriendlynetmonitor.Assistant; 46 | 47 | 48 | import android.app.Activity; 49 | import android.content.Context; 50 | 51 | import org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis.ServiceHandler; 52 | 53 | /** 54 | * Singleton-Like implementation which holds App-Context information and ServiceHandlers 55 | */ 56 | public class RunStore { 57 | 58 | private static Activity gContext; 59 | private static Context gAppContext; 60 | private static ServiceHandler gService; 61 | 62 | public static void setContext(Activity activity) { 63 | gContext = activity; 64 | } 65 | 66 | public static Context getContext() { 67 | if(gContext == null) return gAppContext; 68 | return gContext; 69 | } 70 | 71 | public static ServiceHandler getServiceHandler() { 72 | if (gService == null) { 73 | gService = new ServiceHandler(); 74 | } 75 | return gService; 76 | } 77 | 78 | public static void setAppContext(Context appContext) { 79 | RunStore.gAppContext = appContext; 80 | } 81 | 82 | public static Context getAppContext() { 83 | return gAppContext; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/Assistant/TLType.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | package org.secuso.privacyfriendlynetmonitor.Assistant; 50 | 51 | /** 52 | * Enum indication transport layer protocol 53 | */ 54 | public enum TLType { 55 | tcp, 56 | tcp6, 57 | udp, 58 | udp6 59 | } -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/ConnectionAnalysis/ServiceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 43 | https://bitbucket.org/schillef/tlsmetric/overview. 44 | */ 45 | package org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis; 46 | 47 | import android.app.ActivityManager; 48 | import android.content.ComponentName; 49 | import android.content.Context; 50 | import android.content.Intent; 51 | import android.content.ServiceConnection; 52 | import android.os.IBinder; 53 | import android.widget.Toast; 54 | 55 | import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore; 56 | import org.secuso.privacyfriendlynetmonitor.R; 57 | 58 | /** 59 | * This class handles commands and access to the services of the app 60 | * Currently Handles Services: Passive Service 61 | */ 62 | public class ServiceHandler { 63 | 64 | private PassiveService mPassiveService; 65 | 66 | private boolean mIsBound; 67 | 68 | //Get information of running services 69 | public boolean isServiceRunning(Class serviceClass) { 70 | ActivityManager manager = (ActivityManager) RunStore.getAppContext().getSystemService(Context.ACTIVITY_SERVICE); 71 | for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { 72 | if (serviceClass.getName().equals(service.service.getClassName())) { 73 | return true; 74 | } 75 | } 76 | return false; 77 | } 78 | 79 | private ServiceConnection mPassiveServiceConnection = new ServiceConnection() { 80 | public void onServiceConnected(ComponentName className, IBinder service) { 81 | // This is called when the connection with the service has been 82 | // established, giving us the service object we can use to 83 | // interact with the service. Because we have bound to a explicit 84 | // service that we know is running in our own process, we can 85 | // cast its IBinder to a concrete class and directly access it. 86 | mPassiveService = ((PassiveService.AnalyzerBinder) service).getService(); 87 | Toast.makeText(RunStore.getContext(), R.string.passive_service_start, 88 | Toast.LENGTH_SHORT).show(); 89 | } 90 | 91 | public void onServiceDisconnected(ComponentName className) { 92 | // This is called when the connection with the service has been 93 | // unexpectedly disconnected -- that is, its process crashed. 94 | // Because it is running in our same process, we should never 95 | // see this happen. 96 | mPassiveService = null; 97 | Toast.makeText(RunStore.getContext(), R.string.passive_service_stop, 98 | Toast.LENGTH_SHORT).show(); 99 | } 100 | }; 101 | 102 | //start the service manually 103 | public void startPassiveService() { 104 | // Establish a connection with the service. 105 | Intent intent = new Intent(RunStore.getAppContext(), PassiveService.class); 106 | RunStore.getContext().startService(intent); 107 | } 108 | 109 | //stop the passive service 110 | public void stopPassiveService() { 111 | if (isServiceRunning(PassiveService.class)) { 112 | RunStore.getContext().stopService(new Intent(RunStore.getAppContext(), PassiveService.class)); 113 | } 114 | } 115 | 116 | //Bind the passive service to the assigned context 117 | public void bindPassiveService(Context context) { 118 | Intent intent = new Intent(RunStore.getAppContext(), PassiveService.class); 119 | context.bindService(intent, mPassiveServiceConnection, Context.BIND_AUTO_CREATE); 120 | mIsBound = true; 121 | } 122 | 123 | //Unbind the passive service to app context 124 | public void unbindPassiveService(Context context) { 125 | if (mIsBound) { 126 | context.unbindService(mPassiveServiceConnection); 127 | mIsBound = false; 128 | } 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /app/src/main/java/org/secuso/privacyfriendlynetmonitor/DatabaseUtil/DBApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Privacy Friendly Net Monitor (Net Monitor) 3 | - Copyright (2015 - 2017) Felix Tsala Schiller 4 | 5 | ################################################################### 6 | 7 | This file is part of Net Monitor. 8 | 9 | Net Monitor is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Net Monitor is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Net Monitor. If not, see . 21 | 22 | Diese Datei ist Teil von Net Monitor. 23 | 24 | Net Monitor ist Freie Software: Sie können es unter den Bedingungen 25 | der GNU General Public License, wie von der Free Software Foundation, 26 | Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren 27 | veröffentlichten Version, weiterverbreiten und/oder modifizieren. 28 | 29 | Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber 30 | OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 31 | Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 32 | Siehe die GNU General Public License für weitere Details. 33 | 34 | Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 35 | Programm erhalten haben. Wenn nicht, siehe . 36 | 37 | ################################################################### 38 | 39 | This app has been created in affiliation with SecUSo-Department of Technische Universität 40 | Darmstadt. 41 | 42 | The design is based on the Privacy Friendly Example App template by Karola Marky, Christopher 43 | Beckmann and Markus Hau (https://github.com/SecUSo/privacy-friendly-app-example). 44 | 45 | Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller 46 | https://bitbucket.org/schillef/tlsmetric/overview. 47 | 48 | */ 49 | package org.secuso.privacyfriendlynetmonitor.DatabaseUtil; 50 | 51 | import android.app.Application; 52 | import android.content.SharedPreferences; 53 | import android.os.AsyncTask; 54 | 55 | import org.greenrobot.greendao.database.Database; 56 | import org.secuso.privacyfriendlynetmonitor.Assistant.RunStore; 57 | 58 | import java.util.Map; 59 | 60 | 61 | /** 62 | * Created by m4rc0 on 12.11.2017. 63 | * DB class to store all apps and track the connections of the app. Implemented with greenDao. 64 | */ 65 | 66 | public class DBApp extends Application { 67 | 68 | public static final boolean ENCRYPTED = false; 69 | 70 | private static DaoSession daoSession; 71 | private static DBApp mContext; 72 | 73 | private static final String dbVersion = "1"; 74 | 75 | private static SharedPreferences selectedAppsPreferences; 76 | private static SharedPreferences.Editor editor; 77 | 78 | @Override 79 | public void onCreate() { 80 | super.onCreate(); 81 | mContext = this; 82 | new DBAppAsyncTask().execute(""); 83 | 84 | RunStore.setAppContext(getApplicationContext()); 85 | 86 | selectedAppsPreferences = getSharedPreferences("DBINFO", 0); 87 | editor = selectedAppsPreferences.edit(); 88 | } 89 | 90 | public DaoSession getDaoSession() { 91 | return daoSession; 92 | } 93 | 94 | static class DBAppAsyncTask extends AsyncTask { 95 | 96 | @Override 97 | protected Object doInBackground(Object[] objects) { 98 | System.out.println("Starting Database Async Task"); 99 | DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(mContext, ENCRYPTED ? "reports-db-encrypted" : "reports-db"); 100 | Database db = ENCRYPTED ? helper.getEncryptedWritableDb("super-secret") : helper.getWritableDb(); 101 | 102 | Map map = selectedAppsPreferences.getAll(); 103 | if (!map.isEmpty() && map.get("Version") != null && !map.get("Version").equals("")) { 104 | if (!map.get("Version").equals(dbVersion) && Integer.parseInt((String) map.get("Version")) < Integer.parseInt(dbVersion)) { 105 | helper.onUpgrade(db, Integer.parseInt((String) map.get("Version")), Integer.parseInt(dbVersion)); 106 | editor.putString("Version", dbVersion); 107 | editor.commit(); 108 | } 109 | } else { 110 | helper.onUpgrade(db, 0, Integer.parseInt(dbVersion)); 111 | editor.putString("Version", dbVersion); 112 | editor.commit(); 113 | } 114 | 115 | daoSession = new DaoMaster(db).newSession(); 116 | return ""; 117 | } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v11/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-hdpi-v11/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi-v9/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-hdpi-v9/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-hdpi/ic_action_name.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_edit_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-hdpi/ic_edit_list.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-hdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi-v11/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-mdpi-v11/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi-v9/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-mdpi-v9/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-mdpi/ic_action_name.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_edit_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-mdpi/ic_edit_list.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-mdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi-v11/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xhdpi-v11/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi-v9/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xhdpi-v9/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xhdpi/ic_action_name.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_edit_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xhdpi/ic_edit_list.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xhdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi-v11/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xxhdpi-v11/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi-v9/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xxhdpi-v9/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xxhdpi/ic_action_name.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_edit_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xxhdpi/ic_edit_list.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable-xxhdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_border.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_fullwidth.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_clear.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_help.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_history.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_sort_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stop.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tutorial.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tutorial_inverted.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/privacyfriendlyappslogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable/privacyfriendlyappslogo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/secuso_logo_blau_blau.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecUSo/privacy-friendly-netmonitor/c927533285960fc03e74b5ad62e93b176fd26188/app/src/main/res/drawable/secuso_logo_blau_blau.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_help_content.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | 20 | 26 | 27 | 33 | 34 | 37 | 38 | 46 | 47 |