mirror of https://github.com/encounter/SDL.git
Android: Added additional error messages for APK expansion file use.
This commit is contained in:
parent
6e7c479ec2
commit
625d39b164
|
@ -703,8 +703,15 @@ public class SDLActivity extends Activity {
|
||||||
return null; // no expansion use if no patch version was set
|
return null; // no expansion use if no patch version was set
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer mainVersion = Integer.valueOf(mainHint);
|
Integer mainVersion;
|
||||||
Integer patchVersion = Integer.valueOf(patchHint);
|
Integer patchVersion;
|
||||||
|
try {
|
||||||
|
mainVersion = Integer.valueOf(mainHint);
|
||||||
|
patchVersion = Integer.valueOf(patchHint);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
throw new IOException("No valid file versions set for APK expansion files", ex);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// To avoid direct dependency on Google APK expansion library that is
|
// To avoid direct dependency on Google APK expansion library that is
|
||||||
|
@ -719,6 +726,7 @@ public class SDLActivity extends Activity {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
expansionFile = null;
|
expansionFile = null;
|
||||||
expansionFileMethod = null;
|
expansionFileMethod = null;
|
||||||
|
throw new IOException("Could not access APK expansion support library", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,12 +735,14 @@ public class SDLActivity extends Activity {
|
||||||
try {
|
try {
|
||||||
fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName);
|
fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
// calling "getInputStream" failed
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
fileStream = null;
|
throw new IOException("Could not open stream from APK expansion file", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileStream == null) {
|
if (fileStream == null) {
|
||||||
throw new IOException();
|
// calling "getInputStream" was successful but null was returned
|
||||||
|
throw new IOException("Could not open stream from APK expansion file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileStream;
|
return fileStream;
|
||||||
|
|
Loading…
Reference in New Issue