Skip to content

Commit

Permalink
Merge pull request #13 from omnt/rel/0.3
Browse files Browse the repository at this point in the history
Create Release 0.3
  • Loading branch information
PeterHasse authored Jun 14, 2024
2 parents 98dccef + 1256205 commit 129772c
Show file tree
Hide file tree
Showing 105 changed files with 2,494 additions and 1,172 deletions.
90 changes: 74 additions & 16 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,83 @@ name: Android CI

on:
push:
branches: [ "main" ]
branches: [ 'main', 'rel/**' ]
tags:
- '*'
pull_request:
branches: [ "main" ]
branches: [ 'main' ]


jobs:
build:

runs-on: ubuntu-latest

environment: ngni-omnt
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Checkout Branch ${{ github.ref }}
uses: actions/checkout@v4
- name: Get Latest iPerf
run: |
wget -O jniLibs.zip https://github.com/omnt/iperf/releases/latest/download/jniLibs
unzip jniLibs.zip -d app/src/main
rm jniLibs.zip
- name: Decode Keystore and Create key.properties
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.STOREPASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEYPASSWORD }}
run: |
echo -n "$ENCODED_STRING" | base64 -d > app/OpenMobileNetworkToolkit-key.jks
mkdir android
touch android/key.properties
echo "storePassword=$RELEASE_KEYSTORE_PASSWORD" > android/key.properties
echo "keyPassword=$RELEASE_KEY_PASSWORD" >> android/key.properties
echo "keyAlias=$RELEASE_KEYSTORE_ALIAS" >> android/key.properties
echo "storeFile=OpenMobileNetworkToolkit-key.jks" >> android/key.properties
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle

- name: Build Release APK
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }}
run: ./gradlew assembleRelease --stacktrace

- name: Build Release APK
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }}
run: ./gradlew assembleDebug --stacktrace

- name: Generate SPDX
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PW }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PW }}
run: ./gradlew app:spdxSbomForRelease

- name: Get release file apk path
id: releaseApk
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
mkdir upload
mv app/build/outputs/apk/debug/app-debug.apk ./upload/omnt-debug.apk
mv app/build/outputs/apk/release/app-release.apk ./upload/omnt-release.apk
mv app/build/spdx/release.spdx.json ./upload/release.spdx.json
- name: Upload All Artifacts
uses: actions/upload-artifact@v4
with:
name: omnt-${{ steps.releaseApk.outputs.sha_short }}
path: ./upload
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenMobileNetworkToolkit Changelog
## Release [0.3]

