Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae10bccc authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

feat:2995: Add hidden debug activity

parent b4fd3c2b
Loading
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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:

+8 −0
Original line number Diff line number Diff line
@@ -104,5 +104,13 @@
            android:launchMode="singleInstance"
            android:theme="@style/Theme.InvisibleActivity"
            />
<!-- Debug activity to be started with adb command:
adb shell am start -n foundation.e.advancedprivacy/.features.debug.AdvancedPrivacyDebugActivity
-->
        <activity
            android:name="foundation.e.advancedprivacy.features.debug.AdvancedPrivacyDebugActivity"
            android:exported="true"
            android:label="@string/debug_activity_title"
            />
    </application>
</manifest>
+35 −0
Original line number Diff line number Diff line
/*
 * 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 <https://www.gnu.org/licenses/>.
 */

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)
    }
}
+33 −0
Original line number Diff line number Diff line
/*
 * 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 <https://www.gnu.org/licenses/>.
 */

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)
    }
}
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ 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 <https://www.gnu.org/licenses/>.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/debug_activity_title"
        android:gravity="center"
        android:padding="4dp"
        android:textSize="20sp"
        />
    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/fragment_container_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="foundation.e.advancedprivacy.features.debug.DebugWeeklyreportFragment" />

</LinearLayout>
 No newline at end of file
Loading