SDL: new option AppOpenFileExtension to open a file with specific extension using the app

This commit is contained in:
Sergii Pylypenko
2017-05-26 20:45:04 +03:00
parent d179d4d2c7
commit 5ab39a579a
5 changed files with 52 additions and 7 deletions

View File

@@ -435,6 +435,9 @@ echo >> AndroidAppSettings.cfg
echo "# Google Play Game Services application ID, required for cloud saves to work" >> AndroidAppSettings.cfg
echo GooglePlayGameServicesId=$GooglePlayGameServicesId >> AndroidAppSettings.cfg
echo >> AndroidAppSettings.cfg
echo "# The app will open files with following extension, file path will be added to commandline params" >> AndroidAppSettings.cfg
echo AppOpenFileExtension=\'$AppOpenFileExtension\' >> AndroidAppSettings.cfg
echo >> AndroidAppSettings.cfg
fi
AppShortName=`echo $AppName | sed 's/ //g'`
@@ -837,6 +840,15 @@ if [ "$AccessInternet" = "n" ]; then
$SEDI "/==INTERNET==/ d" project/AndroidManifest.xml
fi
if [ -z "$AppOpenFileExtension" ]; then
$SEDI "/==OPENFILE==/ d" project/AndroidManifest.xml
else
EXTS="`for EXT in $AppOpenFileExtension; do echo -n '\\\\1'$EXT'\\\\2' ; done`"
echo "EXTS $EXTS"
#$SEDI "s/\(.*\)==OPENFILE-EXT==\(.*\)/$EXTS/g" project/AndroidManifest.xml
$SEDI "s/\(.*\)==OPENFILE-EXT==\(.*\)/$EXTS/g" project/AndroidManifest.xml
fi
if [ "$ImmersiveMode" = "n" ]; then
ImmersiveMode=false
else