fix duplicate permissions

Merging of AndroidManifest.xml files meant the dbg flavor was getting
its C2D_MESSAGE permission and the main flavor's, which on recent OS
versions meant it couldn't be installed. Use substitution from gradle to
fix.
This commit is contained in:
Eric House 2017-01-18 19:56:03 -08:00
parent 995da3a0b2
commit f5ebee89da
4 changed files with 11 additions and 25 deletions

View file

@ -1,6 +1,4 @@
-TAGS -TAGS
-/xwords4/android/XWords4-dbg -/xwords4/android/app/build
-/xwords4/linux/discon_ok2.sh_logs -/xwords4/linux/discon_ok2.sh_logs
-/xwords4/android/XWords4/res_src/values-pt/strings.xml
-/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml
-/xwords4/relay/xwrelay.log -/xwords4/relay/xwrelay.log

View file

@ -44,9 +44,9 @@
<uses-feature android:name="android.hardware.nfc" android:required="false" /> <uses-feature android:name="android.hardware.nfc" android:required="false" />
<!-- GCM stuff --> <!-- GCM stuff -->
<permission android:name="org.eehouse.android.xw4.permission.C2D_MESSAGE" <permission android:name="${APP_ID}.permission.C2D_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="org.eehouse.android.xw4.permission.C2D_MESSAGE" /> <uses-permission android:name="${APP_ID}.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
@ -235,7 +235,7 @@
<intent-filter> <intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="org.eehouse.android.xw4" /> <category android:name="${APP_ID}" />
</intent-filter> </intent-filter>
</receiver> </receiver>

View file

@ -44,9 +44,9 @@
<uses-feature android:name="android.hardware.nfc" android:required="false" /> <uses-feature android:name="android.hardware.nfc" android:required="false" />
<!-- GCM stuff --> <!-- GCM stuff -->
<permission android:name="org.eehouse.android.xw4dbg.permission.C2D_MESSAGE" <permission android:name="${APP_ID}.permission.C2D_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="org.eehouse.android.xw4dbg.permission.C2D_MESSAGE" /> <uses-permission android:name="${APP_ID}.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
@ -239,7 +239,7 @@
<intent-filter> <intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="org.eehouse.android.xw4dbg" /> <category android:name="${APP_ID}" />
</intent-filter> </intent-filter>
</receiver> </receiver>

View file

@ -3,18 +3,13 @@
set -e -u set -e -u
usage () { usage () {
echo "usage: $(basename $0) [--tag tagname | --branch branchname] [--variant variant]" echo "usage: $(basename $0) [--tag tagname | --branch branchname] "
echo " # (uses current branch as default)" echo " # (uses current branch as default)"
exit 1 exit 1
} }
TAG="" TAG=""
BRANCH="" BRANCH=""
VARIANT="XWords4"
if [ -f ./AndroidManifest.xml ]; then # we're in the right directory
VARIANT=$(basename $(pwd))
fi
while [ 0 -lt $# ] ; do while [ 0 -lt $# ] ; do
case $1 in case $1 in
@ -26,10 +21,6 @@ while [ 0 -lt $# ] ; do
BRANCH=$2 BRANCH=$2
shift shift
;; ;;
--variant)
VARIANT=$2
shift
;;
*) *)
usage usage
;; ;;
@ -37,8 +28,6 @@ while [ 0 -lt $# ] ; do
shift shift
done done
echo "VARIANT=$VARIANT"
if [ -n "$TAG" ]; then if [ -n "$TAG" ]; then
if ! git tag | grep -w "$TAG"; then if ! git tag | grep -w "$TAG"; then
echo "tag $TAG not found" echo "tag $TAG not found"
@ -48,7 +37,7 @@ elif [ -z $BRANCH ]; then
BRANCH=$(git branch | grep '^*' | sed 's,^.* ,,') BRANCH=$(git branch | grep '^*' | sed 's,^.* ,,')
fi fi
echo "building $VARIANT with ${TAG}${BRANCH}" echo "building with ${TAG}${BRANCH}"
BUILDIR=/tmp/$(basename $0)_build_$$ BUILDIR=/tmp/$(basename $0)_build_$$
OUT_FILE=$BUILDIR/apks.txt OUT_FILE=$BUILDIR/apks.txt
@ -61,9 +50,8 @@ cd $BUILDIR
git clone $SRCDIR BUILD git clone $SRCDIR BUILD
cd BUILD cd BUILD
git checkout ${TAG}${BRANCH} git checkout ${TAG}${BRANCH}
cd ./xwords4/android/${VARIANT} cd ./xwords4/android/
../scripts/setup_local_props.sh ./scripts/arelease.sh --apk-list $OUT_FILE
../scripts/arelease.sh --variant ${VARIANT} --apk-list $OUT_FILE
mkdir -p /tmp/releases_${VARIANT} mkdir -p /tmp/releases_${VARIANT}
cp *.apk /tmp/releases_${VARIANT} cp *.apk /tmp/releases_${VARIANT}