From 4ad7e4059e338ad8326561b072f4d586dfe07b1e Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Tue, 26 Apr 2016 20:23:42 -0400 Subject: [PATCH] Issue #768: [Android] Can't install multiple apps using this plugin (v1.6.x) --- plugin.xml | 7 ++++--- push.gradle | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 push.gradle diff --git a/plugin.xml b/plugin.xml index 4f1973729..e5f38d635 100755 --- a/plugin.xml +++ b/plugin.xml @@ -47,8 +47,8 @@ - - + + @@ -61,7 +61,7 @@ android:permission="com.google.android.c2dm.permission.SEND" > - + + diff --git a/push.gradle b/push.gradle new file mode 100644 index 000000000..11e735ae7 --- /dev/null +++ b/push.gradle @@ -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") + } +}