From dfb3ca449e799792d2a10e4cd29dffe3aad43936 Mon Sep 17 00:00:00 2001 From: SaeedZhiany Date: Wed, 9 Aug 2023 07:27:13 +0330 Subject: [PATCH 1/3] loaded Android Gradle Plugin Conditionally --- android/build.gradle | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 30878fe..b19d4df 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,11 +1,16 @@ buildscript { - repositories { + // The Android Gradle plugin is only required when opening the Android folder stand-alone. + // This avoids unnecessary downloads and potential conflicts when the library is included as a + // module dependency in an application project. + if (project == rootProject) { + repositories { google() mavenCentral() - } + } - dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + dependencies { + classpath 'com.android.tools.build:gradle:3.5.3' + } } } From 7ecbe5fa9dd70df56a2c72de9753279fe52a5b3f Mon Sep 17 00:00:00 2001 From: Ahmad Syarifuddin Randiko Date: Fri, 11 Aug 2023 14:45:28 +0700 Subject: [PATCH 2/3] feat(android): add namespace to support upcoming react native 0.73 --- android/build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/build.gradle b/android/build.gradle index b19d4df..8bb8ea7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -35,6 +35,13 @@ def getExtOrIntegerDefault(name) { android { compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') + //Get Android Gradle Plugin version + def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + //Apply namespace only if Android Gradle Plugin version equal or greater than 7 + if (agpVersion.tokenize('.')[0].toInteger() >= 7) { + namespace "com.captureprotection" + } + defaultConfig { minSdkVersion getExtOrIntegerDefault('minSdkVersion') targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') From 554dc4be052147546aaf3408d83f5961c67b86e1 Mon Sep 17 00:00:00 2001 From: Lethe <37437842+0xlethe@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:04:14 +0900 Subject: [PATCH 3/3] chore: docs, version --- README.md | 23 ++++++++++++----------- package.json | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8dd184b..b0b40b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # react-native-capture-protection -simple control capture event (like screenshot, screen record) in Android, iOS Native +> 🚀 Simple control capture event (like screenshot, screen record) in Android, iOS + React Native + +![Simulator Screen Recording](https://user-images.githubusercontent.com/37437842/206644553-e4c3f2bc-b624-47ac-a005-132199e049b2.gif) + +## Features + +- iOS Capture Event via screen recording, capture capture with Listener +- allow, prevent Android, iOS Capture Event +- allow, prevent iOS Record Screen +- Provider, Hooks +- RN 0.73 and higher ## Installation @@ -8,14 +18,6 @@ simple control capture event (like screenshot, screen record) in Android, iOS Na npm install react-native-capture-protection ``` -## Preview - -### prevent, allow screenshot in iOS - -![Simulator Screen Recording - iPhone 14 - 2022-12-09 at 16 02 15](https://user-images.githubusercontent.com/37437842/206644553-e4c3f2bc-b624-47ac-a005-132199e049b2.gif) - -## Usage - ```js import { CaptureProtection, @@ -45,11 +47,10 @@ const Component = (props) => { }; ``` -More Infomation, please read this +## Docs - [method](https://github.com/0xlethe/react-native-capture-protection/wiki/method) - [type](https://github.com/0xlethe/react-native-capture-protection/wiki/type) -- [migration to v1](https://github.com/0xlethe/react-native-capture-protection/wiki/how-to-migration-v0-to-v1) ## Contributing diff --git a/package.json b/package.json index 17a8170..4621f3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-capture-protection", - "version": "1.7.0", + "version": "1.8.0", "description": "It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)", "main": "lib/commonjs/index", "module": "lib/module/index",