Bug fix: latestcrash.txt on Android 10+

This commit is contained in:
Duy Tran Khanh 2022-03-25 19:28:04 +07:00 committed by GitHub
parent e428bb94b7
commit eedfd54d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ public class PojavApplication extends Application {
@Override
public void onCreate() {
Thread.setDefaultUncaughtExceptionHandler((thread, th) -> {
boolean storagePermAllowed = Build.VERSION.SDK_INT < 23 ||
boolean storagePermAllowed = Build.VERSION.SDK_INT < 23 || Build.VERSION.SDK_INT >= 29 ||
ActivityCompat.checkSelfPermission(PojavApplication.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
File crashFile = new File(storagePermAllowed ? Tools.DIR_GAME_HOME : Tools.DIR_DATA, "latestcrash.txt");
try {