From c9922b1d94d2a875e405c8e21493482f6fa53bd7 Mon Sep 17 00:00:00 2001 From: Simon <6168240+DrBeef@users.noreply.github.com> Date: Mon, 6 May 2024 19:49:08 +0100 Subject: [PATCH] Proper External SDCARD access No need to use scoped storage --- Projects/Android/AndroidManifest.xml | 6 +- Projects/Android/build.gradle | 4 +- Projects/Android/jni/darkplaces/menu.c | 2 +- .../drbeef/quakequest/GLES3JNIActivity.java | 91 +++++-------------- 4 files changed, 32 insertions(+), 71 deletions(-) diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index da5e543..995a99a 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -1,8 +1,8 @@ @@ -14,7 +14,7 @@ - + 0 && results[0] == PackageManager.PERMISSION_GRANTED) { - permissionCount++; - } - else - { - System.exit(0); - } - } - - if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_ID) { - if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) { - permissionCount++; - } - else - { - System.exit(0); - } - } - - checkPermissionsAndInitialize(); + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + create(); } - public void create() throws ErrnoException { + public void create() { //This will copy the shareware version of quake if user doesn't have anything installed copy_asset(dir + "/id1", "pak0.pak"); copy_asset(dir + "/id1", "config.cfg"); copy_asset(dir, "commandline.txt"); - setenv("QUAKEQUEST_DIR", dir, true); + try { + setenv("QUAKEQUEST_DIR", dir, true); + } catch (Exception ignored) + { + System.exit(-9);; + } //Read these from a file and pass through commandLineParams = new String("quake");