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

Fatal Exception: java.lang.SecurityException without permission com.google.android.c2dm.permission.RECEIVE #62

Open
HanteIsHante opened this issue Jan 2, 2019 · 3 comments

Comments

@HanteIsHante
Copy link
Owner

This is my previous manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="packagename">


    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.BLUETOOTH" />

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <!--FireBase Event -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
  <permission
      android:name="${applicationId}.permission.C2D_MESSAGE"
      android:protectionLevel="signature" />

    <application
        android:name=".application.Application"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:resizeableActivity="false"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:targetApi="n">


        <activity
            android:name=".Activity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait" />


        <activity
            android:name=".exchange.Activity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait" />


        <activity
            android:name=".line.Activity"
            android:screenOrientation="portrait" />


        <activity
            android:name=".guide.Activity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="ApiKey" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="ApiKey" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" />
        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <activity
            android:name=".purchase.Activity"
            android:screenOrientation="portrait" />


        <activity
            android:name="com.alipay.sdk.app.H5PayActivity"
            android:configChanges="orientation|keyboardHidden|navigation"
            android:exported="false"
            android:screenOrientation="behind" />
        <activity
            android:name="com.alipay.sdk.auth.AuthActivity"
            android:configChanges="orientation|keyboardHidden|navigation"
            android:exported="false"
            android:screenOrientation="behind" />
        <activity
            android:name=".msgcenter.MsgCenterActivity"
            android:screenOrientation="portrait" />

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true"
            tools:replace="android:authorities">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>


        <receiver android:name=".receiver.ApkDownloadedBroadcast">
            <intent-filter>
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
            </intent-filter>
        </receiver>
    </application>

</manifest>

According to the personnel related to the firebase, the other party feedback any code about c2dm, which has been discarded, need to be deleted, so delete these:

  <!--FireBase Event -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
  <permission
      android:name="${applicationId}.permission.C2D_MESSAGE"
      android:protectionLevel="signature" />

Unfortunately, it still has no effect. Still happening crash

Fatal Exception: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1941)
       at android.app.ContextImpl.startService(ContextImpl.java:1918)
       at android.content.ContextWrapper.startService(ContextWrapper.java:527)
       at com.google.firebase.iid.zzat.zze(Unknown Source:130)
       at com.google.firebase.iid.zzat.zzd(Unknown Source:91)
       at com.google.firebase.iid.zzat.zzc(Unknown Source:90)
       at com.google.firebase.iid.zzr.zza(Unknown Source:73)
       at com.google.firebase.iid.zzs.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)
@HanteIsHante
Copy link
Owner Author


Fatal Exception: java.lang.SecurityException: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) }: Unable to launch app com.google.android.gms/10188 for service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }: process is bad
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1301)
       at android.app.ContextImpl.startService(ContextImpl.java:1274)
       at android.content.ContextWrapper.startService(ContextWrapper.java:595)
       at com.google.firebase.iid.zzat.zze(Unknown Source:130)
       at com.google.firebase.iid.zzat.zzd(Unknown Source:91)
       at com.google.firebase.iid.zzat.zzc(Unknown Source:90)
       at com.google.firebase.iid.zzr.zza(Unknown Source:73)
       at com.google.firebase.iid.zzs.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       at java.lang.Thread.run(Thread.java:818)

GIONEE(GN5003 6.0)

@HanteIsHante
Copy link
Owner Author

Fatal Exception: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1394)
       at android.app.ContextImpl.startService(ContextImpl.java:1371)
       at android.content.ContextWrapper.startService(ContextWrapper.java:613)
       at com.google.firebase.iid.zzat.zze(Unknown Source:130)
       at com.google.firebase.iid.zzat.zzd(Unknown Source:91)
       at com.google.firebase.iid.zzat.zzc(Unknown Source:90)
       at com.google.firebase.iid.zzr.zza(Unknown Source:73)
       at com.google.firebase.iid.zzs.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:761)

设备信息

nubia 7.1.1

  1. NX595J
  2. NX563J

@HanteIsHante
Copy link
Owner Author


Fatal Exception: java.lang.SecurityException: Not allowed to bind to service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
       at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1839)
       at android.app.ContextImpl.bindService(ContextImpl.java:1773)
       at android.content.ContextWrapper.bindService(ContextWrapper.java:684)
       at com.google.android.gms.common.stats.ConnectionTracker.zza(Unknown Source:22)
       at com.google.android.gms.common.stats.ConnectionTracker.bindService(Unknown Source:24)
       at com.google.firebase.iid.zzad.zzb(Unknown Source:17)
       at com.google.firebase.iid.zzab.zza(Unknown Source:17)
       at com.google.firebase.iid.zzab.zzb(Unknown Source:12)
       at com.google.firebase.iid.zzat.zzc(Unknown Source:80)
       at com.google.firebase.iid.zzr.zza(Unknown Source:73)
       at com.google.firebase.iid.zzs.run(Unknown Source:6)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:784)

HUAWEI ARE-AL10 8.1.0

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

1 participant