Skip to content

Commit 0df5d1a

Browse files
committed
First open release
1 parent 2291702 commit 0df5d1a

Some content is hidden

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

52 files changed

+4982
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 29
5+
defaultConfig {
6+
applicationId "com.atcnetz.de.notification"
7+
minSdkVersion 21
8+
targetSdkVersion 29
9+
versionCode 72
10+
versionName = versionCode
11+
}
12+
buildTypes {
13+
release {
14+
minifyEnabled true
15+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
16+
}
17+
}
18+
}
19+
20+
dependencies {
21+
implementation fileTree(dir: 'libs', include: ['*.jar'])
22+
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
23+
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
24+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
25+
implementation "org.permissionsdispatcher:permissionsdispatcher:4.3.1"
26+
annotationProcessor "org.permissionsdispatcher:permissionsdispatcher-processor:4.3.1"
27+
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:3.0.1"
28+
implementation 'com.google.android.material:material:1.1.0'
29+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.atcnetz.de.notification">
4+
5+
<uses-permission android:name="android.permission.BLUETOOTH" />
6+
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
7+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
8+
<uses-permission android:name = "android.permission.WRITE_EXTERNAL_STORAGE"/>
9+
<uses-permission android:name = "android.permission.READ_EXTERNAL_STORAGE"/>
10+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
11+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
12+
<uses-permission android:name="android.permission.VIBRATE"/>
13+
<uses-permission android:name="android.permission.INTERNET" />
14+
<uses-feature
15+
android:name="android.hardware.bluetooth_le"
16+
android:required="true" />
17+
18+
<application
19+
android:allowBackup="true"
20+
android:usesCleartextTraffic="true"
21+
android:requestLegacyExternalStorage="true"
22+
android:icon="@drawable/ic_launcher"
23+
android:label="D6 Notification"
24+
android:supportsRtl="true"
25+
android:theme="@style/AppTheme">
26+
<activity
27+
android:windowSoftInputMode="stateHidden"
28+
android:name=".Settings"
29+
android:label="Settings" />
30+
<activity
31+
android:windowSoftInputMode="stateHidden"
32+
android:name=".httplogset"
33+
android:label="HTTP/Log Settings" />
34+
<activity
35+
android:windowSoftInputMode="stateHidden"
36+
android:name=".app_filter"
37+
android:label="App Notification filter" />
38+
<activity
39+
android:name=".NofiticationPicker"
40+
android:label="Notification Picker" />
41+
42+
<service
43+
android:name=".BLEservice"
44+
android:enabled="true"
45+
android:exported="true" />
46+
47+
<activity
48+
android:name=".ScanActivity"
49+
android:label="D6 BLE Scanner" />
50+
51+
<service
52+
android:name=".NifityService"
53+
android:enabled="true"
54+
android:exported="true"
55+
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
56+
<intent-filter>
57+
<action android:name="android.service.notification.NotificationListenerService" />
58+
</intent-filter>
59+
</service>
60+
61+
<activity android:name=".MainActivity">
62+
<intent-filter>
63+
<action android:name="android.intent.action.MAIN" />
64+
65+
<category android:name="android.intent.category.LAUNCHER" />
66+
</intent-filter>
67+
</activity>
68+
</application>
69+
70+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.atcnetz.de.notification;
2+
3+
import android.content.Context;
4+
import android.graphics.drawable.Drawable;
5+
import android.view.LayoutInflater;
6+
import android.view.View;
7+
import android.view.ViewGroup;
8+
import android.widget.ArrayAdapter;
9+
import android.widget.CheckBox;
10+
import android.widget.ImageView;
11+
import android.widget.TextView;
12+
import com.atcnetz.de.notification.util.Apps;
13+
14+
import java.util.List;
15+
16+
public class AppAdapter extends ArrayAdapter<Apps> {
17+
private List<Apps> mList;
18+
private LayoutInflater mInflater;
19+
private int mResId;
20+
21+
public AppAdapter(Context context, int resId, List<Apps> objects) {
22+
super(context, resId, objects);
23+
mResId = resId;
24+
mList = objects;
25+
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
26+
}
27+
28+
@Override
29+
public View getView(int position, View convertView, ViewGroup parent) {
30+
Apps item = (Apps) getItem(position);
31+
32+
if (convertView == null) {
33+
convertView = mInflater.inflate(mResId, null);
34+
}
35+
TextView name = (TextView) convertView.findViewById(R.id.device_name);
36+
assert item != null;
37+
name.setText(item.getAppName());
38+
TextView address = (TextView) convertView.findViewById(R.id.device_address);
39+
address.setText(item.getDisplayName());
40+
ImageView iconview = (ImageView) convertView.findViewById(R.id.app_icon);
41+
iconview.setImageDrawable(item.getIcon());
42+
CheckBox checkBox = (CheckBox) convertView.findViewById(R.id.checkBox);
43+
checkBox.setChecked(item.getIsChecked());
44+
return convertView;
45+
}
46+
47+
public void setChecked(View convertView, boolean checked){
48+
if (convertView == null) {
49+
convertView = mInflater.inflate(mResId, null);
50+
}
51+
CheckBox checkBox = convertView.findViewById(R.id.checkBox);
52+
checkBox.setChecked(checked);
53+
}
54+
/** add or update BluetoothDevice */
55+
public void update(String packageName, Drawable appIcon,String appName,boolean isChecked) {
56+
if (packageName == null) {
57+
return;
58+
}
59+
mList.add(new Apps(packageName, appIcon,appName,isChecked));
60+
}
61+
/** add or update BluetoothDevice */
62+
public void updateReal() {
63+
notifyDataSetChanged();
64+
}
65+
}

0 commit comments

Comments
 (0)