From 15db20bd5115534a10343236f3f9ca5b5891de7c Mon Sep 17 00:00:00 2001 From: Lethe <37437842+0xlethe@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:54:53 +0900 Subject: [PATCH] feat: support compileSDK under 33 --- .../captureprotection/CaptureProtectionModule.java | 14 ++++++++++++-- example/android/build.gradle | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/captureprotection/CaptureProtectionModule.java b/android/src/main/java/com/captureprotection/CaptureProtectionModule.java index 4005e05..f651bb9 100644 --- a/android/src/main/java/com/captureprotection/CaptureProtectionModule.java +++ b/android/src/main/java/com/captureprotection/CaptureProtectionModule.java @@ -118,8 +118,8 @@ private boolean requestStoragePermission() { // android.permission.DETECT_SCREEN_CAPTURE instead. } - String requestPermission = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU - ? Manifest.permission.READ_MEDIA_IMAGES + String requestPermission = Build.VERSION.SDK_INT >= 33 // Build.VERSION_CODES.TIRAMISU + ? "android.permission.READ_MEDIA_IMAGES" // Manifest.permission.READ_MEDIA_IMAGES : Manifest.permission.READ_EXTERNAL_STORAGE; if (ContextCompat.checkSelfPermission( @@ -213,6 +213,16 @@ public String getName() { return NAME; } + @ReactMethod + public void addListener(String eventName) { + addListener(); + } + + @ReactMethod + public void removeListeners(Integer count) { + removeListener(); + } + @ReactMethod public void addScreenshotListener() { addListener(); diff --git a/example/android/build.gradle b/example/android/build.gradle index 8569fee..355f3b0 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -4,8 +4,8 @@ buildscript { ext { buildToolsVersion = "31.0.0" minSdkVersion = 21 - compileSdkVersion = 31 - targetSdkVersion = 31 + compileSdkVersion = 32 + targetSdkVersion = 32 if (System.properties['os.arch'] == "aarch64") { // For M1 Users we need to use the NDK 24 which added support for aarch64