SDL: shut up Google Play security warning
This commit is contained in:
@@ -1274,6 +1274,11 @@ public class MainActivity extends Activity
|
|||||||
if( entry.isDirectory() )
|
if( entry.isDirectory() )
|
||||||
{
|
{
|
||||||
File outDir = new File( libDir.getAbsolutePath() + "/" + entry.getName() );
|
File outDir = new File( libDir.getAbsolutePath() + "/" + entry.getName() );
|
||||||
|
if( !outDir.getCanonicalPath().startsWith(libDir.getAbsolutePath() + "/") )
|
||||||
|
{
|
||||||
|
Log.i("SDL", "Security exception: " + outDir.getCanonicalPath());
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||||
outDir.mkdirs();
|
outDir.mkdirs();
|
||||||
continue;
|
continue;
|
||||||
@@ -1284,6 +1289,11 @@ public class MainActivity extends Activity
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
||||||
|
if( !outDir.getCanonicalPath().startsWith(libDir.getAbsolutePath() + "/") )
|
||||||
|
{
|
||||||
|
Log.i("SDL", "Security exception: " + outDir.getCanonicalPath());
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||||
outDir.mkdirs();
|
outDir.mkdirs();
|
||||||
}
|
}
|
||||||
@@ -1305,6 +1315,11 @@ public class MainActivity extends Activity
|
|||||||
} catch( Exception eeeeee ) { }
|
} catch( Exception eeeeee ) { }
|
||||||
|
|
||||||
Log.i("SDL", "Saving to file '" + path + "'");
|
Log.i("SDL", "Saving to file '" + path + "'");
|
||||||
|
if( !(new File(path).getCanonicalPath().startsWith(libDir.getAbsolutePath() + "/")) )
|
||||||
|
{
|
||||||
|
Log.i("SDL", "Security exception: " + path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
out = new FileOutputStream( path );
|
out = new FileOutputStream( path );
|
||||||
int len = zip.read(buf);
|
int len = zip.read(buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user