### Added
- Github Action Workflow for APK Debug/Relase Build and SPDX File [PR 13](https://github.com/omnt/OpenMobileNetworkToolkit/pull/13)
- Documentation [PR 13](https://github.com/omnt/OpenMobileNetworkToolkit/pull/13)
- CHANGELOG.md [PR 13](https://github.com/omnt/OpenMobileNetworkToolkit/pull/13)

### Changed
- Fix possible [InfluxDB Bug](https://github.com/influxdata/influxdb-client-java/issues/731)
- iPerf3 GUI [PR 14](https://github.com/omnt/OpenMobileNetworkToolkit/pull/14)
- Fix Ping Bug, where button is enabled but now Ping is running after app restart [PR 14](https://github.com/omnt/OpenMobileNetworkToolkit/pull/14)
- Update Ping Fragment, now uses the Metric class to display [PR 14](https://github.com/omnt/OpenMobileNetworkToolkit/pull/14)
-
### Breaking Changes
- see [PR 14](https://github.com/omnt/OpenMobileNetworkToolkit/pull/14)

## Release [0.2]
### Changed
- Improved 4G support. Now all cell parameters of 4G networks should be logged and displayed correctly
- Improved 2G same as 4G
- Logging status indicator in the actionbar
- Filter for Carrier Settings Readout
- Carrier Settings Apply button moved to Settings
- InfluxDB Cloud is now also supported to be used as logging target. This means we can log to Influx 1.x 2.x and 3.x
- [PR 7](https://github.com/omnt/OpenMobileNetworkToolkit/pull/7)
- [Release 0.2](https://github.com/omnt/OpenMobileNetworkToolkit/releases/tag/0.2
75 changes: 7 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Also, OMNT provides access to different "secret" settings in Android phones.
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.
Use the app at your own risk. If you find it useful for your research, please cite the app in publications.


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

## Why use this app

* 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
Expand Down Expand Up @@ -46,75 +51,9 @@ The following permissions are requested:

If the app can't gain Carrier Privileges, some values can't be accessed and some features are disabled. See below.

### Carrier Permissions
Carrier specific settings can only be accessed by apps running with so-called carrier privileges. This was added in android 6 and is mostly relevant
for 4G and 5G networks. (https://source.android.com/devices/tech/config/carrier)

Carrier or researcher who are able (admin key to the SIM card is required) to program their own sim cards can store a fingerprint of an signing certificate in an access rule applet (ARA-M) on the SIM card.
An app signed with this certificate will get carrier privileges granted by android. (https://source.android.com/devices/tech/config/uicc)

E.g. the [ARAM-Applet by Bertrand Martel](https://github.com/bertrandmartel/aram-applet) for JavaCard based SIM cards can be used.
Some SIM cards like the cards from [Sysmocom](http://shop.sysmocom.de/products/sysmoISIM-SJA2) already come with the applet pre installed.
To install the applet to a SIM card [GlobalPlatformPro by Martin Paljak](https://github.com/martinpaljak/GlobalPlatformPro) can be used.
Pre-compiled versions of ARA-M and GP can be found in the [CoIMS_Wiki repository by Supreeth Herle](https://github.com/herlesupreeth/CoIMS_Wiki).

To provision the fingerprint to the applet, either (pySim)[https://github.com/osmocom/pysim] or GP can be used.

With pySim it can be done by entering the following commands into pySim-shell:

start pySim shell with an PSCD attached reader
```
python3 pySim-shell.py -p0 -a <admin key>
or if you have a csv file with ICCID and admin pin:
python3 pySim-shell.py -p0 --csv card_data.csv
```

Provision the fingerprint. Note that instead of a fingerprint also a valid android App ID can be used.
If you have a SIM Card with the ARA-M applet from sysmocom you can skip the 'verify_adm' part as the applet is not write protected.
```shell
verify_adm
select ADF.ARA-M
aram_delete_all
aram_store_ref_ar_do --aid ffffffffffff --device-app-id E849B63A7B96E571F788FC5845C4AA3C520D18E8 --android-permissions 0000000000000001
```
(this assumes the credentials to access the card are stored in the pySim format.)
### Signing the app
This can be done with android studio.
To generated a signed apk:
```
Go to 'build' -> 'Generate signed Bundle/APK'
You will be ask to generate a new key or import an existing one.
Click through the dialogs until you end up with a signed APK
```
To sign the debug apks used for development
```
Go to 'file' -> Project Structure -> Modules
Select the 'app', select the 'Signing config' tab.
create a new signing config referencing you key file
```
You can also manually re-sign the downloaded .apk file using apksigner https://developer.android.com/tools/apksigner .
```shell
apksigner sign --ks my.keystore OpenMobileNetworkToolkit.apk
```
where my.keystore is your java keystore.

## SPDX-SBOM
The SPDX formatted Software Bill Of Material is a machine readable list of all software components used in the app.
To generate a new file run
The SPDX formatted ```Software Bill Of Material``` is a machine readable list of all software components used in the app. To generate a new file run
```shell
./gradlew app:spdxSbomForRelease
```
## iPerf3
iPerf3 has been compiled with a [jni](https://developer.android.com/training/articles/perf-jni) interface to enable OMNT to call it using the specified parameters.
To see how to integrate iPerf3 into your app, look at [iPerf3 Repo](https://github.com/omnt/iperf)
![iPerf3](screenshots/iperf3.png)
## Network Slicing
This function is still under development and requires support from the core network.
```
43 changes: 29 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
plugins {
id 'com.android.application'
id 'androidx.navigation.safeargs'
id("org.spdx.sbom") version "0.7.0"
id("org.spdx.sbom") version "0.8.0"
}

def keystoreProperties = new Properties()
Expand All @@ -24,6 +24,14 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties['storePassword'] = "omnt2024"
}

def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = stdout
}
return stdout.toString().trim()
}

android {
signingConfigs {
Expand All @@ -33,16 +41,23 @@ android {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
release{
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

compileSdk 34

defaultConfig {
applicationId "de.fraunhofer.fokus.OpenMobileNetworkToolkit"
//targetSdkPreview "VanillaIceCream"
minSdk 31
targetSdk 34
versionCode 2
versionName "0.2"
versionCode 3
versionName "0.3"
resValue("string", "git_hash", getGitHash())

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.debug
Expand Down Expand Up @@ -72,13 +87,13 @@ android {
}
buildFeatures {
viewBinding true
buildConfig = true
}
namespace 'de.fraunhofer.fokus.OpenMobileNetworkToolkit'
ndkVersion '25.2.9519653'
lint {
abortOnError false
}
buildToolsVersion '34.0.0'
}

spdxSbom {
Expand All @@ -87,7 +102,7 @@ spdxSbom {
configurations = ['releaseRuntimeClasspath']
scm {
uri.set("https://github.com/omnt/OpenMobileNetworkToolkit")
revision.set("0.2")
revision.set("0.3")
}
document {
name.set("OpenMobileNetworkToolkit")
Expand All @@ -106,13 +121,13 @@ dependencies {

implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
implementation 'androidx.concurrent:concurrent-futures:1.2.0'
implementation 'androidx.activity:activity:1.9.0'
implementation 'androidx.fragment:fragment:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.fragment:fragment:1.8.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.7.7'
implementation 'androidx.navigation:navigation-ui:2.7.7'
Expand All @@ -123,10 +138,10 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
implementation 'com.influxdb:influxdb-client-java:7.0.0'
implementation 'com.google.android.gms:play-services-location:21.2.0'
implementation 'com.influxdb:influxdb-client-java:7.1.0'
implementation 'com.google.android.gms:play-services-location:21.3.0'
implementation 'com.github.anastr:speedviewlib:1.6.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "androidx.viewpager2:viewpager2:1.1.0"
}

configurations.implementation {
Expand Down
4 changes: 2 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontskipnonpubliclibraryclasses
-dontobfuscate
-forceprocessing
-optimizationpasses 5

-keep class * extends android.app.Activity
-keep class com.influxdb.**

-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
<service
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.LoggingService"
android:foregroundServiceType="location" />
<service
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.Ping.PingService" />


<service android:name="androidx.work.impl.foreground.SystemForegroundService" android:foregroundServiceType="specialUse">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,22 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
super.onViewCreated(view, savedInstanceState);
TextView about_text = requireView().findViewById(R.id.about_text_box);
about_text.setAutoLinkMask(Linkify.WEB_URLS);
about_text.setTextIsSelectable(true);
about_text.append(getString(R.string.appinfo));
about_text.append("\n\n");
about_text.append("https://omnt.app\n");
about_text.append("https://github.com/omnt/OpenMobileNetworkToolkit");
about_text.append("\n\nThird party software used in this app: \n \n");
about_text.append(
"The InfluxDB 2.x JVM Based Client is released under the MIT License. \nhttps://github.com/influxdata/influxdb-client-java");
about_text.append("\n\n");
about_text.append(
"iPerf3 is licensed under a BSD style license. \nhttps://github.com/esnet/iperf");

about_text.append("\n\n");
about_text.append("Version Code: " + BuildConfig.VERSION_CODE + "\nVersion Name: " + BuildConfig.VERSION_NAME + "\n");
about_text.append("Build Type: " + BuildConfig.BUILD_TYPE + "\n");
about_text.append("GitHash: " + getString(R.string.git_hash) + "\n");
about_text.append("SigningHash sha256: " + GlobalVars.getInstance().getSigning_hash() + "\n");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public class DataProvider extends PhoneStateListener implements LocationListener
private List<NetworkInterfaceInformation> nii = new ArrayList<>();
private ArrayList<SignalStrengthInformation> ssi = new ArrayList<>();
private SliceInformation si = new SliceInformation();
private PingInformation pi = new PingInformation();
// Time stamp, should be updated on each update of internal data caches
private long ts = System.currentTimeMillis();
private LocationCallback locationCallback;
Expand Down
Loading

0 comments on commit 129772c

Please sign in to comment.