java.lang.SecurityException:权限被拒绝:打开提供程序 com.quickblox.q_municate_core.db.DatabaseProvider
Posted
技术标签:
【中文标题】java.lang.SecurityException:权限被拒绝:打开提供程序 com.quickblox.q_municate_core.db.DatabaseProvider【英文标题】:java.lang.SecurityException: Permission Denial: opening provider com.quickblox.q_municate_core.db.DatabaseProvider 【发布时间】:2015-12-10 09:50:49 【问题描述】:我正在开发一个使用 q-municate 作为基础的应用程序。如自述文件中所述,我将凭据(应用程序 ID、授权密钥、授权密钥)复制到我在 Consts.java 中的 Q-municate 项目代码中
我将包名从com.quickblox.qmunicate
折射为com.quickblox.TestingApp
除了<uses-permission android:name="com.quickblox.qmunicate.permission.C2D_MESSAGE" />
、<category android:name="com.quickblox.qmunicate" />
之外,我还更改了AndroidManifest文件中的包名
<uses-permission android:name="com.quickblox.qmunicate.permission.C2D_MESSAGE" />
<receiver
android:name="com.quickblox.TestingApp.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.quickblox.qmunicate" />
</intent-filter>
</receiver>
和android:authorities="com.qmun.quickblox"
<provider
android:name="com.quickblox.q_municate_core.db.DatabaseProvider"
android:authorities="com.qmun.quickblox"
android:exported="false" />
<meta-data android:name="com.crashlytics.ApiKey" android:value="7aea78439bec41a9005c7488bb6751c5e33fe270"/>
进行这些更改后,我可以安装 Quickblox 应用和我修改后的应用。
但修改后的应用变得无响应。记录消息
02-12 15:09:37.329 14889-14889/? E/LoginActivity﹕ loginOnClickListener(View view)
02-12 15:09:37.329 14889-14889/? E/LoginActivity﹕ userEmail = tester@gmail.com
02-12 15:09:37.329 14889-14889/? E/LoginActivity﹕ userPassword = apptester
02-12 15:09:37.329 14889-14889/? E/LoginActivity﹕ (validationUtils.isValidUserDate(userEmail, userPassword))
02-12 15:09:37.349 14889-14889/? E/LoginActivity﹕ login(String userEmail, String userPassword)
02-12 15:09:37.349 14889-14889/? E/BaseActivity﹕ showProgress()
02-12 15:09:37.349 14889-14889/? E/BaseActivity﹕ (!progress.isAdded())
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ BaseBroadcastReceiver : onReceive(Context context, final Intent intent)
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ executinglogin_success_action
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ (intent != null && (action) != null)
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ (commandSet != null && !commandSet.isEmpty())
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ getHandler()
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ (handler == null)
02-12 15:09:43.279 14889-14889/? E/ActivityHelper﹕ for (Command command : commandSet)
02-12 15:09:43.279 14889-14889/? E/LoginActivity﹕ LoginSuccessAction execute(Bundle bundle)
02-12 15:09:43.279 14889-14889/? E/LoginActivity﹕ (rememberMeCheckBox.isChecked())
02-12 15:09:43.279 14889-14889/? E/BaseAuthActivity﹕ startMainActivity(Context context, QBUser user, boolean saveRememberMe)
02-12 16:06:25.159 20226-20226/? E/BaseAuthActivity﹕ startMainActivity(Context context, QBUser user, boolean saveRememberMe)
02-12 16:06:25.169 20226-20226/? W/System.err﹕ java.lang.SecurityException: Permission Denial: opening provider com.quickblox.q_municate_core.db.DatabaseProvider from ProcessRecord4324dc18 20226:com.quickblox.TestingApp/u0a195 (pid=20226, uid=10195) that is not exported from uid 10190
02-12 16:06:25.169 20226-20226/? W/System.err﹕ at android.os.Parcel.readException(Parcel.java:1489)
02-12 16:06:25.169 20226-20226/? W/System.err﹕ at android.os.Parcel.readException(Parcel.java:1443)
02-12 16:06:25.169 20226-20226/? W/System.err﹕ at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2865)
02-12 16:06:25.169 20226-20226/? W/System.err﹕ at android.app.ActivityThread.acquireProvider(ActivityThread.java:4450)
02-12 16:06:25.169 1045-1336/? W/ActivityManager﹕ Permission Denial: opening provider com.quickblox.q_municate_core.db.DatabaseProvider from ProcessRecord4324dc18 20226:com.quickblox.TestingApp/u0a195 (pid=20226, uid=10195) that is not exported from uid 10190
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:2229)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.content.ContentResolver.acquireProvider(ContentResolver.java:1378)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.content.ContentResolver.delete(ContentResolver.java:1276)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.q_municate_core.db.managers.UsersDatabaseManager.deleteAllUsers(UsersDatabaseManager.java:438)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.q_municate_core.db.managers.ChatDatabaseManager.clearAllCache(ChatDatabaseManager.java:537)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.TestingApp.ui.authorization.base.BaseAuthActivity.startMainActivity(BaseAuthActivity.java:136)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.TestingApp.ui.authorization.login.LoginActivity.access$400(LoginActivity.java:24)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.TestingApp.ui.authorization.login.LoginActivity$LoginSuccessAction.execute(LoginActivity.java:135)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.quickblox.TestingApp.ui.base.ActivityHelper$BaseBroadcastReceiver$1.run(ActivityHelper.java:247)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.os.Looper.loop(Looper.java:136)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5052)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
02-12 16:06:25.179 20226-20226/? W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
关于最小化应用程序
02-12 15:36:05.649 14889-14889/? E/BaseActivity﹕ onPause()
02-12 15:36:05.649 14889-14889/? E/ActivityHelper﹕ onPause()
02-12 15:36:05.659 14889-14889/? E/ActivityHelper﹕ unregisterBroadcastReceiver()
02-12 15:36:05.889 378-378/? E/QCALOG﹕ [MessageQ] ProcessNewMessage: [XT-CS] unknown deliver target [OS-Agent]
02-12 15:36:05.979 14889-14889/? E/BaseAuthActivity﹕ onSaveInstanceState(Bundle outState)
02-12 15:36:05.989 14889-14889/? E/BaseActivity﹕ onStop()
02-12 15:36:05.989 14889-14889/? E/ActivityHelper﹕ onStop()
02-12 15:36:05.989 14889-14889/? E/ActivityHelper﹕ unbindService()
02-12 15:36:05.989 14889-14889/? E/ActivityHelper﹕ (bounded)
02-12 15:36:05.989 14889-14889/? E/BaseAuthActivity﹕ onStop()
再次开启
02-12 15:34:09.749 14889-14889/? E/BaseActivity﹕ onStart()
02-12 15:34:09.749 14889-14889/? E/ActivityHelper﹕ onStart()
02-12 15:34:09.749 14889-14889/? E/ActivityHelper﹕ connectToService()
02-12 15:34:09.749 14889-14889/? E/BaseActivity﹕ start
02-12 15:34:09.749 14889-14889/? E/BaseAuthActivity﹕ onStart()
02-12 15:34:09.749 14889-14889/? E/BaseActivity﹕ onResume()
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ onResume()
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ registerGlobalReceiver()
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ updateBroadcastActionList()
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ for (String commandName : broadcastCommandMap.keySet())
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ for (String commandName : broadcastCommandMap.keySet())
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ for (String commandName : broadcastCommandMap.keySet())
02-12 15:34:09.759 14889-14889/? E/BaseActivity﹕ addAction(String action, Command command)
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ addAction(String action, Command command)
02-12 15:34:09.759 14889-14889/? E/ActivityHelper﹕ onServiceConnected(ComponentName name, IBinder binder)
02-12 15:34:09.759 14889-14889/? E/BaseActivity﹕ onConnectedToService(QBService service)
此屏幕截图
我必须关闭应用程序并重新打开才能进入登录页面。问题还在继续。
出了什么问题? 任何使用 qmunicate 开发应用程序并在 google play store 上发布的人,请告诉我有什么问题以及需要更改的地方。
在开始修改 qmunicate 应用程序之前,谁能告诉我,除了 App ID、授权密钥、授权密钥之外,还需要更改哪些内容?
【问题讨论】:
【参考方案1】:你应该更改修改版本的包名,因为包名应该是唯一的。
【讨论】:
以上是关于java.lang.SecurityException:权限被拒绝:打开提供程序 com.quickblox.q_municate_core.db.DatabaseProvider的主要内容,如果未能解决你的问题,请参考以下文章