mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 23:52:52 +00:00
Initial commit
This commit is contained in:
35
static/scripts/android.sh
Executable file
35
static/scripts/android.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
DEFAULT_APP_LINK_URL="your.deep.link.host.tld"
|
||||
APP_LINK_URL="${APP_LINK_URL:-$DEFAULT_APP_LINK_URL}"
|
||||
|
||||
if [ -n "$(xmlstarlet sel -T -t -v "/manifest/application/activity[intent-filter/@android:autoVerify='true']" app/android/app/src/main/AndroidManifest.xml)" ]; then
|
||||
echo "Deep link capability already defined in AndroidManifest.xml"
|
||||
else
|
||||
echo "Adding deep link capability to AndroidManifest.xml"
|
||||
xmlstarlet edit -L -s /manifest/application/activity -t elem -n tmpElement -v "" \
|
||||
-i //tmpElement -t attr -n "android:autoVerify" -v "true" \
|
||||
-r //tmpElement -v intent-filter \
|
||||
app/android/app/src/main/AndroidManifest.xml
|
||||
|
||||
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
|
||||
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.VIEW" \
|
||||
-r //tmpElement -v action \
|
||||
app/android/app/src/main/AndroidManifest.xml
|
||||
|
||||
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
|
||||
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.DEFAULT" \
|
||||
-r //tmpElement -v category \
|
||||
app/android/app/src/main/AndroidManifest.xml
|
||||
|
||||
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
|
||||
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.BROWSABLE" \
|
||||
-r //tmpElement -v category \
|
||||
app/android/app/src/main/AndroidManifest.xml
|
||||
|
||||
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
|
||||
-i //tmpElement -t attr -n "android:scheme" -v "https" \
|
||||
-i //tmpElement -t attr -n "android:host" -v "$APP_LINK_URL" \
|
||||
-r //tmpElement -v data \
|
||||
app/android/app/src/main/AndroidManifest.xml
|
||||
fi
|
||||
Reference in New Issue
Block a user