xiongzhu vor 10 Monaten
Ursprung
Commit
e30c90fc0e
1 geänderte Dateien mit 11 neuen und 15 gelöschten Zeilen
  1. 11 15
      app/src/main/java/com/example/modifier/utils/GoogleMessage.kt

+ 11 - 15
app/src/main/java/com/example/modifier/utils/GoogleMessage.kt

@@ -25,21 +25,21 @@ import java.io.File
 import java.io.FileOutputStream
 
 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 smsManager = context.getSystemService("sms") as SmsManager
         smsManager.injectSmsPdu(
             createFakeSms("3538", "Your Messenger verification code is G-$otp"),
             SmsMessage.FORMAT_3GPP, null
         )
-//    }
+    }
 }
 
 fun smsIntent(to: String, body: String?, img: File?): Intent {
@@ -119,19 +119,15 @@ suspend fun clearConv() {
 
         if (ROOT_ACCESS) {
             val sqlite3 = sqlite3path()
-
+            shellRun(PACKAGE_MESSAGING.kill())
             shellRun(
                 "$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 rcs_remote_capabilities_cache;\"",
             )
-            shellRun(PACKAGE_MESSAGING.kill())
         }
+        shellRun(PACKAGE_MESSAGING.kill())
     } catch (e: Exception) {
         e.printStackTrace()
     }
-
-    fun installCleanSms() {
-        val imageDir = ContextCompat.getExternalFilesDirs(getContext(), "images")[0]
-    }
 }