transfuse icon indicating copy to clipboard operation
transfuse copied to clipboard

manifest package name rewriting

Open dbachelder opened this issue 10 years ago • 2 comments

do you think there is an easy win to facilitate changing namespace based on build variant package names like in the manifest snippet below where com.namespace.local could be com.namespace.test or com.namespace.prod depending on the build variant... currently gradle takes care of replacing namespace in the <manifest packag="com.namespace" with whatever the variant specifies. but the rest needs to either be done through some custom groovy or via manifest merging, neither option is particularly appealing.

    <uses-permission android:name="com.namespace.local.permission.C2D_MESSAGE" t:tag="+,n"/>
...
    <permission android:name="com.namespace.local.permission.C2D_MESSAGE" android:protectionLevel="signature" t:tag="+,n,p"/>
...
<receiver android:name=".gcm.PushReceiverBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" t:tag="+,n,p">
            <intent-filter t:tag="+">
                <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
                <category android:name="com.namespace.local" t:tag="+,n"/>
            </intent-filter>
        </receiver>

dbachelder avatar Mar 22 '14 18:03 dbachelder

Hmm, we could introduce a build parameter... can you describe the use case further? I'm not sure I understand.

johncarl81 avatar Mar 23 '14 04:03 johncarl81

Basically, you need certain permissions and categories to match the package name of the app. but the package name is determined at build time and the permissions and categories are hard coded in the source.

dbachelder avatar Mar 23 '14 20:03 dbachelder