|
@@ -25,21 +25,21 @@ import java.io.File
|
|
|
import java.io.FileOutputStream
|
|
import java.io.FileOutputStream
|
|
|
|
|
|
|
|
fun injectOTP(otp: String) {
|
|
fun injectOTP(otp: String) {
|
|
|
-// if (ROOT_ACCESS) {
|
|
|
|
|
-// val intent = Intent()
|
|
|
|
|
-// intent.setAction("com.example.modifier.sms")
|
|
|
|
|
-// intent.putExtra("sender", "3538")
|
|
|
|
|
-// intent.putExtra("message", "Your Messenger verification code is G-$otp")
|
|
|
|
|
-// val context = getContext()
|
|
|
|
|
-// context.sendBroadcast(intent)
|
|
|
|
|
-// } else {
|
|
|
|
|
|
|
+ if (ROOT_ACCESS) {
|
|
|
|
|
+ val intent = Intent()
|
|
|
|
|
+ intent.setAction("com.example.modifier.sms")
|
|
|
|
|
+ intent.putExtra("sender", "3538")
|
|
|
|
|
+ intent.putExtra("message", "Your Messenger verification code is G-$otp")
|
|
|
|
|
+ val context = getContext()
|
|
|
|
|
+ context.sendBroadcast(intent)
|
|
|
|
|
+ } else {
|
|
|
val context = getContext()
|
|
val context = getContext()
|
|
|
val smsManager = context.getSystemService("sms") as SmsManager
|
|
val smsManager = context.getSystemService("sms") as SmsManager
|
|
|
smsManager.injectSmsPdu(
|
|
smsManager.injectSmsPdu(
|
|
|
createFakeSms("3538", "Your Messenger verification code is G-$otp"),
|
|
createFakeSms("3538", "Your Messenger verification code is G-$otp"),
|
|
|
SmsMessage.FORMAT_3GPP, null
|
|
SmsMessage.FORMAT_3GPP, null
|
|
|
)
|
|
)
|
|
|
-// }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fun smsIntent(to: String, body: String?, img: File?): Intent {
|
|
fun smsIntent(to: String, body: String?, img: File?): Intent {
|
|
@@ -119,19 +119,15 @@ suspend fun clearConv() {
|
|
|
|
|
|
|
|
if (ROOT_ACCESS) {
|
|
if (ROOT_ACCESS) {
|
|
|
val sqlite3 = sqlite3path()
|
|
val sqlite3 = sqlite3path()
|
|
|
-
|
|
|
|
|
|
|
+ shellRun(PACKAGE_MESSAGING.kill())
|
|
|
shellRun(
|
|
shellRun(
|
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM conversations;\"",
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM conversations;\"",
|
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM messages;\"",
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM messages;\"",
|
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM rcs_remote_capabilities_cache;\"",
|
|
"$sqlite3 /data/data/$PACKAGE_MESSAGING/databases/bugle_db \"DELETE FROM rcs_remote_capabilities_cache;\"",
|
|
|
)
|
|
)
|
|
|
- shellRun(PACKAGE_MESSAGING.kill())
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ shellRun(PACKAGE_MESSAGING.kill())
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
e.printStackTrace()
|
|
e.printStackTrace()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- fun installCleanSms() {
|
|
|
|
|
- val imageDir = ContextCompat.getExternalFilesDirs(getContext(), "images")[0]
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|