Skip to content

Commit 4bb6f47

Browse files
committed
ignore blocked numbers below Android 7
1 parent 8e0a2c6 commit 4bb6f47

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ android {
5656
}
5757

5858
dependencies {
59-
implementation 'com.simplemobiletools:commons:5.25.21'
59+
implementation 'com.simplemobiletools:commons:5.26.4'
6060
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
6161
implementation 'org.greenrobot:eventbus:3.2.0'
6262
implementation 'com.klinkerapps:android-smsmms:5.2.6'

app/proguard-rules.pro

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
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
1+
# EventBus
2+
-keepattributes *Annotation*
3+
-keepclassmembers class ** {
4+
@org.greenrobot.eventbus.Subscribe <methods>;
5+
}
6+
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import com.klinker.android.send_message.Transaction
2929
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
3030
import com.simplemobiletools.commons.extensions.*
3131
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
32+
import com.simplemobiletools.commons.helpers.isNougatPlus
3233
import com.simplemobiletools.smsmessenger.R
3334
import com.simplemobiletools.smsmessenger.adapters.AutoCompleteTextViewAdapter
3435
import com.simplemobiletools.smsmessenger.adapters.ThreadAdapter
@@ -146,6 +147,7 @@ class ThreadActivity : SimpleActivity() {
146147
menuInflater.inflate(R.menu.menu_thread, menu)
147148
menu.apply {
148149
findItem(R.id.delete).isVisible = threadItems.isNotEmpty()
150+
findItem(R.id.block_number).isVisible = isNougatPlus()
149151
}
150152

151153
return true

app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ fun Context.getThreadId(addresses: Set<String>): Long {
619619
}
620620

621621
fun Context.isNumberBlocked(number: String): Boolean {
622+
if (!isNougatPlus()) {
623+
return false
624+
}
625+
622626
val blockedNumbers = getBlockedNumbers()
623627
val numberToCompare = number.trimToComparableNumber()
624628
return blockedNumbers.map { it.numberToCompare }.contains(numberToCompare) || blockedNumbers.map { it.number }.contains(numberToCompare)

0 commit comments

Comments
 (0)