rethink-app: App crashes when activating it as an Always-on VPN on Shelter's work profile

Hi!

Description

After updating to version v0.5.3k, Rethink crashes (it doesn’t even open) on my work profile (created by Shelter) whenever it’s enabled as an (always-on) VPN. This, however, does not happen on version v0.5.3j, where the work profile always-on VPN works as expected.

(On both versions Rethink works as expected on my main profile.

Device

Pixel 4, Android 13

Steps to reproduce

Prerequisites:

  • Shelter, a work profile created by it and Rethink DNS installed on the main profile

Steps to reproduce:

  • Clone the app to the work profile through Shelter
  • Open the app and give it VPN permissions
  • The app crashes

Logs

type: crash
osVersion: google/flame/flame:13/TP1A.221005.002/2022102800:user/release-keys
package: com.celzero.bravedns:22
process: com.celzero.bravedns

java.lang.IllegalArgumentException: User 10 is not the current user.
 at android.os.Parcel.createExceptionOrNull(Parcel.java:3025)
 at android.os.Parcel.createException(Parcel.java:3005)
 at android.os.Parcel.readException(Parcel.java:2981)
 at android.os.Parcel.readException(Parcel.java:2923)
 at com.android.internal.statusbar.IStatusBarService$Stub$Proxy.requestTileServiceListeningState(IStatusBarService.java:2363)
 at android.app.StatusBarManager.requestTileServiceListeningState(StatusBarManager.java:883)
 at android.service.quicksettings.TileService.requestListeningState(TileService.java:503)
 at com.celzero.bravedns.service.BraveVPNService.updateQuickSettingsTile(BraveVPNService.kt:1364)
 at com.celzero.bravedns.service.BraveVPNService.access$updateQuickSettingsTile(BraveVPNService.kt:88)
 at com.celzero.bravedns.service.BraveVPNService$onStartCommand$1.invokeSuspend(BraveVPNService.kt:1130)
 at com.celzero.bravedns.service.BraveVPNService$onStartCommand$1.invoke(Unknown Source:8)
 at com.celzero.bravedns.service.BraveVPNService$onStartCommand$1.invoke(Unknown Source:2)
 at com.celzero.bravedns.service.BraveVPNService$ui$1$1.invokeSuspend(BraveVPNService.kt:1779)
 at com.celzero.bravedns.service.BraveVPNService$ui$1$1.invoke(Unknown Source:8)
 at com.celzero.bravedns.service.BraveVPNService$ui$1$1.invoke(Unknown Source:4)
 at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
 at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
 at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
 at com.celzero.bravedns.service.BraveVPNService$ui$1.invokeSuspend(BraveVPNService.kt:1778)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
 at android.os.Handler.handleCallback(Handler.java:942)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at android.app.ActivityThread.main(ActivityThread.java:7904)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
 at com.android.internal.os.ExecInit.main(ExecInit.java:49)
 at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
 at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
 Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@7976e65, Dispatchers.Main]
Caused by: android.os.RemoteException: Remote stack trace:
 at com.android.server.statusbar.StatusBarManagerService.requestTileServiceListeningState(StatusBarManagerService.java:1814)
 at com.android.internal.statusbar.IStatusBarService$Stub.onTransact(IStatusBarService.java:1241)
 at android.os.Binder.execTransactInternal(Binder.java:1302)
 at android.os.Binder.execTransact(Binder.java:1265)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25

Commits related to this issue

Most upvoted comments

While I was on F-droid I found this app called InviZible, and under setting -> common settings there’s an option enabled by default called Multi-user support with a description explaining that it adds support for Island, Shelter and work profile. Maybe you can check with them what they’ve done.

@ignoramous so far everything’s working great on my phone (pixel 7 with grapheneos) with shelter 😃

Must handle IllegalArgumentException in:

https://github.com/celzero/rethink-app/blob/0543666a3130247ae757cdea3a273b3674fe0d5a/app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt#L1480


@An-dz Thanks. It seems like InviZible doesn’t do much other than detect presence of root and grant itself interact-across-users permission (which isn’t available to installed apps, otherwise) (code).

Well, I tried some extra options and ways of installing and completely broke Rethink, and I guess my whole phone. I could no longer configure a blocklist, it would go to a black screen and after some seconds it would get back to the DNS settings screen showing 0 selected blocklists. Uninstalling Rethink, deleting the work profile and uninstalling Shelter had no effect, it broke for good.

I re-flashed Android since I needed to upgrade to Android 12 anyway. Unfortunately I won’t be able to test any further as I can’t risk breaking my only phone.

thank you very much 😃 if i can help with anything else, please let me know!

Also, it could be that this error happens on Android 13 only, due to whatever new restrictions they may have imposed… No clue. Will take a look at this bug the first thing tomorrow.

I could never get Shelter running on my Android to test this. I’ve got multiple reports of v053L not working but no one provided the logcat output. And so, many thanks for that. (:

We’ll take a look at this on priority. Note though, we don’t really test for Work Profiles (as we don’t “support” it, yet) so expect it to break again… but: expect us to fix it if precise bugreports come in, too.