mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 08:09:51 +00:00
More paranoia from Google Play
This commit is contained in:
parent
b730d187e8
commit
343763cf5a
@ -323,6 +323,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||
}
|
||||
|
||||
std::string GetJavaString(JNIEnv *env, jstring jstr) {
|
||||
if (!jstr)
|
||||
return "";
|
||||
const char *str = env->GetStringUTFChars(jstr, 0);
|
||||
std::string cpp_string = std::string(str);
|
||||
env->ReleaseStringUTFChars(jstr, str);
|
||||
@ -397,7 +399,9 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init
|
||||
langRegion = GetJavaString(env, jlangRegion);
|
||||
|
||||
std::string externalDir = GetJavaString(env, jexternalDir);
|
||||
std::string user_data_path = GetJavaString(env, jdataDir) + "/";
|
||||
std::string user_data_path = GetJavaString(env, jdataDir);
|
||||
if (user_data_path.size() > 0)
|
||||
user_data_path += "/";
|
||||
library_path = GetJavaString(env, jlibraryDir) + "/";
|
||||
std::string shortcut_param = GetJavaString(env, jshortcutParam);
|
||||
std::string cacheDir = GetJavaString(env, jcacheDir);
|
||||
|
@ -296,7 +296,12 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
File sdcard = Environment.getExternalStorageDirectory();
|
||||
|
||||
String externalStorageDir = sdcard.getAbsolutePath();
|
||||
String dataDir = this.getFilesDir().getAbsolutePath();
|
||||
File filesDir = this.getFilesDir();
|
||||
String dataDir = null;
|
||||
if (filesDir != null) {
|
||||
// Null has been seen in Google Play stacktraces
|
||||
dataDir = this.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
String apkFilePath = appInfo.sourceDir;
|
||||
String cacheDir = getCacheDir().getAbsolutePath();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user