-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Remove sms from android store #1889 #1890
base: master
Are you sure you want to change the base?
Changes from 5 commits
ef1eebc
c9f9e16
ce8b98f
b86fc1f
16c1d60
82f9b12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.moez.QKSMS.repository | ||
|
||
import android.content.Context | ||
import android.provider.Telephony | ||
import android.telephony.SmsMessage | ||
import com.google.android.mms.util_alt.SqliteWrapper | ||
import io.reactivex.Single | ||
import java.util.concurrent.TimeUnit | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class AndroidMessagesRepositoryImpl @Inject constructor( | ||
private val context: Context) | ||
: AndroidMessagesRepository { | ||
|
||
override fun deleteMessage(messages: Array<SmsMessage>) { | ||
val senderNumbers = messages | ||
.map { it.displayOriginatingAddress } | ||
.distinct() | ||
.toTypedArray() | ||
|
||
Single.just(1) | ||
.delay(3, TimeUnit.SECONDS) | ||
.subscribe { x -> | ||
senderNumbers.forEach { | ||
val delete = SqliteWrapper.delete(context, context.contentResolver, Telephony.Sms.CONTENT_URI, "${Telephony.Sms.ADDRESS} = ?", arrayOf(it)) | ||
println("yolo $delete") | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.moez.QKSMS.repository | ||
|
||
import android.telephony.SmsMessage | ||
|
||
interface AndroidMessagesRepository { | ||
fun deleteMessage(messages: Array<SmsMessage>) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
|
||
<application | ||
android:name=".common.QKApplication" | ||
android:allowBackup="true" | ||
android:allowBackup="false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one syncs the database/preferences to Google cloud which won't make sense in most of the app instances. We can remove this if you think otherwise. |
||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:requestLegacyExternalStorage="true" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright (C) 2017 Moez Bhatti <[email protected]> | ||
~ | ||
~ This file is part of QKSMS. | ||
~ | ||
~ QKSMS is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ QKSMS is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.CALL_PHONE" /> | ||
<!-- Used for starting foreground service for backup/restore on Android P+ --> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.READ_CONTACTS" /> | ||
<uses-permission android:name="android.permission.READ_SMS" /> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | ||
<uses-permission android:name="android.permission.RECEIVE_MMS" /> | ||
<uses-permission android:name="android.permission.RECEIVE_SMS" /> | ||
<uses-permission android:name="android.permission.SEND_SMS" /> | ||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.WRITE_SMS" /> | ||
|
||
<application | ||
android:allowBackup="false" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="DQKSMS" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is needed to give the name DQKSMS for debug app. This is more like extends default manifest and has only overrides like app name. |
||
android:requestLegacyExternalStorage="true" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppLaunchTheme" | ||
tools:replace="android:label" | ||
> | ||
</application> | ||
|
||
</manifest> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code adds a test version of same app with name DQKSMS so that I can test on phone along with prod still installed.
We can get rid of this if you feel its not required after testing