[PR #388] [CLOSED] [NOT A PULL REQUEST] Request SMS Backup+ to be the default SMS package before restoring #955

Closed
opened 2026-02-26 01:32:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jberkel/sms-backup-plus/pull/388
Author: @beverloo
Created: 11/4/2013
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 50f9a0e Request SMS Backup+ to be set as the default SMS package before restoring.

📊 Changes

6 files changed (+107 additions, -5 deletions)

View changed files

📝 AndroidManifest.xml (+45 -0)
📝 build.gradle (+2 -2)
📝 pom.xml (+2 -2)
📝 src/com/zegoggles/smssync/Consts.java (+6 -0)
📝 src/com/zegoggles/smssync/activity/MainActivity.java (+19 -1)
📝 src/com/zegoggles/smssync/service/SmsRestoreService.java (+33 -0)

📄 Description

Request SMS Backup+ to be set as the default SMS package before restoring.

THIS PATCH HAS A NUMBER OF TODOS AND SHOULD NOT LAND AS IS.

Starting with Android KitKat, only the default SMS package is allowed to
write to the SMS provider. Because SMS Backup+ did not register for the
ComposeSmsActivity activity or the receivers at all, it could not be set
as such, rendering the restore functionality useless in KitKat.

This patch somewhat hacks the necessary functionality in the application to
make it possible to import SMS messages again. It adds the necessary
receivers and activity to the AndroidManifest.xml file (but does not become
the default SMS app by default) and adds some logic to the restore flow:

  • When starting the restore, request to become the default SMS package
    if the user is running KitKat or higher and it's not already.
  • If the default SMS activity has changed, add this as an intent with
    which we're launching the service.
  • In the SmsRestoreService, abort restoring if we're not able to write
    to the SMS provider. A better message should be added here.
  • After the restore finished, check if the previous-sms-provider intent
    extra has been set. If so, ask the user to restore to that activity.

It's important to reset the default SMS provider to something that's not
SMS Backup+, because otherwise incoming messages will disappear in a black
hole. There's a lot of user interaction involved here, but I'm not sure if
there's a good way around that.

This patch is not ready to land, but I hope it gives you a good idea about
what's needed to fix restore for Android KitKat and higher. It allowed me
to import my SMS messages just fine :-). Thanks for the great app!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jberkel/sms-backup-plus/pull/388 **Author:** [@beverloo](https://github.com/beverloo) **Created:** 11/4/2013 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`50f9a0e`](https://github.com/jberkel/sms-backup-plus/commit/50f9a0e2c17655e7abdf5646243334762b97e59f) Request SMS Backup+ to be set as the default SMS package before restoring. ### 📊 Changes **6 files changed** (+107 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `AndroidManifest.xml` (+45 -0) 📝 `build.gradle` (+2 -2) 📝 `pom.xml` (+2 -2) 📝 `src/com/zegoggles/smssync/Consts.java` (+6 -0) 📝 `src/com/zegoggles/smssync/activity/MainActivity.java` (+19 -1) 📝 `src/com/zegoggles/smssync/service/SmsRestoreService.java` (+33 -0) </details> ### 📄 Description Request SMS Backup+ to be set as the default SMS package before restoring. **THIS PATCH HAS A NUMBER OF TODOS AND SHOULD NOT LAND AS IS.** Starting with Android KitKat, only the default SMS package is allowed to write to the SMS provider. Because SMS Backup+ did not register for the ComposeSmsActivity activity or the receivers at all, it could not be set as such, rendering the restore functionality useless in KitKat. This patch somewhat hacks the necessary functionality in the application to make it possible to import SMS messages again. It adds the necessary receivers and activity to the AndroidManifest.xml file (but does not become the default SMS app by default) and adds some logic to the restore flow: - When starting the restore, request to become the default SMS package if the user is running KitKat or higher and it's not already. - If the default SMS activity has changed, add this as an intent with which we're launching the service. - In the SmsRestoreService, abort restoring if we're not able to write to the SMS provider. A better message should be added here. - After the restore finished, check if the previous-sms-provider intent extra has been set. If so, ask the user to restore to that activity. It's important to reset the default SMS provider to something that's not SMS Backup+, because otherwise incoming messages will disappear in a black hole. There's a lot of user interaction involved here, but I'm not sure if there's a good way around that. This patch is not ready to land, but I hope it gives you a good idea about what's needed to fix restore for Android KitKat and higher. It allowed me to import my SMS messages just fine :-). Thanks for the great app! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 01:32:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sms-backup-plus-jberkel#955
No description provided.