Creating Fake SMS with Android

I was curious about how challenging it would be to create fake SMS messages, so I decided to make a small research. I came across a straightforward app that allows users to create fake SMS messages. The app's interface is user-friendly, letting you set the message type, date, and time. However, to use this app, you need to set it as the default messaging application. At this point, I was confident that it was possible to achieve this without root permissions.

Initial Exploration

My first approach was to send a fake intent to simulate a new SMS arrival. Despite my efforts, this method didn’t work. Many sources suggested using the android.provider.Telephony.SMS_DELIVER intent action, which is the system intent action for broadcasting SMS. However, starting from Android 4.4 (KitKat), only the default messaging app can receive this intent, and broadcasting it is restricted to system applications. Additionally, permissions for reading and writing SMS are restricted to the default messaging app. A detailed blog post I found outlines these changes introduced in Android 4.4.

Finding a Solution

After reviewing the blog post, I updated my application to function as the default messaging app. This involved updating the manifest and creating necessary receivers with empty bodies. I soon realized that I didn't need to send or broadcast an intent. Instead, I could use the content provider URI to write an SMS directly. By following these steps, you can successfully create fake SMS messages:

  1. Set Up as Default Messaging App:

    • Implement receivers and services for your app.
    • Add the following permissions to your manifest: WRITE_SMS, READ_SMS, and RECEIVE_SMS.
    • At the start of your activity (or when writing a new SMS), prompt the user to set your app as the default messaging application.
  2. Check Permissions:

    • Ensure that your app has the necessary permissions to read and write SMS. Request the required permissions from the user if needed.
  3. Insert Fake SMS:

    • Use the ContentResolver to insert a new SMS into the SMS inbox:
      getContentResolver().insert(Uri.parse("content://sms/inbox"), values);

By following these steps, you can create a fake SMS generator for your friends, family, or even your favorite transport service!





Comments

Popular posts from this blog

Play table

Counting dice and train wagons using computer vision

Skate Tricks Recognition Using Gyroscope