16 |
17 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2024 Daniel Saynov
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Notification Listener App
2 |
3 | ### Overview
4 | This Android application enhances user experience by filtering and highlighting important notifications. It allows users to specify a sound effect and a keyword. When enabled, the app monitors notifications from selected apps for occurrences of the keyword. Upon detection, it replaces the default notification sound with the user-selected sound, ensuring important notifications are never overlooked.
5 |
6 | ### Features
7 | - **Keyword Detection:** Specify a keyword that the app will watch for in incoming notifications.
8 | - **Custom Sound Effects:** Choose a unique sound effect to play when the keyword is detected.
9 | - **Selective Listening:** Select which apps the listener should monitor for notifications.
10 | - **Enhanced Notification Management:** Ensures that notifications containing the keyword stand out from others.
11 |
12 | ### Usage
13 | 1. **Select Sound Effect:** Choose a preferred sound effect for notifications.
14 | 2. **Set Keyword:** Enter a specific keyword that the app will search for in notifications.
15 | 3. **Choose Apps:** Select the apps from which notifications should be monitored.
16 | 4. **Activate Listener:** Enable the app's listener to start monitoring incoming notifications.
17 | 5. **Permission Requirements:** Make sure to enable necessary permissions for the app to function properly.
18 |
19 | ### Download
20 | - **F-Droid:** You can download the latest version of the app from [F-Droid](https://f-droid.org/en/packages/com.example.notificationalerter/).
21 |
22 | ### Purpose
23 | This app aims to improve user productivity by prioritizing important notifications and reducing distractions from less critical alerts. It ensures that users are promptly notified of crucial information, making daily smartphone use more efficient and focused.
24 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | dependenciesInfo {
8 | // Disables dependency metadata when building APKs.
9 | includeInApk = false
10 | // Disables dependency metadata when building Android App Bundles.
11 | includeInBundle = false
12 | }
13 |
14 | namespace 'com.example.notificationalerter'
15 | compileSdk 35
16 |
17 | defaultConfig {
18 | applicationId "com.example.notificationalerter"
19 | minSdk 28
20 | targetSdk 35
21 | versionCode 2
22 | versionName "1.1.0"
23 |
24 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
25 | }
26 |
27 | buildTypes {
28 | release {
29 | minifyEnabled true
30 | vcsInfo.include false
31 | }
32 | }
33 | kotlinOptions {
34 | jvmTarget = "1.8" // Make sure Kotlin targets JVM 1.8
35 | }
36 | }
37 |
38 | dependencies {
39 | implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.21"
40 | implementation 'androidx.appcompat:appcompat:1.7.0'
41 | implementation 'com.google.android.material:material:1.12.0'
42 | implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
43 | testImplementation 'junit:junit:4.13.2'
44 | androidTestImplementation 'androidx.test.ext:junit:1.2.1'
45 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
46 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
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/releases/download/v1.0.1/alertly-1.0.1.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/releases/download/v1.0.1/alertly-1.0.1.apk
--------------------------------------------------------------------------------
/app/releases/download/v1.1.0/alertly-1.1.0.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/releases/download/v1.1.0/alertly-1.1.0.apk
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/com/example/notificationalerter/AppAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.example.notificationalerter
2 |
3 | import android.content.Context
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.CheckBox
9 | import android.widget.CompoundButton
10 | import android.widget.ImageView
11 | import android.widget.TextView
12 |
13 | class AppAdapter(context: Context?, private val appList: List) : ArrayAdapter(context!!, 0, appList) {
14 | private val inflater: LayoutInflater = LayoutInflater.from(context)
15 | private var listener: OnCheckedChangeListener? = null
16 |
17 | fun setOnCheckedChangeListener(listener: OnCheckedChangeListener?) {
18 | this.listener = listener
19 | }
20 |
21 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
22 | var convertView = convertView
23 | val holder: ViewHolder
24 | if (convertView == null) {
25 | convertView = inflater.inflate(R.layout.list_item_app, parent, false)
26 | holder = ViewHolder()
27 | holder.iconImageView = convertView.findViewById(R.id.icon_image_view)
28 | holder.nameTextView = convertView.findViewById(R.id.name_text_view)
29 | holder.checkBox = convertView.findViewById(R.id.checkbox)
30 | convertView.setTag(holder)
31 | } else {
32 | holder = convertView.tag as ViewHolder
33 | }
34 |
35 | val appInfo = appList[position]
36 |
37 | holder.iconImageView!!.setImageDrawable(appInfo.icon)
38 | holder.nameTextView!!.text = appInfo.name
39 |
40 | holder.checkBox!!.setOnCheckedChangeListener(null)
41 | holder.checkBox!!.isChecked = appInfo.isChecked
42 | holder.checkBox!!.setOnCheckedChangeListener { compoundButton: CompoundButton?, isChecked: Boolean ->
43 | appInfo.isChecked = isChecked
44 | if (listener != null) {
45 | listener!!.onCheckedChange(appInfo.packageName, isChecked)
46 | }
47 | }
48 |
49 | return convertView!!
50 | }
51 |
52 | internal class ViewHolder {
53 | var iconImageView: ImageView? = null
54 | var nameTextView: TextView? = null
55 | var checkBox: CheckBox? = null
56 | }
57 |
58 | interface OnCheckedChangeListener {
59 | fun onCheckedChange(packageName: String?, isChecked: Boolean)
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/com/example/notificationalerter/AppInfo.kt:
--------------------------------------------------------------------------------
1 | package com.example.notificationalerter
2 |
3 | import android.graphics.drawable.Drawable
4 |
5 | // This is the info of each listed app
6 | class AppInfo {
7 | @JvmField
8 | var name: String? = null
9 | @JvmField
10 | var packageName: String? = null
11 | @JvmField
12 | var icon: Drawable? = null
13 | var isChecked: Boolean = false
14 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/com/example/notificationalerter/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.notificationalerter
2 |
3 | import android.app.NotificationChannel
4 | import android.app.NotificationManager
5 | import android.content.ComponentName
6 | import android.content.Intent
7 | import android.content.pm.PackageManager
8 | import android.media.RingtoneManager
9 | import android.net.Uri
10 | import android.os.Build
11 | import android.os.Bundle
12 | import android.preference.PreferenceManager
13 | import android.provider.Settings
14 | import android.view.View
15 | import android.widget.Button
16 | import android.widget.EditText
17 | import android.widget.ListView
18 | import android.widget.Toast
19 | import androidx.appcompat.app.AppCompatActivity
20 |
21 | class MainActivity : AppCompatActivity() {
22 | private var toggleListenerButton: Button? = null
23 | private var appListView: ListView? = null
24 | private var appAdapter: AppAdapter? = null
25 | private var isListenerEnabled = false
26 | private var searchInput: EditText? = null
27 |
28 | private var chooseNotificationButton: Button? = null
29 |
30 | override fun onCreate(savedInstanceState: Bundle?) {
31 | super.onCreate(savedInstanceState)
32 | setContentView(R.layout.activity_main)
33 |
34 | toggleListenerButton = findViewById(R.id.toggle_listener_button)
35 | appListView = findViewById(R.id.app_list_view)
36 | searchInput = findViewById(R.id.search_input)
37 | chooseNotificationButton = findViewById(R.id.choose_notification_button)
38 |
39 | isListenerEnabled = false
40 |
41 | toggleListenerButton?.setOnClickListener(View.OnClickListener { toggleListener() })
42 |
43 | chooseNotificationButton?.setOnClickListener(View.OnClickListener { openNotificationSoundPicker() })
44 |
45 | appAdapter = AppAdapter(this, installedApps)
46 | appAdapter!!.setOnCheckedChangeListener(object : AppAdapter.OnCheckedChangeListener {
47 | override fun onCheckedChange(packageName: String?, isChecked: Boolean) {
48 | if (packageName != null) {
49 | if (isChecked) {
50 | MyNotificationListenerService.addSelectedApp(packageName)
51 | // Toast.makeText(this@MainActivity, "Selected: $packageName", Toast.LENGTH_SHORT).show()
52 | } else {
53 | MyNotificationListenerService.removeSelectedApp(packageName)
54 | // Toast.makeText(this@MainActivity, "Deselected: $packageName", Toast.LENGTH_SHORT).show()
55 | }
56 | }
57 | }
58 | })
59 | appListView?.setAdapter(appAdapter)
60 |
61 | if (isNotificationAccessGranted) {
62 | toggleListenerButton?.setVisibility(View.VISIBLE)
63 | } else {
64 | toggleListenerButton?.setVisibility(View.GONE)
65 | requestNotificationAccessPermission()
66 | }
67 |
68 | // Retrieve the selected sound URI from SharedPreferences
69 | val preferences = PreferenceManager.getDefaultSharedPreferences(this)
70 | val selectedSoundUriString = preferences.getString(PREF_SELECTED_SOUND_URI, null)
71 | if (selectedSoundUriString != null) {
72 | val selectedSoundUri = Uri.parse(selectedSoundUriString)
73 | MyNotificationListenerService.customSoundUri = selectedSoundUri
74 | }
75 |
76 | createNotificationChannel()
77 | }
78 |
79 | private val installedApps: List
80 | get() {
81 | val appList: MutableList = ArrayList()
82 | val packageManager = packageManager
83 | val applications = packageManager.getInstalledApplications(PackageManager.GET_META_DATA)
84 | val appPackageName = packageName
85 |
86 | for (applicationInfo in applications) {
87 | val packageName = applicationInfo.packageName
88 |
89 | // Exclude the app itself
90 | if (packageName != appPackageName && isLaunchable(packageManager, packageName)) {
91 | val appInfo = AppInfo()
92 | appInfo.packageName = packageName
93 | appInfo.name = applicationInfo.loadLabel(packageManager).toString()
94 | appInfo.icon = applicationInfo.loadIcon(packageManager)
95 | appList.add(appInfo)
96 | }
97 | }
98 |
99 | return appList
100 | }
101 |
102 | private fun isLaunchable(packageManager: PackageManager, packageName: String): Boolean {
103 | val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
104 | return launchIntent != null
105 | }
106 |
107 | private fun requestNotificationAccessPermission() {
108 | val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS)
109 | startActivityForResult(intent, REQUEST_NOTIFICATION_ACCESS)
110 | }
111 |
112 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
113 | super.onActivityResult(requestCode, resultCode, data)
114 |
115 | if (requestCode == REQUEST_NOTIFICATION_ACCESS) {
116 | if (isNotificationAccessGranted) {
117 | toggleListenerButton!!.visibility = View.VISIBLE
118 | } else {
119 | Toast.makeText(this, "Notification access not granted", Toast.LENGTH_SHORT).show()
120 | }
121 | } else if (requestCode == REQUEST_SOUND_PICKER) {
122 | if (resultCode == RESULT_OK) {
123 | val selectedSoundUri = data!!.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI)
124 | if (selectedSoundUri != null) {
125 | // Save the selected sound URI to SharedPreferences
126 | val preferences = PreferenceManager.getDefaultSharedPreferences(this)
127 | val editor = preferences.edit()
128 | editor.putString(PREF_SELECTED_SOUND_URI, selectedSoundUri.toString())
129 | editor.apply()
130 |
131 | // Handle the selected sound URI here
132 | // You can save it or use it to set the notification sound for your app
133 | MyNotificationListenerService.customSoundUri = selectedSoundUri
134 | Toast.makeText(this, "Sound selected", Toast.LENGTH_SHORT).show()
135 | }
136 | } else {
137 | Toast.makeText(this, "No sound selected", Toast.LENGTH_SHORT).show()
138 | }
139 | }
140 | }
141 |
142 | private val isNotificationAccessGranted: Boolean
143 | get() {
144 | val cn = ComponentName(this, MyNotificationListenerService::class.java)
145 | val flat = Settings.Secure.getString(contentResolver, "enabled_notification_listeners")
146 | return flat != null && flat.contains(cn.flattenToString())
147 | }
148 |
149 | private fun toggleListener() {
150 | if (isListenerEnabled) {
151 | stopListener()
152 | } else {
153 | startListener()
154 | }
155 | }
156 |
157 | private fun startListener() {
158 | toggleListenerButton!!.text = "Stop Listener"
159 | isListenerEnabled = true
160 | Toast.makeText(this, "Listener started", Toast.LENGTH_SHORT).show()
161 |
162 | // Get the search word from the input field
163 | val searchWord = searchInput!!.text.toString().trim { it <= ' ' }
164 |
165 | // Pass the search word to the notification listener service
166 | MyNotificationListenerService.setSearchWord(searchWord)
167 |
168 | // Start the notification listener service
169 | startService(Intent(this, MyNotificationListenerService::class.java))
170 | }
171 |
172 | private fun stopListener() {
173 | toggleListenerButton!!.text = "Start Listener"
174 | isListenerEnabled = false
175 | Toast.makeText(this, "Listener stopped", Toast.LENGTH_SHORT).show()
176 |
177 | // Stop the notification listener service
178 | stopService(Intent(this, MyNotificationListenerService::class.java))
179 | // (applicationContext as MyNotificationListenerService).onListenerDisconnected() // Explicitly call it
180 | // finishAffinity() // This will finish all activities and close the app properly
181 | MyNotificationListenerService.setSearchWord(null)
182 | }
183 |
184 | private fun createNotificationChannel() {
185 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
186 | val name: CharSequence = "Alerter Channel"
187 | val description = "Channel for alerter notifications"
188 | val importance = NotificationManager.IMPORTANCE_HIGH
189 |
190 | val channel = NotificationChannel(NOTIFICATION_CHANNEL_ID, name, importance)
191 | channel.description = description
192 |
193 | val notificationManager = getSystemService(NotificationManager::class.java)
194 | notificationManager.createNotificationChannel(channel)
195 | }
196 | }
197 |
198 | private fun openNotificationSoundPicker() {
199 | val intent = Intent(RingtoneManager.ACTION_RINGTONE_PICKER)
200 | intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION)
201 | intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Notification Sound")
202 | intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, null as Uri?)
203 | startActivityForResult(intent, REQUEST_SOUND_PICKER)
204 | }
205 |
206 | companion object {
207 | private const val REQUEST_NOTIFICATION_ACCESS = 1
208 | private const val REQUEST_SOUND_PICKER = 2
209 | private const val NOTIFICATION_CHANNEL_ID = "alerter_channel_id"
210 |
211 | private const val PREF_SELECTED_SOUND_URI = "selected_sound_uri"
212 | }
213 | }
214 |
215 |
216 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/com/example/notificationalerter/MyNotificationListenerService.kt:
--------------------------------------------------------------------------------
1 | package com.example.notificationalerter
2 |
3 | import android.R
4 | import android.app.Notification
5 | import android.app.NotificationChannel
6 | import android.app.NotificationManager
7 | import android.app.PendingIntent
8 | import android.content.Intent
9 | import android.media.AudioAttributes
10 | import android.media.AudioManager
11 | import android.media.RingtoneManager
12 | import android.net.Uri
13 | import android.os.Build
14 | import android.service.notification.NotificationListenerService
15 | import android.service.notification.StatusBarNotification
16 | import android.util.Log
17 | import androidx.annotation.RequiresApi
18 | import androidx.core.app.NotificationCompat
19 | import androidx.core.app.NotificationManagerCompat
20 | import com.example.notificationalerter.MainActivity
21 | import java.util.Locale
22 |
23 | @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
24 | class MyNotificationListenerService : NotificationListenerService() {
25 | override fun onCreate() {
26 | super.onCreate()
27 | Log.d(TAG, "NotificationListenerService onCreate")
28 | createNotificationChannel()
29 | }
30 |
31 | override fun onDestroy() {
32 | super.onDestroy()
33 | searchWord = null
34 | stopListening()
35 | Log.d(TAG, "NotificationListenerService onDestroy")
36 | }
37 |
38 | override fun onListenerConnected() {
39 | super.onListenerConnected()
40 | Log.d(TAG, "NotificationListenerService onListenerConnected")
41 |
42 | // Service is connected, start listening to notifications
43 | startListening()
44 | }
45 |
46 | override fun onListenerDisconnected() {
47 | super.onListenerDisconnected()
48 | Log.d(TAG, "NotificationListenerService onListenerDisconnected")
49 |
50 | // Service is disconnected, stop listening to notifications
51 | stopListening()
52 | }
53 |
54 | override fun onNotificationPosted(sbn: StatusBarNotification) {
55 | super.onNotificationPosted(sbn)
56 | Log.d(TAG, "Notification posted: " + sbn.packageName)
57 |
58 | val packageName = sbn.packageName
59 | if (isAppSelected(packageName)) {
60 | val title = sbn.notification.extras.getString(Notification.EXTRA_TITLE)
61 | val text = sbn.notification.extras.getString(Notification.EXTRA_TEXT)
62 | Log.d(TAG, "Title: $title")
63 | Log.d(TAG, "Text: $text")
64 |
65 | if (containsSearchWord(text)) {
66 | if (customSoundUri != null) {
67 | playCustomNotificationSound(customSoundUri)
68 | } else {
69 | playDefaultNotificationSound()
70 | }
71 |
72 | sendNotificationBroadcast(packageName, title, text)
73 | }
74 | }
75 | }
76 |
77 | private fun containsSearchWord(text: String?): Boolean {
78 | if (searchWord == null || searchWord!!.isEmpty()) {
79 | return false
80 | }
81 |
82 | val words = text!!.lowercase(Locale.getDefault()).split("\\W+".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
83 | val lowercaseSearchWord = searchWord!!.lowercase(Locale.getDefault())
84 | for (word in words) {
85 | if (word == lowercaseSearchWord) {
86 | return true
87 | }
88 | }
89 |
90 | return false
91 | }
92 |
93 |
94 | private fun isAppSelected(packageName: String): Boolean {
95 | return selectedApps.contains(packageName)
96 | }
97 |
98 | private fun containsSearchWord(sbn: StatusBarNotification): Boolean {
99 | if (searchWord == null || searchWord!!.isEmpty()) {
100 | return true
101 | }
102 |
103 | val title = sbn.notification.extras.getString(Notification.EXTRA_TITLE)
104 | val text = sbn.notification.extras.getString(Notification.EXTRA_TEXT)
105 |
106 | return ((title != null && title.lowercase(Locale.getDefault()).contains(searchWord!!.lowercase(Locale.getDefault())))
107 | || (text != null && text.lowercase(Locale.getDefault()).contains(searchWord!!.lowercase(Locale.getDefault()))))
108 | }
109 |
110 | private fun playDefaultNotificationSound() {
111 | try {
112 | val defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
113 | playNotificationSound(defaultSoundUri)
114 | } catch (e: Exception) {
115 | Log.e(TAG, "Error playing default notification sound: " + e.message)
116 | }
117 | }
118 |
119 | private fun playCustomNotificationSound(soundUri: Uri?) {
120 | if (soundUri == null) {
121 | return
122 | }
123 |
124 | try {
125 | playNotificationSound(soundUri)
126 | } catch (e: Exception) {
127 | Log.e(TAG, "Error playing custom notification sound: " + e.message)
128 | }
129 | }
130 |
131 | private fun playNotificationSound(soundUri: Uri) {
132 | try {
133 | val context = applicationContext
134 | val ringtone = RingtoneManager.getRingtone(context, soundUri)
135 |
136 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
137 | ringtone.audioAttributes = AudioAttributes.Builder()
138 | .setUsage(AudioAttributes.USAGE_NOTIFICATION)
139 | .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
140 | .build()
141 | } else {
142 | ringtone.streamType = AudioManager.STREAM_NOTIFICATION
143 | }
144 |
145 | ringtone.play()
146 | } catch (e: Exception) {
147 | Log.e(TAG, "Error playing notification sound: " + e.message)
148 | }
149 | }
150 |
151 | private fun sendNotificationBroadcast(packageName: String, title: String?, text: String?) {
152 | // Create an explicit intent for MainActivity
153 | val intent = Intent(applicationContext, MainActivity::class.java)
154 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
155 |
156 | // Create a PendingIntent for the notification
157 | val pendingIntent = PendingIntent.getActivity(applicationContext, 0, intent, PendingIntent.FLAG_IMMUTABLE)
158 |
159 | // Build the notification
160 | val builder = NotificationCompat.Builder(applicationContext, CHANNEL_ID)
161 | .setSmallIcon(R.drawable.ic_lock_idle_low_battery)
162 | .setContentTitle(title)
163 | .setContentText(text)
164 | .setPriority(NotificationCompat.PRIORITY_DEFAULT)
165 | .setContentIntent(pendingIntent)
166 | .setAutoCancel(true)
167 |
168 | // Get the notification manager
169 | val notificationManager = NotificationManagerCompat.from(applicationContext)
170 |
171 | // Post the notification
172 | notificationManager.notify(NOTIFICATION_ID, builder.build())
173 | }
174 |
175 | private fun startListening() {
176 | setSearchWord(searchWord)
177 | }
178 |
179 | private fun stopListening() {
180 | setSearchWord(null)
181 | }
182 |
183 | private fun createNotificationChannel() {
184 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
185 | val name: CharSequence = "Alerter Channel"
186 | val description = "Channel for alerter notifications"
187 | val importance = NotificationManager.IMPORTANCE_HIGH
188 |
189 | val channel = NotificationChannel(CHANNEL_ID, name, importance)
190 | channel.description = description
191 |
192 | val notificationManager = getSystemService(NotificationManager::class.java)
193 | notificationManager.createNotificationChannel(channel)
194 | }
195 | }
196 |
197 | companion object {
198 | private const val TAG = "NotificationListener"
199 | private const val ACTION_NOTIFICATION_POSTED = "com.example.notificationalerter.NOTIFICATION_POSTED"
200 | private const val EXTRA_SOUND_URI = "sound_uri"
201 |
202 | private val selectedApps: MutableSet = HashSet()
203 | private var searchWord: String? = null
204 | var customSoundUri: Uri? = null
205 |
206 | private const val CHANNEL_ID = "alerter"
207 | private const val NOTIFICATION_ID = 175
208 |
209 | fun addSelectedApp(packageName: String) {
210 | selectedApps.add(packageName)
211 | }
212 |
213 | fun removeSelectedApp(packageName: String) {
214 | selectedApps.remove(packageName)
215 | }
216 |
217 | fun setSearchWord(word: String?) {
218 | searchWord = word
219 | }
220 | }
221 | }
222 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/drawable/logo.jpg
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
21 |
22 |
32 |
33 |
42 |
43 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_app.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
19 |
20 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF000000
4 | #FFFFFFFF
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Alertly
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/src.7z:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/app/src/src.7z
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '8.7.2' apply false
4 | id 'com.android.library' version '8.7.2' apply false
5 | id 'org.jetbrains.kotlin.android' version '2.0.21' apply false // Add this line
6 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
22 | org.gradle.configuration-cache=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat May 27 21:20:48 MSK 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/metadata/en-US/changelogs/2.txt:
--------------------------------------------------------------------------------
1 | 1. Increased SDK version from 33 to 35.
2 | 2. Decreased min SDK version from 31 to 28.
3 | 3. Migrated app to Kotlin.
4 | 4. Removed selected/deselected pop-ups.
5 | 5. Fixed button glitch during first mount.
6 | 6. Fixed stop button
--------------------------------------------------------------------------------
/metadata/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | This Android application is designed to improve user experience by filtering and highlighting important notifications amongst spam. The app scans incoming notifications for a user-defined keyword. Its primary goal is to help users by ensuring they never miss crucial information!
--------------------------------------------------------------------------------
/metadata/en-US/images/featureGraphic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/metadata/en-US/images/featureGraphic.jpg
--------------------------------------------------------------------------------
/metadata/en-US/images/icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/metadata/en-US/images/icon.jpg
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lightningcpu/Alertly/1f14d616ef39c642163b6d786fda6aa0c8f36d16/metadata/en-US/images/phoneScreenshots/1.jpg
--------------------------------------------------------------------------------
/metadata/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | Get notified only of important notifications.
2 |
--------------------------------------------------------------------------------
/metadata/en-US/title.txt:
--------------------------------------------------------------------------------
1 | Alertly
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "Alertly"
16 | include ':app'
17 |
--------------------------------------------------------------------------------