|
|
@@ -1,5 +1,7 @@
|
|
|
package com.example.modifier.ui.utils
|
|
|
|
|
|
+import android.content.Intent
|
|
|
+import android.net.Uri
|
|
|
import android.os.Bundle
|
|
|
import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
@@ -7,8 +9,11 @@ import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
import android.widget.Toast
|
|
|
import androidx.appcompat.app.AlertDialog
|
|
|
+import androidx.core.content.ContextCompat
|
|
|
+import androidx.core.content.FileProvider.getUriForFile
|
|
|
import androidx.fragment.app.Fragment
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
+import com.example.modifier.BuildConfig
|
|
|
import com.example.modifier.Frida
|
|
|
import com.example.modifier.R
|
|
|
import com.example.modifier.Utils
|
|
|
@@ -265,6 +270,28 @@ class UtilsFragment : Fragment() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ binding.btnSendImg.setOnClickListener {
|
|
|
+ val intent = Intent(Intent.ACTION_SENDTO)
|
|
|
+ intent.data = Uri.parse("sms:+18583199738")
|
|
|
+ intent.putExtra("exit_on_sent", true)
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
|
+ intent.setPackage(PACKAGE_MESSAGING)
|
|
|
+
|
|
|
+ val context = com.example.modifier.utils.getContext()
|
|
|
+ val imagePath: File = ContextCompat.getExternalFilesDirs(context, "images")[0]
|
|
|
+ val newFile = File(imagePath, "1.jpg")
|
|
|
+ val contentUri: Uri =
|
|
|
+ getUriForFile(com.example.modifier.utils.getContext(), "${BuildConfig.APPLICATION_ID}.fileprovider", newFile)
|
|
|
+ intent.putExtra(Intent.EXTRA_STREAM, contentUri)
|
|
|
+ Log.i(TAG, "contentUri: ${contentUri}")
|
|
|
+ requireContext().grantUriPermission(
|
|
|
+ PACKAGE_MESSAGING,
|
|
|
+ contentUri,
|
|
|
+ Intent.FLAG_GRANT_READ_URI_PERMISSION
|
|
|
+ )
|
|
|
+ startActivity(intent)
|
|
|
+ }
|
|
|
+
|
|
|
return binding.root
|
|
|
}
|
|
|
|