Skip to content

Commit

Permalink
remove query pemission
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky committed Feb 16, 2022
1 parent 53ba90c commit e482fec
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 56 deletions.
2 changes: 1 addition & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Privacy Police
# Privacy Policy

The app has nothing to store.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ Clipboard cleaner.
src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/me.lucky.clipeus/)

[comment]: <> ([<img )

[comment]: <> ( src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" )

[comment]: <> ( alt="Get it on Google Play" )

[comment]: <> ( height="80">]&#40;https://play.google.com/store/apps/details?id=me.lucky.clipeus&#41;)
[<img
src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=me.lucky.clipeus)

<img
src="https://raw.githubusercontent.com/x13a/Clipeus/main/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png"
Expand All @@ -23,12 +19,12 @@ Clipboard cleaner.
Tiny app to clean clipboard.

No UI. Click on the app icon to clean clipboard.
Also you can grant device and app notifications permission to clean clipboard on screen off.
Also you can grant device and app notifications permission to clean clipboard automatically on
screen off.

## Permissions

- Notifications - receive screen off event
- QueryAllPackages - disable notification events for all apps on Android 12 and newer
* NOTIFICATION_LISTENER - receive screen off events (optional)

## License
[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0.en.html)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "me.lucky.clipeus"
minSdk 23
targetSdk 32
versionCode 3
versionName "1.0.2"
versionCode 4
versionName "1.0.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="me.lucky.clipeus">

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
23 changes: 4 additions & 19 deletions app/src/main/java/me/lucky/clipeus/NotificationListenerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.service.notification.NotificationListenerService
import androidx.annotation.RequiresApi

class NotificationListenerService : NotificationListenerService() {
private val screenReceiver = ScreenReceiver()
Expand All @@ -23,28 +22,14 @@ class NotificationListenerService : NotificationListenerService() {

override fun onListenerConnected() {
super.onListenerConnected()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) migrate()
}

@RequiresApi(Build.VERSION_CODES.S)
private fun migrate() {
val packages = packageManager
.getInstalledPackages(0)
.map { it.packageName }
.toMutableSet()
packages.addAll(packageManager
.queryIntentActivities(
Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER),
0,
)
.map{ it.activityInfo.packageName })
migrateNotificationFilter(0, packages.toMutableList())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
migrateNotificationFilter(0, null)
}

private class ScreenReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (context == null || intent?.action != Intent.ACTION_SCREEN_OFF) return
Utils(context).clean(false)
if (intent?.action == Intent.ACTION_SCREEN_OFF)
Utils(context ?: return).clean(false)
}
}
}
6 changes: 1 addition & 5 deletions app/src/main/java/me/lucky/clipeus/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class Utils(private val ctx: Context) {
manager?.setPrimaryClip(ClipData.newPlainText("", ""))
}
if (manager != null && showToast)
Toast.makeText(
ctx,
ctx.getString(R.string.clipboard_cleaned),
Toast.LENGTH_SHORT,
).show()
Toast.makeText(ctx, R.string.clipboard_cleaned, Toast.LENGTH_SHORT).show()
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Clipeus</string>
<string name="service_label">Щит</string>
<string name="service_label">Клинер</string>
<string name="clipboard_cleaned">Буфер обмена очищен</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Clipeus</string>
<string name="service_label">Shield</string>
<string name="service_label">Cleaner</string>
<string name="clipboard_cleaned">Clipboard cleaned</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remove query permission
6 changes: 3 additions & 3 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Tiny app to clean clipboard.

No UI. Click on the app icon to clean clipboard.
Also you can grant device and app notifications permission to clean clipboard on screen off.
Also you can grant device and app notifications permission to clean clipboard automatically on
screen off.

Permissions:
* Notifications - receive screen off event
* QueryAllPackages - disable notification events for all apps on Android 12 and newer
* NOTIFICATION_LISTENER - receive screen off events (optional)

It is Free Open Source Software.
License: GPL-3
8 changes: 3 additions & 5 deletions fastlane/metadata/android/ru-RU/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Минимальное приложение для очистки буфера обмена.

Без пользовательского интерфейса. Нажмите на иконку приложения, чтобы очистить буфер обмена.
Также Вы можете выдать разрешения на чтение уведомлений устройства для очистки буфера обмена при
выключении экрана.
Также Вы можете выдать разрешения на чтение уведомлений устройства для очистки буфера обмена
автоматически при выключении экрана.

Разрешения:
* Уведомления - получать события выключения экрана
* Запрашивать все пакеты приложений - отключить обработку уведомлений от всех приложений на
Android 12 и новее
* NOTIFICATION_LISTENER - получать события выключения экрана (опционально)

Это свободное программное обеспечение с открытым исходным кодом.
Лицензия: GPL-3
2 changes: 1 addition & 1 deletion fastlane/metadata/android/ru-RU/title.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Clipeus
Clipeus

0 comments on commit e482fec

Please sign in to comment.