Skip to content

Commit 7ada492

Browse files
RkShaRkzPeterHassehajohaderpetererrdemk
authored
Update from upstream + some minor changes (#10)
Update from upstream since we were 93 commits behind Alright, we were 93 commits behind, now we should be up to speed... or probably +1 ahead due to the merge commit. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SharedPreferencesGrouper` class for improved management of shared preferences. - Added multiple new fragments including `DetailFragment`, `QuickFragment`, and `SharedPreferencesIOFragment`. - Implemented a `MultiSelectDialogFragment` for user-friendly multi-selection of preferences. - Enhanced UI with new layouts for displaying cell information (CDMA, GSM, LTE, NR). - Added new utility methods in `Iperf3Utils` for converting protocol and mode identifiers to strings. - Introduced a `PingFragment` for managing ping operations with a modern UI. - Added new layouts for quick views of various network types. - New `CloudCityConstants` class for centralized string constants related to Cloud City. - New `CloudCityParamsRepository` for managing application parameters related to the Cloud City service. - Added `sentry.properties` for Sentry integration to track errors and performance metrics. - **Bug Fixes** - Improved error handling across various components, including logging exceptions instead of printing stack traces. - **Documentation** - Updated comments and documentation across various classes for better clarity and maintainability. - **Style** - Enhanced UI elements with Material Design components and improved layout structures. - **Chores** - Cleaned up unused imports and removed deprecated code sections for better code hygiene. <!-- end of auto-generated comment: release notes by coderabbit.ai --> * added available location provider to home screen * removed inacurate log message * add basic config file export/import * update to use SPG instead of default SharedPreferences * wifi logging implemented. Needed some refactoring on permissions requests. Also fixes some issues on cp handling * add config GUI * update template config * add dynamic clearance of ScrollView if Clear button is pressed * rename * refactor MainActivity to prevent to early access of the data provider * android studio code optimization, lets hope for the best ;-) * Fix some of the deprecation warnings mentioned in omnt#28 the rest needs more refactoring or ah higher min SDK version * fix duplicate switch entry because of typo * move to separate Dir * fix bug * rework cell information code to be more robust for situation where no UICC is present or network is not available. Moved code from homefragment to main activity which only needs to be called once linter care * fix log icon reference not valid as to early access * update doc and fix Select Diag for Config import * pretty print config * update * update * remove DefaultSharedPreference * fix bug & add support for indefinitely running iperf3 * Added wifi standard to log / homescreen * check background permission on each start * update ping * refactor make it more readable * remove Intent * update Fragment if Cancel via Notification is clicked * fix "show neighbour cell setting did not take effect for home screen" * removed usage printStackTrace as it is considered bad practice in favor of using the logging framework * removed usage printStackTrace as it is considered bad practice in favor of using the logging framework * refactor some warnings in logging service * refactor some warnings in logging service * Print units to wifi information * Print units to wifi information * first part of fixing subscription selection * fix defaultsharedpreferences bug * Make sure to repopulate the data provider after an TM change * fix import config * fix wifi bug * split Homefragment into Quick View and Detail * add CellInformation to QuickView * add LTE/NR * refactor * update quick view * update quick view * update quick view * update quick view * add CDMA * add detail view * add detail view for every celltype * update signal strength * remove pretty print json * update * update * update * move Display code back to Fragment * add GSM quickview * add NR * Add QuickView to Hoimescreen vol. 2 (#33) * add CDMA * rename * add LTE * fix format issue * bump gradle to 8.6.0 * use MaterialTextView * add function comments * clean up --------- Co-authored-by: hajoha <[email protected]> * fix wrong value in RSSI for wifi * fix LTE/GSM/CDMA influx export * reworked duplicate logging strings * Clean up logging. Bumb some dependencies. Change app version to 0.4. * Clean up logging. Bumb some dependencies. Change app version to 0.4. Some further cleanup of logging refactoring. uncomment some code we will use in the future to make linter happy * Clean up logging. Bumb some dependencies. Change app version to 0.4. Some further cleanup of logging refactoring. Uncomment some code we will use in the future to make linter happy. Reworked subscription settings code to better handle no UICC present * Clean up logging. Bumb some dependencies. Change app version to 0.4. Some further cleanup of logging refactoring. Uncomment some code we will use in the future to make linter happy. Reworked subscription settings code to better handle no UICC present Update Changelog Bump gradle version * Clean up logging. Bumb some dependencies. Change app version to 0.4. Some further cleanup of logging refactoring. Uncomment some code we will use in the future to make linter happy. Reworked subscription settings code to better handle no UICC present Update Changelog Bump gradle version * clean up failed merge from 91cad78 * code cleanup and typo fix * update changelog * fixed wrong button state of ping fragment button after app start some cleanup in ping fragment * Add supported android versions to readme * typo in readme * remove deprecated checks and vars vom loggingservice * removed unneccessary call on update all information for quick view * cleanup in preparation for 0.4 release * bump influx client version to 7.2.0 * added Wifi Security Type to wifi information * Add alternative solution to enable carrier permissions * Add docs about IMS activation * Extract CloudCity changes to MainActivity EDIT: streamline even further, we'll rename these later on * Extract CloudCity changes to LoggingService * Address own CR comments - handle NPE * Fix prefilling of server params in logging settings part of the settings screen So, since they changed how they work with things and have kinda-but-not-really moved away from SharedPreferences by using their new SharedPreferencesGrouper which is just a dispatcher to many different shared preferences, the prefilling was broken by them started using the "logging_sp" SharedPreferences for the logging settings, while the cloud city-related preferenes were being saved in the default one. But apart from that, a new "source of truth" was made, the CloudCityParamsRepository which will hopefully hold all data together (and save them in it's own 'normal' sharedpref :( ) until it diverges from the values saved in their logging_sp shared pref. A new application class was made as well, which initializes the repository, and cloud city-related (string) parameters were extracted to the new CloudCityConstants class. the rest of the files were affected by minor refactoring or importing the new CloudCityConstants tl;dr - the prefilling works fine now again. * Integrate Sentry crashreporting for project mobile-app by using it's DSN (in metadata) * Move LoggingService cloudcity updates from main thread While extracting everything to have less changes in OMNT classes and more code in our "composite" classes, i accidentally used Looper.myLooper() instead of the old handler that was being used... so logging service would update every second on the UI thread. Whoops. My bad. * Previous fix wasn't so great, abandon the CloudCityHandler Makes no sense for the LoggingService to just have a handler which it'll pass over to our methods. Since our methods instantiate a new internal handler for the update thread, might as well also instantiate a new HandlerThread which will force the updates to a background thread (away from the main thread). So this fix is more resiliant to problems than the previous one (which also didn't work since the handler was never instantiated) * Update sentry project to new project * Add sentry properties so AndroidCI workflow can work again * More sentry updates * Separate the sentry.properties into two... So, according to the very bad and ambiguous documentation, there should apparently be two sentry.properties file: 1. where I originally put it, that just sets the DSN 2. one in the project root that defines the project, org and authToken So lets try this and see where that gets us. * Update auth token with the new one I made * Remove auth token from sentry.properties and just keep it as a repo secret * Revert "Remove auth token from sentry.properties and just keep it as a repo secret" This reverts commit e42638f. * Turn off sentry debug logs * Add coderabbit's CR suggestion to cache after loading from shared pref * Rework the last fix * Apply similar isBlank() fix to other places that were using regular isBlank() After all, the String#isBlank() is introduced in Java11 aka API34 so for devices running lower APIs we shouldn't use it; so we have to roll out our own version using String.trim().isEmpty() instead The Util method checks the API level and acts accordingly. --------- Co-authored-by: Peter Hasse <[email protected]> Co-authored-by: Johann <[email protected]> Co-authored-by: derpeter <[email protected]> Co-authored-by: hajoha <[email protected]> Co-authored-by: PeterHasse <[email protected]> Co-authored-by: Johann <[email protected]> Co-authored-by: errdemk <[email protected]>
1 parent a1504f0 commit 7ada492

File tree

101 files changed

+6650
-2796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+6650
-2796
lines changed

.github/ISSUE_TEMPLATE/bug.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug Report
33
about: Use this template for creating bug report.
4-
title: "[BUG] - BUG_DESCRIPTION"
4+
title: "BUG_DESCRIPTION"
55
labels: bug
66
assignees: ""
77
---

.github/ISSUE_TEMPLATE/feature.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Feature Request
33
about: Use this template for creating feature request.
4-
title: "[FEATURE] - FEATURE_DESCRIPTION"
4+
title: "FEATURE_DESCRIPTION"
55
labels: feature
66
assignees: ""
77
---

CHANGELOG.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# OpenMobileNetworkToolkit Changelog
2+
## Release [0.4] - Stralsund
3+
4+
### Added
5+
- WiFi Data logging and display on the home screen
6+
- New Quick View on home screen for Cell Information
7+
- Import / Export application settings
8+
9+
### Changed
10+
- code clean up around soon to be deprecated functions
11+
- refactored code that causes warnings
12+
- refactored data model for cell information
13+
- Bump lib dependencies
14+
- Bump gradle version
15+
16+
### Fixed
17+
- Fix crash where no UICC or Cell is available
18+
- Wrong value in Wifi RSSI filed
19+
120
# OpenMobileNetworkToolkit Changelog
221
## Release [0.3.1]
322

@@ -7,7 +26,7 @@
726
### Changed
827
- Use [TelephonyCallback](https://developer.android.com/reference/android/telephony/TelephonyCallback) instead of [PhoneStateListener](https://developer.android.com/reference/android/telephony/PhoneStateListener)
928
- Bump gradle to 8.5.0
10-
- Bump lib depencies
29+
- Bump lib decencies
1130
- disable Radio Settings if Carrier Permissions are not available
1231
- minor documentation update
1332

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22

33
OMNT provides tooling to researchers and developers of mobile communication networks like 3GPP 2/3/4/5G.
44
The main objective of OMNT is the collection of measurement data on the mobile network like RSSI, RSRQ, RSRP, GNSS position, Cell ID, PLNM and much more.
5-
On top of those passive measurements on the radio environment and network parameters, OMNT can also run a iPerf3 server / client for bandwidth, latency and jitter evaluation as well as
5+
On top of those passive measurements on the radio environment and network parameters, OMNT can also run an iPerf3 server / client for bandwidth, latency and jitter evaluation as well as
66
round-trip-time and jitter evaluation via ICMP (Ping). Measurement data can be stored locally and / or send to an InfluxDB 2.x server.
7-
Measurement results can be visualized e.g. via provided Graphana Dashboards or be further processed e.g. with python.
8-
Besides its measurement capabilities, OMNT provides a deep insight in the state of the phone e.g. software versions, connectivity states, SIM card content and much more.
7+
Measurement results can be visualized e.g. via provided Grafana Dashboards or be further processed e.g. with python.
8+
Besides its measurement capabilities, OMNT provides a deep insight into the state of the phone e.g. software versions, connectivity states, SIM card content and much more.
99
Network related Carrier Settings can be configured (if the app is granted the corresponding privileges).
1010
Also, OMNT provides access to different "secret" settings in Android phones.
1111

1212
The current state of the app can be described as "research software", it fits our needs but does not aim to be complete or bug free.
1313
Use the app at your own risk. If you find it useful for your research, please cite the app in publications.
1414

15-
1615
* [Quick Start HowTo](docs/quick-start.md)
1716
* [User Manual](docs/OpenMobileNetworkToolkit.md)
1817
* [Signing HowTo](docs/signing.md)
1918

19+
## Requirements
20+
21+
OMNT currently supports Android 11 (API Level 30) and is tested up to Android 15 (API Level 35). While it would be technical possible to support lower API levels,
22+
it would be a lot of work and would require some duplicate implementations. If you can, try to update your phone to the latest software update. If there is no recent enough
23+
firmware from you phone vendor you might have luck with LineageOS or other after market firmware.
24+
2025
## Why use this app
2126

2227
* As apps like OMNT can can access a lot of private information. It is important for users to be able to make sure that those data is not

app/build.gradle

+51-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
plugins {
99
id 'com.android.application'
10+
id "io.sentry.android.gradle" version "4.13.0"
1011
id 'androidx.navigation.safeargs'
1112
id("org.spdx.sbom") version "0.8.0"
1213
}
@@ -46,8 +47,8 @@ android {
4647
applicationId "de.fraunhofer.fokus.OpenMobileNetworkToolkit"
4748
minSdk 31
4849
targetSdk 34
49-
versionCode 3
50-
versionName "0.3"
50+
versionCode 4
51+
versionName "0.4"
5152

5253
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5354
signingConfig signingConfigs.debug
@@ -74,6 +75,13 @@ android {
7475
compileOptions {
7576
sourceCompatibility JavaVersion.VERSION_11
7677
targetCompatibility JavaVersion.VERSION_11
78+
tasks.withType(JavaCompile).tap {
79+
configureEach {
80+
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
81+
}
82+
}
83+
84+
7785
}
7886
buildFeatures {
7987
viewBinding true
@@ -113,35 +121,69 @@ spdxSbom {
113121
}
114122
}
115123

124+
// Sentry
125+
sentry {
126+
// Enables more detailed log output, e.g. for sentry-cli.
127+
//
128+
// Default is false.
129+
debug = false
130+
// debug = true
131+
132+
// Generates a source bundle and uploads it to Sentry.
133+
// This enables source context, allowing you to see your source
134+
// code as part of your stack traces in Sentry.
135+
//
136+
// Default is disabled. To enable, see the source context guide.
137+
includeSourceContext = true
138+
139+
// Includes additional source directories into the source bundle.
140+
// These directories are resolved relative to the project directory.
141+
// additionalSourceDirsForSourceContext = ["mysrc/java", "other-source-dir/main/kotlin"] //We don't need this yet
142+
143+
// Disables or enables dependencies metadata reporting for Sentry.
144+
// If enabled, the plugin will collect external dependencies and
145+
// upload them to Sentry as part of events. If disabled, all the logic
146+
// related to the dependencies metadata report will be excluded.
147+
//
148+
// Default is enabled.
149+
includeDependenciesReport = true
150+
151+
// Automatically adds Sentry dependencies to your project.
152+
autoInstallation {
153+
enabled = true
154+
}
155+
}
156+
116157
dependencies {
117158
implementation 'androidx.preference:preference:1.2.1'
118-
implementation 'androidx.work:work-runtime:2.9.0'
159+
implementation 'androidx.work:work-runtime:2.9.1'
119160
def room_version = "2.6.1"
120161

121162
implementation "androidx.room:room-runtime:$room_version"
122163
annotationProcessor "androidx.room:room-compiler:$room_version"
123164
implementation 'androidx.appcompat:appcompat:1.7.0'
124165
implementation 'com.google.guava:guava:33.2.1-jre'
125166
implementation 'androidx.concurrent:concurrent-futures:1.2.0'
126-
implementation 'androidx.activity:activity:1.9.0'
127-
implementation 'androidx.fragment:fragment:1.8.1'
167+
implementation 'androidx.activity:activity:1.9.3'
168+
implementation 'androidx.fragment:fragment:1.8.4'
128169
implementation 'androidx.appcompat:appcompat:1.7.0'
129170
implementation 'com.google.android.material:material:1.12.0'
130171
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
131-
implementation 'androidx.navigation:navigation-fragment:2.7.7'
132-
implementation 'androidx.navigation:navigation-ui:2.7.7'
172+
implementation 'androidx.navigation:navigation-fragment:2.8.3'
173+
implementation 'androidx.navigation:navigation-ui:2.8.3'
133174
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
134175
testImplementation 'junit:junit:4.13.2'
135176
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
136177
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
137178
implementation 'androidx.preference:preference-ktx:1.2.1'
138179
implementation 'androidx.recyclerview:recyclerview:1.3.2'
139180
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
140-
implementation 'com.influxdb:influxdb-client-java:7.1.0'
181+
implementation 'com.influxdb:influxdb-client-java:7.2.0'
141182
implementation 'com.google.android.gms:play-services-location:21.3.0'
142183
implementation 'com.github.anastr:speedviewlib:1.6.1'
143184
implementation "androidx.viewpager2:viewpager2:1.1.0"
144-
185+
implementation "androidx.compose.material3:material3:1.3.0"
186+
// OkHttp and Retrofit
145187
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
146188
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
147189
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'

app/src/main/AndroidManifest.xml

+32-9
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
android:name="android.hardware.telephony"
1414
android:required="false" />
1515

16-
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"
16+
<uses-permission
17+
android:name="android.permission.MODIFY_PHONE_STATE"
1718
tools:ignore="ProtectedPermissions" />
18-
<uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE"
19+
<uses-permission
20+
android:name="android.permission.READ_PRECISE_PHONE_STATE"
1921
tools:ignore="ProtectedPermissions" />
2022
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
2123
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@@ -25,6 +27,7 @@
2527
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2628
<uses-permission android:name="android.permission.INTERNET" />
2729
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />
30+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
2831
<uses-permission
2932
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
3033
tools:ignore="ProtectedPermissions" />
@@ -38,13 +41,31 @@
3841
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
3942

4043
<application
44+
android:name="cloudcity.CloudCityOMNTApplication"
45+
android:description="@string/app_description"
4146
android:icon="@mipmap/ic_launcher"
4247
android:label="@string/app_name"
43-
android:description="@string/app_description"
4448
android:roundIcon="@mipmap/ic_launcher_round"
4549
android:supportsRtl="true"
4650
android:theme="@style/Theme.AppCompat.NoActionBar"
4751
android:usesCleartextTraffic="true">
52+
53+
<!-- sentry metadata -->
54+
<!-- Required: set your sentry.io project identifier (DSN) -->
55+
<meta-data
56+
android:name="io.sentry.dsn"
57+
android:value="https://4aaf77c233f470cc87cb4926a66461c7@o4507344274522112.ingest.de.sentry.io/4508228493770832" />
58+
59+
<!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->
60+
<meta-data
61+
android:name="io.sentry.traces.user-interaction.enable"
62+
android:value="true" />
63+
<!-- enable screenshot for crashes -->
64+
<meta-data
65+
android:name="io.sentry.attach-screenshot"
66+
android:value="true" />
67+
<!-- end of sentry metadata -->
68+
4869
<service
4970
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.OpenMobileNetworkToolkit"
5071
android:enabled="true"
@@ -62,13 +83,15 @@
6283
<service
6384
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.LoggingService"
6485
android:foregroundServiceType="location" />
65-
<service
66-
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.Ping.PingService" />
86+
<service android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.Ping.PingService" />
6787

6888

69-
<service android:name="androidx.work.impl.foreground.SystemForegroundService" android:foregroundServiceType="specialUse">
70-
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
71-
android:value="explanation_for_special_use"/>
89+
<service
90+
android:name="androidx.work.impl.foreground.SystemForegroundService"
91+
android:foregroundServiceType="specialUse">
92+
<property
93+
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
94+
android:value="explanation_for_special_use" />
7295
</service>
7396

7497

@@ -124,4 +147,4 @@
124147
</receiver>
125148

126149
</application>
127-
</manifest>
150+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package cloudcity;
2+
3+
/**
4+
* The "string holder" class for anything CloudCity related
5+
*/
6+
public class CloudCityConstants {
7+
/**
8+
* Name of the cloud city server url preference
9+
*/
10+
public static final String CLOUD_CITY_SERVER_URL = "cloud_city_url";
11+
/**
12+
* Name of the cloud city token preference
13+
*/
14+
public static final String CLOUD_CITY_TOKEN = "cloud_city_token";
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package cloudcity;
2+
3+
import android.app.Application;
4+
5+
public class CloudCityOMNTApplication extends Application {
6+
7+
@Override
8+
public void onCreate() {
9+
super.onCreate();
10+
CloudCityParamsRepository.initialize(getApplicationContext());
11+
}
12+
}

0 commit comments

Comments
 (0)