From ae10bccc73a429db659791c77e03e963441d765f Mon Sep 17 00:00:00 2001 From: jacquarg Date: Wed, 19 Mar 2025 09:41:52 +0100 Subject: [PATCH 1/2] feat:2995: Add hidden debug activity --- README.md | 12 +++---- app/src/main/AndroidManifest.xml | 8 +++++ .../features/debug/DebugActivity.kt | 35 ++++++++++++++++++ .../debug/DebugWeeklyreportFragment.kt | 33 +++++++++++++++++ app/src/main/res/layout/debug_activity.xml | 36 +++++++++++++++++++ .../layout/debug_weeklyreport_fragment.xml | 28 +++++++++++++++ app/src/main/res/values/strings.xml | 4 +++ 7 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugActivity.kt create mode 100644 app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt create mode 100644 app/src/main/res/layout/debug_activity.xml create mode 100644 app/src/main/res/layout/debug_weeklyreport_fragment.xml diff --git a/README.md b/README.md index 521f91a7..9f5387cc 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,18 @@ The following features are currently part of AdvancedPrivacy app. This app comes in two flavours, one for /e/OS and second one for other android (where app doesn't have system access) # Testing -Need to write test and add code coverage. + +A Debug tools activity is accessible through adb, for debugging and QA + +``` +adb shell am start -n foundation.e.advancedprivacy/.features.debug.AdvancedPrivacyDebugActivity +``` # Development ## Setup You can use any latest stable version of android studio to be able to build this app. -## Supported Versions -- Minimum SDK: 26 (Android O) -- Compile SDK: 34 (Android U) -- Target SDK: 33 (Android T) - ## API Keys This project uses [Sentry](https://sentry.io) for telemetry and crash reports, [Mapbox](https://docs.mapbox.com/android/maps/guides/install/) sdk as maps tiles provider. To compile the project, you need to set keys for them: diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aa3e518c..32f51596 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -104,5 +104,13 @@ android:launchMode="singleInstance" android:theme="@style/Theme.InvisibleActivity" /> + + diff --git a/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugActivity.kt b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugActivity.kt new file mode 100644 index 00000000..911436e0 --- /dev/null +++ b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugActivity.kt @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2025 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package foundation.e.advancedprivacy.features.debug + +import android.os.Bundle +import androidx.fragment.app.FragmentActivity +import foundation.e.advancedprivacy.databinding.DebugActivityBinding + +// Hidden debug tools activity for AdvancedPrivacy +// Centralize collection of tools for debuging and QA +// especially for feature which involve delayed (like weekly) workers. +class DebugActivity : FragmentActivity() { + private lateinit var binding: DebugActivityBinding + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = DebugActivityBinding.inflate(layoutInflater) + setContentView(binding.root) + } +} diff --git a/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt new file mode 100644 index 00000000..42727aa1 --- /dev/null +++ b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2025 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package foundation.e.advancedprivacy.features.debug + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import foundation.e.advancedprivacy.R +import foundation.e.advancedprivacy.databinding.DebugWeeklyreportFragmentBinding + +class DebugWeeklyreportFragment : Fragment(R.layout.debug_weeklyreport_fragment) { + private lateinit var binding: DebugWeeklyreportFragmentBinding + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding = DebugWeeklyreportFragmentBinding.bind(view) + } +} diff --git a/app/src/main/res/layout/debug_activity.xml b/app/src/main/res/layout/debug_activity.xml new file mode 100644 index 00000000..761b6574 --- /dev/null +++ b/app/src/main/res/layout/debug_activity.xml @@ -0,0 +1,36 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/debug_weeklyreport_fragment.xml b/app/src/main/res/layout/debug_weeklyreport_fragment.xml new file mode 100644 index 00000000..15e5c329 --- /dev/null +++ b/app/src/main/res/layout/debug_weeklyreport_fragment.xml @@ -0,0 +1,28 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f7728bd7..a0a4e465 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -218,4 +218,8 @@ Tracker control is on This could impact the functioning of some applications. + + + AdvancedPrivacy debug tools + Weekly Report debug tools -- GitLab From d76928d94d78a7d29639cebb537bb41a2a3c5971 Mon Sep 17 00:00:00 2001 From: jacquarg Date: Tue, 25 Mar 2025 08:21:19 +0100 Subject: [PATCH 2/2] feat:2995: WeeklyReport typography everywhere. --- README.md | 2 +- app/src/main/AndroidManifest.xml | 2 +- ...eklyreportFragment.kt => DebugWeeklyReportFragment.kt} | 8 ++++---- app/src/main/res/layout/debug_activity.xml | 2 +- ...port_fragment.xml => debug_weekly_report_fragment.xml} | 2 +- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename app/src/main/java/foundation/e/advancedprivacy/features/debug/{DebugWeeklyreportFragment.kt => DebugWeeklyReportFragment.kt} (78%) rename app/src/main/res/layout/{debug_weeklyreport_fragment.xml => debug_weekly_report_fragment.xml} (95%) diff --git a/README.md b/README.md index 9f5387cc..69396401 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This app comes in two flavours, one for /e/OS and second one for other android ( A Debug tools activity is accessible through adb, for debugging and QA ``` -adb shell am start -n foundation.e.advancedprivacy/.features.debug.AdvancedPrivacyDebugActivity +adb shell am start -n foundation.e.advancedprivacy/.features.debug.DebugActivity ``` # Development diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 32f51596..667891d7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -108,7 +108,7 @@ adb shell am start -n foundation.e.advancedprivacy/.features.debug.AdvancedPrivacyDebugActivity --> diff --git a/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyReportFragment.kt similarity index 78% rename from app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt rename to app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyReportFragment.kt index 42727aa1..3ca369c5 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyreportFragment.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/features/debug/DebugWeeklyReportFragment.kt @@ -21,13 +21,13 @@ import android.os.Bundle import android.view.View import androidx.fragment.app.Fragment import foundation.e.advancedprivacy.R -import foundation.e.advancedprivacy.databinding.DebugWeeklyreportFragmentBinding +import foundation.e.advancedprivacy.databinding.DebugWeeklyReportFragmentBinding -class DebugWeeklyreportFragment : Fragment(R.layout.debug_weeklyreport_fragment) { - private lateinit var binding: DebugWeeklyreportFragmentBinding +class DebugWeeklyReportFragment : Fragment(R.layout.debug_weekly_report_fragment) { + private lateinit var binding: DebugWeeklyReportFragmentBinding override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding = DebugWeeklyreportFragmentBinding.bind(view) + binding = DebugWeeklyReportFragmentBinding.bind(view) } } diff --git a/app/src/main/res/layout/debug_activity.xml b/app/src/main/res/layout/debug_activity.xml index 761b6574..d3cdea8e 100644 --- a/app/src/main/res/layout/debug_activity.xml +++ b/app/src/main/res/layout/debug_activity.xml @@ -31,6 +31,6 @@ android:id="@+id/fragment_container_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:name="foundation.e.advancedprivacy.features.debug.DebugWeeklyreportFragment" /> + android:name="foundation.e.advancedprivacy.features.debug.DebugWeeklyReportFragment" /> \ No newline at end of file diff --git a/app/src/main/res/layout/debug_weeklyreport_fragment.xml b/app/src/main/res/layout/debug_weekly_report_fragment.xml similarity index 95% rename from app/src/main/res/layout/debug_weeklyreport_fragment.xml rename to app/src/main/res/layout/debug_weekly_report_fragment.xml index 15e5c329..b5cd3598 100644 --- a/app/src/main/res/layout/debug_weeklyreport_fragment.xml +++ b/app/src/main/res/layout/debug_weekly_report_fragment.xml @@ -21,7 +21,7 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a0a4e465..14898632 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -221,5 +221,5 @@ AdvancedPrivacy debug tools - Weekly Report debug tools + Weekly Report debug tools -- GitLab