dropbox / dropbox-sdk-java

A Java library for the Dropbox Core API.
https://www.dropbox.com/developers/documentation/java
MIT License
593 stars 447 forks source link

AuthActivity startWebAuth Crash #505

Open BaojunCZ opened 1 year ago

BaojunCZ commented 1 year ago

Fatal Exception: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=https://www.dropbox.com/... cmp=team.opay.pay.merchant.service/com.opay.webview.WebFoundationActivity } from ProcessRecord{28b315a 21629:com.smartwallet.app/u0a265} (pid=21629, uid=10265) not exported from uid 10256 at android.os.Parcel.createExceptionOrNull(Parcel.java:2373) at android.os.Parcel.createException(Parcel.java:2357) at android.os.Parcel.readException(Parcel.java:2340) at android.os.Parcel.readException(Parcel.java:2282) at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:4128) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1732) at android.app.Activity.startActivityForResult(Activity.java:5370) at android.app.Activity.startActivityForResult(Activity.java:5328) at android.app.Activity.startActivity(Activity.java:5714) at android.app.Activity.startActivity(Activity.java:5667) at com.dropbox.core.android.AuthActivity.startWebAuth(AuthActivity.kt:295) at com.dropbox.core.android.AuthActivity.onTopResumedActivityChanged$lambda-0(AuthActivity.kt:144) at android.app.Activity.runOnUiThread(Activity.java:7138) at com.dropbox.core.android.AuthActivity.onTopResumedActivityChanged(AuthActivity.kt:134) at android.app.Activity.performTopResumedActivityChanged(Activity.java:2000) at android.app.ActivityThread.reportTopResumedActivityChanged(ActivityThread.java:4911) at android.app.ActivityThread.handleTopResumedActivityChanged(ActivityThread.java:4895) at android.app.servertransaction.TopResumedActivityChangeItem.execute(TopResumedActivityChangeItem.java:39) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2203) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:268) at android.app.ActivityThread.main(ActivityThread.java:8017) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)

   Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1095)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1643)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:1279)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1238)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1181)
greg-db commented 1 year ago

I'll be happy to help with any issues you're having with the SDK, but I'll need some more information. Please reply with:

BaojunCZ commented 11 months ago

com.dropbox.core:dropbox-core-sdk:5.4.4 Phone: Infinix Smart 4 Plus,Infinix HOT 10S startOAuth2PKCE

greg-db commented 11 months ago

This issue does not reproduce for me when running startOAuth2PKCE using v5.4.4 of the Dropbox SDK.

Have you made any changes to the SDK?

What version of Android are you using?

Have you configured the AuthActivity as shown in the example here?

Please share the specific steps and code to reproduce the issue so we can look into it.

BaojunCZ commented 7 months ago

val requestConfig = DbxRequestConfig(ClientIdentifier) val scopes = listOf( "account_info.read", "files.content.write", "files.content.read", "files.metadata.write", "files.metadata.read" ) Auth.startOAuth2PKCE(context, ApiKey, requestConfig, scopes)

I did not change the SDK.

I am also unable to reproduce the issue, only receiving many exceptions on the log collection platform. And most of the error reports come from the Transsion brand, and a small part comes from Samsung.

greg-db commented 7 months ago

Can you confirm if you configured the AuthActivity as shown in the example here? In particular, it looks like the android:exported="true" line may be relevant, so make sure you have that.

Also, I notice there are two different third party package names mentioned in the error output: team.opay.pay.merchant.service and com.smartwallet.app. Can you clarify what these two are?