Skip to content

Commit

Permalink
Merge pull request #4 from BernhardRo/NotificationListener
Browse files Browse the repository at this point in the history
including NotificationListener
  • Loading branch information
BernhardRo committed Jan 31, 2024
2 parents 3f6b9af + c5fc4bc commit fb8ca72
Show file tree
Hide file tree
Showing 67 changed files with 1,384 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

5 changes: 2 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Esel
There are two different methods how to access the readings from Eversense:
* Companion mode, which reads the data from the Eversense notifications (works with the standard Eversense App)
* Patched mode, which requires a patched version of the Eversense App (works completely offline, including backfilling)

First of all, you need to install ESEL:
1. Get the ESEL apk e.g. from https://github.com/BernhardRo/Esel/tree/master/apk
2. Install the apk on your phone
* You need to enable installation of Apps from unknown sources
3. Configuration:
* Allow ESEL to run in the background (it will ask for it)
* Allow ESEL access to the Android Notifications (it will ask for it)
* Upload to Nightscout: Activate "Send to NightScout" in the preferences. It needs a configured AndroidAPS with internal NSClient or NSClient itself installed on the same phone
* Inter-App-Broadcasts: Activate "Send to AAPS and xDrip". In xDrip and/or AndroidAPS activate the input method "640g/Eversense".
* "Smooth Data" applies a smoothing algorithm to the raw values and provides these smoothed values instead of the raw readings. Smoothing is per default disabled.

## Companion Mode
1. Install/use the official Eversense App from the Google Play Store
* Optional, but required for backfilling: Login to your Eversense account with your login data
* In Sync, enable Auto synchronization
3. Configuration of ESEL:
* Disable the setting "Get data from patched Eversense App"
* For backfilling: Enable "Fill missing data from eversensedms.com"
* Provide as Email address and password your Eversense login data

## Patched Eversense App
1. Uninstall the Eversense App (Warning: your local historical data (older than 1 week) will be lost!)
2. Install the patched Eversense app (mod_com.senseonics.gen12androidapp-release.apk) and use it as described by the vendor
2. Install the patched Eversense app (e.g. get it from https://cr4ck3d3v3r53n53.club) and use it as described by the vendor
* You need to enable installation of Apps from unknown sources
* Start the Eversense App, login, connect to your transmitter and use it just like the normal app.
3. Build https://github.com/BernhardRo/Esel and install it on your phone.
4. Configuration:
* Allow ESEL to run in the background (it will ask for it)
* Upload to Nightscout: Activate "Send to NightScout" in the preferences. It needs a configured AndroidAPS with internal NSClient or NSClient itself installed on the same phone
* Inter-App-Broadcasts: Activate "Send to AAPS and xDrip". In xDrip and/or AndroidAPS activate the input method "640g/Eversense".
* "Smooth Data" applies a smoothing algorithm to the raw values and provides these smoothed values instead of the raw readings. Smoothing is per default disabled.
* For feedback contact @BernhardRo
4. For the modification of the Eversense App, see: https://github.com/BernhardRo/Esel/wiki/How-to-modify-the-Android-Eversense-App
3. Configuration of ESEL:
* Enable the setting "Get data from patched Eversense App"

If you run esel with a fresh installation of Eversense for the first time, it can take up to 15min until your first values appear in xDrip!
Binary file added apk/esel_241.apk
Binary file not shown.
Binary file added apk/esel_301.apk
Binary file not shown.
28 changes: 17 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdk 30
defaultConfig {
applicationId "esel.esel.esel"
minSdkVersion 22
targetSdkVersion 25
minSdk 26
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -17,16 +16,23 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'esel.esel.esel'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.retrofit2:adapter-guava:2.9.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.squareup.retrofit2:retrofit-converters:2.8.1'
implementation 'com.squareup.retrofit2:adapter-guava:2.9.0'
implementation 'com.squareup.retrofit2:adapter-guava:2.9.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
testImplementation 'junit:junit:4.13.2'
}
Binary file modified app/debug/app-debug.apk
Binary file not shown.
Binary file removed app/debug/esel.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/debug/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "esel.esel.esel",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-debug.apk"
}
],
"elementType": "File"
}
1 change: 0 additions & 1 deletion app/debug/output.json

This file was deleted.

30 changes: 21 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="esel.esel.esel">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<application
android:name=".Esel"
android:allowBackup="true"
Expand All @@ -27,11 +28,9 @@
</activity>

<activity android:name=".preferences.Preferences"></activity>
<activity android:name=".ErrorsActivity"
<activity android:name=".LogActivity"
android:theme="@style/AppTheme.NoActionBar">
</activity>


<receiver android:name=".receivers.ReadReceiver" />
<receiver android:name=".receivers.KeepAliveReceiver" />

Expand All @@ -41,8 +40,21 @@
</intent-filter>
</receiver>



<service
android:name=".datareader.EsNotificationListener"
android:exported="true"
android:label="@string/EsNotificationListener_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
<meta-data android:name="android.service.notification.notification_listener_service" android:value=".datareader.EsNotificationListener" />
</service>
</application>

<queries>
<package android:name="com.senseonics.gen12androidapp"/>
<package android:name="com.senseonics.androidapp"/>
<package android:name="com.eveningoutpost.dexdrip"/>
<package android:name="info.nightscout.androidaps"/>
</queries>
</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 0 additions & 47 deletions app/src/main/java/esel/esel/esel/ErrorsActivity.java

This file was deleted.

47 changes: 47 additions & 0 deletions app/src/main/java/esel/esel/esel/LogActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package esel.esel.esel;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import esel.esel.esel.util.SP;

public class LogActivity extends MenuActivity {

private static TextView textViewValue;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupView(R.layout.activity_errors);
textViewValue = (TextView) findViewById(R.id.textview_main);
String msg = SP.getString("logging","");
textViewValue.setText(msg);
}
public static void addLog(String type,String tag, String value){
String msg = SP.getString("logging","");
int lines_limit = 500;
String[] lines = msg.split("\n");
if(lines.length>lines_limit){
int limit_to = (int)(lines_limit * 0.7);
StringBuilder strbuild = new StringBuilder();
for (int i = 0; i<limit_to; i++){
strbuild = new StringBuilder(strbuild + lines[i] + "\n");
}
msg = strbuild.toString();
}
LocalDateTime currentTime = LocalDateTime.now();
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String line = currentTime.format(format) + ": "+type + " " +value;
msg = line + "\n" + msg;
SP.putString("logging",msg);

if(textViewValue != null){
textViewValue.setText(msg);
}
}

}
Loading

0 comments on commit fb8ca72

Please sign in to comment.