Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work profile apps can NOT send SMS #291

Open
jindalshreyansh opened this issue Jan 5, 2024 · 6 comments
Open

Work profile apps can NOT send SMS #291

jindalshreyansh opened this issue Jan 5, 2024 · 6 comments

Comments

@jindalshreyansh
Copy link

I am from India, and all the payment apps here use UPI. The way it works is that the app is required to send an automated SMS to the bank to verify the identity of user.
Earlier, in Android 13, things were working fine. However, after updating to Android 14, shelter apps can not send such SMS. Also, they can not auto read OTPs.

@RohitSurwase
Copy link

Hey @jindalshreyansh were you able to get over this limitation? Is there any way to fix this issue?

Even I am facing this issue.

@RohitSurwase
Copy link

I feel this issue is because of some changes in Android 14 as I tried Shelter, Insular, Test DPC and noticed all apps fails to send SMS from work profile.

@DroidFreak32
Copy link

It's a horrible, I repeat HORRIBLE hack, but if you can build a custom ROM you can bypass this by:

  1. Flip this switch in FWB's TelephonyPermissions.java :

  2. Hardcode:

  • callingUid and callerUid to 1001
  • callerUserHandle to UserHandle.getUserHandleForUid(1001)

In SmsProvider.java

@RohitSurwase
Copy link

@DroidFreak32 Thanks for sharing the idea. Is this because it is a bug/feature in Android 14? Instead of this hack, can we do some config changes in TestDPC App, which very customizable alternative for creating work profile. Please have a look at the app, let us know if it can be done via any of the app's config.

@DroidFreak32
Copy link

DroidFreak32 commented Oct 9, 2024

This is a restriction in the underlying system code, which was implemented in A13/14 and prevents Work Profile apps to use the SmsProvider. Only the primary user is allowed. The hack fakes the User ID for any call to SmsProvider sent by apps in work profile.

Any Work profile managing apps cannot change the system behavior unfortunately (afaik). They simply use the Work Profile APIs exposed by android so any changes to that needs to be done at the ROM level.

EDIT: Somewhere I have read something about assigning SIM to a profile, so apps requesting to send/receive SMS from the SIM assigned to the work profile might not be affected.
Not sure if that is really possible at the moment.

@RohitSurwase
Copy link

@DroidFreak32 Maybe you are right but the Google's doc says SMS should work in Work Profile via SMS app in Personal Profile.

All text messages are sent and received through the default SMS app in your personal space, such as Messages.
When you send a text message to a contact using the SMS app in your work profile, you’ll get an alert that says You’re using this app outside of your work profile. The text message is sent from the device’s default SMS app in your personal space. If your contact replies, the text message response appears as a reply in your personal space. Conversations with contacts in your work profile are stored in the history in your personal space alongside your personal chats. Only the sender’s number is shown and their details remain hidden.
Reference: https://support.google.com/work/android/answer/6275589?hl=en

So, ideally we should have been able to send and receive SMS from work profile via sms app in personal profile. So I think it's a bug in Android 14. I read that it was working in Android 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants