SDL: settings file sohuld be non-readable by other apps for API level 25

This commit is contained in:
Sergii Pylypenko
2017-01-13 15:15:41 +02:00
parent 05f6522c27
commit 6a7d1887b8
6 changed files with 13 additions and 8 deletions

View File

@@ -89,7 +89,7 @@ public class Settings
static void Save(final MainActivity p)
{
try {
ObjectOutputStream out = new ObjectOutputStream(p.openFileOutput( SettingsFileName, p.MODE_WORLD_READABLE ));
ObjectOutputStream out = new ObjectOutputStream(p.openFileOutput( SettingsFileName, p.MODE_PRIVATE ));
out.writeInt(SETTINGS_FILE_VERSION);
out.writeBoolean(Globals.DownloadToSdcard);
out.writeBoolean(Globals.PhoneHasArrowKeys);
@@ -401,8 +401,11 @@ public class Settings
return;
} catch( FileNotFoundException e ) {
Log.i("SDL", "libSDL: settings file not found: " + e);
} catch( SecurityException e ) {
Log.i("SDL", "libSDL: settings file cannot be opened: " + e);
} catch ( IOException e ) {
Log.i("SDL", "libSDL: settings file cannot be read: " + e);
DeleteFilesOnUpgrade(p);
if( Globals.ResetSdlConfigForThisVersion )
{
@@ -508,7 +511,7 @@ public class Settings
public static void DeleteSdlConfigOnUpgradeAndRestart(final MainActivity p)
{
try {
ObjectOutputStream out = new ObjectOutputStream(p.openFileOutput( SettingsFileName, p.MODE_WORLD_READABLE ));
ObjectOutputStream out = new ObjectOutputStream(p.openFileOutput( SettingsFileName, p.MODE_PRIVATE ));
out.writeInt(-1);
out.close();
} catch( FileNotFoundException e ) {

View File

@@ -693,6 +693,7 @@ int main(int argc, char* argv[])
if(evt.key.keysym.sym == SDLK_1)
{
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 0);
SDL_ANDROID_OpenExternalWebBrowser("http:/google.com/");
}
if(evt.key.keysym.sym == SDLK_2)
{

View File

@@ -7,10 +7,10 @@ AppName="OpenTTD"
AppFullName=org.openttd.sdl
# Application version code (integer)
AppVersionCode=16163
AppVersionCode=16164
# Application user-visible version name (string)
AppVersionName="1.6.1.63"
AppVersionName="1.6.1.64"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
@@ -18,7 +18,7 @@ AppVersionName="1.6.1.63"
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.6.1-0.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz^HD graphics - 220 Mb download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/abase-0.1.2-0.zip.xz/download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/zBase-v5588.zip.xz/download"
AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.6.1-1.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz^HD graphics - 220 Mb download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/abase-0.1.2-0.zip.xz/download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/zBase-v5588.zip.xz/download"
# Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=n

View File

@@ -20,6 +20,7 @@ export LD_LIBRARY_PATH=/usr/local/lib
if [ -z "$1" ]; then
./openttd -d 2 -r 854x480 #-g opntitle.sav
else
gdb -ex run --args \
#gdb -ex run --args \
valgrind --track-fds=yes --log-file=valgrind.log --leak-check=full \
./openttd -d 2 -r 854x480 #-g opntitle.sav
fi

View File

@@ -1,6 +1,6 @@
#!/bin/sh
VER=1.6.1-0
VER=1.6.1-1
cd data
rm -f ../AndroidData/openttd-data-*.zip.xz ../AndroidData/openttd-data-*.zip