From 5123b8fc8c9309fbb34e65608255c36a4496646b Mon Sep 17 00:00:00 2001 From: Peter Sanford Date: Wed, 22 Nov 2023 11:04:21 -0600 Subject: [PATCH 1/3] Fix write file permission check for sdk > 31 It looks like we don't need to perform this check to write to the downloads directory on new versions of android. Fixes #37 --- .../main/java/io/sanford/wormholewilliam/WriteFilePerm.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/sanford/wormholewilliam/WriteFilePerm.java b/android/src/main/java/io/sanford/wormholewilliam/WriteFilePerm.java index 3651834..76f3cc9 100644 --- a/android/src/main/java/io/sanford/wormholewilliam/WriteFilePerm.java +++ b/android/src/main/java/io/sanford/wormholewilliam/WriteFilePerm.java @@ -6,6 +6,7 @@ import android.app.FragmentTransaction; import android.content.Context; import android.content.pm.PackageManager; +import android.os.Build; import android.os.Handler; import android.util.Log; import android.view.View; @@ -37,7 +38,7 @@ public void run() { @Override public void onAttach(Context ctx) { super.onAttach(ctx); Log.d("wormhole", "WriteFilePerm: onAttach()"); - if (ctx.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.R && ctx.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST); } else { permissionResult(true); From 5d6a8c3d7c58fda458672d49717c2cb02d9cdb83 Mon Sep 17 00:00:00 2001 From: Peter Sanford Date: Wed, 22 Nov 2023 11:19:44 -0600 Subject: [PATCH 2/3] Bump version --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 879d6ab..5653007 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,8 +28,8 @@ android { defaultConfig { minSdkVersion 22 targetSdkVersion 33 - versionCode 14 - versionName "1.0.9" + versionCode 15 + versionName "1.0.10" } compileOptions { sourceCompatibility 1.8 From f54d4f0c6bac78c74fdfbd057275fbca92af573d Mon Sep 17 00:00:00 2001 From: Peter Sanford Date: Wed, 22 Nov 2023 11:24:42 -0600 Subject: [PATCH 3/3] Set BUILDTOOLS env in shell.nix The Makefile looks for this env var to find zipalign --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 09c8223..ee0b2eb 100644 --- a/shell.nix +++ b/shell.nix @@ -24,6 +24,7 @@ pkgs.mkShell { shellHook = '' export GRADLE_OPTS="-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidComposition.androidsdk}/libexec/android-sdk/build-tools/${buildToolsVersion}/aapt2"; export ANDROID_SDK_ROOT="${androidComposition.androidsdk}/libexec/android-sdk" + export BUILDTOOLS="${androidComposition.androidsdk}/libexec/android-sdk/build-tools/${buildToolsVersion}/" ''; }