Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Issue #768: [Android] Can't install multiple apps using this plugin (…
Browse files Browse the repository at this point in the history
…v1.6.x)
  • Loading branch information
macdonst committed Apr 27, 2016
1 parent 33b7019 commit 4ad7e40
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="$PACKAGE_NAME.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="$PACKAGE_NAME.permission.C2D_MESSAGE" />
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
</config-file>

<config-file target="AndroidManifest.xml" parent="/manifest/application">
Expand All @@ -61,7 +61,7 @@
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="$PACKAGE_NAME" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<service
Expand All @@ -84,6 +84,7 @@
</service>
</config-file>

<framework src="push.gradle" custom="true" type="gradleReference" />
<framework src="com.android.support:support-v13:23+" />
<framework src="com.google.android.gms:play-services-gcm:+" />

Expand Down
21 changes: 21 additions & 0 deletions push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.util.regex.Pattern

def doExtractStringFromManifest(name) {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
def pattern = Pattern.compile(name + "=\"(.*?)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return matcher.group(1)
}

android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}

defaultConfig {
applicationId = doExtractStringFromManifest("package")
}
}

0 comments on commit 4ad7e40

Please sign in to comment.